Skip to content

Commit

Permalink
MAINT: Add more corners for automatic CC finder
Browse files Browse the repository at this point in the history
  • Loading branch information
jwboth committed Apr 1, 2024
1 parent 2b7ce48 commit 1adf8cd
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/darsia/corrections/color/colorcheckerfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,18 @@ def _reorient_colorchecker(


def find_colorchecker(
img: darsia.Image, strategy: Literal["upper_right", "upper_left"]
img: darsia.Image,
strategy: Literal["upper_right", "upper_left"],
update: float = 0.8,
):
"""Detect colorchecker in corner.
Search for position and colors.
Args:
img (darsia.Image): Image to search in.
strategy (str, optional): Strategy to use. Defaults to "upper_right".
strategy (str, optional): Strategy to target corner. Defaults to "upper_right".
update (float, optional): Update factor for the search window. Defaults to 0.8.
Returns:
colorchecker (darsia.CustomColorChecker): Colorchecker.
Expand Down Expand Up @@ -184,11 +187,15 @@ def detect_colorchecker(arr):
if strategy == "upper_right":
target_corner = np.array([0, shape[1]])
start_corner = np.array([shape[0], 0])
update = 0.8
elif strategy == "upper_left":
target_corner = np.array([0, 0])
start_corner = np.array([shape[0], shape[1]])
update = 0.8
elif strategy == "lower_right":
target_corner = np.array([shape[0], shape[1]])
start_corner = np.array([0, 0])
elif strategy == "lower_left":
target_corner = np.array([shape[0], 0])
start_corner = np.array([0, shape[1]])
else:
raise NotImplementedError(f"Strategy {strategy} not implemented.")

Expand Down

0 comments on commit 1adf8cd

Please sign in to comment.