03-14-2013 11:11 AM
Hi all
I am new to Labview and I am using it to do image recognition. I got that working but now my problem is that I need to get the centroid of the image that it had recognized. I understand that the image mask input on the 'IMAQ Centroid' block provides a boundary search area to calculate the centroid. But I don't know how to connect it up. I need the centroid of the object that I had recognized.
Or if there is a easier/better way to achieve my goal please do comment.
Please if someone could attach an image on how to wire this block up it will be a major help for my mechatronics project or email it to me shiraubayd@gmail.com
Thank you in advance
03-14-2013 11:21 AM
How are you locating your object?
If you are using pattern matching, the object coordinates are included with the results.
If you are using particle analysis, the centroid of each particle is included in the results.
You probably don't want to use IMAQ Centroid. I believe it uses the grayscale values, which puts more weight on brighter pixels. It is also influenced by the background if the pixels are non-zero.
Bruce
03-14-2013 05:13 PM
Hi Bruce
Thank you. I am using pattern matching, I analyzed my circuit and yes I am obtaining coordinates.
I am doing my image recognition in grey scale. I had problems when trying to make the search in colour.
Please if you could have a look at my circuit I attached, its not the final circuit, currently in the testing and improvement phase. If you could assist in giving me a colour search pattern match. It would really help.
Kind regards
U Shira
01-30-2014 09:08 PM - edited 01-30-2014 09:09 PM
In the following we proceed to function block search pattern extracted in the previous process (the parameters as rotation angle and minimum score is inserted into SETTINGS control), extract the output of the search function to get the position values indicators that will be displayed on the front panel)
01-31-2014 12:35 AM - edited 01-31-2014 12:36 AM
Hello,
do you really need color pattern matching for your application (is the color really relevant in the object detection or can the object(s) be described with other features like shape? Color pattern matching process will take more time to find the object(s) as opposed to a grayscale matching.
Anyway, there is a rough example of color pattern matching here:
http://forums.ni.com/t5/Machine-Vision/color-pattern-matching/m-p/2498096/highlight/true#M39315
Two .vi's - one is used to learn the information relevant for color pattern matching and the other is to find the object on the snapshot from the webcam.
As for the stepper control part you would need a stepper driver/power stage and a microcontroller/controller stage. In my opiniton, the simplest way to do this is to have the camera and the stepper(s) mounted on some sort of pedestal and tracking in such a way that the object is always in the center (or rather in the center's vicinity) of the optical axis of the camera. For increased accuracy, it would probably also help if you calibrate the camera (correct lens distortions). The tangential distortion should give you no problems, but I am not sure about radial distortion. I don't know your camera parameters.
You could use RS232 communication to send the data to the microcontroller. As for the microcontroller I would probably go for the ARM, but using an AVR board would be also as good (for example Arduino Nano as its small in dimension). If you use Arduino, you can use Labview functionality with LIFA (although I much rather work in C environment when microcontrollers are concerned). You can take a look at the following link, where one such application is discussed (along with some example code in C++ and Labview):
http://forums.ni.com/t5/Machine-Vision/eye-controlled-wheelchair/td-p/2651903
Hope this helps a bit.
Best regards,
K