Cropping and Center of Gravity
Vijay from United States  [5 posts]
17 year
Hi, I just started using RoboRealm for the prototype stages of a motion tracking  & control project. Because my camera setup isn't exactly aligned using the test rig I made, parts of the camera image don't need to be included.

Before cropping, we have this:

This is fine for the red RGB filter to do its work on isolating the red gumball shown there. But to isolating the green squares is harder because the background of the image gives off a little too much green near the same hue and intensity. So I put in a crop filter to cut out everything that wasn't the board covered in white paper.

But the order of the crop function within the other filters makes a big difference. If put Crop before everything else, it greatly destroys the original image and makes further analysis messed up.

See how the ordering of functions messes things up.

After cropping everything looks ok.

RGB red filtering works ok, but look what happened to the original image:

This makes proper filtering on green not work properly.

More in a second post...
Vijay from United States  [5 posts] 17 year
Now, if I move the crop function down between RGBFilter Green and the Center of Grav. Analysis on it, the filter seems to work fine. But suppose the red COG analysis beforehand had NEEDED cropping to do proper RGB filtering... i couldn't do cropping for that without messing up the green filter later.

Seems to work fine

Then again, looking at the product of the COG analysis, the source image is messed up and keeps me from doing another RGB filter later if I wanted to.

Vijay from United States  [5 posts] 17 year
Found something else. After cropping, the locations of COG stuff gets knocked out of place in the COG view because it overlays using the source image, not the cropped afterimage. Due to this, I wonder if it'd be better to do cropping in an outside script and then have Roborealm do the rest via API.

Before cropping and filtering:

After doing both and doing COG with "Overlay Graphics on Source Image"

Trying to correct for this by adding another Crop statement after the source image was restored via COG only made the image smaller for some reason. Haven't figured it out. It kind of fixes the error in marker from COG, but look at what it does to the picture dimensions:

Vijay from United States  [5 posts] 17 year
Hmm, image4 didn't show up. I'll try it again. Compare this one to image3 from last post.

Image Cropping Issues
17 year

First off thanks very much for all the images and great detective work. There was an issue in the Crop routine that was fixed last week or so. According to your experiments you probably found out that you needed to revert back to the source image after your red rgbfilter. Another way to do this is to use the Set_Marker module .. but this will cause an issue since you would need to crop the image once again ... a better way is to set a marker after you crop, then rgbfilter then create another marker and switch back to the post cropped image. You can then combine both images at the end using the math module.

We've included an example image looking at a red ball and green ball.

The reason for your last image post error was due to our new .robo file upload feature. We've uploaded a .robo file at the end of this post. You should be able to click on that link and have RoboRealm start running it immediately. This should allow you and others to experiment with the script that we are discussing.

Please download RoboRealm again (a new version went out this morning) and try the script below.

Thanks again for your posts!


Vijay from United States  [5 posts] 17 year
Thanks for the response STeven; Looking at other posts in the forum, it amazes me how you fix these problems so quickly!

I seem to be having an issue with the Set_marker function. In the old version I had from 12/21, there was only the option (a checkbox) to revert to source. I see that in the newer version, there's a dropdown to set a marker to current, source, or previous markers. But if I click any of the options, it forces it to "Current" no matter what I pick. If I highlight the dropdown box and hit the down arrow, it never leaves the "Current" setting. However, in the .robo you provided, it appears yours returns just fine to that previous marker... though when I try and edit it, I'm stuck on Current again. Any ideas?

I also noticed in the Crop dialog that the order of tabbing between fields is reversed. As set up it is Y End -> Y Start -> X End -> X Start -> Help -> OK -> Cancel.

Thanks for your help!
Set Marker fixed
17 year

Thanks for your note. Those issues have been fixed. Please download RoboRealm again.


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