简体   繁体   中英

How do I use imhistmatch in Matlab?

I'm trying to implement with the matlab function imhistmatch. So I use following commends.

A= imread('example1.jpg')
B= imread('example2.jpg')
C= imhistmatch(A,B)

But there is problem like this. ?? Undefined functionor method 'imhistmatch' for input arguments of type 'uint8'

So What am I suppose to do for solve?

I am not sure about your question. Are you trying to implement imhistmatch? Then probably your function is in the wrong folder or you have a typo in the functions name. use

addpath('Pathto/imhistmatch')

to ensure that matlab can find your implemented function.

But maybe you want to use the function imhistmatch provided by the image processing toolbox. Then, I guess you don't have the image processing toolbox. Try

ver

and check the output. You should find these lines:

MATLAB                                                Version X.X        (XXXXX)
Image Processing Toolbox                              Version X.X        (XXXXX)

If not, then you may want to buy the image processing toolbox, get a evaluation version or maybe try octave.

On my computer the following works:

imhistmatch(ones(10),ones(10))
imhistmatch(ones(10,'uint8'),ones(10,'uint8'))

but when I type

imhistmatch(ones(10,'int8'),ones(10,'int8'))

I get an error:

Error using imhistmatch
Expected input number 1, A, to be one of these types:

uint8, uint16, double, int16, single

Instead its type was int8.
...

So, if it would be a type problem you would see another error.

Your error is the result of not having the proper function imhistmatch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM