BaseNormalizer
fit_and_rotate_image(image_path:os.PathLike, experiment:str, optional, results:bool, optional, focus_ratio:float, optional)
Fits a robust line to the bottom edges of an image and rotates the image to level the surface.
Parameters:
image_path
(os.PathLike): Path to the input image.experiment
(str, optional): Experiment name for saving results.results
(bool, optional): If True, saves a diagnostic plot.focus_ratio
(float, optional): Portion of the image height to analyze from the bottom. Default 0.3.
Returns:

Labels:
src_PyThon_ContactAngle_BaseLine_BaseNormalizer_fit_and_rotate_image
fit_image(image:cv2.Mat, black_base_line:int, optional)
Fits a line to the detected edges in a grayscale image using RANSAC, and computes the vertical offset from the fitted line to a given black baseline.
Parameters:
image
(cv2.Mat): Grayscale input image.black_base_line
(int, optional): Reference baseline offset in pixels. Defaults to 10.
Returns:
int
: Vertical offset (in pixels) between the fitted line's center height and the black baseline.Labels:
src_PyThon_ContactAngle_BaseLine_BaseNormalizer_fit_image
line_finder(image:cv2.Mat, rotation_matrix:cv2.Mat, black_base_line:int)
Finds the height of the line in the image after applying a rotation matrix.
Parameters:
image
(cv2.Mat): Input image in **grayscale**.rotation_matrix
(cv2.Mat): Rotation matrix to apply to the image.black_base_line
(int): The baseline height to subtract from the line height.
Returns:
int
: Height of the line in the rotated image.Labels:
src_PyThon_ContactAngle_BaseLine_BaseNormalizer_line_finder
process_image(file:str, rotation_matrix:cv2.Mat)
Processes an image by applying a rotation matrix and saving the result.
Parameters:
file
(str): Path to the input image file.rotation_matrix
(cv2.Mat): Rotation matrix to apply to the image.
Returns:

Labels:
src_PyThon_ContactAngle_BaseLine_BaseNormalizer_process_image