Skip to content

Allow Matx static functions to work with Vec.#21684

Merged
opencv-pushbot merged 1 commit intoopencv:3.4from
vrabaud:34_vec
Mar 11, 2022
Merged

Allow Matx static functions to work with Vec.#21684
opencv-pushbot merged 1 commit intoopencv:3.4from
vrabaud:34_vec

Conversation

@vrabaud
Copy link
Copy Markdown
Contributor

@vrabaud vrabaud commented Mar 4, 2022

Those functions should not be proposed if they do not compile. We can also remove them from the Vec API (eye might not make sense but ones and zeros do).

This is because there is no way to convert a Matx to Vec, cf: #4650
Adding an explicit constructor does not solve the assignment operator missing and the ambiguities it would create (like how do you convert a Scalar to Vec), except if we create all the possible versions of it.

Pull Request Readiness Checklist

  • 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
  • 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

@vrabaud vrabaud changed the title Allow Matx static function to work with Vec. Allow Matx static functions to work with Vec. Mar 4, 2022
@vrabaud
Copy link
Copy Markdown
Contributor Author

vrabaud commented Mar 4, 2022

Sorry, this actually obviously breaks the API as some code might rely on cv::Vec3b::ones() returning a cv::Matx<uint8_t, 3, 1> (and not cv::Vec3b) as it should.
Should I submit that to OpenCV 5 ?

@vrabaud vrabaud added the RFC label Mar 4, 2022
@opencv-pushbot opencv-pushbot merged commit 5d8134e into opencv:3.4 Mar 11, 2022
@alalek alalek mentioned this pull request Mar 26, 2022
@opencv-pushbot opencv-pushbot mentioned this pull request Apr 23, 2022
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