Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

opencv Mat points to acess Mat image in one line

I have an Mat image and a Mat of points containing few coordinates. I want to extract and make another Mat variable from the Mat image pixels at the points stored in the Mat of points without using for loop. Currently I am using for loop but want to make it faster.

for(int kk=0;kk < cAM.cd[ii].ind_in.rows; kk++) { I.at < float > (kk,0)=Iw.at < float > (cAM.cd[ii].ind_in.at < Point > (kk,0).y, cAM.cd[ii].ind_in.at < Point > (kk,0).x); }

Here I have coordinates in "cAM.cd[ii].ind_in" and Iw a Mat type image. I want a linear Mat I with all pixel values in Iw at those coordinates.

opencv Mat points to acess Mat image in one line

I have an Mat image and a Mat of points containing few coordinates. I want to extract and make another Mat variable from the Mat image pixels at the points stored in the Mat of points without using for loop. Currently I am using for loop but want to make it faster.

for(int kk=0;kk < cAM.cd[ii].ind_in.rows; kk++)
{
I.at < float > (kk,0)=Iw.at < float > (cAM.cd[ii].ind_in.at < Point > (kk,0).y, cAM.cd[ii].ind_in.at < Point > (kk,0).x);
}

}

Here I have coordinates in "cAM.cd[ii].ind_in" and Iw a Mat type image. I want a linear Mat I with all pixel values in Iw at those coordinates.

opencv Mat points to acess Mat image in one line

I have an Mat image and a Mat of points containing few coordinates. I want to extract and make another Mat variable from the Mat image pixels at the points stored in the Mat of points without using for loop. Currently I am using for loop but want to make it faster.

for(int `for(int kk=0;kk < cAM.cd[ii].ind_in.rows; kk++)
   {
        I.at < float > (kk,0)=Iw.at < float > (cAM.cd[ii].ind_in.at < Point > (kk,0).y, cAM.cd[ii].ind_in.at < Point > (kk,0).x);
   }
}`

Here I have coordinates in "cAM.cd[ii].ind_in" and Iw a Mat type image. I want a linear Mat I with all pixel values in Iw at those coordinates.