Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

findContours()

Hi all,

I am implementing a QR-Code reader with openCV on Android. At some point, I am using findContours() with tree hierarchy.

My problem is, that if the image contains a lot of details (like what it does when pointing the camera out of the window), findContours() takes quite a bit of time, because it finds up to 3000+ contours... This eats a lot of battery, while the image does not contain any QR-code...

I have already applied various pre-processing steps (gaussian, morph opening etc.) but the details are big enough to still produce the large number of contours.

I have no idea, how to deal with such a situation... The only way I can think of would be to tell findContours() the maximum number of contours that make sense - and have it return as soon as it reaches the limit...

Does anybody know how to deal with such a situation, when you have no control over the content of the image? Would it be possible to add such an additional parameter to the findContours() function?

  • Tom

findContours()

Hi all,

I am implementing a QR-Code reader with openCV on Android. At some point, I am using findContours() with tree hierarchy.

My problem is, that if the image contains a lot of details (like what it does when pointing the camera out of the window), findContours() takes quite a bit of time, because it finds up to 3000+ contours... This eats a lot of battery, while the image does not contain any QR-code...

I have already applied various pre-processing steps (gaussian, morph opening etc.) but the details are big enough to still produce the large number of contours.

I have no idea, how to deal with such a situation... The only way I can think of would be to tell findContours() the maximum number of contours that make sense - and have it return as soon as it reaches the limit...

Does anybody know how to deal with such a situation, when you have no control over the content of the image? Would it be possible to add such an additional parameter to the findContours() function?

  • Tom

findContours()findContours() with detailed images

Hi all,

I am implementing a QR-Code custom barcode code reader (to read custom codes that look like a QR-code) with openCV on Android. At some point, I am using findContours() with tree hierarchy.

My problem is, that if the image contains a lot of details (like what it does when pointing the camera out of the window), findContours() takes quite a bit of time, because it finds up to 3000+ contours... This eats a lot of battery, while the image does not contain any QR-code...

I have already applied various pre-processing steps (gaussian, morph opening etc.) but the details are big enough to still produce the large number of contours.

I have no idea, how to deal with such a situation... The only way I can think of would be to tell findContours() the maximum number of contours that make sense - and have it return as soon as it reaches the limit...

Does anybody know how to deal with such a situation, when you have no control over the content of the image? Would it be possible to add such an additional parameter to the findContours() function?

  • Tom