www.gusucode.com > visionhdl工具箱matlab源码程序 > visionhdl/visionhdl/+visionhdl/en/GrayscaleDilation.m

    classdef GrayscaleDilation< visionhdl.internal.abstractLineMemoryKernel & matlab.system.mixin.Propagates & matlab.system.mixin.CustomIcon & matlab.system.mixin.Nondirect
%GrayscaleDilation Performs morphological dilation on a grayscale image.
%  morphDilate = visionhdl.GrayscaleDilation returns a System object, 
%  morphDilate, that performs morphological dilation of an input 
%  stream based on the input control signals.
%
%  morphDialite = visionhdl.GrayscaleDilation('PropertyName',PropertyValue,...)
%  returns a dilation System object, morphDialite, with each specified
%  property set to the specified value.
%
%  morphDialite = visionhdl.GrayscaleDilation(Nhood,'PropertyName',PropertyValue,...) 
%  returns a dilation System object, morphDialite, with the 
%  Neighborhood property set to Nhood, other specified properties set 
%  to the specified values.
%
%  Step method syntax: 
%  [pixOut,ctrlOut] = step(morphDilate,pixIn,ctrlIn) performs 
%  morphological dilation. ctrlIn and ctrlOut are structures consisting 
%  of five control signals. See also <a href="matlab:doc visionhdl.FrameToPixels">visionhdl.FrameToPixels</a> or 
%  <a href="matlab:doc pixelcontrolstruct">pixelcontrolstruct</a>.
%
%  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.
%
%  Grayscale Dilation methods:
%
%   step     - See above description for use of this method
%   release  - Allow property value and input characteristics changes
%   clone    - Create median filter object with same property values
%   isLocked - Locked status (logical)
%
%  Grayscale Dilation properties:
%
%   Neighborhood      - Neighborhood values
%   LineBufferSize    - Line buffer size
%
% % EXAMPLE:
% % Perform morphological dilation on an image.
% frm2pix = visionhdl.FrameToPixels(...
%     'VideoFormat','custom',...
%     'ActivePixelsPerLine',32,...
%     'ActiveVideoLines',18,...
%     'TotalPixelsPerLine',42,...
%     'TotalVideoLines',28,...
%     'StartingActiveLine',6,...
%     'FrontPorch',5);
% [actPixPerLine,actLine,numPixPerFrm] = getparamfromfrm2pix(frm2pix);
%
% pix2frm = visionhdl.PixelsToFrame(...
%     'VideoFormat','custom',...
%     'ActivePixelsPerLine',actPixPerLine,...
%     'ActiveVideoLines',actLine);
%
% morphDilate = visionhdl.GrayscaleDilation;
%
% frmFull = imread('peppers.png');
% frmIn = imresize(rgb2gray(frmFull),[actLine actPixPerLine]);
% imshow(frmIn);
%
% pixOutVec = ones(numPixPerFrm,1);
% ctrlOutVec = repmat(pixelcontrolstruct,numPixPerFrm,1);
% 
% [pixInVec,ctrlInVec] = step(frm2pix,frmIn);
% for p = 1:numPixPerFrm
%     [pixOutVec(p),ctrlOutVec(p)] = step(morphDilate,pixInVec(p),ctrlInVec(p));
% end
% [frmOut,frmValid] = step(pix2frm,pixOutVec,ctrlOutVec);
%
% if frmValid
%     figure;
%     imshow(frmOut);
% end
%
%   See also imdilate.

     
    %   Copyright 2015-2016 The MathWorks, Inc.

    methods
        function out=GrayscaleDilation
            %GrayscaleDilation Performs morphological dilation on a grayscale image.
            %  morphDilate = visionhdl.GrayscaleDilation returns a System object, 
            %  morphDilate, that performs morphological dilation of an input 
            %  stream based on the input control signals.
            %
            %  morphDialite = visionhdl.GrayscaleDilation('PropertyName',PropertyValue,...)
            %  returns a dilation System object, morphDialite, with each specified
            %  property set to the specified value.
            %
            %  morphDialite = visionhdl.GrayscaleDilation(Nhood,'PropertyName',PropertyValue,...) 
            %  returns a dilation System object, morphDialite, with the 
            %  Neighborhood property set to Nhood, other specified properties set 
            %  to the specified values.
            %
            %  Step method syntax: 
            %  [pixOut,ctrlOut] = step(morphDilate,pixIn,ctrlIn) performs 
            %  morphological dilation. ctrlIn and ctrlOut are structures consisting 
            %  of five control signals. See also <a href="matlab:doc visionhdl.FrameToPixels">visionhdl.FrameToPixels</a> or 
            %  <a href="matlab:doc pixelcontrolstruct">pixelcontrolstruct</a>.
            %
            %  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.
            %
            %  Grayscale Dilation methods:
            %
            %   step     - See above description for use of this method
            %   release  - Allow property value and input characteristics changes
            %   clone    - Create median filter object with same property values
            %   isLocked - Locked status (logical)
            %
            %  Grayscale Dilation properties:
            %
            %   Neighborhood      - Neighborhood values
            %   LineBufferSize    - Line buffer size
            %
            % % EXAMPLE:
            % % Perform morphological dilation on an image.
            % frm2pix = visionhdl.FrameToPixels(...
            %     'VideoFormat','custom',...
            %     'ActivePixelsPerLine',32,...
            %     'ActiveVideoLines',18,...
            %     'TotalPixelsPerLine',42,...
            %     'TotalVideoLines',28,...
            %     'StartingActiveLine',6,...
            %     'FrontPorch',5);
            % [actPixPerLine,actLine,numPixPerFrm] = getparamfromfrm2pix(frm2pix);
            %
            % pix2frm = visionhdl.PixelsToFrame(...
            %     'VideoFormat','custom',...
            %     'ActivePixelsPerLine',actPixPerLine,...
            %     'ActiveVideoLines',actLine);
            %
            % morphDilate = visionhdl.GrayscaleDilation;
            %
            % frmFull = imread('peppers.png');
            % frmIn = imresize(rgb2gray(frmFull),[actLine actPixPerLine]);
            % imshow(frmIn);
            %
            % pixOutVec = ones(numPixPerFrm,1);
            % ctrlOutVec = repmat(pixelcontrolstruct,numPixPerFrm,1);
            % 
            % [pixInVec,ctrlInVec] = step(frm2pix,frmIn);
            % for p = 1:numPixPerFrm
            %     [pixOutVec(p),ctrlOutVec(p)] = step(morphDilate,pixInVec(p),ctrlInVec(p));
            % end
            % [frmOut,frmValid] = step(pix2frm,pixOutVec,ctrlOutVec);
            %
            % if frmValid
            %     figure;
            %     imshow(frmOut);
            % end
            %
            %   See also imdilate.
        end

        function getExecutionSemanticsImpl(in) %#ok<MANU>
            % works in both classic and synchronous subsystems
        end

        function getHeaderImpl(in) %#ok<MANU>
            %getHeaderImpl   Return header for object display
        end

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

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

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

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

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

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

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

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

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

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

        function outputImpl(in) %#ok<MANU>
            % Call to function handle - see private methods for actual computation...    
        end

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

        function saveObjectImpl(in) %#ok<MANU>
            % Save the public properties
        end

        function setupImpl(in) %#ok<MANU>
            %coder.extrinsic('validatecontrolsignals');
        end

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

        function updateImpl(in) %#ok<MANU>
            % Call to function handle - see private methods for actual computation...    
        end

    end
    methods (Abstract)
    end
    properties
        %LineBufferSize Line buffer size
        %   Specify the maximum number of pixels in a horizontal line as an
        %   positive integer. The default value of this property is 2048.
        LineBufferSize;

        %Neighborhood  Neighborhood 
        Neighborhood;

    end
end