1 | initial version |
you can blend the two images with addweighted()
function
2 | No.2 Revision |
you can blend the two images with addweighted()
functionfunction. But what is your goal and why you want to do that?
3 | No.3 Revision |
you can blend the two images with addweighted()
function. function or you can just apply something like src += canny_image;
but you will need first convert your canny image to bgr
. But what is your goal and why you want to do that?
4 | No.4 Revision |
you can blend the two images with addweighted()
function or you can just apply something like src += canny_image;
but you will need first convert your canny image to bgr
. But what is your goal and why you want to do that?
Mat dst, detected_edges;
Canny( gray, detected_edges, 30, 100, 3 );
imshow("canny", detected_edges);
dst = Scalar::all(0);
Mat addweight;
src.copyTo( dst, detected_edges); // copy part of src image according the canny output, canny is used as mask
cvtColor(detected_edges, detected_edges, CV_GRAY2BGR); // convert canny image to bgr
addWeighted( src, 0.5, detected_edges, 0.5, 0.0, addweight); // blend src image with canny image
src += detected_edges; // add src image with canny image
imshow("addition", src );
imshow("copyTo", dst );
imshow("addwweighted", addweight );
waitkey();
source:
addition:
copyTo:
addweighted:
5 | No.5 Revision |
you can blend the two images with addweighted()
function or you can just apply something like src += canny_image;
but you will need first convert your canny image to bgr
. But what is your goal and why you want to do that?
Mat dst, detected_edges;
Canny( gray, detected_edges, 30, 100, 3 );
imshow("canny", detected_edges);
dst = Scalar::all(0);
Mat addweight;
src.copyTo( dst, detected_edges); // copy part of src image according the canny output, canny is used as mask
cvtColor(detected_edges, detected_edges, CV_GRAY2BGR); // convert canny image to bgr
addWeighted( src, 0.5, detected_edges, 0.5, 0.0, addweight); // blend src image with canny image
src += detected_edges; // add src image with canny image
imshow("addition", src );
imshow("copyTo", dst );
imshow("addwweighted", addweight );
waitkey();
source:
canny:
addition:
copyTo:
addweighted:
6 | No.6 Revision |
you can blend the two images with addweighted()
function or you can just apply something like src += canny_image;
but you will need first convert your canny image to bgr
. But what is your goal and why you want to do that?
Mat dst, detected_edges;
Canny( gray, detected_edges, 30, 100, 3 );
imshow("canny", detected_edges);
dst = Scalar::all(0);
Mat addweight;
src.copyTo( dst, detected_edges); // copy part of src image according the canny output, canny is used as mask
cvtColor(detected_edges, detected_edges, CV_GRAY2BGR); // convert canny image to bgr
addWeighted( src, 0.5, detected_edges, 0.5, 0.0, addweight); // blend src image with canny image
src += detected_edges; // add src image with canny image
imshow("addition", src );
imshow("copyTo", dst );
imshow("addwweighted", addweight );
waitkey();
source:
canny:
addition:
copyTo:
addweighted: