gusucode.com > vision工具箱matlab源码程序 > vision/+vision/en/ImageDataTypeConverter.m

    classdef ImageDataTypeConverter< matlab.system.SFunSystem
%ImageDataTypeConverter Convert and scale input image to specified output data type
%   -----------------------------------------------------------------------
%   The vision.ImageDataTypeConverter will be removed in a future release. 
%   Use the im2uint8, im2double, im2single, im2int16, or im2uint16
%   function with equivalent functionality instead.
%   -----------------------------------------------------------------------
%
%   HIDTYPECONV = vision.ImageDataTypeConverter returns a System
%   object, HIDTYPECONV, that converts and scales input image to specified
%   output data type. When converting between floating-point data types,
%   the object casts the input into the output data type and clips values
%   outside the range to 0 or 1. When converting between all other data
%   types, the object casts the input into the output data type and scales
%   the data type values into the dynamic range of the output data type.
%   For double- and single-precision floating-point data types, the dynamic
%   range is between 0 and 1. For fixed-point data types, the dynamic range
%   is between the minimum and maximum values that can be represented by
%   the data type.
%
%   HIDTYPECONV = vision.ImageDataTypeConverter('PropertyName',
%   PropertyValue, ...) returns an image data type conversion object,
%   HIDTYPECONV, with each specified property set to the specified value.
%
%   Step method syntax:
%
%   Y = step(HIDTYPECONV, X) converts the input image X to Y. The data type
%   of Y is specified by the OutputDataType property.
%
%   System objects may be called directly like a function instead of using
%   the step method. For example, y = step(obj, x) and y = obj(x) are
%   equivalent.
%
%   ImageDataTypeConverter methods:
%
%   step     - See above description for use of this method
%   release  - Allow property value and input characteristics changes
%   clone    - Create image data type conversion object with same property
%              values
%   isLocked - Locked status (logical)
%
%   ImageDataTypeConverter properties:
%
%   OutputDataType - Data type of output
%
%   This System object supports fixed-point operations. For more
%   information, type vision.ImageDataTypeConverter.helpFixedPoint.
%
%   % EXAMPLE: Convert the image datatype from uint8 to single.
%       x = imread('pout.tif');
%       hidtypeconv = vision.ImageDataTypeConverter;
%       y = step(hidtypeconv, x);
%       imshow(y);
%       whos y % Image has been converted from uint8 to single.
%
%   See also im2uint8, im2double, im2single, im2uint16, im2int16.

 
%   Copyright 2008-2016 The MathWorks, Inc.

    methods
        function out=ImageDataTypeConverter
            %ImageDataTypeConverter Convert and scale input image to specified output data type
            %   -----------------------------------------------------------------------
            %   The vision.ImageDataTypeConverter will be removed in a future release. 
            %   Use the im2uint8, im2double, im2single, im2int16, or im2uint16
            %   function with equivalent functionality instead.
            %   -----------------------------------------------------------------------
            %
            %   HIDTYPECONV = vision.ImageDataTypeConverter returns a System
            %   object, HIDTYPECONV, that converts and scales input image to specified
            %   output data type. When converting between floating-point data types,
            %   the object casts the input into the output data type and clips values
            %   outside the range to 0 or 1. When converting between all other data
            %   types, the object casts the input into the output data type and scales
            %   the data type values into the dynamic range of the output data type.
            %   For double- and single-precision floating-point data types, the dynamic
            %   range is between 0 and 1. For fixed-point data types, the dynamic range
            %   is between the minimum and maximum values that can be represented by
            %   the data type.
            %
            %   HIDTYPECONV = vision.ImageDataTypeConverter('PropertyName',
            %   PropertyValue, ...) returns an image data type conversion object,
            %   HIDTYPECONV, with each specified property set to the specified value.
            %
            %   Step method syntax:
            %
            %   Y = step(HIDTYPECONV, X) converts the input image X to Y. The data type
            %   of Y is specified by the OutputDataType property.
            %
            %   System objects may be called directly like a function instead of using
            %   the step method. For example, y = step(obj, x) and y = obj(x) are
            %   equivalent.
            %
            %   ImageDataTypeConverter methods:
            %
            %   step     - See above description for use of this method
            %   release  - Allow property value and input characteristics changes
            %   clone    - Create image data type conversion object with same property
            %              values
            %   isLocked - Locked status (logical)
            %
            %   ImageDataTypeConverter properties:
            %
            %   OutputDataType - Data type of output
            %
            %   This System object supports fixed-point operations. For more
            %   information, type vision.ImageDataTypeConverter.helpFixedPoint.
            %
            %   % EXAMPLE: Convert the image datatype from uint8 to single.
            %       x = imread('pout.tif');
            %       hidtypeconv = vision.ImageDataTypeConverter;
            %       y = step(hidtypeconv, x);
            %       imshow(y);
            %       whos y % Image has been converted from uint8 to single.
            %
            %   See also im2uint8, im2double, im2single, im2uint16, im2int16.
        end

        function helpFixedPoint(in) %#ok<MANU>
            %helpFixedPoint Display vision.ImageDataTypeConverter System object
            %               fixed-point information
            %   vision.ImageDataTypeConverter.helpFixedPoint displays information
            %   about fixed-point properties and operations of the
            %   vision.ImageDataTypeConverter System object.
        end

        function isInactivePropertyImpl(in) %#ok<MANU>
        end

        function setPortDataTypeConnections(in) %#ok<MANU>
        end

    end
    methods (Abstract)
    end
    properties
        %CustomOutputDataType Output word and fraction lengths 
        %   Specify the output fixed-point type as a signed or unsigned scaled
        %   numerictype object. This property is applicable when the
        %   OutputDataType property is 'Custom'. The default value of this
        %   property is numerictype(true,16,0).
        %
        %   See also numerictype.
        CustomOutputDataType;

        %OutputDataType Data type of output
        %   Specify the data type of the output signal as one of ['double' |
        %   {'single'} | 'int8' | 'uint8' | 'int16' | 'uint16' | 'logical' |
        %   'Custom'].
        OutputDataType;

    end
end