Roi definition and what can be allocated

First, I love the platform and it is fun to use! I am trying to read out histogram values for a circular object for a circular area. Using the blob tool and single color, I can get the center coordinates of the blob and object. My sample presentation is fixed and I would like to use a defined circle with a given radius for my roi. Is this currently possible or do I have to tinker in C? It looks like that the roi is looking for a rectangle. Is it possible to copy/mask the outer area with a predefined bitmap instead so only the area of interest contributes to the histogram data? Any suggestions are appreciated!

Hi, you can pass a threshold argument to the histogram method such that it only includes pixels within those thresholds in the histogram.

There’s no way to define a circular area though. Just an ROI.

1 Like

Thank you for the fast response. I have the freedom of a well positioned sample and the blob tool is only a check that the sample is positioned correctly. Once i confirm that I could overlay a bmp mask blocking out the unwanted pixels and after that follow your suggestion to get histogram and threshold. I have no timing constraints and evaluation can take a couple of seconds.

dear friend after finding your blob you can inspect particular color range inside that rectangle if you do what @kwagyeman said. No bmp mask is needed this way. If this doesn’t help you try to filter out blobs on the found rectangle…

Dear Fanis,
Your suggestion is great as well. I do some prototyping and have worked on vision system issues before. The Lab scoring is useful but sometimes you will need the raw RGB settings to make things work. I once aligned a reference system (Hunterlabs) to a commercial vision system by building a model for a pseudo white illuminant not defined by CIE). I my current case, I want to use the individual RGB values for some optical brightener response (circular shape) and analysis of area intensity. I want to use the blob tool for verifying that an object in the position is present (color match in the blue range → blob using blue criteria providing info about center point and shape). I will then switch to the green RGB scale (illuminant UV bleeds into the blue) to get a more linear response of intensity. I am getting close to have some working system. I have the luxury to design the optical path myself and with shrouding and glare reduction I can highlight just the object so that recognition tools are much easier and robust to configure. Thank you all for your fast responses and I will spread the word for this interesting platform. On suggestion for the documentation would be for connecting examples of the IDE and code references via short examples how to implement certain features. This is more thought of as a community effort next to the forum and I may have not discovered it yet.

Hi, generally you can discover what the camera can do by reading the documentation and just playing around with the thing. The IDE allows for very fast iteration.

Good luck to your project!
Generally it will be very helpful to be able to pass through the inspection tools circular regions…
But unfortunately only rectangles…

I made good progress and added a LCD screen for a stand-alone application. In order to optimize my color criteria for the Lab color range of my objects, it would be nice to have all the pixels highlighted which are part of the blob or stats Lab criteria.

I use the following to find a blue round object:
for blob in img.find_blobs([thresholds[threshold_index]], pixels_threshold=4000, area_threshold=4000, merge=False):

and later on (needs optimization):
Stats = img.get_histogram([(9, 60, -40, 45, -100, -10)]).get_statistics()

I assume that the stats only include pixels which meet the color range of the image.
According to the docs, I would have to use image.get_pixel and set_pixel for visualization of my stats pixels in range range. This is just a clarification question. Thank you for all your help.

You could use a bitmask and draw that on the image. E.g. you can use draw image with an alpha mask set for values 1 in the bitmask and then also use a color palette to assign a specific color.

Never use get/set pixel. They exist just because but are basically unusable for any speed purpose. Use our API of other functions.