U-Net: Convolutional Networks for Biomedical Image Segmentation
Paper
•
1505.04597
•
Published
•
16
U-Net Like Pretrained Model For Scene Document Detection (pytorch, Semantic Segmentation)
$ pip install -r requirements.txtStructure/ scanner = Scanner("Structure/Scanner-Detector.pth", config_)
Load model.
org = cv2.imread(fname)
org_gray = cv2.cvtColor(org, cv2.COLOR_RGB2GRAY)
org_resize = cv2.resize(org_gray, (256, 256), interpolation = cv2.INTER_AREA)
Read image in gray scale and resize it to 256*256.
mask = scanner.ScanView(org_resize)
Detect document area.
paper, approx = ExtractPaper(org_gray, mask)
org = DrawBox(org, approx)
Extract document and draw bounding box on original image.
paper = EnhacePaper(paper)
Enhance extracted document.