0
我试图按照以下步骤创建一个垫目标:的Java opencv的垫构造不匹配
// ROI by creating mask for the trapezoid
Mat mask = Mat(frame.rows(), frame.cols(), CvType.CV_8UC1, new Scalar(0));
但是我得到以下编译时错误:
The method Mat(int, int, int, Scalar) is undefined for the type
而在Mat.class
文件,我可以肯定请参阅以下功能签名:
//
// C++: Mat::Mat(int rows, int cols, int type, Scalar s)
//
// javadoc: Mat::Mat(rows, cols, type, s)
public Mat(int rows, int cols, int type, Scalar s)
{
nativeObj = n_Mat(rows, cols, type, s.val[0], s.val[1], s.val[2], s.val[3]);
return;
}
这是一个错误还是?
应该不会是'垫面膜=新垫(...)'摆在首位? – Miki
你说得对,我很愚蠢,我将代码从C++转换为Java,因此是错误的。如果你写的话,我会接受它作为答案。谢谢。 –