0% found this document useful (0 votes)
1 views

assignment 3

This report presents a methodology for iris and pupil detection in eye images using a combination of image preprocessing, Hough Circle Transform, and contour detection. The proposed approach enhances detection stability under varying lighting conditions and includes a fallback mechanism for improved reliability. Future improvements suggest integrating deep learning techniques and dynamic parameter tuning for better accuracy in detection.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

assignment 3

This report presents a methodology for iris and pupil detection in eye images using a combination of image preprocessing, Hough Circle Transform, and contour detection. The proposed approach enhances detection stability under varying lighting conditions and includes a fallback mechanism for improved reliability. Future improvements suggest integrating deep learning techniques and dynamic parameter tuning for better accuracy in detection.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

Report on Iris and Pupil Detection Methodology

Name: HOSSAIN MD ZAKIR


Student ID: M24W0495
Introduction
In this report, a firm method has been developed for identifying the iris and pupil in eye images.
In the current work, the image preprocessing, Hough Circle Transform, and contour Falcons are
integrated as a proposed approach to segment the iris and pupil of the human eyes. This double-
stage approach confirms the stability of both the light sensitivity and the image quality under
different lighting conditions.

Methodology
1. Preprocessing
Preprocessing is an important process since the quality of suitable features is important for a
good detection. The applying of the following steps was performed to improve the image and
ready it for circle and contour identification:
• Grayscale Conversion:
Takes the RGB picture and transform it to the single channel grayscale picture because
the complexity of the algorithms is less.
• Histogram Equalization:
Enhances contrast, by equalizing the pixel intensities, in order that noticeable edge of iris
and pupil may be observed.
• Gaussian Blurring:
Removes some noise and, therefore, smoothes the image to minimize probable artefacts
in subsequent phases.
• Edge Detection (Canny):
This determines high/low intensity changes, which coincide with circle margin
indications.
• Adaptive Thresholding:
Divides dynamic pupil and iris regions intelligently by converting the image to the binary
form in order to enhance the features under diversified illumination conditions.

2. Circle Detection
For circular feature detections in the image, the Hough Circle Transform was used. I call the first
circle a pupil, the last circle an iris, and the center of the last circle is in line with the center of the
first circle.
• Hough Circle Parameters:
o dp: Resolution of the accumulator array (set to 1.2 for a balance between
precision and computation time).
o minDist: Minimum distance between detected circle centers.
o param1: Canny edge detection high threshold.
o param2: Accumulator threshold for confirming a circle.
o minRadius & maxRadius: Range for expected circle sizes.
• Alignment Check:
To ensure the detected iris is accurate, its center must align with the detected pupil.

3. Fallback Contour-Based Detection


In cases where the Hough Circle Transform fails to detect the iris:
• Contour Detection:
o Extracts all external contours using the thresholded image.
o The largest contour is assumed to represent the iris.
• Circle Approximation:
o A minimum enclosing circle is fitted around the largest contour to estimate the iris
boundary.

Visualization Steps
To provide insights into the detection process, intermediate results are visualized:
1. Original Image: Displays the input image for reference.
2. Equalized Grayscale: Highlights the enhanced contrast.
3. Adaptive Thresholding: Segments regions of interest (pupil and iris).
4. Gaussian Blurring: Reduces noise and smoothens edges.
5. Edge Detection: Highlights boundaries for circle detection.
6. Final Detection: Overlays detected circles (pupil and iris) on the original image.
Advantages of the Method
1. Robust Preprocessing:
Adaptive thresholding and Histogram Equalization guarantee safer segmentation
irrespective of prevailing conditions.
2. Multi-Step Detection:
HCT combined with contour-based fallback has been implemented, making this
interesting method more immune to abnormal inputs.
3. Efficient Parameters:
Optimizing circle detecting parameters allows to reduce number of false positives and
properly overlay features.
4. Fallback Mechanism:
Contour-based detection guarantees the reliability of the detection in cases when the
circle-shaped objects are not well outlined.

Limitations
• Lighting Sensitivity:
Even in cases where the lighting is taken at opposite extremes circle detection can still
present a concern.
• Contour Approximation:
Finding a best fit circle to contours may not accurately model as shapes of irises are not
well defined rectangular.

Future Improvements
1. Deep Learning Integration:
Employ CNNs to enhance its feature extractor as well as use it for better segmentation as
well.
2. Dynamic Parameter Tuning:
Self adaptively tunes detectors according to the images characteristics.
3. Multi-Modal Analysis:
In order to get much more accuracy visible and infrared imaging should be combine or
used simultaneously.
All contents copyright (C) kcg.edu.
All contents copyright (C) kcg.edu.
1. OpenCV.
2. Basic concepts in OpenCV.
3. Examples of car plate detection.

