Ask Your Question

Vayn's profile - activity

2019-04-07 10:13:25 -0600 commented answer How to find text area after dilating the image

Thank you so much! After spending hours researching, I found I can use canny operator to detect the edges of the text, t

2019-04-07 09:58:52 -0600 received badge  Supporter (source)
2019-04-07 09:58:33 -0600 marked best answer How to find text area after dilating the image

This is the original image:

original

At first I applied the sobel operator to the image:

gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
sobel = cv.Sobel(gray, cv.CV_8U, 1, 0, 1)  
x = cv.Sobel(gray, cv.CV_16S, 1, 0)
y = cv.Sobel(gray, cv.CV_16S, 0, 1)
absX = cv.convertScaleAbs(x)
absY = cv.convertScaleAbs(y)
sobel = cv.addWeighted(absX, 0.2, absY, 0.8, 0)

sobel

Then I dilated the image:

kernel = cv.getStructuringElement(cv.MORPH_RECT, (24, 14))
dilate = cv.dilate(sobel, kernel, iterations=1)

image description

findContours can't find the rect of text, it detected the irrelevant rect on the left of the image:

image description

2019-04-07 09:58:33 -0600 received badge  Scholar (source)
2019-04-07 09:58:29 -0600 commented answer How to find text area after dilating the image

Thank you so much! After after spending hours researching, I found I can use canny operator to detect the edges of the t

2019-04-07 06:16:40 -0600 edited question How to find text area after dilating the image

How to find text area after dilating the image This is the original image: At first I applied the sobel operator to t

2019-04-07 06:14:26 -0600 commented question How to find text area after dilating the image

@sturkmen The third image is almost the original one. I updated the code.

2019-04-07 06:13:55 -0600 received badge  Editor (source)
2019-04-07 06:13:55 -0600 edited question How to find text area after dilating the image

How to find text area after dilating the image At first I applied the sobel operator to the image: gray = cv.cvtColor(i

2019-04-07 06:11:50 -0600 commented question How to find text area after dilating the image

@sturkmen The third image is almost the original one.

2019-04-07 00:42:45 -0600 asked a question How to find text area after dilating the image

How to find text area after dilating the image At first I applied the sobel operator to the image: Then I dilated the