Pre-processing steps for detecting the edge of a business card using gpuimage hough lines

I am trying to detect the edges of a business card using the GPUImage HoughTransform , as it seems to be the best way to achieve this with this structure from what I found with similar questions / problems.

The best results I can get are just playing with lineDetectionThreshold set to 0.25 , which gives me 4 lines limiting the business card, while minimizing the total number of lines.

I cannot determine if the edgeThreshold parameter helps here.

With the lines that I get, I filter the lines that are very similar to each other (usually he finds a lot on each edge!), Separating them horizontally and vertically, and then typing 2 horizontal and 2 vertical lines that can form a rectangle.

I still find a lot of lines due to text or shapes in the business card itself, and the higher the number, the worse the performance for the video stream.

I tried to add some preprocessing, but not very successfully, perhaps because I don’t know which methods can help me here.

How can I improve the detection of only four lines defining the edges? Is this really possible?

EDIT:

Here are some illustrations to illustrate. I deleted the logo and data on the business card to maintain confidentiality.

Raw lines obtained with a threshold of 0.25 (and this threshold sometimes leads to the loss of some edges when processing video) test5.1.jpg

after manual filtering with the same image: test5.1.filtered.jpg

Another example, although it can be tricky, even adding preprocessing steps:

Source lines: test7.1.jpg

Filtered Lines: test7.1.filtered.jpg

+5
source share

Source: https://habr.com/ru/post/1212476/


All Articles