# Image sequence (images behind each other) MATLAB

2 Ansichten (letzte 30 Tage)
Pouyan Sadeghian am 11 Jun. 2021
Kommentiert: Tarunbir Gambhir am 15 Jun. 2021
Hi,
I want to create an image sequence with multiply images. I want to display my images behind each other, like in the following picutre:
And the commands cat, montage but I think with these commands I get an image sequence with images side by side.
My issue:
I have a matrix which I want to seperate in 10 matrices with same dimensions and display them an image sequence serially like I mentioned.
This is how I started. I think with the following command I can seperate my matrix in 10 matrices (scan).
scan=reshape(double(matrix), 20,100,10);
If I want for example display my third matrix I enter:
scan3=scan(:,:,3);
Now I dont know how to continue.
I was thinking about a for loop but I dont really know how to realize that.
I searched in the forum for similar questions but I did not find a similar question.
I hope my question is understandable.
Thank you
##### 0 Kommentare-1 ältere Kommentare anzeigen-1 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

### Antworten (1)

Tarunbir Gambhir am 14 Jun. 2021
I am not sure if there is any MATLAB tool/function that does this specifically. But as a workaround, a simple script can create similar results. Try the following:
multi = cat(3,img1,img2,img3,img4);
I = img1;
[ri, ci] = size(I);
for x=1:size(multi,3)-1
[r, c] = size(I);
inew = uint8(zeros(floor([r, c]*pad) + [r, c]) + 255);
inew(end-ri+1:end, 1:ci) = multi(:,:,x);
I = inew;
end
imshow(I);
##### 3 Kommentare2 ältere Kommentare anzeigen2 ältere Kommentare ausblenden
Tarunbir Gambhir am 15 Jun. 2021
The use of imshow is incorrect here. You cannot achieve a slide-like image switcher using imshow. For the input, this function only takes a grayscale, or binary image as a 2-D matrix, or an RGB image of the format MxNx3. Please refer the documentation on how to use the function.
I can suggest you to try creating an app with a slider image view based on your requirements, using the App Designer.

Melden Sie sich an, um zu kommentieren.

### Kategorien

Mehr zu Image Segmentation finden Sie in Help Center und File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by