Question

I have a series of images in url obtained from Google, My question is

  1. Why imwrite doesn't not save all the images in the link? More precise, I stored the extracted image in im =imread(images), but the problem occurs when the number of saved images reaches up to 80 images? Even though the image 81 is existed in the "im" variable but does not pass to the imwrite to save it?
  2. Is the problem happening because I have limited access to a number of images from Google? or is it because the imwrite function has a problem?

Is there anyone who can explain to me why such a problem happening?

Was it helpful?

Solution

Try to replace the imwrite line in your loop with something like (with k being your loop increment):

filepath{k}=fullfile(imgpath,T_MODE,keyword,strcat('img_',num2str(count_save),'.jpg');
imageSize{k}=size(im);

Run the loop once and browse through the resulting cells to see if the name of the file is always different (otherwise it will overwrite the existing files) and that the size of the images are not zero. Then you will have ruled out two reasons for your images not saving.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top