how i can capture and then save many images using kinect camera at one time?
16 views (last 30 days)
Muhammad Hammad Malik on 15 Aug 2018
how i can capture and thensave many images using kinect camera at one time? i am using matlab by making GUI. i can save image now but i want to save more then one images with the passing of seconds. kindly guide me thanks
Florian Morsch on 20 Aug 2018
Right now you have a fixed N, in this case N=4 and if you run your code you will save the images to my_new1.png, my_new2.png, and so on. Now if you run the code again, the N stays the same which causes the name to be the same, thats why you are overriting the images. If you want to save multiple images in the folder, search for all image files in the folder, count them and then add that number to the name.
From this already answered question ( https://de.mathworks.com/matlabcentral/answers/65564-find-total-number-of-images-in-a-folder ) you can learn how to count the images in a folder.
You can use
a=dir([yourfolder '/*.jpg']); %%You have to give your folder location here
N = 4;
A = imread('my_img.png');
for ii = 1:N
NumberOfNextImage=ii + out;
Now your code would check for the total amount of images in the folder and if you run with 4 images and say you already have 12 in the folder, your images would be named ii + 12, so my_img13.png, my_img14.png, ... and so on.