HDR Tone Mapping with CUDA 5

In this example, for the sake of learning, we are going to butcher some great images. Let's describe the problem first.We are going to take some HDR images and modify their luminosity to lighten them. We could also darken the images, or apply changes only to parts of the images,

C++ (117.3 MB)
 
 
 
 
 
(0)
2,773 times
Add to favorites
3/8/2013
E-mail Twitter del.icio.us Digg Facebook

Solution explorer

C++
#pragma once

#define NOMINMAX					// Use standard library min/max
#define WIN32_LEAN_AND_MEAN

#include <Windows.h>				// For writing debug info to the output windows, remove if you do not need it.
#include <cassert>
#include <chrono>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <memory>
#include <ppl.h>
#include <string>
#include <vector>

#include <opencv2\core\core.hpp>
#include <opencv2\highgui\highgui.hpp>
#include <opencv2\opencv.hpp>

#include <cuda.h>
#include <cuda_runtime.h>
#include <cuda_runtime_api.h>

#include <thrust\extrema.h>
#include <thrust\device_vector.h>
#include <thrust\scan.h>

// My headers
#include "GpuTimer.h"
#include "Utilities.h"

// Load libraries
#pragma comment(lib, "cudart")

// opencv requires debug libraries when running indebug mode
#if _DEBUG
#pragma comment(lib, "opencv_core243d")
#pragma comment(lib, "opencv_imgproc243d")
#pragma comment(lib, "opencv_highgui243d")
#pragma comment(lib, "opencv_ml243d")
#pragma comment(lib, "opencv_video243d")
#pragma comment(lib, "opencv_features2d243d")
#pragma comment(lib, "opencv_calib3d243d")
#pragma comment(lib, "opencv_objdetect243d")
#pragma comment(lib, "opencv_contrib243d")
#pragma comment(lib, "opencv_legacy243d")
#pragma comment(lib, "opencv_flann243d")
#else
#pragma comment(lib, "opencv_core243")
#pragma comment(lib, "opencv_imgproc243")
#pragma comment(lib, "opencv_highgui243")
#pragma comment(lib, "opencv_ml243")
#pragma comment(lib, "opencv_video243")
#pragma comment(lib, "opencv_features2d243")
#pragma comment(lib, "opencv_calib3d243")
#pragma comment(lib, "opencv_objdetect243")
#pragma comment(lib, "opencv_contrib243")
#pragma comment(lib, "opencv_legacy243")
#pragma comment(lib, "opencv_flann243")
#endif