LimbEdgeDetectionOptions

class giant.image_processing.limb_edge_detection.LimbEdgeDetectionOptions(edge_detection_type=EdgeDetectionMethods.ZERNIKE_RAMP_EDGE_DETECTOR, custom_edge_detection_class=None, edge_detection_options=None, step=1, surround_check_size=None, minimum_surround_check_size=4)[source]

This dataclass specifies the options which control how limbs are identified using edge detection.

Parameters:
  • edge_detection_type (EdgeDetectionMethods)

  • custom_edge_detection_class (type[EdgeDetector] | None)

  • edge_detection_options (object | ZernikeRampEdgeDetectorOptions | PAESubpixelEdgeDetectorOptions | None)

  • step (int)

  • surround_check_size (int | None)

  • minimum_surround_check_size (int)

edge_detection_type: EdgeDetectionMethods = 3

The edge detection type to use.

If this is set to EdgeDetectionMethods.CUSTOM_DETECTOR then the custom_edge_detection_class must be specified.

If this is set to EdgeDetectionMethods.CUSTOM_DETECTOR, EdgeDetectionMethods.PAE_SUBPIXEL_EDGE_DETECTOR or EdgeDetectionMethods.ZERNIKE_RAMPE_EDGE_DETECTOR then you can configure the detector using the edge_detection_options attribute.

From this class, we only use the EdgeDetector.refine_edges() method to refine the pixel level limb points we detected.

custom_edge_detection_class: type[EdgeDetector] | None = None

A custom edge detector class implementing the EdgeDetector API.

This will be initialized by providing the “attr:edge_detection_options attribute as the only argument.

edge_detection_options: object | ZernikeRampEdgeDetectorOptions | PAESubpixelEdgeDetectorOptions | None = None

The options dataclass to initialize the edge detector with.

This is provided as the only argument to initialization if the edge_detection_type is set to anything by EdgeDetectionMethods.PIXEL_EDGE_DETECTOR

step: int = 1

The step size to sample limb points at in units of pixels

surround_check_size: int | None = None

How many pixels to use before/after the limb in the sun direction to check that the intensity changes from darker to brighter (indicating an illuminated limb).

That is, we will check that the median of image intensity of the previous surround_check_size pixels along the scan line is lower than the median of the image intensity of the next surround_check_size pixels along the scan line.

If this is set to None then we use approximately 1/8 of the length of the scan line.

minimum_surround_check_size: int = 4

The minimum number of pixels before/after the limb to include in checking that the image goes from dark to light at the limb point.

If there are not this many pixels before or after a potential limb to check (due to being close to the boundary of the image) then the potential limb is discarded. Therefore, you want this to be a decent size so you can get a reasonable sense of the intensity before/after the potential limb point, but if set too large too many true limbs could be unnecessarily discarded.