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:

but when take closer picture, there no closed contour, see 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
Post a Comment