def hough_fullsized(images): processed = functions.process_several(images, function=functions.text_edging) rotated_images = functions.draw_several(processed, drawing_images=originals, function=prob_hough_rotation) return rotated_images
def downsized_canny_detection(image): downsized, ratio = functions.standard_resize(image, new_width = 100.0) edged, titles = canny(downsized) originals = utility.image_array(downsized, array_length = len(edged)) # detected = functions.process_several(images = edged, function = demo.vanilla_boxing) detected = functions.draw_several(images = edged, drawing_images = originals, function = demo.vanilla_box_drawing) functions.plot_images(edged, titles) functions.plot_images(detected,titles)
def downsized_canny_dilated(image): downsized, ratio = functions.standard_resize(image) edged, titles = canny(downsized) originals = utility.image_array(downsized, array_length = len(edged)) kernel = np.ones((5,5),np.uint8) # original was 15x15. 5x5 is working well right now. dilated = functions.process_several(images = edged, function = cv2.dilate, kernel = kernel) detected = functions.draw_several(images = dilated, drawing_images = originals, function = demo.vanilla_box_drawing) functions.plot_images(dilated, titles) functions.plot_images(detected,titles)
def downsized_canny_CI(image): downsized, ratio = functions.standard_resize(image, new_width = 250.0) # edged, titles = canny_thresh(downsized) edged, titles = canny(downsized) originals = utility.image_array(downsized, array_length = len(edged)) closed_inverted = functions.process_several(images = edged, function = functions.closed_inversion) # detected = functions.process_several(images = closed_inverted, function = demo.vanilla_boxing) detected = functions.draw_several(images = closed_inverted, drawing_images = originals, function = demo.vanilla_box_drawing) functions.plot_images(edged,titles) # functions.plot_images(closed_inverted, titles) functions.plot_images(detected,titles)
def downsized_hough(originals, images): downsized = functions.process_several( originals, function=reshape.standard_resize, new_width=200.0, return_ratio=False ) # breaking because now returning ratio from std. resize processed_downsized = functions.process_several( downsized, function=functions.downsized_text_edging) rotated_images = functions.draw_several( processed_downsized, drawing_images=downsized, function=prob_hough_rotation) # downsize -> process -> Hough return rotated_images