samedi 27 juin 2015

Type conversion in open cv

I am trying to convert an uint32_t* into a format that could be accepted by a Mat object (from open cv). I do not need to display the data from the Mat, I am simply using the mat to transport and pack information.I know that opencv does not use uint32_t and as a workaround I used int. What I did is the following:

Mat package = Mat(width,height, CV_32SC4);
int *dst1 = package.data;
//code that works with the dst
//finally put it back in the package
package.data = dst1;

The above code gives me an error at the second line. (Cannot convert from 'int *' to 'uchar *')

Aucun commentaire:

Enregistrer un commentaire