Detecting multicolor document with OpenCV4Android

I am new to OpenCv from Android. I am trying to create an application that automatically detects documents using OpenCv - 2.4.13. My app has document detection functionality (like Scanbot app) and then projected onto document. This way, far away I can detect documents with one color or documents that are clearly distinguishable from the background. But the problem arises when the document is multi-colored. To understand the problem clearly, I added an image:

enter image description here

As you can see, the blue line is the detection line and it does not detect the complete document. What I have done so far is as shown below:

original image -> cvtColor -> GaussianBlur filter -> expand it to sharpen the edges -> applied watershed image segmentation algorithm -> canny edge detection with otsu dynamic threshold -> then find largest outlines -> paint outlines

After some research, I found out that the problem is with canny edge detection. Below is the output after detecting the canny edge:

enter image description here

Is there a way to achieve this? Any help would be much appreciated! thanks in advance

+3


source to share





All Articles