createImMontage (imarray, varargin)

版本 1.0.0.0 (4.8 KB) 作者: Wajahat Kazmi
Create a rectangular image montage or image grid from an image array
48.0 次下载
更新时间 2017/2/24

查看许可证

A simple function and an alternative to Matlab Image processing Toolbox's montage(). It will produce an image as a grid of frames of the input image array instead of displaying. It also provides an option to resize the input images before adding them to the grid.
% --------------------------------------------------------------------------------
% Input arguments:
% 1st arg: imarray is input array of dimensions H x W x NumImages or H x W x C x NumImages where C
% is the number of channels in each image
% 2nd arg: gridcols = Number of images to appear horizontally
% Default = 3
% 3rd arg: dsf = Down Sampling Factor (to downsample or reduce the size of the input images)
% range [0 1]. Default = 1 (no downsampling)
% 4th arg: border = Thickness of border between two images (in pixels)
% Default = 2;
% ----------------------------------------------------
% Output argument:
% imMontage = output image montage or grid
% ----------------------------------------------------
% Examples:
% imMontage = createImMontage(imarray); % automatically select grid size and populate without any
% downsampling with 2 pixels border between consecutive images (default)
%
% imMontage = createImMontage(imarray,5,0.25); % 5 images horizontally and every
% image downsampled to quarter with 2 pixels border (default) between
% consecutive images
%
% imMontage = createImMontage(imarray,7,0.5,5); % 7 images horizontally and every
% image downsampled to half with 5 pixels border between consecutive images
%
% NOTE: Input image array can be created by:
% imarray = cat(3,imgray1,imgray2,imgray3,imgray4); % for gray scale images
% imarray = cat(4,imcolor1, imcolor2, imcolor4, imcolor5); for color images

引用格式

Wajahat Kazmi (2024). createImMontage (imarray, varargin) (https://www.mathworks.com/matlabcentral/fileexchange/61749-createimmontage-imarray-varargin), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2008a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Grid Lines, Tick Values, and Labels 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.0

.

.
.