Ask Your Question
1

Convert cv::Mat::at to Android

asked 2013-04-13 16:52:06 -0600

baharsan gravatar image

Hey There, please help me to figure it out : I have a opencv C++ code like :

 cv::Mat kernel(ks,ks, CV_32F);
    for (int y=-hks; y<=hks; y++)
    {
        for (int x=-hks; x<=hks; x++)
        {
            x_theta = x*del*cos(theta)+y*del*sin(theta);
            y_theta = -x*del*sin(theta)+y*del*cos(theta);
            kernel.at<float>(hks+y,hks+x) = (float)exp(-0.5*(pow(x_theta,2)+pow(y_theta,2))/pow(sigma,2))* cos(2*CV_PI*x_theta/lmbd + psi);
        }
    }

I want to convert below code to android

kernel.at<float>(hks+y,hks+x) = (float)exp(-0.5*(pow(x_theta,2)+pow(y_theta,2))/pow(sigma,2))* cos(2*CV_PI*x_theta/lmbd + psi);

can you help me please, thanks in advance :)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
3

answered 2013-04-14 14:38:48 -0600

Daniil Osokin gravatar image

Hi! You should use put method. Check this great answer for details.

edit flag offensive delete link more

Comments

1

many thanks dude, it help me a lot.

baharsan gravatar imagebaharsan ( 2013-04-14 16:24:11 -0600 )edit

Question Tools

Stats

Asked: 2013-04-13 16:52:06 -0600

Seen: 1,617 times

Last updated: Apr 14 '13