Ask Your Question

Around's profile - activity

2014-02-04 09:30:20 -0600 received badge  Organizer (source)
2014-02-04 01:21:39 -0600 asked a question How can I apply dft to a complex Mat?

I learnt from the tutorials that dft() can be applied to a float point Mat and get a complex output array. If I have a complex input array and I want to get an complex output array, how can I do it with OpenCV?

2014-01-29 03:55:12 -0600 received badge  Student (source)
2014-01-28 11:33:23 -0600 commented question how to use imshow in class member?

Thanks a lot.

2014-01-28 11:24:58 -0600 received badge  Editor (source)
2014-01-28 11:24:17 -0600 asked a question how to use imshow in class member?

The following code is used in a class member. Image watch shows the correct picture, but imshow() only gives a gray picture. Am I making mistakes? Thanks a lot.

void plane::Display()
{
using namespace cv;
Mat M(nPixel, nPixel, CV_8UC1);
double MAX = 0;
for (int i = 0; i < nPixel; i++)
        {
            for (int j = 0; j < nPixel; j++)
            {
                if (abs((*data)(i, j))>MAX)
                    MAX = pow(abs((*data)(i, j)), 2);
            }
        }

        for (int i = 0; i < nPixel; i++)
        {
            for (int j = 0; j < nPixel; j++)
            {
                M.at<uchar>(i, j) = pow(abs((*data)(i, j)), 2) / MAX * 255;
            }
        }
        namedWindow("Intensity", WINDOW_AUTOSIZE);
        imshow("Intensity", M);
}