loading
 
Shape Match with API and idx files?
Anonymous
15 year
Hi,

So I'm trying to call a few RoboRealm scripts using the API (python, but that doesn't really matter).  Two of them use the Shape Match function.  In one, it works great, but other can't find any shapes.  When I go to the roborealm window, I realize the second one fails because you need to manually train the module.  

I then tried to find the difference between the script that you have to manually train and the other that comes ready made.  In the training folder for the ready to use one, there is a file 'roborealm.idx' that was created that is missing in the other folder.  I've tried to decipher this file, but it's pretty cryptic.

So my question is either how do you use Shape Match in a script without needing to manually train it or how I make the roborealm.idx file?

Thanks!

Steve
Anonymous 15 year
Steve,

Just to clarify ... you should be able to manually train the second script just once which will generate the idx file. From then on the script should allow you to switch between the two.

Or are you in a situation that you get new files and need to automate the training?

Another way would be to use two shape match modules trained on different folders and then use an if statement around the module to cause the processing to switch from one to the next based on a variable that you set using the API.

Note that I would not recommend trying to generate the idx file. If you can specify a situation where automated training is needed we can add that capability ... much easier than generating it on your own!

Does this help at all or am I not understanding your situation?

STeven.
Anonymous 15 year
Hi Steven,

Thanks for the post.

My situation is one where I only need to train the model once.  The problem is it doesn't remember that it got trained.

When I train the model now, no idx files get created, just a roborealm.shape (I think, I'm not at the computer right now).  Is this a bug in the software or is there a special place you need to go to train the idx file?  

Thank!
Anonymous 15 year
Steve,

the RoboRealm.idx file is created by the Image_Matching module not the Shape_Matching module. Thus that file should not be needed for the ShapeMatching to work.

The ShapeMatch module will check the

base_folder

value (be sure that you include that in your API call) and check to see if a roborealm.shape exists in that folder. If it does then it will use that file for matching.

Could you include your XML that you are using with your API call so that we can double check the values?

Thanks,
STeven.
Anonymous 15 year
Hmmm... That totally explains why we don't get idx files!

Here is the working ShapeMatch Call:
<Shape_Match>
  <is_rotational_invariant>TRUE</is_rotational_invariant>
  <min_confidence>50</min_confidence>
  <max_size>100</max_size>
  <sort_array_on_y>FALSE</sort_array_on_y>
  <display_confidence>FALSE</display_confidence>
  <max_angle>360</max_angle>
  <display_orientation>FALSE</display_orientation>
  <select_top_blobs>1024</select_top_blobs>
  <create_shape_array>TRUE</create_shape_array>
  <is_mirrored_invariant>TRUE</is_mirrored_invariant>
  <max_confidence>100</max_confidence>
  <base_folder>C:\Documents and Settings\cs266\Desktop\train\red</base_folder>
  <display_coord>FALSE</display_coord>
  <color_index>-1</color_index>
  <display_box>FALSE</display_box>
  <display_filename>TRUE</display_filename>
  <sort_array_on_x>FALSE</sort_array_on_x>
  <display_size>FALSE</display_size>
</Shape_Match>

And the one giving problems is attached.  

Both folders (...\train\red and black) have roborealm.shape files in them, but the black one still requires manual input.

Thanks again for all the help

Steve
Anonymous 15 year
Steve,

We tracked down the issue to a loading error of the shape file. This has been fixed and uploaded to the site. Can you download 1.8.23.14 and see if this corrects the issue?

Thanks,
STeven.
Anonymous 15 year
Hi Steven,

The Shapematch is working great in 1.8.23.14!

The only problem is that the program is now crashing sometimes when I try to run my load picture script.  I've attached it (I'm using the Point Grey DR2 camera if that is important).  The error is:
"Unhandled exception at 0x0059f587 in RoboRealm.exe: 0xC0000005: Access violation reading location 0x04f3f861."

I've tried restarting the program and computer and the error still comes up.  I think I can run the script once after each computer restart before receiving the error.  At that point restarting the program does not help.

Thanks again for all your help,
Steve
Anonymous 15 year
Steve,

thanks for the robofile. Can you also post an image that you get from your firewire camera that causes it to crash? The error seems to be dependent on the image.

Thanks!
STeven.
Anonymous 15 year
Ok, so I lied to you a little.  The program crashes when you load that script.  But I tracked down the bug - it crashes during the RadialDistort part.  I've attached

ExampleImage.png - raw picture from camera taken with RoboRealm
ExampleImageScaled.png - that image after it is scaled 75% by 75%  

If you try calling RadialDistort after this, the program crashes when you move around the parameter bars.

Cheers,
Steve

Anonymous 15 year
Steve,

Ok, that's what we needed. We were able to track down the issue and have already uploaded a fix. Please download 1.8.23.15 which should solve the Radial Distortion problem. The error was indeed coming from that module and had to do with the large image size you were using. But all should be ok now ...

Thanks for the image and description. That helped to quickly isolate the issue!

STeven.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index