If i change the image except rice.png it shows me the filter 2 error?

조회 수: 2 (최근 30일)
bavani marimuthu
bavani marimuthu 2018년 1월 4일
편집: Guillaume 2018년 1월 4일
str ='Hello'
A = double(str)
I1=mat2gray(A)
J=filter2(fspecial('sobel'),I1);
min_matrix=min(J(:))
max_matrix = max(J(:))
K = mat2gray(J);
min_image = min(K(:))
max_image = max(K(:))
figure
imshow(K)
Am getting an below error and the image pears.png is also not changed into gray scale image.. Please help
  댓글 수: 2
Jan
Jan 2018년 1월 4일
Please post error messages as text, not as screenshot. Thanks.
Guillaume
Guillaume 2018년 1월 4일
편집: Guillaume 2018년 1월 4일
I've formatted your post for you but please use the {}Code button to do this yourself in the future.
What has 'rice.png' or 'pears.png' got to do with any of the code you've posted?
Your code works without error for me (It also doesn't do anything useful but that's another matter entirely). I would suspect that you have some path issues, although I don't understand how matlab could find the fspecial function but not the conv2 function. Which version of matlab are you using?

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Smoothing and Denoising에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by