Closed implicit-invocation closed 1 week ago
@implicit-invocation Please add an example of the code that causes the error.
My bad, found the problem, I create a MatVector for the output circles param, not a Mat.
I changed it and it worked.
const src = OpenCV.base64ToMat(image);
OpenCV.invoke('cvtColor', src, src, ColorConversionCodes.COLOR_RGBA2GRAY);
const circles = OpenCV.createObject(ObjectType.Mat, 1, 300, DataTypes.CV_32FC3);
OpenCV.invoke('HoughCircles', src, circles, HoughModes.HOUGH_GRADIENT, 1, 45, 75, 40);
// do things with circles
OpenCV.clearBuffers();
But I have something else to ask.
When using OpenCV with C++, we use vector<Vec3f>
to get the circles. With OpenCV.js, I just call new cv.Mat()
.
Do react-native-fast-opencv
have a similar way to construct a Mat without specifying cols and rows like that?
The type inference doesn’t work well also, IDE showing no overload