From 53c5d03516ebc52df665b2b793ed972a6dc4ba49 Mon Sep 17 00:00:00 2001 From: Ruben Young On <r.d.youngon@student.tudelft.nl> Date: Fri, 24 May 2019 13:08:29 +0200 Subject: [PATCH] Fixed lint warnings --- zesje/images.py | 1 + zesje/pregrader.py | 14 +++----------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/zesje/images.py b/zesje/images.py index 05acb9eb..469cf9d0 100644 --- a/zesje/images.py +++ b/zesje/images.py @@ -4,6 +4,7 @@ import numpy as np from operator import sub, add + def guess_dpi(image_array): h, *_ = image_array.shape resolutions = np.array([1200, 600, 400, 300, 200, 150, 120, 100, 75, 60, 50, 40]) diff --git a/zesje/pregrader.py b/zesje/pregrader.py index 44015968..269c81be 100644 --- a/zesje/pregrader.py +++ b/zesje/pregrader.py @@ -53,13 +53,13 @@ def box_is_filled(box, page_img, corner_keypoints, marker_margin=72/2.54, thresh page_img: np.array A numpy array of the image scan corner_keypoints: (float,float) - The x coordinate of the left markers and the y coordinate of the top markers, - used as point of reference since scans can deviate from the original. + The x coordinate of the left markers and the y coordinate of the top markers, + used as point of reference since scans can deviate from the original. (x,y) are both in pixels. marker_margin: float The margin between the corner markers and the edge of a page when generated. threshold: int - the threshold needed for a checkbox to be considered marked range is between 0 (fully black) + the threshold needed for a checkbox to be considered marked range is between 0 (fully black) and 255 (absolutely white). cut_padding: float The extra padding when retrieving an area where the checkbox is in inches. @@ -139,11 +139,3 @@ def box_is_filled(box, page_img, corner_keypoints, marker_margin=72/2.54, thresh if res_x < 0.333 * box_size_px or res_y < 0.333 * box_size_px: return True return np.average(res_rect) < threshold - - -def box_is_filled(box, page_img, marker_position, marker_margin=72/2.54): - pass - - -def _locate_checkbox(): - pass -- GitLab