CVBpy 14.1
EdgeDetectionResult Class Reference

Result of the function cvb.foundation.detect_edges_of_stripe_target. More...

Inherits object.

Properties

 edge_indices = property
 List[float]: Array that holds the indices of edges for each scan line. More...
 
 num_edges_per_profile = property
 int: Number of edges per scan line.
 
 num_profiles = property
 int: Number of scan lines where edges are correctly detected. More...
 
 scan_line_indices = property
 List[int]: Array that holds the indices of the scan lines. More...
 

Detailed Description

Result of the function cvb.foundation.detect_edges_of_stripe_target.

The cvb.foundation.detect_edges_of_stripe_target function identifies edges within an image depicting a target with alternating black and white stripes. The image is scanned line by line and the results, including edge indices and scan lines are stored within this class. Subsequently, the instance of this class serves as input for the linescan calibration process executed by the cvb.foundation.create_line_scan_calibration function.

Property Documentation

◆ edge_indices

edge_indices = property
static

List[float]: Array that holds the indices of edges for each scan line.

Note, that the size of edge_indices does not represent the actual dimensions. It depends on the allocated memory determined by the image height and the given number of stripes given in function cvb.foundation.detect_edges_of_stripe_target. Only values up to elements with index cvb.foundation.EdgeDetectionResult.num_edges_per_profile * cvb.foundation.EdgeDetectionResult.num_profiles - 1 are valid. In order to get the edge_indices in a readable format, please use the following code:

# reshape edge_indices and remove invalid elements
edge_indices = np.array(
... detected_edges.edge_indices[0:detected_edges.num_edges_per_profile * detected_edges.num_profiles]
... ).reshape(-1, detected_edges.num_edges_per_profile)
cvb.foundation.EdgeDetectionResult detect_edges_of_stripe_target(cvb.Image image_stripes, cvb.Rect aoi, int num_stripes, int scan_direction, float threshold)
This function detects edges from a calibration pattern with alternating black and white stripes.
Definition: __init__.py:3080

◆ num_profiles

num_profiles = property
static

int: Number of scan lines where edges are correctly detected.

Note, that only profiles, where the same number of edges are found, are stored to cvb.foundation.EdgeDetectionResult.

◆ scan_line_indices

scan_line_indices = property
static

List[int]: Array that holds the indices of the scan lines.

Note, that the size of scan_line_indices does not represent the actual array length. It depends on the allocated memory determined by the image height given in function cvb.foundation.detect_edges_of_stripe_target. Only values up to elements with index cvb.foundation.EdgeDetectionResult.num_profiles - 1 are valid. In order to get the scanline_indices in a readable format, please use the following code:

# remove invalid elements
scan_line_indices = detected_edges.scan_line_indices[0:detected_edges.num_profiles]
print(scan_line_indices)