Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to find moving object/target displacement (how much X, how much Y) using a USB camera in an acquired set of images?

Hi Amar

 

The Error Code 3 - Unable to open front panel is a message that explains that the VI has gone curropted (Actually the error is a bad connector pane). This is a problem with the downconverted version it does not exist in my version.

 

For general forum search: If you get the error: "Could Not Load the Front Panel" and does not have a backup it can very often be solved by contacting your local National Instruments Technical Support Department. For more information see (

 

I have attached a Color Identification 2010.vi, please see if this works for you.

 

EDIT: You should be able to incorporate my results with your VI to get it to work. Problem is that you are not finding the centroid for each object but for the image. Instead use IMAQ count objects VI. And to find the maximum use a for loop to iterate over the results in the cluster. 

 

Best Regards,

Anders Rohde

0 Kudos
Message 11 of 22
(1,927 Views)

Mr. Rohdes,

 

                         Thanks for the vi again. I am able to open it and now I got the idea how to compute the centre of mass for each object in the image. I will do it for my application and be back for doing it for a sequence of frames.

 

Amar.

0 Kudos
Message 12 of 22
(1,923 Views)

Your are welcome Amar.

 

Please let me know if you need any further assistance with this. Or if you have trouble locating the red object in your real images.

 

Best Regards,

Anders Rohde

0 Kudos
Message 13 of 22
(1,922 Views)

Hello Mr. Rohde,

 

                         I hope you are doing good. I am back again for your help. I was experimenting with the DAQmx task part for my project. I was able to succeed in driving the motors by sending digital inputs and a PWM as enable to the motor drivers I acquired and my VI.

 

                         Now I have attached here a part of your color thresholding VI with part of my DAQmx task vis to give you an idea what I am going to try next. I was able to get the Centre of Mass of the Largest Object using your VI continuously if I run it in a loop. Now I would like to make a decision depending on the Centre of Mass of one object (RED CIRCLE on white background as told earlier) in successive frames.

 

And with the decision (moved in X? moved in Y? moved in Z?) I should be able to send the digital outputs and the PWM to the corresponding motor driver. I am thinking to show movement in Z with the change in area of the circle in the frame. (Like if the area is more than some value, it is forward, less than that value, it should move backward in Z). I am assuming you know, how a motor driver works. I need to loop the digital outputs to cause movement. So, can you please see the VI, partial explaination of the tasks there and tell me how I can bring out the decision (i.e. movement in which direction). The decision should result in mutually exclusive events (in the sense, it should drive only one motor at a time to take care of the motor drivers!)

 

Amar Makana.

0 Kudos
Message 14 of 22
(1,906 Views)

Hi Amar I'm sorry but I don't really understand what you are asking me about

 

 

1) You say you understand and can use my color identification VI

 

2) You say you have successfully been able to send PWM to the motor drivers.

 

What is it then that you have difficulties with?

 

Best advise is to focus on a small problem at a time and break down the problem. If the color identification works don't focus on that any more, if the PWM works don't focus on that any more. Start a blank VI with the concepts that you are still missing and use test inputs to create a VI that works.

 

Best Regards

Anders Rohde

0 Kudos
Message 15 of 22
(1,900 Views)

I have created a small example to show how to do conditional execution based on previous and current center of mass. This shoud be possible for you to modify

 

Best Regards,

Anders Rohde

0 Kudos
Message 16 of 22
(1,897 Views)

Hello Mr. Rohde,

 

I was trying to explain my project status in my previous message. Sorry if I confused you by telling the whole concept of my project and it's progress. I was just explaining my progress with the project. I know how to frame the decision if I get two centre of mass figures/co-ordinates depending on my application. I made it in small vis already and I am okay with that. 

 

What I exactly now need is acquire the video in a sequence/buffer (say 2 frames for now) and get the previous and present centre of mass co-ordinates so that by taking the differences between the co-ordinates, I can take a decision. I need help on how to do that. 

 

I saw this message now, thought that the message with points 1 and 2 you gave was the last one from you. I got some idea after looking at your vi. I will try it for my application  and be back for help. Thanks.

 

Amar Makana.

0 Kudos
Message 17 of 22
(1,878 Views)

Thanks for the update Amar.

 

The attached VI should do what you want. Good luck with the application.

 

 

Best Regards

Anders Rohde

Applications Engineer

National Instruments Denmark

0 Kudos
Message 18 of 22
(1,872 Views)

Hello Mr. Rohde,

 

 Can you please downconvert the VI again for LV 2010 SP1. I was unable to open it at my college as it is this version. I was able to open it at home with evaluation copy. But I am not able to open it again as the evaluation time finished for my home copy of LabVIEW.

 

Amar.

0 Kudos
Message 19 of 22
(1,866 Views)