Log in

View Full Version : Invalid Template image


JM033
26-01-2013, 11:50
I'm getting an error when loading my vision tracking script on my driver station, it says IMAQ: invalid color template image Any ideas?
EDIT: I followed this tutorial: https://docs.google.com/viewer?a=v&q=cache:vuYBmZI943gJ:svn.assembla.com/svn/gccrobotics/Image%2520Processing%2520in%2520LabView/Image_Processing_in_LabVIEW_for_FRC%5B1%5D.pdf+vis ion+assistant+frc&hl=en&gl=us&pid=bl&srcid=ADGEESgKZqY5rnpEu7oDYfKG-5F1kBKf7DbhmMx5xSgKMTV6rkYKE0wDRlPuqM5wSXnINsOcK-BLKLdqwdGv-ELVLEfmGYKStsw0K5agbVjzEOEBCW19EGMyIXUcCY5kvhzftUd LcXTW&sig=AHIEtbSlXmtgpL8V8ou96Jr3M4FLLswFYQ
and made a template, but still won't work.

Greg McKaskle
26-01-2013, 12:23
I'm not sure that tutorial is really the best to follow compared to the 2013 white paper, but if you choose to use templates, you need to make sure the template is placed on the controller and that the code shown on page 11 of the tutorial points to the path of the template on the controller. It is possible to add the templates to the deployment script or to ftp them.

Greg McKaskle

JM033
26-01-2013, 13:03
Yes, my code points to the template.
What do you mean placed on the controller? And do I have to FTP them?
EDIT: nevermind, I think I know what you mean, going to try ftp.

JM033
26-01-2013, 14:20
OK, I FTP'ed into the crio, placed the template there, and told the code to locate the template at the crio. But still get 'invalid color template image'

JM033
26-01-2013, 17:51
I quit

Greg McKaskle
26-01-2013, 18:28
Hopefully just for dinner.

Sorry I couldn't help, but I had to run errands with my kids. Is the error coming from the Match Color Pattern or from the block that loads the image? It should tell you in the complete error message, and you can open the code and probe the error I/O to verify if you need to.

Backing up a few steps, Color Pattern Matching is pretty intensive and is likely to take quite awhile to complete on the cRIO. The monochrome pattern matching will also work if you do the threshold with your color and then match for a hollow rectangle. Both color and monochrome pattern matching require pattern templates to be on the controller, which is one of the reasons the white paper didn't use them.

The other approach, the one outlined in the white paper does a threshold using color or intensity to produce blobs. It then requests a number of measurements on those blobs and checks to see how rectangular, how hollow, what ratio the sides have, and other simple stuff like that. I'm not going to discourage you from exploring on your own, but there is a reason why Color Pattern Matching wasn't used in the example in the white paper.

Greg McKaskle

JM033
27-01-2013, 23:38
Thanks for your insight! Not to go up on another limb but attached is the rectangular image processing SAMPLE code that labview gives you. Is everything setup correctly? Do I need to put the udp send and receive code somewhere? What about the dashboard? Does it need udp send and receive too? I want to do the processing on the lappy, not on the crio. I think the term is called "offboard image processing." Sorry If I'm asking a lot, but I just don't have a clue where everything goes even after reading some whitepapers. After reading other posts it seems everyone is successful in tracking. I just can't seem to get it. Thanks G3G
https://www.dropbox.com/sh/sc81tdp0lz69y58/ISN3YTL3AA

Greg McKaskle
28-01-2013, 05:58
If you are going to do it on the dashboard laptop, I'd recommend using SmartDashboard variables.

First, create a dashboard project, then locate the loop the requests the camera and displays it. Combine that with the sample code, and send the target results back to the robot using SmartDashboard.

Greg McKaskle

JM033
28-01-2013, 11:10
Alright, I'll try when I get back in the lab, ty

JM033
28-01-2013, 11:37
Instead of smartdashboard variables can I use network tables for labview? or why not UDP? UDP seems easier?

Alan Anderson
28-01-2013, 13:41
SmartDashboard variables are Network Tables variables, with a specific name prefix.

You can use UDP if you want. It's easy, it's simple, and it's just what you need for this kind of communication. The only reason to choose SmartDashboard is that it's already in the code and already running, but for many teams that's a very good reason.