Ask Your Question

Abs's profile - activity

2017-02-06 23:40:31 -0600 received badge  Supporter (source)
2017-02-06 23:40:28 -0600 received badge  Scholar (source)
2017-02-06 23:40:26 -0600 commented answer opencv Mat points to acess Mat image in one line

Thanks a lot @LBerger. It solved my problem.

2017-02-06 05:24:46 -0600 received badge  Student (source)
2017-02-06 04:41:19 -0600 asked a question 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.