making a folded picture
Show older comments
the basic idea is to create a folded photo with a resolution of 1080 by 1920 ratio . it works by having a rotated object and the program would cut a rectangle from the middle of frames(1080-by-3 ) and it combines all the cropped photos in sequence to achieve a folding effect.
my basic code was like this:
%this code bring a frame of photo, crops from the centre, and combine the
%previous photo with the new one.
load('s.mat','s')
s; %a reference(1080-by-3) photo for the loop
target=[1080 3]; %the croped size
a=VideoReader('VID_20210828_184108.mp4'); %analyzes the video
for img= 1:640 % the number of frames needed for the photo
I=read(a,img); %read the frame
r=centerCropWindow2d(size(I),target); %creates a rectangle with the target size
j=imcrop(I,r); %crop the image to the target size
s=imfuse(s,j,'montage'); %combines the new cropped photo with the old ones
end
imshow(s)
when i run the code, the image turns to be way too big. i then discovered that (imfuse) fills up the image if the two fused images dont have the same dimensions. is there a function that combines photos as they are without filling up? thank you already
Accepted Answer
More Answers (0)
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!