📄 houghiris.h
字号:
//
// Routines for iris detection using hough transform.
// FindPupilL:
// Find the pupil, which is a dark circular region bordered by a lighter region near the center
// of the image.
// FindScleraL:
// Find the sclera boundary, which is a light circular region surrounding a darker region, centered on the
// given pupil center.
//
// 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 HoughIris_h
#define HoughIris_h
#include "Image.h"
#include "PipelineStage.h"
#include <e32cons.h>
namespace Algorithm
{
class CHoughIris: public CBase
{
// Lifecycle
public:
IMPORT_C static CHoughIris* NewL();
~CHoughIris(void);
private:
CHoughIris();
// Operations
public:
// FindPupilL
// Find the pupil, which is a dark circular region bordered by a lighter region near the center
// of the image.
// Parameters:
// In:
// pImage = color input image. Converted to gray before other processing
// nReduce = image reduction factor (horizontal & vertical) before other processing
// nStretchLow = image grayvalues are stretched and all values > than this are set to 255
// nSmooth = kernel width and height for smoothing applied to image before edge detection
// nThreshLow, nThreshHi = thresholds for hysterisis edge detection
// nRadiusMin, nRadiusMax = minimum and maximum radii of pupil
// Out:
// returned value is true if it appears iris was detected, false otherwise
// cx, cy = pupil center
// r = pupil radius
//
IMPORT_C bool FindPupilL(int& cx, int& cy, int& r, Core::CImage pImage,
int nReduce = 4, int nStretchLow = 64, int nSmooth = 7, int nThreshLow = 200, int nThreshHi = 250,
int nRadiusMin = 7, int nRadiusMax = 15);
// FindScleraL
// Find the sclera boundary, which is a light circular region surrounding a darker region, centered on the
// given pupil center.
// Parameters:
// In:
// cx, cy - the pupil center
// pImage = color input image. Converted to gray before other processing
// nReduce = image reduction factor (horizontal & vertical) before other processing
// nStretchHi = image grayvalues are stretched and all values < than this are set to 0
// nSmooth = kernel width and height for smoothing applied to image before edge detection
// nThreshLow, nThreshHi = thresholds for hysterisis edge detection
// nRadiusMin, nRadiusMax = minimum and maximum radii of sclera
// Out:
// returned value is true if it appears sclera was detected, false otherwise
// r = sclera radius
//
IMPORT_C bool FindScleraL(int cx, int cy, int& r, Core::CImage pImage,
int nReduce = 4, int nStretchHi = 192, int nSmooth = 7, int nThreshLow = 200, int nThreshHi = 250,
int nRadiusMin = 20, int nRadiusMax = 200);
private:
// Create a histogram that stretches all the low values (up to nStretchLow) up, and assigns all
// higher values the value 255. This is used with edge detection to detect an edge between a dark
// region and the rest of the image.
void HistStretchLow(float* pHist, int nStretchLow);
// Create a histogram that stretches the high values (down to nStretchHi) down, and assigns all
// lower values the value 0.
void HistStretchHi(float* pHist, int nStretchHi);
};
};
#endif // HoughIris_h
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -