#include <iostream>
#include <stdlib.h>
{
cout << endl;
cout << "Cloning Module" << endl;
cout << "---------------" << endl;
cout << "Options: " << endl;
cout << endl;
cout << "1) Normal Cloning " << endl;
cout << "2) Mixed Cloning " << endl;
cout << "3) Monochrome Transfer " << endl;
cout << "4) Local Color Change " << endl;
cout << "5) Local Illumination Change " << endl;
cout << "6) Texture Flattening " << endl;
cout << endl;
cout << "Press number 1-6 to choose from above techniques: ";
int num = 1;
cin >> num;
cout << endl;
if(num == 1)
{
string folder = "cloning/Normal_Cloning/";
string original_path1 = folder + "source1.png";
string original_path2 = folder + "destination1.png";
string original_path3 = folder + "mask.png";
if(source.empty())
{
cout << "Could not load source image " << original_path1 << endl;
exit(0);
}
if(destination.empty())
{
cout << "Could not load destination image " << original_path2 << endl;
exit(0);
}
{
cout << "Could not load mask image " << original_path3 << endl;
exit(0);
}
Mat result;
p.y = 100;
imwrite(folder +
"cloned.png", result);
}
else if(num == 2)
{
string folder = "cloning/Mixed_Cloning/";
string original_path1 = folder + "source1.png";
string original_path2 = folder + "destination1.png";
string original_path3 = folder + "mask.png";
if(source.empty())
{
cout << "Could not load source image " << original_path1 << endl;
exit(0);
}
if(destination.empty())
{
cout << "Could not load destination image " << original_path2 << endl;
exit(0);
}
{
cout << "Could not load mask image " << original_path3 << endl;
exit(0);
}
Mat result;
p.
x = destination.size().width/2;
p.y = destination.size().height/2;
imwrite(folder +
"cloned.png", result);
}
else if(num == 3)
{
string folder = "cloning/Monochrome_Transfer/";
string original_path1 = folder + "source1.png";
string original_path2 = folder + "destination1.png";
string original_path3 = folder + "mask.png";
if(source.empty())
{
cout << "Could not load source image " << original_path1 << endl;
exit(0);
}
if(destination.empty())
{
cout << "Could not load destination image " << original_path2 << endl;
exit(0);
}
{
cout << "Could not load mask image " << original_path3 << endl;
exit(0);
}
Mat result;
p.
x = destination.size().width/2;
p.y = destination.size().height/2;
imwrite(folder +
"cloned.png", result);
}
else if(num == 4)
{
string folder = "cloning/Color_Change/";
string original_path1 = folder + "source1.png";
string original_path2 = folder + "mask.png";
if(source.empty())
{
cout << "Could not load source image " << original_path1 << endl;
exit(0);
}
{
cout << "Could not load mask image " << original_path2 << endl;
exit(0);
}
Mat result;
imwrite(folder +
"cloned.png", result);
}
else if(num == 5)
{
string folder = "cloning/Illumination_Change/";
string original_path1 = folder + "source1.png";
string original_path2 = folder + "mask.png";
if(source.empty())
{
cout << "Could not load source image " << original_path1 << endl;
exit(0);
}
{
cout << "Could not load mask image " << original_path2 << endl;
exit(0);
}
Mat result;
imwrite(folder +
"cloned.png", result);
}
else if(num == 6)
{
string folder = "cloning/Texture_Flattening/";
string original_path1 = folder + "source1.png";
string original_path2 = folder + "mask.png";
if(source.empty())
{
cout << "Could not load source image " << original_path1 << endl;
exit(0);
}
{
cout << "Could not load mask image " << original_path2 << endl;
exit(0);
}
Mat result;
imwrite(folder +
"cloned.png", result);
}
}
_Tp x
x coordinate of the point
Definition: modules/core/include/opencv2/core/types.hpp:201
Point2i Point
Definition: modules/core/include/opencv2/core/types.hpp:209
GMat mask(const GMat &src, const GMat &mask)
Applies a mask to a matrix.
void imshow(const String &winname, InputArray mat)
Displays an image in the specified window.
int waitKey(int delay=0)
Waits for a pressed key.
@ IMREAD_COLOR
Same as IMREAD_COLOR_BGR.
Definition: imgcodecs.hpp:72
CV_EXPORTS_W bool imwrite(const String &filename, InputArray img, const std::vector< int > ¶ms=std::vector< int >())
Saves an image to a specified file.
CV_EXPORTS_W Mat imread(const String &filename, int flags=IMREAD_COLOR_BGR)
Loads an image from a file.
void seamlessClone(InputArray src, InputArray dst, InputArray mask, Point p, OutputArray blend, int flags)
Performs seamless cloning to blend a region from a source image into a destination image....
void colorChange(InputArray src, InputArray mask, OutputArray dst, float red_mul=1.0f, float green_mul=1.0f, float blue_mul=1.0f)
Given an original color image, two differently colored versions of this image can be mixed seamlessly...
void illuminationChange(InputArray src, InputArray mask, OutputArray dst, float alpha=0.2f, float beta=0.4f)
Applying an appropriate non-linear transformation to the gradient field inside the selection and then...
void textureFlattening(InputArray src, InputArray mask, OutputArray dst, float low_threshold=30, float high_threshold=45, int kernel_size=3)
By retaining only the gradients at edge locations, before integrating with the Poisson solver,...
int main(int argc, char *argv[])
Definition: highgui_qt.cpp:3
Definition: core/include/opencv2/core.hpp:107