All contents copyright (C) kcg.edu.


• A library aimed at real-time computer
vision.
• Cross-platform.
• Free.

• In most cases, you can use it freely without any concerns.

All contents copyright (C) kcg.edu.


• OpenCV generally only includes mature algorithms.
• It is hard to find the newest methods in OpenCV.
• An object detection method called YOLOwas published in 2015, then
included in 2018.
• Machine-learning-based methods are limited.

• It is easy for building a prototype.


• To make your program perfect, you need to understand the
algorithms.

All contents copyright (C) kcg.edu.


• Operation System: Windows, Linux, Android, MacOS, FreeBSD,
OpenBSD, Maemo, and iOS.
• Acceleration: CUDA, OpenCL
• Programming Languages: Python, Java, C, and C++.

• You can write OpenCV code, then run it anywhere.

All contents copyright (C) kcg.edu.


From https://opencv.org/license/:
• OpenCV 4.5.0 and higher versions are licensed under the Apache 2
License.
• OpenCV 4.4.0 and lower versions, including OpenCV 3.x, OpenCV 2.x,
and OpenCV 1.x, are licensed under the 3-clause BSDlicense.

All contents copyright (C) kcg.edu.


• The license is very important if you use it for commercial
purposes.
• A license will regulate your behavior.

• The 3-clause BSDlicense just asks you to include the license.


• https://github.com/opencv/opencv/blob/4.4.0/LICENSE
• The Apache 2 license is a better solution to the patent issue.
• https://github.com/opencv/opencv/blob/master/LICENSE

All contents copyright (C) kcg.edu.


OpenCV

Company A Company B

What if I have applied for a patent?

All contents copyright (C) kcg.edu.


• When using open source code for commercial purposes, be aware of
the issue of licenses.
• However, generally speaking, the open source community is more
vulnerable.

• Checking whether you are using their code is not a simple matter.
• A commercial software is usually closed source software.

All contents copyright (C) kcg.edu.


• What is an image in OpenCV?
• For an RGBimage, it is an HxWx3 array.
• In a computer, the essence of an image is a matrix that stores
pixel information.

• We can use matrix computation to manipulate the image.

All contents copyright (C) kcg.edu.


All contents copyright (C) kcg.edu.
All contents copyright (C) kcg.edu.
All contents copyright (C) kcg.edu.
• Those transformations can be included in the Affine
Transformation.
• https://en.wikipedia.org/wiki/Affine_transformation
• We can use matrix multiplication to compute the position after the
transformation.

All contents copyright (C) kcg.edu.


• Different ways to model the color.
• In OpenCV, we can convert the color
spaces easily.

• The performance varies according to the


color space you used.

https://en.wikipedia.org/wiki/Color
_space#/media/File:CIE1931xy_ga
mut_comparison.svg

All contents copyright (C) kcg.edu.


• Convolution kernel

10 5 3 0 0 0

4 5 1 0 0.5 0 7

1 1 7 0 1 0.5

All contents copyright (C) kcg.edu.


• Gauss Filter

1 2 1

1/16 2 4 2

1 2 1

All contents copyright (C) kcg.edu.


1 0 -1 1 2 1
• Sobel
2 0 -2 0 0 0
Gx Gy
1 0 -1 -1 -2 -1

All contents copyright (C) kcg.edu.


• See the examples!
• We can use those filters to do edge detection.

All contents copyright (C) kcg.edu.


• See the examples!

All contents copyright (C) kcg.edu.


All contents copyright (C) kcg.edu.
Assignment CV
Iris segmentation
Assignment
• # Learn hough transformation
https://docs.opencv.org/3.4/d4/d70/tutorial_hough_circle.html.
• # Use hough transformation to detect the iris for the following
eye image.

You need to include


1. The code for iris detection by hough transformation.
2. A report about the detail of your method.
Hints
1. I have provided an example for pupil detection.
2. Extend this method to detect the iris part.
Pupil

Iris

Draw the orange circle.


Pupil

Iris

Assume that they share


the same center.
Pupil

Iris

Try every possible


diameters.
Pupil

Iris

When you are enlarging the


diameter, accumulate the color.
What will happen?
Reference
• https://paperswithcode.com/task/iris-segmentation
• https://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm
• https://docs.opencv.org/3.4/d4/d70/tutorial_hough_circle.html

You might also like