HHousen / lecture2notes

Consider removing the commented out code block PY-W0069
Anti-pattern
Major
8 months ago2 years old
Consider removing the commented out code block
284                potential_figure = original[
285                    y - padding : y + h + padding, x - padding : x + w + padding
286                ]
287            # cv2.imwrite("potential_figure.png", potential_figure)288
289            # Go to next figure if the `potential_figure` is empty
290            if potential_figure.size == 0:
Consider removing the commented out code block
271        if min_area < area < max_area and 0.2 < aspect_ratio < 6:
272            # Draw bounding box rectangle, crop using numpy slicing
273            roi_rectangle = convert_coords_to_corners(box)
274            # cv2.rectangle(image, (x, y), (x + w, y + h), (0, 255, 0), 3)275            # cv2.imwrite("rect.png", image)
276            if (
277                y + h >= image_height
Consider removing the commented out code block
255                # min_area_small = cv2.contourArea(approx)
256                figure_contour = approx[:, 0]
257
258                # if not none_tested:259                bounding_box = cv2.boundingRect(figure_contour)
260                x, y, w, h = bounding_box
261                figure = original[
Consider removing the commented out code block
251                and cv2.isContourConvex(approx)
252                and min_area_small < cv2.contourArea(approx) < max_area
253            ):
254                # none_tested = False255                # min_area_small = cv2.contourArea(approx)
256                figure_contour = approx[:, 0]
257
Consider removing the commented out code block
240    output_paths = []
241
242    if large_box_detection:
243        # none_tested = True244        for contour in contours_small:
245            perimeter = cv2.arcLength(contour, True)
246            approx = cv2.approxPolyDP(contour, 0.1 * perimeter, True)