回 帖 发 新 帖 刷新版面

主题:matlab 图象处理

各位
matlab中如何让图象求反?
谢谢

回复列表 (共4个回复)

沙发


用灰度图的最大值减去你现在的图象,

看看是不是你想要的结果

板凳

我这里有处理过后的图片,
不知道是不是你想要的结果,如果需要就给我电子邮件,我发给你

3 楼


可以用g=imcomplement(f)或者imadjust,具体请查阅matlab得help

4 楼

IMCOMPLEMENT Complement image.
    IM2 = IMCOMPLEMENT(IM) computes the complement of the image IM.  IM
    can be a binary, intensity, or RGB image.  IM2 has the same class and
    size as IM.
 
    In the complement of a binary image, zeros become ones and ones
    become zeros; black and white are reversed.  In the complement of an
    intensity or RGB image, each pixel value is subtracted from the
    maximum pixel value supported by the class (or 1.0 for
    double-precision images), and the difference is used as the pixel
    value in the output image.  In the output image, dark areas become
    lighter and light areas become darker.
 
    Note
    ----
    If IM is a double intensity or RGB image, you can use the expression
    1-IM instead of this function.  If IM is a binary image, you can use
    the expression ~IM instead of this function.
 
    Example
    -------
        I = imread('bonemarr.tif');
        J = imcomplement(I);
        imshow(I), figure, imshow(J)
 
    See also IMABSDIFF, IMADD, IMDIVIDE, IMLINCOMB, IMMULTIPLY, IMSUBTRACT.

我来回复

您尚未登录,请登录后再回复。点此登录或注册