opencv - How to get image uchar array's actual length opencv2 -
i trying use blur image gpu. shall write own gpu routine. using opencv2 library image reading.
i want access image array (uchar *), figured out; can following
cv::mat im = imread( 'lena.jpg');
i figure out can access uchar* array --
uchar * data = im.data;
now problem that, there padded bytes put efficiency purpose. means size of array more (or equal to) width*height*channels.
how
- a) actual size of array
- b) variable widthstep or incrementing row-wise??
you need called stride or step-width.
can access im.step
, in:
cv::mat im = imread( 'lena.jpg'); uchar * data = im.data; int stepwidth = im.step;
Comments
Post a Comment