#include "IppImage\IppFourier.h" #include <mmsystem.h> #pragma comment(lib, "winmm.lib") #define SHOW_SPECTRUM_PHASE_IMAGE void CImageToolDoc::OnFourierDft() { int w = m_Dib.GetWidth(); int h = m_Dib.GetHeight(); if (w * h > 128 * 128) { CString msg = _T("영상의 크기가 커서 시간이 오래 걸릴 수 있습니다.\n계속 하시겠습니까?"); if (AfxMessageBox(msg, MB_OKCANCEL) != IDOK) return; } CWaitCursor wait; CONVERT_DIB_TO_BYTEIMAGE(m_Dib, img) IppFourier fourier; fourier.SetImage(img); DWORD t1 = timeGetTime(); fourier.DFT(1); #ifdef SHOW_SPECTRUM_PHASE_IMAGE IppByteImage imgSpec; fourier.GetSpectrumImage(imgSpec); CONVERT_IMAGE_TO_DIB(imgSpec, dibSpec) AfxNewBitmap(dibSpec); IppByteImage imgPhase; fourier.GetPhaseImage(imgPhase); CONVERT_IMAGE_TO_DIB(imgPhase, dibPhase) AfxNewBitmap(dibPhase); #endif fourier.DFT(-1); DWORD t2 = timeGetTime(); IppByteImage img2; fourier.GetImage(img2); CONVERT_IMAGE_TO_DIB(img2, dib) AfxPrintInfo(_T("[푸리에변환/DFT] 입력 영상: %s, 처리 시간: %dmsec"), GetTitle(), t2 - t1); AfxNewBitmap(dib); } void CImageToolDoc::OnFourierDftrc() { int w = m_Dib.GetWidth(); int h = m_Dib.GetHeight(); if (w * h > 256 * 256) { CString msg = _T("영상의 크기가 커서 시간이 오래 걸릴 수 있습니다.\n계속 하시겠습니까?"); if (AfxMessageBox(msg, MB_OKCANCEL) != IDOK) return; } CWaitCursor wait; CONVERT_DIB_TO_BYTEIMAGE(m_Dib, img) IppFourier fourier; fourier.SetImage(img); DWORD t1 = timeGetTime(); fourier.DFTRC(1); #ifdef SHOW_SPECTRUM_PHASE_IMAGE IppByteImage imgSpec; fourier.GetSpectrumImage(imgSpec); CONVERT_IMAGE_TO_DIB(imgSpec, dibSpec) AfxNewBitmap(dibSpec); IppByteImage imgPhase; fourier.GetPhaseImage(imgPhase); CONVERT_IMAGE_TO_DIB(imgPhase, dibPhase) AfxNewBitmap(dibPhase); #endif fourier.DFTRC(-1); DWORD t2 = timeGetTime(); IppByteImage img2; fourier.GetImage(img2); CONVERT_IMAGE_TO_DIB(img2, dib) AfxPrintInfo(_T("[푸리에변환/DFTRC] 입력 영상: %s, 처리 시간: %dmsec"), GetTitle(), t2 - t1); AfxNewBitmap(dib); }