简体   繁体   English

如何在Matlab中使用imhistmatch?

[英]How do I use imhistmatch in Matlab?

I'm trying to implement with the matlab function imhistmatch. 我正在尝试使用matlab函数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' 类型为'uint8'的输入参数的未定义函数方法'imhistmatch'

So What am I suppose to do for solve? 那么我应该怎么做才能解决?

I am not sure about your question. 我不确定你的问题。 Are you trying to implement imhistmatch? 您是否要实施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. 以确保Matlab可以找到您实现的功能。

But maybe you want to use the function imhistmatch provided by the image processing toolbox. 但是也许您想使用图像处理工具箱提供的函数imhistmatch。 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. 您的错误是由于没有正确的函数imhistmatch导致的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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