高动态图片 HDR
Ptr<CalibrateDebevec> calibrate = createCalibrateDebevec();
calibrate->process(images, response, times);
//
Ptr<MergeDebevec> merge_debevec = createMergeDebevec(); merge_debevec->process(images, hdr, times, response);
色调映射 Tone mapping
hdr=hdrread('hdr.hdr');
rgb=tonemap(hdr);
imshow(rgb);
对齐 Alignment
vector<Mat> images_(images);
Ptr<AlignMTB> align=createAlignMTB(4);// 4=max 16 pixel shift
align->process(images_, images);
曝光融合 Exposure fusion
Mat fusion;
Ptr<MergeMertens> merge_mertens = createMergeMertens();
merge_mertens->process(images, fusion); // fusion is a
fusion=fusion*255; // float. point image w. values in [0..1]
imwrite("fusion.png", fusion);
无缝克隆 Seamless cloning
Mat source = imread("source1.png", IMREAD_COLOR);
Mat destination = imread("destination1.png", IMREAD_COLOR);
Mat mask = imread("mask.png", IMREAD_COLOR);
imshow("source", source);
imshow("mask", mask);
imshow("destination", destination);
Mat result;
Point p; // p will be near top right corner
p.x = (float)2*destination.size().width/3;
p.y = (float)destination.size().height/4;
seamlessClone(source, destination, mask, p, result, NORMAL_CLONE); imshow("result", result);
去色 Decolorization
cvtColor(source, grayscale, COLOR_BGR2GRAY);
decolor(source,decolorized,dummy);
非真实渲染 Non-photorealistic rendering
原图
边缘保护 edgePreservingFilter
细节增强 detailEnhance
铅笔草图 pencilSketch
风格化 stylization