Accessing pixel pointer
Hi guys
Can you explain to me how the accessing pixel has been done in the double loop ? how do they change rows and cols and pixel's value like what is the (1,1) pixel coordinates for example ?
for(int i=0;i<cv_ptr->image.rows;i++)
{
float* ptr_img_A = cv_ptr->image.ptr<float>(i);
for(int j=0;j<cv_ptr->image.cols;j++)
{
*ptr_img_B=255*(*ptr_img_A)/3.5;
ptr_img_A++;
}
}
Thank you.
I have not met
cv_ptr
until now. Can you post also the definition of thecv_ptr
?OK this the code where it comes from: cv_ptr = cv_bridge::toCvCopy(msg, sensor_msgs::image_encodings::TYPE_32FC1);