Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

How to speed up seamlessClone? (incredibly slow)

$
0
0
Hi, I am using seamlessClone to integrate a logo into a video and it is incredibly slow. Actually creating a video with 1000 frames with a resolution of 1280 x 800 takes 30 seconds. While using seamlessClone it takes round about 15 seconds to write one single frame! I am not sure whether I use this function in a wrong way or whether seamlessClone is really that heavy. This is basically what I do: int main() { cv::Mat logo= imread("logo.png", CV_LOAD_IMAGE_COLOR); Size size(100,120); Mat LogoResized; resize(logo,LogoResized,size); Point center(300,300); Mat mask_forCloning = 255 * Mat::ones(LogoResized.rows, LogoResized.cols, LogoResized.depth()); Mat normal_clone; Mat image; for (int i=0; i<1000; i++) { image = imread(pictureName, CV_LOAD_IMAGE_COLOR); //Of course the name is changing with every frame ;-) seamlessClone(LogoResized, image, mask_forCloning, center, normal_clone, NORMAL_CLONE); writeCurrentFrameToVideo(normal_clone); } } Is there a possibility to speed this up? Thank you very much :-)

Viewing all articles
Browse latest Browse all 41027

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>