how can i read image from my google drive, process it and sent the output to my email address?, image after image, automatically?
38 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
inon hen
il 19 Dic 2018
Risposto: Richard Zapor
il 17 Giu 2023
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.
2 Commenti
Rik
il 19 Dic 2018
Matlab can send e-mails, so the only thing you really need to do is finding a workable API for Google Drive that will work on a slightly older release like R2014b. If there is anything, it will probably be on the File Exchange, and you have good chances on it working on your release.
Risposta accettata
Walter Roberson
il 23 Dic 2018
It looks like it might be possible to imread() an image out of google drive, once you have the file identifier.
Following the "uc" hint in https://stackoverflow.com/questions/10311092/displaying-files-e-g-images-stored-in-google-drive-on-a-website
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!
8 Commenti
Jordan Reid
il 16 Ott 2020
By downloading the Google Drive desktop app, Google Drive essentially becomes a folder accessible by MatLab and any other applications operating locally on the computer.
Walter Roberson
il 16 Ott 2020
Google Drive Desktop App was taken out of service several years ago. Now there is just Google Backup and Sync.
Più risposte (2)
Image Analyst
il 19 Dic 2018
See my attached email sending demo.
7 Commenti
Mei Sing Wang
il 3 Apr 2020
Hi there.. I have same issue as well, may I know did you found your solution?
Richard Zapor
il 17 Giu 2023
Two changes are required to download from a google drive.
1) Set the privilege to Anyone with the link for the file using the triple dots
2) Given a filename of below format: tweak- file/d to uc?export=download&id= while removing /view?usp=sharing
if resourcekey=RESOURCE_KEY exists then also include at the end per Overleaf
Works for urlwrite and imread
urlwrite('https://drive.google.com/uc?export=download&id=1v3GsGgP3p905wzdvUqypL_-djYmxiyzK','2.png');
img=imread('https://drive.google.com/uc?export=download&id=1v3GsGgP3p905wzdvUqypL_-djYmxiyzK','png')
img2=imread('https://drive.google.com/uc?export=download&id=1v3GsGgP3p905wzdvUqypL_-djYmxiyzK');
solution credit to https://www.overleaf.com/learn/how-to/How_can_I_upload_files_from_Google_Drive%3F
0 Commenti
Vedere anche
Categorie
Scopri di più su Downloads in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!