how can i read image from my google drive, process it and sent the output to my email address?, image after image, automatically?
46 次查看(过去 30 天)
显示 更早的评论
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 个评论
Rik
2018-12-19
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.
采纳的回答
Walter Roberson
2018-12-23
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 个评论
Jordan Reid
2020-10-16
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
2020-10-16
Google Drive Desktop App was taken out of service several years ago. Now there is just Google Backup and Sync.
更多回答(2 个)
Image Analyst
2018-12-19
See my attached email sending demo.
7 个评论
Mei Sing Wang
2020-4-3
Hi there.. I have same issue as well, may I know did you found your solution?
Richard Zapor
2023-6-17
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 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!