Reading a single image from a local file on Mac

조회 수: 3 (최근 30일)
Emily Melinis
Emily Melinis 2017년 11월 6일
댓글: Jan 2022년 3월 29일
I'm trying to use the "imread" command to read an image from my desktop but It keeps giving me this error: Error using imread>get_full_filename (line 516) File "pothole.png" does not exist.
Error in imread (line 340) fullname = get_full_filename(filename); I'm new to matlab and just want to know how to read a single image to then use image processing tools on it.

답변 (2개)

Cam Salzberger
Cam Salzberger 2017년 11월 6일
Hello Emily,
MATLAB looks for files on the MATLAB Search Path. If a file is not on there, or in the current directory, then you'll need to provide an appropriate relative or full file path to the file you would like to operate on.
For a Mac, you can probably use something like:
I = imread('~/Desktop/pothole.png');
When dealing with code files, it is pretty standard to put them somewhere on the search path, if they are to be used as utility functions by lots of other code you write. For data files, it is more common to provide the full file path to the file.
-Cam
  댓글 수: 1
Jan
Jan 2019년 8월 1일
[MOVED from flags] Benjamin Richardson wrote:
not helpful
@Benjamin: Please use flags only to inform admins about contents, which conflict with the terms of use, e.g. spam or rudeness. Thanks.

댓글을 달려면 로그인하십시오.


Devyani Rawat
Devyani Rawat 2022년 3월 29일
c=imread('~/Desktop/flowerimg.jpeg');
  댓글 수: 1
Jan
Jan 2022년 3월 29일
What is the difference to the already posted solution:
I = imread('~/Desktop/pothole.png');
?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB Report Generator에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by