Montage with Raster Scan

12 ビュー (過去 30 日間)
Jason
Jason 2018 年 5 月 22 日
回答済み: Jason 2018 年 5 月 23 日
Hello, I have a cell array of images obtained by scanning in a raster scan as illustrated below
I want to create a montaged image, and can do it successfully when xsteps & ysteps =3 (so 9 images in the image Array "imgArray")
montageImage = [imgArray{1}, imgArray{4}, imgArray{7}; imgArray{2}, imgArray{5}, imgArray{8}; imgArray{3}, imgArray{6}, imgArray{9}];
However, I want it generalised for any values of xstep and ystep.

回答 (2 件)

KSSV
KSSV 2018 年 5 月 23 日
Read about montage in the documentation, there is an option of specifying size..with this you can show them in your desired step/ size.
montage(fileNames, 'Size', [m n]);
  3 件のコメント
KSSV
KSSV 2018 年 5 月 23 日
If images are present, filenames are enough to show.
Jason
Jason 2018 年 5 月 23 日
編集済み: Jason 2018 年 5 月 23 日
Hi, so they are saved in appdata and I get the cell array of images by:
imgArray=getappdata(0,'stack')
What do I pass as filenames, just "imgArray"
OK trying this doesn't work:
figure
montage(imgArray, 'Size', [3 3]);
The specified filename is not a string.

サインインしてコメントする。


Jason
Jason 2018 年 5 月 23 日
OK, I couldn't get the "montage" function to work so used this instead
ny=ysteps; nx=xsteps;
D=[];
for j=1:ny
C=[];
for i=1:nx
idx=1+ (i-1)*ny;
idx=idx+(j-1)
B=imgArray2{idx};
C = horzcat(C,B);
end
D=vertcat(D,C);
end
figure
imshow(D)

カテゴリ

Help Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by