OpenCV——PS滤镜,渐变映射


// define head function
#ifndef PS_ALGORITHM_H_INCLUDED
#define PS_ALGORITHM_H_INCLUDED

#include 
#include 
#include "cv.h"
#include "highgui.h"
#include "cxmat.hpp"
#include "cxcore.hpp"

using namespace std;
using namespace cv;


void Show_Image(Mat&, const string &);


#endif // PS_ALGORITHM_H_INCLUDED

/*
This program will generate
 "Shade" effect.

*/

#include "PS_Algorithm.h"
#include 

using namespace std;
using namespace cv;

int main(void)
{
    string Img_name("4.jpg");
    Mat Image_in;
    Image_in=imread(Img_name);
    Show_Image(Image_in, Img_name);

    Mat Image_out(Image_in.size(), CV_32FC3);
    Image_in.convertTo(Image_out, CV_32FC3);

    Mat Image_2(Image_in.size(), CV_32FC3);
    Image_in.convertTo(Image_2, CV_32FC3);

    Mat Map(Image_in.size(), CV_32FC3);
    Mat temp;
    float val;

    // build the mapping table
    /*
    for (int i=0; i
#include 

using namespace std;
using namespace cv;

void Show_Image(Mat& Image, const string& str)
{
    namedWindow(str.c_str(),CV_WINDOW_AUTOSIZE);
    imshow(str.c_str(), Image);

}



原图 

OpenCV——PS滤镜,渐变映射_第1张图片


效果图

OpenCV——PS滤镜,渐变映射_第2张图片

转载于:https://www.cnblogs.com/mtcnn/p/9412663.html

你可能感兴趣的:(OpenCV——PS滤镜,渐变映射)