So I am working on a project to locate the position of fish in a tank and choose from an array of sensors to fire. My plan is capture the image of the tank just with water without the fish, convert it into an array of pixels and repeat that same process this time with fish continuously after which I will do array subtraction to tell non- zero pixels as position of fish. In addition to this, we are supposed to take a live stream video of the fish as well as well as store the video. We have a managed to have a working video capturing and storing VI, however, the challenge is to take that first image of the tank without the fish. I tried to use a switch and either select function or case structure to choose between taking just one single picture as baseline but I couldn't seem to work that out correctly, would there be an easier way to do this? Help. I have attached the VI we have now.
I don't have IMAQdx/Vision installed on this computer, but what you're describing sounds a lot like a "tare" operation.
The usual way to do this in LabVIEW typically involves a shift register with your static value, and a subtraction.
Some quick searching tells me that there is an IMAQ Subtract VI available.
The idea would be something like the following:
Here I'd normally suggest the use of a Select node, but since you're writing to an AVI file, and you probably don't want the reference image writing mid-stream, you might prefer a Case Structure which includes the Write to AVI, but doesn't include the Grab Image.
In the case that you're not collecting a new reference image, you use the image in the shift register to pass to the subtract node (VI, for IMAQ).
I'm not sure what impact that operation will have on your running speed though, so check. If it's too slow, I can try and think of something else (perhaps Producer/Consumer with the same idea but processing offloaded).