unsigned short 1D array to Mat
hi, how can I convert unsigned short array to Mat in opencv ? unsigned short array[220*220]//contain pixel values of image
ushort is CV_16U type, so if your array called H, then
Mat h = Mat(220,220,CV_16U,H);
to check it:
ushort H[4] = {1,2,3,4}; Mat h = Mat(2,2,CV_16U,H);
cout<<"take a look="<<h<<endl;
the output of h would same as H
Asked: 2019-02-22 22:30:27 -0600
Seen: 1,849 times
Last updated: Feb 23 '19
OpenCV DescriptorMatcher matches
Conversion between IplImage and MxArray
Video On Label OpenCV Qt :: hide cvNamedWindows
Problems using the math.h class with OpenCV (c++, VS2012)
How to reduce false positives for face detection
Area of a single pixel object in OpenCV
build problems for android_binary_package - Eclipse Indigo, Ubuntu 12.04
Can't compile .cu file when including opencv.hpp
Using OpenCV's stitching module, strange error when compositing images