Skip to content

Instantly share code, notes, and snippets.

View poojapi's full-sized avatar
🎯
Focusing

Pooja P poojapi

🎯
Focusing
View GitHub Profile
@poojapi
poojapi / line_detect.py
Created November 9, 2020 10:18
Detect lines in image
import cv2
import numpy as np
import matplotlib.pyplot as plt
image = cv2.imread('input2.png', 0)
# find lines by horizontally blurring the image and thresholding
blur = cv2.blur(image, (80, 9))
#cv2.imshow('y', blur)
#cv2.waitKey(0)
@poojapi
poojapi / detect_para.py
Created November 9, 2020 09:58
Python detect paragraphs with opencv
import cv2
import numpy as np
def para_detect(file_name):
img = cv2.imread(file_name)
img_final = cv2.imread(file_name)
img2gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
ret, mask = cv2.threshold(img2gray, 180, 255, cv2.THRESH_BINARY)
image_final = cv2.bitwise_and(img2gray, img2gray, mask=mask)