for (k=0; k < 4; k++) { roi_out1 = roi_array[g] + roi_array[g + 1] + roi_array[g + 2]; imshow("Accumulator", roi_out1); } int m = getOptimalDFTSize(roi_out1.rows); int n = getOptimalDFTSize(roi_out1.cols); // on the border add zero values copyMakeBorder(roi_out1, padded, 0, m - roi_out1.rows, 0, n - roi_out1.cols, BORDER_CONSTANT, Scalar::all(0)); Mat planes[] = {Mat_<float>(padded), Mat::zeros(padded.size(), CV_32F)}; Mat complexroi_out1; merge(planes, 2, complexroi_out1); // Add to the expanded another plane with zeros dft(complexroi_out1, complexroi_out1); // this way the result may fit in the source matrix split(complexroi_out1, planes); // planes[0] = Re(DFT(I), planes[1] = Im(DFT(I)) magnitude(planes[0], planes[1], planes[0]); // planes[0] = magnitude Mat roi_out1 = planes[0];
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)