LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I take a derivative of data I am receiving from a camera that measures the location of two particles?

I attached an image of my program. The derivative bit that I have connected right now is not working (the values it gives me do not make mathematical sense).

0 Kudos
Message 1 of 12
(3,057 Views)

What particles are you measuring location of? Is it the X and Y coordinates of your image frame?

May be you can show us what's running inside vision assistant so we could tell what measures you can take to localize the particle on your image frame without using any "derivative" function. 

 

Just a guess; if you're using threshold on your image you can use "IMAQ Centroid" to calculate energy center afterwards. This function also gives the (x,y) location of object/particle as a residue. 

 


0 Kudos
Message 2 of 12
(3,030 Views)

Are you trying to measure the derivative from frame to frame? It looks like you are only operating on one frame at a time.

0 Kudos
Message 3 of 12
(3,003 Views)

It is the x y coordinates of the image frame. I'm measuring the position of the black dot. It will eventually be attached to a moving part and that is why I want to be able to take the derivative so I can find out the velocity of the dot when the piece is moving. Attached is the what I see when I open vision assistant. 

0 Kudos
Message 4 of 12
(2,982 Views)

Is there a better or different way to go about this?

0 Kudos
Message 5 of 12
(2,975 Views)

You will want to store the previous frame's location in a shift register so that you can see how the position changes from frame to frame.

0 Kudos
Message 6 of 12
(2,962 Views)

I used the shift register like you said and its making more sense now. Am I correct with what I've done with the derivative function?

0 Kudos
Message 7 of 12
(2,951 Views)

What does your "Particle Measurements" array have inside it? 

0 Kudos
Message 8 of 12
(2,942 Views)

It has the x an y values of the particle. Here's my front panel.

0 Kudos
Message 9 of 12
(2,938 Views)

I see, it is interesting that it is a 2D array and not just a 1D array or a cluster of two elements.

 

In any event, do you care about direction at all, or just the speed at which it is moving? When you input 150 for dt, does that mean that you are capturing images every 150ms, i.e. at 6.67 Hz? We probably don't even have to use the derivative function here, but I want to know more about your setup/goals before I make a code suggestion.

0 Kudos
Message 10 of 12
(2,933 Views)