Repository navigation
QR-Code detector : multiple detection - #15338
Conversation
|
@rayonnant14, @allnes What is the PR status? Is it still WIP? |
Yes, this PR in progress. |
…and vector<vector<Point2f>> in MultipleDetectAndDecode
|
Again, drawing functions should be avoided.
The similar note is about another one need to revise code using of |
| @param img grayscale or color (BGR) image containing (or not) QR codes. | ||
| @param points Output vector of vector of vertices of the minimum-area quadrangle containing the codes. | ||
| */ | ||
| CV_WRAP bool detectMulti(InputArray img, OutputArrayOfArrays points) const; |
There was a problem hiding this comment.
OutputArrayOfArrays
InputArrayOfArrays
std::vector< std::vector< Point > > corners;
Please avoid using of *OfArrays types and/or nested std::vector.
This is unnecessary for fixed size elements (4 points per QR code).
Lets store points as one "array" (without nesting):
std::vector< Point >where each 4 points define QR code instance (<0, 1, 2, 3>, <4, 5, 6 ,7> ...).Mat- CV_32FC2 with one or multiple rows.
and pass them asOutputArray.
This is continued discussion from this comment: #15338 (comment)
…d new key in sample for saving original image from camera
| break; | ||
| } | ||
| if (!out_origin_file.empty()) | ||
| imwrite(out_origin_file, frame); // write original frame |
There was a problem hiding this comment.
Saving each frame slowdowns demo significantly. Image I/O is not optimized (because it is for debug purposes here).
Original and processed frames should be saved by pressing key only (it was space ' '). Both at once.
| class qrcode_detector_test(NewOpenCVTests): | ||
| def test_detect_and_decode(self): | ||
| img = cv.imread(os.path.join(self.extraTestDataPath, 'cv/qrcode/link_ocv.jpg')) | ||
| self.assertFalse(img == None) |
There was a problem hiding this comment.
== None
In Python world checks should look like:
a is Nonea is not None
There was a problem hiding this comment.
@alalek Which way is better img is None or np.shape(img) is () ?
…_3.4 QR-Code detector : multiple detection * change in qr-codes detection * change in qr-codes detection * change in test * change in test * add multiple detection * multiple detection * multiple detect * add parallel implementation * add functional for performance tests * change in test * add perftest * returned implementation for 1 qr-code, added support for vector<Mat> and vector<vector<Point2f>> in MultipleDetectAndDecode * deleted all lambda expressions * changing in triangle sort * fixed warnings * fixed errors * add java and python tests * change in java tests * change in java and python tests * change in perf test * change in qrcode.cpp * add spaces * change in qrcode.cpp * change in qrcode.cpp * change in qrcode.cpp * change in java tests * change in java tests * solved problems * solved problems * change in java and python tests * change in python tests * change in python tests * change in python tests * change in methods name * deleted sample qrcode_multi, change in qrcode.cpp * change in perf tests * change in objdetect.hpp * deleted code duplication in sample qrcode.cpp * returned spaces * added spaces * deleted draw function * change in qrcode.cpp * change in qrcode.cpp * deleted all draw functions * objdetect(QR): extractVerticalLines * objdetect(QR): whitespaces * objdetect(QR): simplify operations, avoid duplicated code * change in interface, additional checks in java and python tests, added new key in sample for saving original image from camera * fix warnings and errors in python test * fix * write in file with space key * solved error with empty mat check in python test * correct path to test image * deleted spaces * solved error with check empty mat in python tests * added check of empty vector of points * samples: rework qrcode.cpp * objdetect(QR): fix API, input parameters must be first * objdetect(QR): test/fix points layout
Merge with extra: opencv/opencv_extra#684