loading
 
color value
BobA from United States  [10 posts]
15 year
New to RR (very impressive), so I'm not sure about where or how to post.

I have a series of translucent backlighted color gradient rectangles at varying distances from the camera (see attached). They appear in a varied daytime outdoor background environment and will be viewed individually one rectangle at a time. They could be strobe equipped to simulate movement (controlled pixel flashing rate and intensity). I want to a, recognize the rectangle and b, determine the RGB values or Index value of the center bottm pixel(s).

Can RR handle this scenario and if so can someone point me in the right direction.

Many thanks,

Bob
Anonymous 15 year
Robert,

Yes, this is possible but you will need to outline each of those rectangles with something that can be tracked as you intend to change the colors to be somewhat different for each rectangle. I'd recommend using something like



as the image which is the rectangle surrounded by a black and then white rectangle. You'd then track for this white and black rectangle as the object and then sample the middle for the color that you are looking for.

For example given a simulated scene



You could use the attach robofile to mask out the rest of the scene to just leave the rectangle.

Before continuing you will need to test this on a real image. Note that the rectangle CANNOT be rotated in any way but can be moved left, right, forward, backwards if needed in the real image.

Let us know by posting some real images that can be further tested.

STeven.

program.robo
BobA from United States  [10 posts] 15 year
Steven, Thankyou fro the quick reply

Outstanding idea! Couple of questions.

1. Why the restriction on rotation? Are we talking about all three axis?
Has it anything to do with the apparent aspect ratio of the rectangle?

2. What kind of problems am I introducing by using the black - white - black pattern on only the top and bottom edges and is there a way around it?

I am going to construct a panel and have a live look using the file. this will take a few days. I'll get you some filtered and unfiltered screen shots as soon as I can.

Again many thanks,

Bob
BobA from United States  [10 posts] 15 year
Steven,

I have had a chance to play with the image you sent me. I made an AVI out of it and then tried some different settings with the file you sent. It gave me a better sense of how to construct the panels so as to enhance the selectivity. I'll get on that right away.

Thanks again,

Bob
Anonymous 15 year
Bob,

1. You can rotate the squares around the Z axis but not the X and Y (i.e. only affine transforms). Thus if the rectangle is not parallel to the CCD plane the square will not be an actual square but more of a diamond which will cause the detection to fail.

2. We were using the black white black to be sure that a square would be detected. As the inner color can change it may not be detected as a square so the outer lines will help to ensure that a square object is detected. If you use other scenes like an indoor scene there will be more square objects detected. You might then be able to use those black/white/black squares to identify just your colors. It will depend on your environment which is why getting actual images to test is key.

STeven.
BobA from United States  [10 posts] 15 year
Steven,

In the image displayed in your first reply the vertical black and white striping on either side is not visible (see above). At least it is not visible on my monitor although it appears complete in background image with the little color rectangle in the lower lefthand coener.

My question:

If at all possible, how would you go about isolating the image with the missing side elements (a color rectangle with a black and white border on the top and bottom edges only)?
Anonymous 15 year
Robert,

Just click on the images to see the correctly sized image. The thumbnail shown above does some cropping which sometimes alters the image in a bad way.

It might be possible just to detect two lines but that will not be as reliable as the entire square. If the sides are really problematic it might be possible to come up with a technique that will work ... but again, having that in real images would really help as that will probably anyhow require a complete rethinking of how to detect those colors.

STeven.
BobA from United States  [10 posts] 15 year
Hi Steven,

OK, I've resolved most of the issues I had. I have overcome the border situation by redesigning the color transparency so that it always presents a 90 degree face toward the camera. I am still having trouble figuring out how to retrieve the RGB value for the COG of the source rectangle using the COG coordinates (not with the mouse).

Thanks

Bob
BobA from United States  [10 posts] 15 year
Hi Steven,

OK. I 've got a way to do it. I just cropped the source rectangle down to the COG and use the COLOR Stats.

Thanks,

Bob
Anonymous 15 year
Bob,

Yes, that will work ... you could also check out the Sample_Color module which will give you a similar mean value for the sample area defined by you.

But cropping and Color Stats will work too!!

STeven.
Robert from United States  [1 posts] 15 year
Steven,

I am having difficulty in setting the crop coordinates with variables. I would like to do something with the Crop Module like, X Start = [COG_X], Y Start = [COG_Y] - X End = [COG_X +1], Y End = [COG_Y +1]. I have tried as many syntax iterations for the * End variables as I can conjur up, but to no avail. What am I not seeing?

Thanks,

Bob
Anonymous 15 year
Bob,

While a nice idea you cannot use generic expressions in the [] specification. They are only meant to id a variable and are not a generic calculation field (although we might switch it to that in the future!).

So you will have to use some other means to add 1 to the cog's. For example placing the following in a VBScript module should do the trick

SetVariable "COG_XX", (GetVariable("COG_X") + 1)
SetVariable "COG_YY", (GetVariable("COG_Y") + 1)

and then using

X Start = [COG_X]
Y Start = [COG_Y]
X End = [COG_XX]
Y End = [COG_YY]

should do the trick.

Thanks for the idea though!

STeven.
BobA from United States  [10 posts] 15 year
Thanks Steven,

Works like a charm (this stuff is so cool)!

Regards,

Bob

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