Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I automate the threshold for a moving object whose light intensity changes for each frame.

I'm using the PCI-1408 and I have this video where an object's shape and color intensity changes for each frame. I want to do a pixel count of that object verses the background (the background also changes color) for each frame. I'm guessing that I need an automatic threshold, but I really have no idea of how to implement this. Any ideas, anyone?
0 Kudos
Message 1 of 3
(3,153 Views)
Hopefully there is a clear distinction between the background and the object.

You can use IMAQ AutoBThreshold to determine the threshold level for an image. You can select from a variety of methods for determining a binary threshold level. Route the "Threshold Data" output along with your image to IMAQ MultiThreshold, which will quickly apply the threshold to your image. Display the results using WindDraw and the Binary palette (from IMAQ GetPalette).

This should run close to real-time. Binary thresholding is a fairly fast operation. You will probably end up processing every other image, which is close enough for most projects.

Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 3
(3,153 Views)
Unfortunately, thats the problem. The background and object don't have a clear distinction in most of the frames. I've tried what you mentioned but the data (pixel count) is not complete because the threshold at times does not detect the part of the object that blends with the background.
0 Kudos
Message 3 of 3
(3,153 Views)