Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@LaurentBerger
Copy link
Contributor

@LaurentBerger LaurentBerger commented Aug 17, 2023

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • [] I agree to contribute to the project under Apache 2 License.
  • 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
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work Get Mat in a blob #24158
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@LaurentBerger LaurentBerger force-pushed the getmatinblob branch 2 times, most recently from 6ccc75c to 29cd88c Compare August 17, 2023 15:44
@asmorkalov
Copy link
Contributor

@LaurentBerger Thanks for the contribution! Could you provide some use-case for the new function?

@asmorkalov asmorkalov self-requested a review September 8, 2023 11:22
@asmorkalov asmorkalov self-assigned this Sep 8, 2023
@asmorkalov asmorkalov added this to the 4.9.0 milestone Sep 8, 2023
@asmorkalov
Copy link
Contributor

@LaurentBerger Thanks for the patch. The PR was discussed on OpenCV core team meeting and the team decided to reject the patch. Reasons:

  • The No strong definition of API. There is no use-case for the function.
  • The same may be done without extra function.

@asmorkalov asmorkalov closed this Sep 8, 2023
@LaurentBerger
Copy link
Contributor Author

LaurentBerger commented Sep 8, 2023

  • There is no use-case for the function.

there is this #24158
Where is use case of imagesfromblob?

  • The same may be done without extra function.

Yes it is true for imread too

@opencv-alalek
Copy link
Contributor

@LaurentBerger At first, thank you for all your contributions to this project!

imagesfromblob

This is just an another example of bad designed function:

  • bad name - according to implementation it should be extractImagesFromNCWHBlob().
  • function is still not used (so it is not needed at all, no use-case)
  • there is no way to provide generic well specified/defined/clear API for that (too many options are here as "blob" is anything like ND-tensor)
  • Now, OpenCV API has cv::transposeND() to perform similar operations. With help of .reshape() + ROI you could get the same result. It is better to provide "basic" operations to keep code clean (and have clean OpenCV API).

So, we need to avoid of repeating of such experience.

Adding function which returns "reference" (not a copy) on the data is a problem with bindings. E.g. in Python code use numpy directly instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants