error using rgb2gray parse input
조회 수: 1 (최근 30일)
이전 댓글 표시
Though i have a rgb image, it shows an error while executing
gray=rgb2gray(image)
this is the image
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/153951/image.jpeg)
댓글 수: 0
채택된 답변
Star Strider
2016년 2월 3일
The problem is probably that you named your image ‘image’. That’s the name of a quite useful core MATLAB function you will likely want to use. (This is called ‘overshadowing’ — in this instance overshadowing the funciton name with your variable name.)
This works:
I = imread('charuleelaa vanilavarasu_1.jpeg');
gray=rgb2gray(I);
figure(1)
imshow(gray)
댓글 수: 0
추가 답변 (1개)
Walter Roberson
2016년 2월 3일
Do not use "image" as the name of a variable.
You do not show your code. Note that you must pass the result of imread to the function, not the file name.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!