03-21-2016 10:06 PM
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).
03-21-2016 11:53 PM
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.
03-22-2016 10:46 AM
Are you trying to measure the derivative from frame to frame? It looks like you are only operating on one frame at a time.
03-22-2016 02:51 PM
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.
03-22-2016 03:07 PM
Is there a better or different way to go about this?
03-22-2016 03:15 PM
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.
03-22-2016 04:05 PM - edited 03-22-2016 04:06 PM
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?
03-22-2016 04:09 PM
What does your "Particle Measurements" array have inside it?
03-22-2016 04:11 PM
It has the x an y values of the particle. Here's my front panel.
03-22-2016 04:14 PM
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.