MATLAB: How can i read image from the google drive, process it and sent the output to the email address?, image after image, automatically

automaticallyemail addressgoogle drive imageMATLABMATLAB Builder EXMATLAB Builder NEread imagesent coordinates

I have a matlab program, named my_program (which is located in a desktop folder) that reads an image (eg image1.jpg) from the folder (by imread (image1.jpg)), processes it and outputs (the output is specific coordinates (x,y) in the image). I want to make that:
1. Input: The program will read the images from a folder in my cloud in Google Drive, automatically. Each time that new image is uploaded to the folder, the program reads it, processes it, and outputs the output. For simplicity, the first image is: image1.jpg, the second is: image2.jpg, the third is: image3.jpg etc.
2. Output: The output (the coordinates) will be sent to a folder in my cloud in Google Drive, or, even better, the output will be sent to my email address. My email address is: inon9999@gmail.com. After that I want that the program will delete the image (that already processed) from the folder in Google Drive.
The program will wait for a new image to be uploaded to the folder, and then it will read it, process it, send the output to my email, and delete it. And so on.

Best Answer

It looks like it might be possible to imread() an image out of google drive, once you have the file identifier.
I have a photo on drive. Normally if I ask for the shareable link for it in any of several ways, I get told it is at https://drive.google.com/open?id=0B6Z9gtnwRLLTMDVTRWptemVwemM . (Notice the lack of file extension.) But you cannot use
img = imread('https://drive.google.com/open?id=0B6Z9gtnwRLLTMDVTRWptemVwemM', 'jpg'); %fails
as it turns out to be a link to a web page.
The uc hint says to change the 'open' to 'uc'. And that appears to work:
img = imread('https://drive.google.com/uc?id=0B6Z9gtnwRLLTMDVTRWptemVwemM', 'jpg'); %works
imshow(img);
Now.. how to get the URL in the first place is a different question!