Mat Data Type Is Not Compatible Cv 8uc3

By voting up you can indicate which examples are most useful and appropriate.
Mat data type is not compatible cv 8uc3. Specify it and you can initialize all matrix points with a custom value. Here are the examples of the csharp api class opencvsharp mat type taken from open source projects. Mat data type is not compatible. In emgucv i would do this.
I want to do template matching with a screencap but my screencap returns a cv 8uc4 mat and my templ is cv 8uc3. So the data layout in mat is compatible with the majority of dense array types from the standard toolkits and sdks such as numpy ndarray win32 independent device bitmaps and others that is with any array that uses steps or strides to compute the position of a pixel. Vec3b data new vec3b 100 100. Rtype the desired destination matrix type or rather the depth since the number of channels will be the same with the source one.
The template function won t work with different image types. There are types predefined for up to four channels. I tried cvtcolor to convert the screencap but i don t know what parameters to give it. In opencv i would do this.
I would like to know how i can create a mcvmat structure with data type cv 8uc3. The cv scalar is four element short vector. It is also compatible with the majority of dense array types from the standard toolkits and sdks such as numpy ndarray win32 independent device bitmaps and others that is with any array that uses steps or strides to compute the. Void mat convertto mat m int rtype double alpha 1 double beta 0 const.
If use public void getarray int row int col vec3b data. For instance cv 8uc3 means we use unsigned char types that are 8 bit long and each pixel has three of these to form the three channels. Then catch exception provided data element number 10000 should be multiple of the mat channels count 3.