-
-
Notifications
You must be signed in to change notification settings - Fork 56.4k
Add blobrecttoimage #24539
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
Add blobrecttoimage #24539
Conversation
f2d0d20 to
9515c38
Compare
|
@LaurentBerger The PR looks good to me. Could you add several accuracy tests for the new functions. Cases for |
|
@dkurt please take a look again. |
|
May be a prototype with rect2d is usefull too ? |
|
@asmorkalov how can I solve conflict? |
|
Let me do it for you. |
|
In doxygen build process |
|
What's new about this PR? |
blobRectsToImageRects rect o Please enter the commit message for your changes. Lines starting
|
/Users/opencv-cn/GHA-OCV-1/_work/opencv/opencv/ios/build/build-armv7-iphoneos/lib/Release/opencv2.framework/Headers/Image2BlobParams.h:129:1: error: duplicate declaration of method 'blobRectToImageRect:sizeOri:'
|
Is conflict here |
|
Not sure, I will take a look closer next day. Commit aba3098 passed without problems. |
I'm not sure that opencv ios was build |
| * @param rImg result rect in image coordinates. | ||
| * @param size spatial size for output image | ||
| */ | ||
| CV_WRAP_AS(blobRectsToImageRects2d) void blobRectsToImageRects (const std::vector<Rect2d> &rBlob, CV_OUT std::vector<Rect2d>& rImg, const Size& size); |
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.
@LaurentBerger , may we ask to remove Rect2d from this PR and if it's a critical feature, discuss separately? In my point of view, users mostly work on Rect (as a ROI or drawable bounding box).
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.
In NMSBoxes there is three type Rect, Rect2d and RotatedRect. Now in blobRect(s)ToImageRect(s) there is a scale factor error can be 0 to 2*scaleFactor pixels (2 because there is origin point and dimension)
In python without this function all operation are in float
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.
Because NMSBoxes might be applied as for relative Rect2d (values from 0 to 1) as for absolute pixel coordinates. On blobToImageRect we always return pixel coordinates and subpixel precision is redundant.
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.
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.
Please let me add a commit to this PR to demonstrate my vision of the version with Rect2d.
The proposal is useful but requires partial changes to make all the public API behaviour aligned.
asmorkalov
left a comment
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.
👍
Add blobrecttoimage opencv#24539 ### Pull Request Readiness Checklist resolves opencv#14659 See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work opencv#14659 - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
Pull Request Readiness Checklist
resolves #14659
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.