Go to Post Funny, I came to robotics for the robot, but find I stay for the people. - Mr. Pockets [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 22-08-2009, 01:09
Delian Delian is offline
Registered User
FRC #3006
 
Join Date: Dec 2008
Location: Salt Lake City
Posts: 16
Delian is on a distinguished road
Labview: Template Recogntion

Hi, I am from team 3006, and our software section has been trying to work on taking an image from the AXIS camera and recognize a black and white template image, and finding the location of all matches above a score, for example of 800.

First thing we tried was to work in NI Vision Assistant with static images. We realized that in NI Vision, the best script was one that ran a color-plane extraction: Value plane, the doing a Color Threshold, and then using the shape matching option from the Binary Image section. We then created several more static images with the template and added some "noise", ran these through the script, and found that it successfully recognized all sizes of the template.

Logically, from here we used the tool to create the VI, from there I ftp'ed our template image onto the robot and fixed the file path for the template. From here we ran the robot and used probes, shocked to find that the template image was only black. However, after a day or so, I saw that in the code, the automatically-created VI grabs the template on the first call, and uses whatever it gets as the template forever. I instead removed the case structure and had it continuously take in the template, and voila, the image was now there.

That was the least of our problems, from there we began to analyze the image from the camera, the color plane extraction worked perfectly, however the threshold turned the image black no matter what values I gave it. Thus, I removed the Threshold form the code, went back to Vision Assistant, removed the Color Threshold there, ran the recognition tests again, and found that it worked. Thus, the final code which we tested, read the template continuously, and only used a Value-plane extraction.

From here, all the inputs to the Shape matching VI seemed to all be correct when probed, the template was there, as was the black and white image, yet no matter what sort of shape matching, template matching VI we switched in, none of them recognized the template.

Anyone have any ideas how to proceed from here, sorry for the long explanation, but I find it helps people to understand a problem if they have some background.
Reply With Quote
  #2   Spotlight this post!  
Unread 22-08-2009, 08:09
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Labview: Template Recogntion

As I was reading, I was wondering if you were really doing a color threshold on a grayscale image. I can't get vision asst to let me do that immediately following a plane extraction. If you have the original script and/or any idea of how you got it to do that, could you send that to technical support?

I'm also curious what the ultimate code looked like as doing a color threshold on a monochrome image will produce a runtime error. If it doesn't change the image, perhaps that would explain some of what you saw.

You shouldn't need to reload the template image. You may want to check that the operations downstream don't modify the image. If an image VI takes the template in as source and you don't wire up a fresh destination image, most blocks will modify the source. Another way this can happen is if the image names are not unique. IMAQ in LV is one of those old odd birds that aren't really dataflow. The image must be created, and the name makes it unique. I'm pretty sure that multiple creates named "fred" will then reference the same image and will affect each other.

If you go back to image asst and build the simpler script with just the plane extraction and template finding and generate code, do things work? I wonder if most of the issues aren't from an invalid script in the first place.

Greg McKaskle
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[FTC]: LabVIEW Programming Template for FTC Team 288 FIRST Tech Challenge 30 06-02-2010 17:49
WindRiver Programming Template kyungjin C/C++ 0 24-01-2009 16:42
LabVIEW FRC Template koreabell NI LabVIEW 2 16-11-2008 20:46
[OCCRA]: Template iwanttodunk OCCRA Programming 14 29-10-2008 21:02
Template Project Astronouth7303 Programming 10 30-05-2004 20:05


All times are GMT -5. The time now is 08:33.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi