ImageProcessing.find_poi_in_roi

giant.image_processing:

ImageProcessing.find_poi_in_roi(image, region=None)[source]

This method identifies pixel level centers for all points of interest inside of some region of interest.

A point of interest is defined as any grouping of n pixels that are above poi_threshold * standard_deviation where poi_min_size <= n <= poi_max_size. The standard_deviation is computed using the flatten_image_and_get_noise_level() method. Pixels are defined to be grouped if they are neighboring:

nnnnn
nyyyn
nyoyn
nyyyn
nnnnn

therefore any pixels labeled y are grouped with o whereas any pixels labeled n are not.

This method will ignore any blobs that contain saturated pixels if reject_saturation is set to True and the image object has an attribute saturation containing the saturation level for the image.

If the return_stats attribute is set to True, then this method will also return the connected components stats (see OpenCV connectedComponentsWithStats for details) and the peak signal to noise ratio for each detection.

Parameters:
  • image (ndarray) – The image being considered

  • region (Tuple[ndarray, ndarray] | None) – The region of the image to consider

Returns:

the pixel level locations of the points of interest in the region of interest (row, col). Optionally returns the connected component stats and the peak signal to noise ratio for each detection if return_stats is set to True.

Return type:

List[ndarray] | Tuple[List[ndarray], List[ndarray], List[ndarray]]