Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
C#
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];
Posted
Updated 24-Apr-14 5:33am
v2
Comments
OriginalGriff 24-Apr-14 10:53am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
phil.o 24-Apr-14 11:33am    
You just forgot to describe the problem.
[no name] 24-Apr-14 12:35pm    
Posting the same code over and over is not likely to get you any different answers then you already have.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900