From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you program the camera to follow a robot trailer?

I asked the question in a general sense because I have exhausted all references to this subject without any success.

The vision target on the robot trailer has two colors.  The program will have to determine which is on top.

I thought that the document "Image Processing in LabVIEW for FRC" would start me in the right direction for developing such a program.

However, I cannot get my program to find any of the three colors that are being searched for in the example.

Everything seemed straight forward and using the "Vision Assistant" was not difficult.

Except I never got any hits on the three colors.

Thanks.

0 Kudos
Message 1 of 3
(7,322 Views)

Hi RobotMan,

There are many variables to take into consideration for finding and recognizing color, as well as multiple programming approaches. The tutorial introduces the basics of using the Vision Assistant to prototype a basic color location algorithm. This approach may not prove to be very robust, considering changing lighting conditions, motion blur, noise, and other variables. You may want to consider the color characteristics of the trailer identifiers, and how they can be differentiated from the background. Perhaps a color threshold and then binary morphology processing would work better for this application. It's hard to say what will work best right off the bat...it's really a problem that would benefit from trial and error.

If you are running a program from the cRIO to try to find the colors based on the templates generated in the examples, you will have to move the templates over to the cRIO as per this document:

FTP File Transfer to cRIO (Using Image Processing Requiring Template Images)

Also, the colors may not match sufficiently if you are searching for a different blue, for example. You would want to take a new template image of the exact object that you are trying to detect.

More information on color image processing in general can be found in the Vision Concepts Manual linked at the bottom of the Image Processing Tutorial that you referenced.

Hope this helps,

~Nate

0 Kudos
Message 2 of 3
(2,399 Views)

Thank you.

I had multiple problems with this and you answered them.

But, as you said, there will need to be a lot of testing.

I just couldn't get anything to work because of not knowing that I had to copy the template files to the cRIO.

Thanks, again.

0 Kudos
Message 3 of 3
(2,399 Views)