Can anyone tell me how can I convert Mat to unsigned char* in OpenCV and also whether the data will be an array? Also, I want to know how can the same thing be done for vector<vector<double>> to float* so as to make it a pointer of array? thanks.
Can anyone tell me how can I convert Mat to unsigned char* in OpenCV
Share
As was already mentioned you should use a
datamember ofcv::Mat:About your second question:
first of all, when you convert from
doubletofloatyou lose some data. And there’s no ready solution to do that so just use simple cycle and copy vector to the array-pointer: