Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Try to use IMAQ UAB to track the braiding point.

Solved!
Go to solution
I see. Thank you!
0 Kudos
Message 21 of 27
(2,129 Views)

Hey, BCHo,

My code kind of works well now.

 Do you know how long time shold I get one shot of image? I mean how many frames there are in one minute even though it is real time. I ever saw it likes one frame per second, is it true? Can we control rate or time of image acquiring?

Thank you!

Guangli

0 Kudos
Message 22 of 27
(2,114 Views)

Hey guangli,

 

The frame rate of your camera is dependent on a number of things. If you were acquiring as fast as possible and had no other code in your application, the frame rate would be completely dependent on the specifications of the camera itself. I.E. how fast the camera's sensor can digitize an image and pass it to your computer. If you have additional code in the loop where you are grabbing the image, your frame rate would be dependent on how long the code you have takes to execute. 

 

1 fps seems fairly slow. Do you have a wait in the while loop where you are acquiring your image. If you acquire an image, do a pattern match, convert the location of your pattern match to real life distance, pass this to your motion control system, wait for your move to complete, and then repeat....this may be causing your acquisition to slow down. If you are doing all of this in a single loop, you might want to thing about implementing a sort of Producer/Consumer design pattern to separate your vision routine from your motion routine. 

 

So, controlling your fps depends on the limiting factor of the frame rate you are seeing. If your fps is limited by the camera itself, you would have to see if there is a camera attribute that addresses fps. If your fps is limited by the amount of time it takes your code to process everything it needs to, you would need to make your code itself more efficient to increase the fps rates that you can reach.

Hope this helps.
-Ben

WaterlooLabs
Message 23 of 27
(2,112 Views)
Hi, BCHo,

Thank you for your detailed reply. Depends on you said: if I set the wait(e.g. 100ms) in the while loop, the camera will acquire on frame every 100ms, right?

Guangli

0 Kudos
Message 24 of 27
(2,092 Views)

Hi, BCHo,

I also want to feedback the velocity of braiding point to motion loop.  The velocity is caculated by the positions, which are got in previous state and current state of images(velocity=(previous position-current position)/elapsed time). This feedback will go with position simultaneously. How can I caculate it? You know, I cannot use for loop before. Shall I use formula or something else. You know, the postion and velocit should be both feedbacked to motion loop in realtime.

Thank you!

Guangli

0 Kudos
Message 25 of 27
(2,088 Views)

Hey guangli,

 

You are correct in your previous description of framerate (that is of course unless the code you have in your while loop takes longer than 100 ms to execute). In terms of calculating the velocity, you could use Shift Registers to keep track of the previous position and previous time stamp. You could then do a simple formula to determine velocity and feed it back to your motion system.

 

In the future, I would advise starting a new thread for this new question of calculating velocity or how to use shift registers to your advantage. This is because the original intent of this thread is to get the match pattern example working. I believe this has been accomplished. So starting a new thread for new questions would allow the entire community to help solve each question.

Hope this helps.
-Ben

WaterlooLabs
Message 26 of 27
(2,076 Views)
BCHo, thank you very much! I will start new thread later. All the best! Guangli
0 Kudos
Message 27 of 27
(2,074 Views)