-
-
Notifications
You must be signed in to change notification settings - Fork 56.2k
core: add writeTo() for ROI operation #27318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 4.x
Are you sure you want to change the base?
Conversation
modules/core/src/copy.cpp
Outdated
|
||
Mat dst = _dst.getMat(); | ||
CV_CheckTrue( !dst.empty(), "dst must not be empty" ); | ||
CV_CheckEQ(type(), dst.type(), "Make the type of dst the same as src"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CV_CheckTypeEQ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your comment, I fixed it.
@sa copyTo | ||
|
||
*/ | ||
void overwriteTo( OutputArray m ) const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just writeTo()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your comment ! Naming functions is very difficult problem.
It is required to express the condition that src and dst must be of the same type and size.
For some verbs(writeTo
, updateTo
), I feel that the difference with copyTo() is hard to explain.
Below are some possible function names that I was considering:
(0) src.copyTo(roi); // currently
(1) src.updateTo(roi);.
(2) src.writeTo(roi);
(3) src.overwriteTo(roi);
(4) src.rewriteTo(roi);
(5) src.recopyTo(roi);
(6) src.copyToWithoutReallocation(roi); // too long.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reconsidered it again., writeTo()
naming is suitable for this purpose, thank you very much ! I fixed it.
src.writeTo(emptyMat)
makes an exception -> natural.src.writeTo(differentTypeMat)
makes an exception -> naturalsrc.writeTo(differentSizeMat)
makes an exception -> natural.
Original #27298 has been closed with "wontfix" tag. |
No. |
@asmorkalov Thank you for your reply. If |
Close #27298
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.