Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

object detection algorithm

Hi. I am trying to develop a simple algorithm in the detection of objects. How could i be able to program something that could be able to tell the presence of a person in the camera whereby a minute ago the person is not there?
0 Kudos
Message 1 of 4
(3,666 Views)
You could simply subtract two images (with and without personnage). With dark BackGround, use (BG&person - BG), with a bright BG, do the reverse operation. This will leave you with a clear silhouette over a nearly uniformly black background. You can even measure the area of the silhouette, to decide if it is large enough to be a person or any moving object or light spot...
Chilly Charly    (aka CC)
0 Kudos
Message 2 of 4
(3,654 Views)

Thanks for the reply. I have got something to work, however, i am not able to make it work as you have explained. What i am doing now is to grab from the camera and then using this image to subtract off with the image without the object inside. This is as u have explained only for dark backgrounds. For brighter backgrounds i will then need to reverse the operation. But once i do this, the program will give me an error message indicating that it could be due to imcompatible data types. I could not understand the reason behind this. I have tried it with the manual way instead of using the camera, i load in manually 2 images. For this case it works perfectly. I am at this for hours. Appreciate ur help.

0 Kudos
Message 3 of 4
(3,644 Views)

Make sure that you are using 8-bit images when you are subtracting. You can use the IMAQ Cast Image to cast your image to a different type if needed. 

Also, subtracting should work on bright or dark backgrounds - it will simply give you the difference between the two images with differences having high values (whiter) and every thing that is the same in the image having low values (dark).

Check out the attached vi (and screenshot if you don't have LabVIEW 7.1).

0 Kudos
Message 4 of 4
(3,630 Views)