Closed abdelaziz-mahdy closed 3 months ago
Mat.add
, Mat.subtract
, Mat.multiply
, Mat.divide
and corresponding U8 I8 U16 I16 I32 F32 F64
methods are exactly operator +
, operator -
operator *
operator /
for cv::Mat
now. Basically they are same as before, BUT Mat.multiply<Mat>()
and Mat.multiplyMat()
now will perform a Matrix Multiplication
instead of a element-wise multiplication
, use Mat.mul
for element-wise
, this behavior is same as opencv. NOTE: Matrix multiplication
in opencv only support CV_32FC1
, CV_32FC2
, CV_64FC1
, CV_64FC2
, if you see some exception like CvException(code: -215, err: , msg:OpenCV(4.10.0) D:\a\opencv.full\opencv.full\build\opencv\modules\core\src\matmul.dispatch.cpp:356: error: (-215:Assertion failed) (type == (((5) & ((1 << 3) - 1)) + (((1)-1) << 3)) || type == (((6) & ((1 << 3) - 1)) + (((1)-1) << 3)) || type == (((5) & ((1 << 3) - 1)) + (((2)-1) << 3)) || type == (((6) & ((1 << 3) - 1)) + (((2)-1) << 3))) in function 'cv::gemm' ) in cv::gemm of file D:\a\opencv.full\opencv.full\build\opencv\modules\core\src\matmul.dispatch.cpp:356
, please check your mat type.Mat add(Mat src1, Mat src2, [Mat? dst])
-> Mat add(Mat src1, Mat src2, {Mat? dst, int dtype = -1, Mat? mask})
Do you think we should add more tests to test the functionality of the optional parameters?
Do you think we should add more tests to test the functionality of the optional parameters?
Not really, optional parameters have default values, which will be passed to native C functions, it's fine to just keep them same as C++ default values and no more extra tests needed.
But if you think they are necessary, you can add more tests and I am willing to accept 😄
And, thanks for your contributions! 🎉
Do you think we should add more tests to test the functionality of the optional parameters?
Not really, optional parameters have default values, which will be passed to native C functions, it's fine to just keep them same as C++ default values and no more extra tests needed.
But if you think they are necessary, you can add more tests and I am willing to accept 😄
And, thanks for your contributions! 🎉
Thank you for being supportive I enjoy contributing to this project ❤️
Also my point for tests was that we make sure that future changes won't break the the optional parameters being passed down correctly, like the reason this issue came up in the first place is that the tests were not covering the changes done by optional parameters
Also my point for tests was that we make sure that future changes won't break the the optional parameters being passed down correctly, like the reason this issue came up in the first place is that the tests were not covering the changes done by optional parameters
Oh I agree with you now, more covered conditions will make this package more robust, just add more tests when you are free, since I am kind of busy recently. 😄
only did the core.dart for now fix https://github.com/rainyl/opencv_dart/issues/180