提交 35d9ca64 编写于 作者: S siddharth

Changes done in cloning module

上级 daa9694c
......@@ -313,8 +313,8 @@ CV_EXPORTS_W Ptr<MergeRobertson> createMergeRobertson();
float alpha = 0.2, float beta = 0.4);
CV_EXPORTS_W void textureFlattening(InputArray src, InputArray mask, OutputArray dst,
double low_threshold, double high_threshold,
int kernel_size);
double low_threshold = 30, double high_threshold = 45,
int kernel_size = 3);
CV_EXPORTS_W void edgePreservingFilter(InputArray src, OutputArray dst, int flags = 1,
float sigma_s = 60, float sigma_r = 0.4);
......
......@@ -127,14 +127,14 @@ void cv::decolor(InputArray _src, OutputArray _dst, OutputArray _color_boost)
temp1.push_back(val + Cg[i]);
}
double ans = 0.0;
double ans1 = 0.0;
double pos = 0.0;
double neg = 0.0;
for(unsigned int i =0;i<alf.size();i++)
{
ans = ((1 + alf[i])/2) * exp((-1.0 * 0.5 * pow(temp[i],2))/pow(obj.sigma,2));
ans1 =((1 - alf[i])/2) * exp((-1.0 * 0.5 * pow(temp1[i],2))/pow(obj.sigma,2));
G_pos.push_back(ans);
G_neg.push_back(ans1);
pos = ((1 + alf[i])/2) * exp((-1.0 * 0.5 * pow(temp[i],2))/pow(obj.sigma,2));
neg = ((1 - alf[i])/2) * exp((-1.0 * 0.5 * pow(temp1[i],2))/pow(obj.sigma,2));
G_pos.push_back(pos);
G_neg.push_back(neg);
}
vector <double> EXPsum;
......
......@@ -41,6 +41,7 @@
#include "precomp.hpp"
#include "opencv2/photo.hpp"
#include "opencv2/highgui.hpp"
#include <iostream>
#include <stdlib.h>
......@@ -148,19 +149,7 @@ void cv::colorChange(InputArray _src, InputArray _mask, OutputArray _dst, float
Mat cs_mask = Mat::zeros(src.size(),CV_8UC3);
int channel = 3;
for(int i=0;i<mask.size().height;i++)
for(int j=0;j<mask.size().width;j++)
{
if(gray.at<uchar>(i,j) == 255)
{
for(int c=0;c<channel;c++)
{
cs_mask.at<uchar>(i,j*channel+c) = src.at<uchar>(i,j*channel+c);
}
}
}
src.copyTo(cs_mask,gray);
Cloning obj;
obj.local_color_change(src,cs_mask,gray,blend,red,green,blue);
......@@ -186,19 +175,7 @@ void cv::illuminationChange(InputArray _src, InputArray _mask, OutputArray _dst,
Mat cs_mask = Mat::zeros(src.size(),CV_8UC3);
int channel = 3;
for(int i=0;i<mask.size().height;i++)
for(int j=0;j<mask.size().width;j++)
{
if(gray.at<uchar>(i,j) == 255)
{
for(int c=0;c<channel;c++)
{
cs_mask.at<uchar>(i,j*channel+c) = src.at<uchar>(i,j*channel+c);
}
}
}
src.copyTo(cs_mask,gray);
Cloning obj;
obj.illum_change(src,cs_mask,gray,blend,alpha,beta);
......@@ -223,19 +200,7 @@ void cv::textureFlattening(InputArray _src, InputArray _mask, OutputArray _dst,
Mat cs_mask = Mat::zeros(src.size(),CV_8UC3);
int channel = 3;
for(int i=0;i<mask.size().height;i++)
for(int j=0;j<mask.size().width;j++)
{
if(gray.at<uchar>(i,j) == 255)
{
for(int c=0;c<channel;c++)
{
cs_mask.at<uchar>(i,j*channel+c) = src.at<uchar>(i,j*channel+c);
}
}
}
src.copyTo(cs_mask,gray);
Cloning obj;
obj.texture_flatten(src,cs_mask,gray,low_threshold,high_threshold,kernel_size,blend);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册