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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -