Display Multiple Images in Single Window in OpenCV
2014-11-01 20:22
399 查看
In MATLAB, it is easy to plot multiple graph in single figure. we use only one command to do this:
However, as far as I know, there is no inbuilt support to display more than one image in OpenCV. There are two major directions on solving this problem. One is to join multiple images into one
Single Big image, the other is to use a third-party library to compensate the deficiency.
1. Join multiple images into one Single Big image
1.1 set the ROIs of a Single Big image and then resizing and copying the input images to the Single Big Image
1.2 use inbuilt function “hconcat” and “vconcat” in OpenCV
2. Use the third-party library
I introduce two excellent third-party libraries for image load and display here
1) Emgu CV
Emgu CV is a cross platform .Net wrapper to the OpenCV image processing library. Allowing OpenCV functions to
be called from .NET compatible languagesuch as C#, VB, VC++, IronPython etc.
2) CxImage
CxImage is a C++ class to load, save, display, transform BMP,JPEG, GIF, TIFF, MNG, ICO, PCX, TGA, WMF, WBMP, JBG,
J2K images.
More details on how to use these two third-party libraries, please look up the reference [3, 4].
3. Reference
[1]http://answers.opencv.org/question/23048/display-many-images-in-single-window-in-opencv/
[2]http://www.codeproject.com/Questions/595865/HowplustoplusDisplayplusMultipleplusImagesplusinpl
[3]http://code.opencv.org/projects/opencv/wiki/DisplayManyImages
[4]http://www.emgu.com/wiki/index.php/Main_Page
subplot(2,2,1); imshow(img);
However, as far as I know, there is no inbuilt support to display more than one image in OpenCV. There are two major directions on solving this problem. One is to join multiple images into one
Single Big image, the other is to use a third-party library to compensate the deficiency.
1. Join multiple images into one Single Big image
1.1 set the ROIs of a Single Big image and then resizing and copying the input images to the Single Big Image
Mat eigenface[3]; eigenface[0] = imread(image0,IMREAD_GRAYSCALE); eigenface[1] = imread(image1,IMREAD_GRAYSCALE); eigenface[2] = imread(image2,IMREAD_GRAYSCALE); //Display multiple images in single window Mat dst(images[0].rows,(images[0].cols+10)*3,CV_8UC1,0); Mat roi = dst(Rect(5,0,images[0].cols,images[0].rows)); eigenface[0].copyTo(roi); roi = dst(Rect(images[0].cols+10,0,images[0].cols,images[0].rows)); eigenface[1].copyTo(roi); roi = dst(Rect((images[0].cols+10)*2,0,images[0].cols,images[0].rows)); eigenface[3].copyTo(roi);</span>
1.2 use inbuilt function “hconcat” and “vconcat” in OpenCV
Mat eigenface[3]; eigenface[0] = imread(image0,IMREAD_GRAYSCALE); eigenface[1] = imread(image1,IMREAD_GRAYSCALE); eigenface[2] = imread(image2,IMREAD_GRAYSCALE); Mat dst; hconcat(eigenface,3,dst);
2. Use the third-party library
I introduce two excellent third-party libraries for image load and display here
1) Emgu CV
Emgu CV is a cross platform .Net wrapper to the OpenCV image processing library. Allowing OpenCV functions to
be called from .NET compatible languagesuch as C#, VB, VC++, IronPython etc.
2) CxImage
CxImage is a C++ class to load, save, display, transform BMP,JPEG, GIF, TIFF, MNG, ICO, PCX, TGA, WMF, WBMP, JBG,
J2K images.
More details on how to use these two third-party libraries, please look up the reference [3, 4].
3. Reference
[1]http://answers.opencv.org/question/23048/display-many-images-in-single-window-in-opencv/
[2]http://www.codeproject.com/Questions/595865/HowplustoplusDisplayplusMultipleplusImagesplusinpl
[3]http://code.opencv.org/projects/opencv/wiki/DisplayManyImages
[4]http://www.emgu.com/wiki/index.php/Main_Page
相关文章推荐
- Display data from multiple sources in a single Data View(转office.Microsoft)
- Display the images in multiple scales
- 解决docker 删除 images时,出现image is referenced in multiple repositories错误,不能删除
- Handling Multiple Versions in a Single Project Team
- Real-time human pose recognition in parts from single depth images 中文翻译【译】【中译】微软kinect中用的算法
- multiple xaml file in a single Silverlight application
- Handling Multiple Versions in a Single Project Team
- Detecting Skin in Images & Video Using Python and OpenCV皮肤检测
- 【Z一贴】Visual C++ Debugging: How to display UNICODE strings in Watch/QuickWatch window?
- Paper Reading:Real-time human pose recognition in parts from single depth images
- What does it mean by Single-Leg & Multiple Leg in Stock Trading?
- single host multiple IP address configuration in Linux
- Map Multiple Domain Names to Web Sites in IIS at a Single IP Address
- [转]Wrapping multiple calls to SaveChanges() in a single transaction
- 用 Python 和 OpenCV 检测图片上的条形码Detecting Barcodes in Images with Python and OpenCV
- How to use OpenCV to capture and display images from a camera
- Call multiple URLs on single click of af:goLink in Oracle ADF
- Restrict each user to a single session in window server 2008 R2 or 2012
- Integral images in OpenCV
- How to display column values in a single cell in Web Intelligence using Oracle database ?