Ask Your Question

Revision history [back]

OpenCV Exception: (-215) mat.type() == type() && mat.size == size && func != 0

Hi all, I got the error:

(-215) mat.type() == type() && mat.size == size && func != 0 in function double cv::Mat::dot(cv::InputArray) const

On the code:

Mat vectorCaracteristicas = caracteristicas(rectangulo); double Sumvv = vectorCaracteristicas.dot(vectorCaracteristicas); int nmin = 0; double Sumvd = tabla_caracteristicas.row(nmin).dot(vectorCaracteristicas);


int NUMERO_CLASES = 10; int MUESTRAS_POR_CLASE = 2; int NUMERO_CARACTERISTICAS = 9; tabla_caracteristicas = new Mat(NUMERO_CLASES* MUESTRAS_POR_CLASE, NUMERO_CARACTERISTICAS, CvType.CV_64FC1);


Mat vectorCaracteristicas = caracteristicas(rectangulo)


public Mat caracteristicas(Mat recorteDigito) { Mat chardouble = new Mat(); recorteDigito.convertTo(chardouble, CvType.CV_64FC1); Calculamos vector de caracteristicas Mat digito_3x3 = new Mat(); Imgproc.resize(chardouble, digito_3x3, new Size(3,3), 0, 0, Imgproc.INTER_AREA); digito_3x3 = digito_3x3.t(); return digito_3x3.reshape(1, 1); }

Anyone can explain to me how to solve it?

Thanks in advance!

OpenCV Exception: (-215) mat.type() == type() && mat.size == size && func != 0

Hi all, I got the error:

(-215) mat.type() == type() && mat.size == size && func != 0 in function double cv::Mat::dot(cv::InputArray) const

On the code:

code:

Mat vectorCaracteristicas = caracteristicas(rectangulo); double Sumvv = vectorCaracteristicas.dot(vectorCaracteristicas); int nmin = 0; double **double Sumvd = tabla_caracteristicas.row(nmin).dot(vectorCaracteristicas);

tabla_caracteristicas.row(nmin).dot(vectorCaracteristicas);**
----------

int NUMERO_CLASES = 10; int MUESTRAS_POR_CLASE = 2; int NUMERO_CARACTERISTICAS = 9; tabla_caracteristicas = new Mat(NUMERO_CLASES* MUESTRAS_POR_CLASE, NUMERO_CARACTERISTICAS, CvType.CV_64FC1);

CvType.CV_64FC1);
----------

Mat vectorCaracteristicas = caracteristicas(rectangulo)

caracteristicas(rectangulo)
----------

public Mat caracteristicas(Mat recorteDigito) { Mat chardouble = new Mat(); recorteDigito.convertTo(chardouble, CvType.CV_64FC1); Calculamos vector de caracteristicas Mat digito_3x3 = new Mat(); Imgproc.resize(chardouble, digito_3x3, new Size(3,3), 0, 0, Imgproc.INTER_AREA); digito_3x3 = digito_3x3.t(); return digito_3x3.reshape(1, 1); }

}

Anyone can explain to me how to solve it?

Thanks in advance!