Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

determining velocity of a particle using IMAQ

Using a NI-1407 card I want to determine the speed of a bead moving through a flowcell, Saving the first and last frame and recording the time in between.
0 Kudos
Message 1 of 6
(3,804 Views)
I would use a progressive scan camera to eliminate any blurring due to the motion of the bead.

Hopefully you can use thresholding to separate the bead from the background, then use Basic Particle to locate the center. Another possibility is using pattern matching to locate the bead. If these don't work, you might need to have an operator specify the approximate location of the bead so you can do a local search.

Once you have located the bead in both images, you will need to know the scale of the image so that you can determine the distance it has traveled. You also need to know the frame rate of the camera and the number of frames acquired so you can calculate the time elapsed. Distance divided by time gives you the speed of the bead.

Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 6
(3,804 Views)
You're exactly described what I can do until now. But the only problem is how to allocate buffers to be sure the frame rate is constant so one can use the number of frames for calculating the time. Tracking of the bead is not a problem, but using this as a trigger for starting a sequence of writing images and doing this in the right way is the thing I want to solve.
0 Kudos
Message 3 of 6
(3,804 Views)
If you are having problems with inconsistant framerate, try using a smaller region of interest to reduce the amount of data being processed.

What framerate does your camera run at? What are you acheiving?
0 Kudos
Message 4 of 6
(3,804 Views)
You can use low level IMAQ acquisition VIs to set up a continuous loop of buffer images. Essentially, it is a sequence that keeps looping. You can check which image was most recently acquired, and examine it for the bead. By subtracting the indices of the two images you are using, you can find out how many images were between them. Add one and divide by the frame rate to get time. I have used this method to acquire a loop of several hundred images with no dropped frames.

I don't know how fast your bead is moving, but what I would probably do is this:

In a fast loop, extract the most recent image and try to locate the bead. If it is found, record the position and index. When the bead is present, you should end up with a few position
& index pairs. Once it is out of view, take the first and last pairs and use them to calculate the velocity. This depends on the bead being present in several images and having time to analyze them.

If the bead is moving really fast, you could monitor the most recent image for the presence of the bead, then once you find it just look a few images forward or backward to get another position.

Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 5 of 6
(3,804 Views)
I'm achieving images at a framerate of 25 Hz.
I'm imaging beads moving in a flowcell and want to calculate their average speed when they are going to my field of view.
0 Kudos
Message 6 of 6
(3,804 Views)