java - OpenCV findContours: make it robust -


how make findcontours robust make work the contour might not closed due noisy data and/or week edges/gradients in image?

for first case (not closed) i'm running following problem: algorithm runs quite when using on thresholded picture this:

enter image description here

but when take closer picture, there no closed contour, see here:

enter image description here

how make work case also? thought of maybe drawing horizontal line @ top , @ bottom of picture "cross" papernote (when note captured close) making full contour. wouldn't work when note bit rotated not correct contour, i!? have better ideas? lot in advance!

this simple solution might work.

if know contour points openings gap (pseudo-code ahead):

point pointgap1; point pointgap2;  if (pointgap1.coordinate == iamgeborder || pointgap2.coordinate == iamgeborder) {     // add line pointgap1 pointgap2 } 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -