

We could have created a rough mask and improved the result.


Now we did not use a good mask and you can see excessive smoothing between the words “I” and “Love”, and between “you” and “Paa”. If we use Normal Cloning by using the NORMAL_CLONE flag, we will get the result shown in Figure 6. Imwrite("images/opencv-mixed-clone-example.jpg", mixed_clone) Imwrite("images/opencv-normal-clone-example.jpg", normal_clone) SeamlessClone(src, dst, src_mask, center, mixed_clone, MIXED_CLONE) SeamlessClone(src, dst, src_mask, center, normal_clone, NORMAL_CLONE) Mat src_mask = 255 * Mat::ones(src.rows, src.cols, src.depth()) Mat dst = imread("images/wood-texture.jpg") Mat src = imread("images/iloveyouticket.jpg") There was a time when kids yearned for their parent’s approval, but these days parents have to do their best to earn “I Love You” tickets. Anyway, back to cloning. I am going to use one of these “I Love You Tickets” in the service of Computer Vision (See Figure 4 ). I have a 5 year old son who gives me “I Love You” tickets if I treat him well. Normal Cloning ( NORMAL_CLONE ) versus Mixed Cloning ( MIXED_CLONE ) Let’s see how the two types differ in detail. There is another type, MIXED_CLONE, that is subtly different from NORMAL_CLONE. In the above example, the cloning type ( flags ) I used was NORMAL_CLONE. Imwrite("images/opencv-seamless-cloning-example.jpg", output) SeamlessClone(src, dst, src_mask, center, output, NORMAL_CLONE) Seamlessly clone src into dst and put the results in output The location of the center of the src in the dst Mat src_mask = Mat::zeros(src.rows, src.cols, src.depth()) įillPoly(src_mask, polygons, num_points, 1, Scalar(255,255,255)) Create a rough mask around the airplane. Read images : src image will be cloned into dst
