Ask Your Question
1

detecting multi color document with OpenCV4Android

asked 2017-07-17 04:04:44 -0600

ImLearning gravatar image

updated 2020-05-26 07:06:55 -0600

supra56 gravatar image

I am new to OpenCv with Android.I am trying to make an application which auto detects documents using OpenCv - 2.4.13 . In my app, there is a functionality of detection documents (like a Scanbot app) and then prospect it to document. So, far I am able to detect documents with single colour or documents which are clearly distinguishable from background. But the problem arises when the document is of multi-color. To clearly understand the problem , I have attached an image:

image description

I am new to OpenCv with Android.I am trying to make an application which auto detects documents using OpenCv - 2.4.13 . In my app, there is a functionality of detection documents (like a Scanbot app) and then prospect it to document. So, far I am able to detect documents with single colour or documents which are clearly distinguishable from background. But the problem arises when the document is of multi-color. To clearly understand the problem , I have attached an image:

enter image description here

As you can see, the blue line is a detection line and it is not detecting full document. What i did so far is as below :

original image -> cvtColor -> GaussianBlur filter -> dilate it to sharpen edges -> applied watershed image segmentation algorithm -> canny edge detection with dynamic otsu's threshold -> then find largest contours -> draw contours

After some research, I came to know that the problem rely on canny edge detection. Below is the result I get after canny edge detection:

image description

Is there any way to achieve this? Any help will be highly appreciated !! Thanks in advance

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2020-05-27 03:33:00 -0600

kpachinger gravatar image

Add gui of restraints such as...

  • document ratio min/max/presets (+2-up spread)
  • quickmask with center-weight foreground and corners background
  • grow/shrink mask via grabcut
  • mask fill convexhull
  • minimum enclosing rectangle
  • background subtraction? Autodetect sounds like video.
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-07-17 04:04:44 -0600

Seen: 654 times

Last updated: May 27 '20