starsclera.h

来自「barcode readers [ from Image]」· C头文件 代码 · 共 96 行

H
96
字号
//
// CStarSclera -- find the sclera boundary given a point on its interior by searching
//               outwards in radial lines.
//
// Copyright (C) 2003, 2006 by Jon A. Webb (Contact via GMail; username is jonawebb)
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// 
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
//
//

#ifndef StarSclera_h
#define StarSclera_h

#include "Image.h"
#include "PipelineStage.h"

#include <e32cons.h>

namespace Algorithm
{

	class CStarSclera : public CBase
    {
        // Lifecycle
    public:
        // NewL
        //   nLines: number of radial lines
        //   nStart: distance from interior point to start searching
        //   nEnd: distance from interior point to stop searching
        //   nWidth: width of filter to use
        //   nThresh: lower grayvalue bound for a pixel to be considered in the iris
        IMPORT_C static CStarSclera* NewL(int nLines, int nStart, int nEnd, int nWidth, int nThresh);
        ~CStarSclera(void);
    private:
        CStarSclera(int nLines, int nStart, int nEnd, int nWidth, int nThresh);
        void ConstructL();

        // Operations
    public:
        // FindSclera
		//     Given an image, finds a vector of points that might lie on the iris-sclera
		//     boundary by searching along radial lines extending from a given point.
		//     The boundary is detected by comparing the average pixel value computed
		//     along the line to the minimum value along the line; where the minimum
		//     is sufficiently greater than the average, the edge is assumed to be found.
        //   Input:
        //     pImage: the image.
        //     ptInt: the point somewhere in the interior of the sclera
        //   Output:
        //     pBoundary: vector of points on sclera boundary. Dimension = nLines, above.
		//        A coordinate of (-1,-1) indicates a line that did not have a point on the
		//        sclera boundary.
        IMPORT_C void FindScleraL(Core::CImage pImage, TPoint ptInt, TPoint* pBoundary);

    private:
        // Attributes
		// Number of lines
        int iLines;
		// Distance along line to start searching
        int iStart;
		// Distance along line to stop searching
        int iEnd;
		// Width of filter (along line) to use in search
        int iWidth;
		// Lower grayvalue bound for a pixel to be considered in the iris
        int iThresh;
		// This is a two-dimensional array that holds the relative x,y coordinates
		// for each of the lines. The first dimension is the number of lines (iLines);
		// the second dimension is the number of points in the lines (iEnd-iStart)
        TPoint** iCoords;
		// This is the list of coordinates of points that are on the sclera boundary.
		// There is one point for each line. A coordinate of (-1,-1) indicates no point
		// along that line appeared to be on the sclera boundary.
        TPoint* iAllCoords;
		// Vector of minimum of RGB values along the line
        int* iMin;
		// Vector of average of RGB values along the line
        int* iAvg;
    };

};

#endif // StarSclera_h

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?