From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Find velocity of moving particle using bounding box information ?

Solved!
Go to solution

I am need a help into find the velocity of the moving particle.

Working project goal is to find the moving particle velocity using two images.

 

steps 

I am taking two images one after one 

do image processing 

do subtractions of two images first image- second image.

moving particle I can see in final image also drawing bounding box on to that

but I do not know how can I measure how much the particle is moved ? after last step 

camera is capturing the images at frame rate 30fps

 

So I need to know how to find the distance traveled by particle.

 

I have vision development kit in LabVIEW.

 

ask.JPG 

Image shows the distance traveled by particle

 

 

two captured imagetwo captured image

let me know if anyone have idea to solve my problem.

 

let me know if any one need VI for more information.

 

0 Kudos
Message 1 of 9
(3,668 Views)
Solution
Accepted by topic author @mi

If I understand correctly the binary Image shows the distance you particle moved in red. If that is correct you can measure the thickness of your red object using some clamp tool that should be included in the Vision Toolkit. ( I can't tell how it's called because I don't have it). From this function you get the distance in pixels. So you will need some calibration information on what distance one pixel represents and the time that passed between your two images.

 

Regards

ʍolɟɐʇɐp ʞuıɥʇ
0 Kudos
Message 2 of 9
(3,650 Views)
Solution
Accepted by topic author @mi

If you have the coordinates of the particle (center of the BBox), and the new coordinates of the particle wouldn't subtracting them give you the distance? That is, the distance in pixels.

 

From pixels to actual distance could be difficult. Ideally, this is just a linear scaling that needs to be calibrated or calculated. But it could be more difficult if you want to correct for perspective distortion. That could be fixed by calibrating your image for perspective correction...

0 Kudos
Message 3 of 9
(3,647 Views)

@wiebe@CARYA 

 

yes that I have already tried but still I am not getting convincing result, so thought to ask the question in Ni forum.

 

I have one more question 

 

if my camera is taking images at the speed of 30fps 

then while finding the velocity what number I have to write in down side in column of time

Velocity = displacement( micrometer travel distance) \ time(30)? 

0 Kudos
Message 4 of 9
(3,636 Views)

@crabman

 

Thank you very much for the idea.

 

Yes you are right I can use clamp function in vision toolkit.

 

I have tried clamp function it is useless for me while it is not showing promising results, so I use center of mass of X for both particles from two images and do subtraction.

 

Thank you very much you time and idea 

0 Kudos
Message 5 of 9
(3,632 Views)

30 FPS means 1/30 sec. between two frames.

 

So (I'd think):

Velocity [um/s] = displacement [um] * 30 [1/s]

 

And the distance should be the Euclidian distance, so sqrt (X*X + Y*Y)

0 Kudos
Message 6 of 9
(3,629 Views)

As I need to find the velocity of particle which are moving in only in one direction so I am just using the center of mass X of both particles in two images and subtracting values.

 

X1 - X2 = Delta X (moving distance) in pixel

Convert it into (um) micrometer

find the velocity .

 

0 Kudos
Message 7 of 9
(3,606 Views)

To find the distance between two points 

 

Euclidian formula is 

 

dist((x1, y1), (x2, y2)) = √(x1 - x2)² + (y1 - y2)²

 

Just correcting 

Please don't mine.

Thank you

Have a nice day

0 Kudos
Message 8 of 9
(3,603 Views)

@mi wrote:

dist((x1, y1), (x2, y2)) = √(x1 - x2)² + (y1 - y2)²

 

Just correcting 


Yes, sqrt (X*X + Y*Y), where X and Y are the deltas. I've could indeed have been clearer.

0 Kudos
Message 9 of 9
(3,596 Views)