Plies detection¶
-
src.processing_cores.plies_detection.correct_orientation(measured_shape, model_shape, step=10)¶ Corrects the measured orientation during the plies detection.
- Arguments:
measured_shape (RealPly): Detected shape on frame model_shape (ModelPly): Real shape stored in the DXF step (int, optional): Correction step beginning value. Defaults to 10.
- Returns:
float: Corrected angle
-
src.processing_cores.plies_detection.correct_position_x(measured_shape, model_shape, step=100)¶ Corrects the measured position on horizontal axis during the plies detection.
- Arguments:
measured_shape (RealPly): Detected shape on frame model_shape (ModelPly): Real shape stored in the DXF step (int, optional): Correction step beginning value. Defaults to 100.
- Returns:
float: Corrected position on horizontal axis
-
src.processing_cores.plies_detection.correct_position_y(measured_shape, model_shape, step=100)¶ Corrects the measured position on vertical axis during the plies detection.
- Arguments:
measured_shape (RealPly): Detected shape on frame model_shape (ModelPly): Real shape stored in the DXF step (int, optional): Correction step beginning value. Defaults to 100.
- Returns:
float: Corrected position on vertical axis
-
src.processing_cores.plies_detection.detect_plies(image, image_contour, dxf_manager, metro, activate_fiber_orientation=True)¶ Detects plies from a given Image. The function thresholds the image to be able to extract contours from the plies. It matches detected shapes and real shapes and draws it on the final image.
- Args:
image (Image): Stitching image
image_contour (Image): Contour image
dxf_manager (DXF_Manager): DXF_Manager with the real shapes of plies.
metro (Metrology): Instance metrology for convertion between pixel and mm measurments.
activate_fiber_orientation (bool, optional): Whether to compute the fiber orientation angle. Defaults to True.
- Returns:
list: List of detected plies
Image: Image with drawn contours of detected plies
-
src.processing_cores.plies_detection.e_2_precision(nb)¶ Computes the e2 precision on a given number.
- Arguments:
nb (float): Number to be rounded
- Returns:
float: Rounded number
-
src.processing_cores.plies_detection.matching_shape(contour, dxf_manager)¶ Matches shapes between contours one and one.
- Arguments:
contour (Shape): Extracted shape to match dxf_manager (DXF_Manager): DXF_Manager containing the real shape to match
- Returns:
ModelPly: ModelPly containig the shape and the name of the detected one.
-
src.processing_cores.plies_detection.plies_detection(*args)¶ Detects plies from a given Image. The function thresholds the image to be able to extract contours from the plies. It matches detected shapes and real shapes and draws it on the final image.
- Arguments:
- 4 arguments:
Image: Image with plies to detect
DXF_Manager: DXF_Manager with the real shapes of plies.
Metrology: Instance metrology for convertion between pixel and mm measurments.
bool: Whether to compute the fiber orientation angle. Defaults to True.
- 5 arguments
Image: Thresholded Image
Image: Image with plies to detect.
DXF_Manager: DXF_Manager with the real shapes of plies.
Metrology: Instance metrology for convertion between pixel and mm measurments.
bool: Whether to compute the fiber orientation angle. Defaults to True.
- Returns:
list: List of detected plies
Image: Image with drawn contours of detected plies
-
src.processing_cores.plies_detection.smart_difference(top, bottom, metro, compensate_movement=True)¶ Applies morphological operations on top to highlight plies contours.
- Arguments:
top (Image): Source Image
bottom (Image): Unused for now
metro (Metrology): Instance Metrology
compensate_movement (bool, optional): Whether to compensate or not the movement, unused for now. Defaults to True.
- Returns:
Image: Output Image
-
src.processing_cores.plies_detection.virtual_contour_to_real(contour, metro)¶ Extracts point from virtual contour and converts it from pixel to millimeters.
- Arguments:
contour (numpy.ndarray): Array containing the points, measured in pixel, representing the shape. metro (Metrology): Instance metrology used to convert pixel to millimeter.
- Returns:
numpy.ndarray: Array containing the points, measured in millimeter, representing the shape.