11-18-2016 09:38 AM
I am facing an issue with tracking based on background subtraction method,
the issue is the noise created in the image after a while from capturing the reference image due to illumination change. I know to deal with non-uniform or changing lighting conditions, adaptive thresholding should be used, but seems its not effective in my case.
Picture 1: Perfect Background Subtraction without noise (reference image taken at t)
Picture 2: Noise is created due to (t+delta which causes illuminationn change) (same reference image used taken at t)
Picture 3: Adaptive Thresholding
How to update the reference image over specified time interval t+delta ?
11-18-2016 10:21 AM
If the object of interest is moving regularly, you can store a background image every few seconds or minutes. Use the last three (or five or eight, etc.) images to generate a composite background image without the object. You could average the images together (works best with large number of images). You could also look at each pixel and take the median value, but that would require converting all the images to arrays, analyzing the arrays, then converting the resulting array back to an image.
Bruce
11-18-2016 04:24 PM
Since you have light blobs you want to remove from a dark background, I would try an 'open'. This is an erosion followed by a diliation. If you're working on the Block Diagram, these operations fall under IMAQ Morphology. If you're working in the Vision Assistant, they're under Greyscale Morphology.
The erode decreases the size of a blob by a small amount (I think 1 px). You'll want to do this a few times - but keep track of it. Once all the small blobs you don't want are gone, call dilate n times to grow the remaining bright area (which is normally the subject you want to remain in the picture) by a corresponding amount.
11-19-2016 01:09 AM
12-05-2016 11:07 AM
" If the object of interest is moving regularly, you can store a background image every few seconds or minutes. "
I did that with a flat sequence structure (true,false boolean and a delay) and a case structure to snap background images over time. But im facing issues with the delay values: (wait function)
- when delay is set to small values (seconds): 6000 ms - the background image is snapped perfectly and the vi works fine
- when delay is set to larger values (minutes): 360000 ms [6mins] - the background image is not snapped and the vi doesn't work properly [which is the case i want to implement]
tried also time delay express vi and got the same results,
any clue how can i fix that ?
12-06-2016 12:16 AM
12-09-2016 08:16 AM
Thank you for your help, I've managed to solve the problem