Ask Your Question

theateist's profile - activity

2019-05-19 11:59:33 -0600 commented answer Why image is not copied to right part of collage image?

Stupid mistake :) Thanks!

2019-05-19 11:59:22 -0600 marked best answer Why image is not copied to right part of collage image?

I'm trying to create a collage image. The following code writes correctly to the left part of collage image (green), but not to the right.

Size collageSize(img1.width + img2.width, std::max(img1.height, img2.height));
Mat collageImg = Mat(collageSize, CV_8UC3, Scalar::all(0));

Mat img1ROI(collageImg, cv::Range(0, img1.rows), cv::Range(0, img1.cols));
rectangle(img1ROI, Rect(0, 0, img1.cols, img1.rows), CV_RGB(0, 255, 0), -1);

Mat img2ROI(collageImg, cv::Range(0, img2.rows), cv::Range(img1.cols, img2.cols));
rectangle(img2ROI, Rect(0, 0, img2.cols, img2.rows), CV_RGB(255, 0, 0), -1);

image description

If I create img2ROI as following:

Mat img2ROI(collageImg, Rect(img1.cols, 0, img2.cols, img2.rows));

Then I get the correct collage image: image description

Why it doesn't work with Range for the right image?

2019-05-19 11:59:22 -0600 received badge  Scholar (source)
2019-05-17 02:13:10 -0600 received badge  Editor (source)
2019-05-17 02:13:10 -0600 edited question Why image is not copied to right part of collage image?

Why image is not copied to right part of collage image? I'm trying to create a collage image. The following code writes

2019-05-17 02:12:47 -0600 asked a question Why image is not copied to right part of collage image?

Why image is not copied to right part of collage image? I'm trying to create a collage image. The following code writes

2019-05-13 01:19:52 -0600 asked a question Why homgraphy matrix doesn't work for any point in the image?

Why homgraphy matrix doesn't work for any point in the image? I'm trying to find homography between the following two im