Get Image On Same Dialog box in opencv 3.0
How to get image on dialog box in dialog based Application, As i use imshow image is displayed on another window
How to get image on dialog box in dialog based Application, As i use imshow image is displayed on another window
You should use the same name of the window in imshow
function. Something like:
for (std::size_t i = 0, i < imgsPaths.size(); i++) // if you have a vector of images' paths
{
cv::Mat img = cv::imread(imgsPaths[i]);
cv::imshow("same window", img);
cv::waitKey(); // for seeing the displayed image until key pressed
}
I am not sure what you want, so I am adding also another thing: If you want to display two images in the same window, you can do something like:
cv::Mat img1 = cv::imread("../img1.png");
cv::Mat img2 = cv::imread("../img2.png");
cv::Mat img3;
img3.push_back(img1);
img3.push_back(img2);
cv::imshow("img3", img3);
cv::waitKey();
Or if you want to display them one next to each other, then you'll need to play a little more (like create a zero Mat of Size(width1 + width2, max(height1, height2)) and just copy the images in the specific places)
Nice the pushing of multiple mats in a vector was something I didn't know yet. Mostly I copy them to the desired region.
I think it is more correct if you display them in the region where you want, but this works for images with the same number of columns
Asked: 2014-10-01 00:27:40 -0600
Seen: 1,580 times
Last updated: Oct 09 '14
GpuMat misses operators, and functions that compared with Mat
Bug with GpuMat::GpuMat(const GpuMat& m, Rect roi)
installing two versions of opencv
Building current 3.0 dev branch Ubuntu 14.04
No EM in the official GIT repository [closed]
opencv3.0 illuminationChange Issue and bug fix [closed]
OpenCV Alpha 3.0 - What is the license for the subset of IPP that is linked to this version?
You should create the Mat that contains both images (maybe using
push_back
)^^ i think, poster means: 1 image on the same window as the rest of the gui (not in an external window)
@Shelly30 See the answer here
I am doing work on mfc vc++ with dialog based application.I want to show image on dialog box not on window
probably not so many ppl around here using mfc any more ..
What you can do is to create a Mat that contains both images you want to display and then give this Mat to the function that transforms it to MFC format