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
samples/cpp/qrcode.cpp
Outdated
| 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 () ?
Merge with extra: opencv/opencv_extra#684