Skip to content

Commit

Permalink
further fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jandom committed Jul 20, 2024
1 parent 0f9bb63 commit 9711685
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions qreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class DecodeQRResult:
scale_factor: float
corrections: CorrectionsType
flavor: FlavorType
blur_kernel_sizes: tuple[tuple[int, int]] | None
blur_kernel_sizes: tuple[tuple[int, int], ...] | None
image: np.ndarray
result: Decoded

Expand Down Expand Up @@ -82,7 +82,7 @@ def __init__(
self,
model_size: str = "s",
min_confidence: float = 0.5,
reencode_to: str | tuple[str] | list[str] | None = DEFAULT_REENCODINGS,
reencode_to: str | tuple[str, ...] | list[str] | None = DEFAULT_REENCODINGS,
weights_folder: str | None = None,
):
"""
Expand Down Expand Up @@ -228,11 +228,7 @@ def detect_and_decode(

def get_detection_result_from_polygon(
self,
quadrilateral_xy: (
np.ndarray
| tuple[tuple[float | int, float | int], ...]
| list[list[float | int, float | int]]
),
quadrilateral_xy: np.ndarray | typing.Sequence[typing.Union[float, int]],
) -> dict[str, np.ndarray | float | tuple[float | int, float | int]]:
"""
This method will simulate a detection result from the given quadrilateral. This is useful when you have detected
Expand Down Expand Up @@ -442,7 +438,9 @@ def __correct_perspective(
return dst_img

def __threshold_and_blur_decodings(
self, image: np.ndarray, blur_kernel_sizes: tuple[tuple[int, int]] = ((3, 3),)
self,
image: np.ndarray,
blur_kernel_sizes: tuple[tuple[int, int], ...] = ((3, 3),),
) -> list[Decoded]:
"""
Try to decode the QR code just with pyzbar, pre-processing the image with different blur and threshold
Expand Down

0 comments on commit 9711685

Please sign in to comment.