createImMontage (imarray, varargin)

バージョン 1.0.0.0 (4.83 KB) 作成者: Wajahat Kazmi
Create a rectangular image montage or image grid from an image array
ダウンロード: 49
更新 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 (2025). createImMontage (imarray, varargin) (https://jp.mathworks.com/matlabcentral/fileexchange/61749-createimmontage-imarray-varargin), MATLAB Central File Exchange. に取得済み.

MATLAB リリースの互換性
作成: R2008a
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersGrid 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

.

.
.