1 | initial version |
imho, you're missing, that the 3rd arg is is reserved for the type, and your actual pointer has to go after that what about: Mat(638, 314, CV_16U, data_pointer) ?
2 | No.2 Revision |
imho, you're missing, that i think, you want to use this constructor here
apart from the 3rd arg is is reserved for to the type (CV_16U) , and your actual pointer has to go after that
what about: Mat(638, 314, CV_16U, data_pointer) ?note, that it's (rows,cols) in opencv, not (width,height)
in the end it will be:
void * data_pointer = ...
Mat m = Mat(314, 628, CV_16U, (uchar*)data_pointer)
3 | No.3 Revision |
i think, you want to use this constructor here
apart from the 3rd arg reserved to the type (CV_16U) , note, that it's (rows,cols) in opencv, not (width,height)
in the end it will be:
void * data_pointer = ...
Mat m = Mat(314, 628, CV_16U, (uchar*)data_pointer)
(uchar*)data_pointer);
you'll also have to very cautios here, since this constructor only makes a shallow copy of your data_pointer (no pixels copied). once, your original pointer gets out of scope, anything is invalid, so please take care, you
4 | No.4 Revision |
i think, you want to use this constructor here
apart from the 3rd arg reserved to the type (CV_16U) , note, that it's (rows,cols) in opencv, not (width,height)
in the end it will be:
void * data_pointer = ...
Mat m = Mat(314, 628, CV_16U, (uchar*)data_pointer);
you'll also have to very cautios here, since this constructor only makes a shallow copy of your data_pointer (no pixels copied). once, your original pointer gets out of scope, anything is invalid, so please take care, you