VideoCapture test to ensure that cv::VideoCapture does not share output buffers#19364
Merged
opencv-pushbot merged 1 commit intoopencv:masterfrom Jan 22, 2021
Merged
Conversation
alalek
reviewed
Jan 21, 2021
| } | ||
|
|
||
| for(int i = 0; i < 10; i+=2) | ||
| frames[i].setTo(cv::Scalar(255,255,255)); |
Member
There was a problem hiding this comment.
It is a bad idea to require changing of such buffers.
They can be allocated as read-only (any write attempt will raise a failure).
For example, OpenCL read-only "map" from GPU decoder.
Suggestion:
- remove this block
- rename test
Contributor
Author
There was a problem hiding this comment.
I renamed the test and removed Mat modification as you suggested, but it's not what OpenCV users expect. Documentation does not provide any cases with read-only Mat object and a lot of examples do camera Mat modification.
3619894 to
49cbc0c
Compare
Contributor
Author
|
@alalek It's ready. |
alalek
reviewed
Jan 22, 2021
| hardCopies[i] = frames[i].clone(); | ||
| } | ||
|
|
||
| for(int i = 1; i < 10; i++) |
Comment on lines
+647
to
+650
| Mat diff; | ||
| absdiff(frames[i], hardCopies[i], diff); | ||
| auto outilers = countNonZero(diff.reshape(1)); | ||
| EXPECT_EQ(outilers, 0); |
Member
There was a problem hiding this comment.
One line check:
EXPECT_EQ(0, cv::norm(frames[i], hardCopies[i], NORM_INF)) << i;
…ut buffers between frames.
e075548 to
b4e941d
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related work: #18377
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.