Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all there

I am trying to capture frames from video captured by webcam.
I have applied skin detection algorithm on the captured images and draw rectangle around the face. Frames are captured by a timer tick event. everything is working but the following error comes.

"Attempted to read or write protected memory. This is often an indication that your memory is corrupt"

If i increase the interval of timer to 500 it gives this error after some time, but as i decrease the interval of timer to 250 it begins sending this error message frequently.
I am using Windows7 OS. Visual Studio 2008 .NET framework 3.5;

Thanks in advance
Posted
Updated 24-Jun-10 20:18pm
v2

1 solution

I think problem in your webcam. 250 and 500 it's a very small interval. When timer tics time after time, your webcam is still busy. Your application refer on unallocated memory. That is why this error comes :)
 
Share this answer
 
Comments
shahidkhosa 28-Jun-10 10:01am    
thanks for replying.
but i have checked it on 2 different computers, Problem is still there but it comes once or twice during programe execution but does'nt hurt programe execution. i have decreased the interval to 33 in timer (means 30 frames per second). Another thing how i will come to know that the application is refering to unallocated memory?
thanks in advance

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900