I am new in opencv. After completing Fourier transform, i have also got display the angle.I want to show in my window how many degree it is.please give me some idea.
int m = getOptimalDFTSize( canny_image.rows );
int n = getOptimalDFTSize( canny_image.cols ); copyMakeBorder(canny_image, padded, 0, m - canny_image.rows, 0, n - canny_image.cols, BORDER_CONSTANT, Scalar::all(0));
Mat planes[2] = {Mat_<float>(padded), Mat::zeros(padded.size(), CV_32F)};
Mat complexcanny_image;
merge(planes, 2, complexcanny_image);
dft(complexcanny_image, complexcanny_image);
split(complexcanny_image, planes); magnitude(planes[0], planes[1], canny_image);
canny_image += Scalar::all(1); log(canny_image,canny_image);
canny_image = canny_image(Rect(0, 0, canny_image.cols & -2, canny_image.rows & -2));
int cx = canny_image.cols/2;
int cy = canny_image.rows/2;
Mat q0(canny_image, Rect(0, 0, cx, cy)); Mat q1(canny_image, Rect(cx, 0, cx, cy)); Mat q2(canny_image, Rect(0, cy, cx, cy)); Mat q3(canny_image, Rect(cx, cy, cx, cy));
Mat tmp; q0.copyTo(tmp);
q3.copyTo(q0);
tmp.copyTo(q3);
q1.copyTo(tmp); q2.copyTo(q1);
tmp.copyTo(q2);
normalize(canny_image, canny_image, 0, 1, CV_MINMAX);
imshow("spectrum magnitude", canny_image);