검색결과 리스트
글
High Dynamic Range Imaging(HDR)
컴퓨터비전/영상처리/OpenCV
2015. 7. 19. 21:50
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | // Reference : http://docs.opencv.org/3.0.0/d3/db7/tutorial_hdr_imaging.html // Examples : High Dynamic Range Imaging(HDR) #include <cv.hpp> #include <iostream> #include <fstream> using namespace std; using namespace cv; void loadExposureSqe(String path, vector<Mat>& images, vector<float>×) { path = path + std::string("/"); ifstream list_file((path + "list.txt").c_str()); string name; float val; while (list_file >> name >> val) { Mat img = imread(path + name); images.push_back(img); times.push_back(1 / val); } list_file.close(); } int main() { vector<Mat> images; vector<float> times; loadExposureSqe("hdr/exposures", images, times); Mat response; Ptr<CalibrateDebevec> calibrate = createCalibrateDebevec(); calibrate->process(images, response, times); Mat hdr; Ptr<MergeDebevec> merge_debevec = createMergeDebevec(); merge_debevec->process(images, hdr, times, response); Mat ldr; Ptr<TonemapDurand> tonemap = createTonemapDurand(2.2f); tonemap->process(hdr, ldr); Mat fusion; Ptr<MergeMertens> merge_mertens = createMergeMertens(); merge_mertens->process(images, fusion); imwrite("hdr/fusion.png", fusion * 255); imwrite("hdr/ldr.png", ldr * 255); imwrite("hdr/hdr.hdr", hdr); return 0; } | cs |
hdr.zip |
'컴퓨터비전/영상처리 > OpenCV' 카테고리의 다른 글
Non-Photorealistic Rendering (0) | 2015.07.30 |
---|---|
OpenCV SeamlessCloning (1) | 2015.07.30 |
OpenCV Principal Component Analysis(PCA) (0) | 2015.07.19 |
OpenCV Scene Change Detection(장면 전환 검출) (0) | 2015.07.19 |
Image Segmentation with Distance Transform and Watershed Algorithm (0) | 2015.07.13 |