Add to this Thread

Steven Gentner from United States 1 year
There are a couple ways of doing this ... doing the entire thing in VB is possible but will be slow.

1. The structure of the GetPixels is litterally a red, green and blue number from 0 to 255 for every pixel in the current image. So one can expect that array to be width * height * 3 big.

2. There are many ways of doing this. A quick answer is to just use the green value (i.e. 2nd value in each pixel triplet) since that represents gray the best or use (red + green + blue)/3 as the gray/intensity value. You can try both to see which way better suits you.

Alternatively, I would use the Crop module to remove all but the part of the image that you want to check. Then you don't have to worry about the region limits from then on.

I would then use the Threshold module to eliminate all the pixels not inbetween Min and Max.

Finally, adding the Color_Statistics module would give me "Area" or the number of non-black pixels ... which is therefore the number of pixels that lay between min and max.

Then you don't need any VBScript at all and its operating near realtime!

See attached example.


Pick Avatar
* Question/Comment - Only <b>, <i>, <u> tags are allowed. All others will be escaped.
Use the tags [image1], [image2], etc. to place the images within your question/comment.
Upload Images (.jpg, .png, .gif) < 300K, robofiles (.robo) or Zip files (.zip) < 300K.

If you have any questions/issues about RoboRealm or image processing this is your chance to ask a question. Your question and any responses will be posted to the forum section of the website for others to read and learn from.

Note that any submission will be considered property of RoboRealm. If you do not wish your images to be displayed as part of the RoboRealm site please do not submit those images. Any submission may be removed from the website at the discretion of RoboRealm personnel.