Undefined function 'immse' for input arguments of type 'uint8'.

im1=imread('stallite1.JPG'); figure subplot(1,3,1),imshow(im1),title('original image') ref=rgb2gray(im1); subplot(1,3,2),imshow(ref),title('gray image')
N = imnoise(ref,'salt & pepper', 0.02); subplot(1,3,3),imshow(N),title('noise image') error = immse(N, ref); fprintf('\n The mean-squared error is %0.4f\n', error)

2 件のコメント

KALYAN ACHARJYA
KALYAN ACHARJYA 2018 年 4 月 24 日
Which version Matlab you use?
raghda aljaff
raghda aljaff 2018 年 4 月 24 日
R2013a

サインインしてコメントする。

 採用された回答

Guillaume
Guillaume 2018 年 4 月 24 日

1 投票

immse was introduced in version R2014b and requires the image processing toolbox. If you're on an earlier version or don't have the image processing toolbox, you'll get the error you see.
Since imnoise does not error we can conclude that you're using a version before R2014b.

4 件のコメント

raghda aljaff
raghda aljaff 2018 年 4 月 24 日
R2013a what i suppose to do i need it in my project? how i install image processing tool box?
Guillaume
Guillaume 2018 年 4 月 24 日

You have the image processing toolbox installed already since imnoise works.

If you do need that function, then your only options are to upgrade matlab to at least R2014b or write the code for the function yourself.

raghda aljaff
raghda aljaff 2018 年 4 月 24 日
The upgrade the matlab to R2014b is free or i should pay for that? thanks
Guillaume
Guillaume 2018 年 4 月 24 日

If you're on a software maintenance service then the upgrade (to any version) is free. Otherwise, yes you will have to pay. You're better off contacting mathworks directly with your license number. They'll be able to tell you directly if it's free and if not, how much.

サインインしてコメントする。

その他の回答 (1 件)

raghda aljaff
raghda aljaff 2018 年 4 月 25 日

0 投票

I used the code above exactly and I convert the image 2 double but unfortunately is still the error message (undefined function ‘immse’ for input arguments of type ‘uint8’ ,thanks for help me

カテゴリ

ヘルプ センター および File ExchangeIntroduction to Installation and Licensing についてさらに検索

製品

リリース

R2013a

タグ

質問済み:

2018 年 4 月 24 日

回答済み:

2018 年 4 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by