I have an image:
I have to detect the white space in between and basically partition it into two parts like this-
This is what I have coded so far... but it does detect only the black lines and not the middle white region.
import numpy as np
import cv2
img = cv2.imread('12.png')
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
edges = cv2.Canny(gray,50,150,apertureSize = 3)
median = cv2.medianBlur(gray,5)
minLineLength = 250
maxLineGap = 100
lines = cv2.HoughLinesP(edges,0.3,np.pi/180,250,minLineLength,maxLineGap)
for line in lines:
x1,y1,x2,y2 =line[0]
cv2.line(img,(x1,y1),(x2,y2),(0,255,0),2)
cv2.imwrite('newwhite.png',img)