Demo entry 6779951

1

   

Submitted by anonymous on Dec 21, 2018 at 12:46
Language: C++. Code size: 573 Bytes.

#include <opencv2\opencv.hpp> 
#include <vector>
#include <random>

using namespace std;
using namespace cv;

int main()
{
    Mat image, image_freq;
    Mat image_raw = imread("./image_raw.jpg", IMREAD_GRAYSCALE);
    image_raw.convertTo(image, CV_32FC1);
    dft(image, image_freq, DFT_COMPLEX_OUTPUT | DFT_SCALE);
    dft(image_freq, image, DFT_INVERSE | DFT_REAL_OUTPUT);
    image.convertTo(image, CV_8UC1);
    imwrite("./image_dft_idft_q1.jpg", image);
    Mat diff;
    absdiff(image, image_raw, diff);
    imwrite("./image_diff_q1.jpg", diff);
}

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).