First time here? Check out the FAQ!

Ask Your Question
1

Convert cv::Mat::at to Android

asked Apr 13 '13

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 :)

Preview: (hide)

1 answer

Sort by » oldest newest most voted
3

answered Apr 14 '13

Daniil Osokin gravatar image

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

Preview: (hide)

Comments

1

many thanks dude, it help me a lot.

baharsan gravatar imagebaharsan (Apr 14 '13)edit

Question Tools

Stats

Asked: Apr 13 '13

Seen: 1,627 times

Last updated: Apr 14 '13