├── .gitignore ├── ABOUT-THIS-FORK.md ├── Build ├── CONTRIBUTING.md ├── COPYING ├── LICENSE.md ├── LibAFIS.sln ├── Makefile.am ├── README.md ├── Sources ├── .gitignore ├── Extraction │ ├── .gitignore │ ├── Binarisaion │ │ └── readme.md │ ├── Detection │ │ └── readme.md │ ├── Enhancement │ │ └── readme.md │ ├── Extract.c │ ├── Extract.h │ ├── Filters │ │ ├── .gitignore │ │ ├── AbsoluteContrast.c │ │ ├── AbsoluteContrast.h │ │ ├── ClippedContrast.c │ │ ├── ClippedContrast.h │ │ ├── CrossRemover.c │ │ ├── CrossRemover.h │ │ ├── Equalizer.c │ │ ├── Equalizer.h │ │ ├── HillOrientation.c │ │ ├── HillOrientation.h │ │ ├── ImageInverter.c │ │ ├── ImageInverter.h │ │ ├── InnerMask.c │ │ ├── InnerMask.h │ │ ├── LinesByOrientation.c │ │ ├── LinesByOrientation.h │ │ ├── LocalHistogram.c │ │ ├── LocalHistogram.h │ │ ├── Makefile.am │ │ ├── OrientedSmoother.c │ │ ├── OrientedSmoother.h │ │ ├── RelativeContrast.c │ │ ├── RelativeContrast.h │ │ ├── SOURCES │ │ ├── SegmentationMask.c │ │ ├── SegmentationMask.h │ │ ├── Thinner.c │ │ ├── Thinner.h │ │ ├── ThresholdBinarizer.c │ │ ├── ThresholdBinarizer.h │ │ ├── VotingFilter.c │ │ ├── VotingFilter.h │ │ └── readme.md │ ├── Makefile.am │ ├── MinutiaeDetection │ │ ├── .gitignore │ │ ├── Makefile.am │ │ ├── MinutiaeDetection.c │ │ ├── MinutiaeDetection.h │ │ └── SOURCES │ ├── Model │ │ ├── .gitignore │ │ ├── DotRemover.c │ │ ├── DotRemover.h │ │ ├── Makefile.am │ │ ├── Minutia.c │ │ ├── Minutia.h │ │ ├── Ridge.c │ │ ├── Ridge.h │ │ ├── SOURCES │ │ ├── SkeletonBuilder.c │ │ └── SkeletonBuilder.h │ ├── Orientation │ │ └── readme.md │ ├── Ridge Tracing │ │ └── readme.md │ ├── SOURCES │ └── Segmentation │ │ └── readme.md ├── General │ ├── .gitignore │ ├── Angle.c │ ├── Angle.h │ ├── Array.c │ ├── Array.h │ ├── BinaryMap.c │ ├── BinaryMap.h │ ├── BlockMap.c │ ├── BlockMap.h │ ├── Calc.c │ ├── Calc.h │ ├── List.c │ ├── List.h │ ├── Makefile.am │ ├── Neighborhood.h │ ├── Point.c │ ├── Point.h │ ├── PointF.c │ ├── PointF.h │ ├── PolarPoint.c │ ├── PolarPoint.h │ ├── Range.c │ ├── Range.h │ ├── RectangleC.c │ ├── RectangleC.h │ ├── SOURCES │ ├── Size.c │ ├── Size.h │ ├── SizeF.c │ ├── SizeF.h │ ├── pgm.c │ └── pgm.h ├── LibAFIS.vcxproj ├── LibAFIS.vcxproj.filters ├── Makefile.am ├── Matcher │ ├── .gitignore │ ├── BestMatchSkipper.c │ ├── BestMatchSkipper.h │ ├── Makefile.am │ ├── Minutia │ │ ├── .gitignore │ │ ├── EdgeLocation.h │ │ ├── EdgeShape.h │ │ ├── IndexedEdge.h │ │ ├── Makefile.am │ │ ├── MinutiaPair.h │ │ ├── NeighbourEdge.h │ │ ├── PairInfo.c │ │ ├── PairInfo.h │ │ └── SOURCES │ ├── SOURCES │ └── readme.md ├── Tests │ ├── .gitignore │ ├── DataStructures │ │ ├── .gitignore │ │ ├── Makefile.am │ │ ├── SOURCES │ │ ├── TestRunner_DataStructures.c │ │ └── Test_DataStructures.c │ ├── Extraction │ │ ├── .gitignore │ │ ├── Filters │ │ │ ├── .gitignore │ │ │ ├── Makefile.am │ │ │ ├── SOURCES │ │ │ ├── Test_HillOrientation.c │ │ │ ├── Test_LinesByOrientation.c │ │ │ ├── Test_LocalHistogram.c │ │ │ ├── Test_OrientedSmoother.c │ │ │ ├── Test_Thinner.c │ │ │ ├── Test_VotingFilter.c │ │ │ └── runners │ │ │ │ ├── .gitignore │ │ │ │ ├── Makefile.am │ │ │ │ ├── SOURCES │ │ │ │ ├── TestRunner_HillOrientation.c │ │ │ │ ├── TestRunner_LinesByOrientation.c │ │ │ │ ├── TestRunner_LocalHistogram.c │ │ │ │ ├── TestRunner_OrientedSmoother.c │ │ │ │ ├── TestRunner_Thinner.c │ │ │ │ └── TestRunner_VotingFilter.c │ │ ├── Makefile.am │ │ ├── Model │ │ │ ├── .gitignore │ │ │ ├── Makefile.am │ │ │ ├── SOURCES │ │ │ ├── Test_DotRemover.c │ │ │ └── runners │ │ │ │ ├── .gitignore │ │ │ │ ├── Makefile.am │ │ │ │ ├── SOURCES │ │ │ │ └── TestRunner_DotRemover.c │ │ └── SOURCES │ ├── General │ │ ├── .gitignore │ │ ├── Makefile.am │ │ ├── SOURCES │ │ ├── Test_Array.c │ │ ├── Test_BinaryMap.c │ │ ├── Test_Calc.c │ │ ├── Test_Equalizer.c │ │ ├── Test_MinutiaeDetection.c │ │ ├── Test_Pgm.c │ │ ├── Test_Point.c │ │ └── runners │ │ │ ├── .gitignore │ │ │ ├── Makefile.am │ │ │ ├── SOURCES │ │ │ ├── TestRunner_Array.c │ │ │ ├── TestRunner_BinaryMap.c │ │ │ ├── TestRunner_Calc.c │ │ │ ├── TestRunner_Equalizer.c │ │ │ ├── TestRunner_MinutiaeDetection.c │ │ │ ├── TestRunner_Pgm.c │ │ │ └── TestRunner_Point.c │ ├── Makefile.am │ ├── Matcher │ │ ├── .gitignore │ │ ├── Makefile.am │ │ ├── SOURCES │ │ ├── Test_BestMatchSkipper.c │ │ └── runners │ │ │ ├── .gitignore │ │ │ ├── Makefile.am │ │ │ ├── SOURCES │ │ │ └── TestRunner_BestMatchSkipper.c │ ├── SOURCES │ ├── all_tests.c │ └── extract.c ├── Utils │ ├── .gitignore │ ├── IO │ │ ├── .gitignore │ │ ├── ArrayIO.c │ │ ├── ArrayIO.h │ │ ├── BinaryMapIO.c │ │ ├── BinaryMapIO.h │ │ ├── BlockMapIO.c │ │ ├── BlockMapIO.h │ │ ├── HistogramIO.c │ │ ├── HistogramIO.h │ │ ├── ImageIO.c │ │ ├── ImageIO.h │ │ ├── Makefile.am │ │ ├── SOURCES │ │ ├── SimpleDataTypesIO.c │ │ └── SimpleDataTypesIO.h │ ├── Makefile.am │ ├── Misc │ │ ├── .gitignore │ │ ├── Makefile.am │ │ ├── SOURCES │ │ └── binarise.c │ ├── SOURCES │ └── Unity │ │ ├── .gitignore │ │ ├── Makefile.am │ │ ├── SOURCES │ │ ├── unity.c │ │ ├── unity.h │ │ ├── unity_fixture.c │ │ ├── unity_fixture.h │ │ ├── unity_fixture_internals.h │ │ ├── unity_fixture_malloc_overrides.h │ │ └── unity_internals.h └── no-makefile ├── TestData ├── DataStructures │ ├── 101_1.tif.12.Equalize.2DFloatArray.dat │ ├── 101_1.tif.12.Equalize.blocks.dat │ ├── 101_1.tif.12.Equalize.histgram.dat │ ├── 101_1.tif.12.Equalize.image.dat │ ├── 101_1.tif.15.LinesByOrientation.StepFactor.dat │ ├── 101_1.tif.15.LinesByOrientation.result.dat │ ├── 101_1.tif.17.LinesByOrientation.result.dat │ ├── 101_1.tif.4.ClippedContrast.result.dat │ └── 101_1.tif.5.AbsoluteContrast.Limit.dat ├── Extraction │ └── Filters │ │ └── VotingFilter │ │ ├── n001_d1_exp.dat │ │ ├── n001_d1_in.dat │ │ ├── n003_d1_exp.dat │ │ ├── n003_d1_in.dat │ │ ├── n006_d1_exp.dat │ │ ├── n006_d1_in.dat │ │ ├── n007_d1_exp.dat │ │ ├── n007_d1_in.dat │ │ ├── n013_d1_exp.dat │ │ └── n013_d1_in.dat ├── FilterData │ ├── AbsoluteContrast │ │ ├── 101_1.tif.5.AbsoluteContrast.Limit.dat │ │ ├── 101_1.tif.5.AbsoluteContrast.contrast.dat │ │ └── 101_1.tif.5.AbsoluteContrast.result.dat │ ├── Binarize │ │ ├── 101_1.tif.18.Binarize.baseline.dat │ │ ├── 101_1.tif.18.Binarize.input.dat │ │ └── 101_1.tif.18.Binarize.result.dat │ ├── ClippedContrast │ │ ├── 101_1.tif.4.ClippedContrast.blocks.dat │ │ ├── 101_1.tif.4.ClippedContrast.histogram.dat │ │ └── 101_1.tif.4.ClippedContrast.result.dat │ ├── Compute │ │ ├── 101_1.tif.22.Compute.outer.dat │ │ └── 101_1.tif.22.Compute.result.dat │ ├── Detect │ │ ├── 101_1.tif.13.Detect.blocks.dat │ │ ├── 101_1.tif.13.Detect.image.dat │ │ ├── 101_1.tif.13.Detect.mask.dat │ │ └── 101_1.tif.13.Detect.result.dat │ ├── Equalize │ │ ├── 101_1.tif.12.Equalize.blockMask.dat │ │ ├── 101_1.tif.12.Equalize.blocks.dat │ │ ├── 101_1.tif.12.Equalize.histgram.dat │ │ ├── 101_1.tif.12.Equalize.image.dat │ │ └── 101_1.tif.12.Equalize.result.dat │ ├── ImageInverter │ │ ├── 101_1.tif.0.ImageInverter.image.dat │ │ └── 101_1.tif.0.ImageInverter.result.dat │ ├── LinesByOrientation │ │ ├── 101_1.tif.15.LinesByOrientation.AngularResolution.dat │ │ ├── 101_1.tif.15.LinesByOrientation.Radius.dat │ │ ├── 101_1.tif.15.LinesByOrientation.StepFactor.dat │ │ ├── 101_1.tif.15.LinesByOrientation.result.dat │ │ ├── 101_1.tif.17.LinesByOrientation.AngularResolution.dat │ │ ├── 101_1.tif.17.LinesByOrientation.Radius.dat │ │ ├── 101_1.tif.17.LinesByOrientation.StepFactor.dat │ │ └── 101_1.tif.17.LinesByOrientation.result.dat │ ├── LocalHistogram │ │ ├── 101_1.tif.1.LocalHistogram.Analyze.blocks.dat │ │ ├── 101_1.tif.1.LocalHistogram.Analyze.image.dat │ │ ├── 101_1.tif.1.LocalHistogram.Analyze.result.dat │ │ ├── 101_1.tif.2.LocalHistogram.SmoothAroundCorners.blocks.dat │ │ ├── 101_1.tif.2.LocalHistogram.SmoothAroundCorners.input.dat │ │ └── 101_1.tif.2.LocalHistogram.SmoothAroundCorners.result.dat │ ├── OrientedSmoother │ │ ├── 101_1.tif.14.OrientedSmoother.blocks.dat │ │ ├── 101_1.tif.14.OrientedSmoother.input.dat │ │ ├── 101_1.tif.14.OrientedSmoother.mask.dat │ │ ├── 101_1.tif.14.OrientedSmoother.orientation.dat │ │ ├── 101_1.tif.14.OrientedSmoother.result.dat │ │ ├── 101_1.tif.16.OrientedSmoother.blocks.dat │ │ ├── 101_1.tif.16.OrientedSmoother.input.dat │ │ ├── 101_1.tif.16.OrientedSmoother.mask.dat │ │ ├── 101_1.tif.16.OrientedSmoother.orientation.dat │ │ └── 101_1.tif.16.OrientedSmoother.result.dat │ ├── RelativeContrast │ │ ├── 101_1.tif.6.RelativeContrast.RelativeLimit.dat │ │ ├── 101_1.tif.6.RelativeContrast.SampleFraction.dat │ │ ├── 101_1.tif.6.RelativeContrast.SampleSize.dat │ │ ├── 101_1.tif.6.RelativeContrast.blocks.dat │ │ ├── 101_1.tif.6.RelativeContrast.contrast.dat │ │ └── 101_1.tif.6.RelativeContrast.result.dat │ ├── Remove │ │ ├── 101_1.tif.21.Remove.input.dat │ │ └── 101_1.tif.21.Remove.result.dat │ ├── SegmentationMask │ │ ├── 101_1.tif.3.SegmentationMask.blocks.dat │ │ ├── 101_1.tif.3.SegmentationMask.histogram.dat │ │ └── 101_1.tif.3.SegmentationMask.result.dat │ ├── Thin │ │ ├── 101_1.tif.23.Thin.MaxIterations.dat │ │ ├── 101_1.tif.23.Thin.input.dat │ │ ├── 101_1.tif.23.Thin.result.dat │ │ ├── 101_1.tif.24.Thin.MaxIterations.dat │ │ ├── 101_1.tif.24.Thin.input.dat │ │ └── 101_1.tif.24.Thin.result.dat │ └── VotingFilter │ │ ├── 101_1.tif.10.VotingFilter.BorderDistance.dat │ │ ├── 101_1.tif.10.VotingFilter.Majority.dat │ │ ├── 101_1.tif.10.VotingFilter.Radius.dat │ │ ├── 101_1.tif.10.VotingFilter.input.dat │ │ ├── 101_1.tif.10.VotingFilter.result.dat │ │ ├── 101_1.tif.11.VotingFilter.BorderDistance.dat │ │ ├── 101_1.tif.11.VotingFilter.Majority.dat │ │ ├── 101_1.tif.11.VotingFilter.Radius.dat │ │ ├── 101_1.tif.11.VotingFilter.input.dat │ │ ├── 101_1.tif.11.VotingFilter.result.dat │ │ ├── 101_1.tif.19.VotingFilter.BorderDistance.dat │ │ ├── 101_1.tif.19.VotingFilter.Majority.dat │ │ ├── 101_1.tif.19.VotingFilter.Radius.dat │ │ ├── 101_1.tif.19.VotingFilter.input.dat │ │ ├── 101_1.tif.19.VotingFilter.result.dat │ │ ├── 101_1.tif.20.VotingFilter.BorderDistance.dat │ │ ├── 101_1.tif.20.VotingFilter.Majority.dat │ │ ├── 101_1.tif.20.VotingFilter.Radius.dat │ │ ├── 101_1.tif.20.VotingFilter.input.dat │ │ ├── 101_1.tif.20.VotingFilter.result.dat │ │ ├── 101_1.tif.7.VotingFilter.BorderDistance.dat │ │ ├── 101_1.tif.7.VotingFilter.Majority.dat │ │ ├── 101_1.tif.7.VotingFilter.Radius.dat │ │ ├── 101_1.tif.7.VotingFilter.input.dat │ │ ├── 101_1.tif.7.VotingFilter.result.dat │ │ ├── 101_1.tif.8.VotingFilter.BorderDistance.dat │ │ ├── 101_1.tif.8.VotingFilter.Majority.dat │ │ ├── 101_1.tif.8.VotingFilter.Radius.dat │ │ ├── 101_1.tif.8.VotingFilter.input.dat │ │ ├── 101_1.tif.8.VotingFilter.result.dat │ │ ├── 101_1.tif.9.VotingFilter.BorderDistance.dat │ │ ├── 101_1.tif.9.VotingFilter.Majority.dat │ │ ├── 101_1.tif.9.VotingFilter.Radius.dat │ │ ├── 101_1.tif.9.VotingFilter.input.dat │ │ └── 101_1.tif.9.VotingFilter.result.dat ├── Manually extracted minutiae │ ├── Arch │ │ ├── Bas1441090192-Hamster-0-0.png │ │ ├── Bas1441090192-Hamster-0-1.png │ │ ├── Bas1441090192-Hamster-0-2.xls │ │ ├── Bas1441090192-Hamster-0-2.zip │ │ ├── Bas1441090192-Hamster-0-2_Arrows.png │ │ └── Bas1441090192-Hamster-0-2_Min.png │ ├── Burn │ │ ├── Bas1441086512-Hamster-3-0.png │ │ └── Bas1441086512-Hamster-3-1.png │ ├── Clean │ │ ├── Bas1441090612-Hamster-1-2.png │ │ └── Bas1441090612-Hamster-1-3.png │ ├── Crease │ │ ├── Bas1441089102-Hamster-1-1.png │ │ ├── Bas1441089102-Hamster-1-2.png │ │ ├── Jul1440933643-Hamster-1-1.xls │ │ ├── Jul1440933643-Hamster-1-1.zip │ │ ├── Jul1440933643-Hamster-1-1_Arrows.png │ │ ├── Jul1440933643-Hamster-1-1_Min.png │ │ ├── Jul1440933643-Hamster-1-2.png │ │ └── Jul1440933643-Hamster-1-3.png │ ├── Delta │ │ ├── Bas1441089429-Hamster-1-0.png │ │ └── Bas1441089429-Hamster-1-2.png │ ├── Interesting │ │ ├── Bas1441085165-Hamster-1-1.png │ │ └── Bas1441085165-Hamster-1-3.png │ ├── Loop │ │ ├── Bas1441089429-Hamster-2-2.png │ │ └── Bas1441089429-Hamster-2-3.png │ ├── Nasty │ │ ├── Bas1441084782-Hamster-2-1.png │ │ ├── Bas1441084782-Hamster-2-2.png │ │ ├── Bas1441084782-Hamster-2-3.png │ │ ├── Bas1441092053-Hamster-2-1.png │ │ ├── Bas1441092053-Hamster-2-2.png │ │ ├── Bas1441093234-Hamster-2-2.png │ │ └── Bas1441093234-Hamster-2-3.png │ ├── Noisy │ │ └── Bas1441084429-Hamster-2-0.png │ ├── Normal │ │ ├── Ale1439794734-Hamster-0-0.png │ │ ├── Ale1439794734-Hamster-0-1.png │ │ ├── Ale1439794734-Hamster-0-1_Arrows.png │ │ ├── Ale1439794734-Hamster-0-1_Min.png │ │ ├── Ale1439794734-Hamster-1-0.png │ │ ├── Ale1439794734-Hamster-1-1_Arrows.png │ │ ├── Ale1439794734-Hamster-1-1_Min.png │ │ ├── Ale1439794734-Hamster-1-2.png │ │ ├── Ale1439794734-Hamster-2-0-1_Arrows.png │ │ ├── Ale1439794734-Hamster-2-0-Min.png │ │ ├── Ale1439794734-Hamster-2-0.png │ │ ├── Ale1439794734-Hamster-2-1.png │ │ ├── Ale1439794734-Hamster-3-1-Min.png │ │ ├── Ale1439794734-Hamster-3-1.png │ │ ├── Ale1439794734-Hamster-3-2.png │ │ ├── Ale1439794734-Hamster-3-2_Arrows.png │ │ ├── Ale1439794734-Hamster0-1.fmr │ │ ├── Ale1439794734-Hamster1-1.fmr │ │ ├── Ale1439794734-Hamster1-2.fmr │ │ ├── Ale1439794734-Hamster2-0.fmr │ │ ├── Ale1439794734-Hamster3-2.fmr │ │ ├── Template_Ale1439794734-Hamster-0-1.xlsx │ │ ├── Template_Ale1439794734-Hamster-1-1.xlsx │ │ ├── Template_Ale1439794734-Hamster-2-0.xlsx │ │ └── Template_Ale1439794734-Hamster-3-2.xlsx │ ├── Over Edge │ │ ├── Bas1441092830-Hamster-2-2.png │ │ └── Bas1441092830-Hamster-2-3.png │ ├── Scar │ │ ├── Bas1441086512-Hamster-0-1.png │ │ └── Bas1441086512-Hamster-0-2.png │ ├── Template_Example.xlsx │ ├── Whorl │ │ ├── Bas1441090612-Hamster-1-1.png │ │ └── Bas1441090612-Hamster-1-3.png │ └── Worn │ │ ├── Ale1439795470-Hamster-1-3.png │ │ ├── Ale1439795470-Hamster-1-3.zip │ │ ├── Ale1439795470-Hamster-1-3_Arrows.png │ │ ├── Ale1439795470-Hamster-1-3_Min.png │ │ ├── Ale1439795470-Hamster1-3.fmr │ │ └── Template_Ale1439795470-Hamster-1-3.xlsx ├── Minutiae test program │ ├── MinutiaeTestApp.sln │ └── MinutiaeTestApp │ │ ├── App.config │ │ ├── MinutiaeTestApp.csproj │ │ ├── Program.cs │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ ├── bin │ │ └── Debug │ │ │ └── SourceAFIS.xml │ │ └── obj │ │ └── Debug │ │ └── MinutiaeTestApp.csproj.FileListAbsolute.txt └── README.md ├── TestImages ├── Person1 │ ├── Bas1440999265-Hamster-0-0.png │ ├── Bas1440999265-Hamster-0-0.png.pgm │ ├── Bas1440999265-Hamster-0-1.png │ ├── Bas1440999265-Hamster-0-1.png.pgm │ ├── Bas1440999265-Hamster-0-2.png │ ├── Bas1440999265-Hamster-0-2.png.pgm │ ├── Bas1440999265-Hamster-1-0.png │ ├── Bas1440999265-Hamster-1-0.png.pgm │ ├── Bas1440999265-Hamster-1-1.png │ ├── Bas1440999265-Hamster-1-1.png.pgm │ ├── Bas1440999265-Hamster-1-2.png │ └── Bas1440999265-Hamster-1-2.png.pgm └── Person2 │ ├── Bas1440999687-Hamster-0-0.png │ ├── Bas1440999687-Hamster-0-1.png │ ├── Bas1440999687-Hamster-0-2.png │ ├── Bas1440999687-Hamster-1-0.png │ ├── Bas1440999687-Hamster-1-1.png │ └── Bas1440999687-Hamster-1-2.png ├── acinclude.m4 ├── boot ├── .gitignore ├── Build ├── Makefile.am ├── configure.ac └── gen │ ├── .gitignore │ └── Makefile.am ├── configure.ac ├── logo ├── libAFIS logo_black.ai ├── libAFIS logo_blue.ai └── libAFIS.jpg └── tools ├── ac ├── .gitattributes ├── ac_check_config_shell.m4 ├── ac_config_init.m4 └── ac_subst_basedir.m4 └── am ├── compat-1.11 ├── compat-1.12 └── compat-1.13 /.gitignore: -------------------------------------------------------------------------------- 1 | # *.[oa] 2 | # *.kdev4 3 | # *.opensdf 4 | # *.sdf 5 | # *.user 6 | # .idea 7 | # .vs/LibAFIS/v1?/.suo 8 | # /Sources/Build/ 9 | # /Sources/Debug/ 10 | *~ 11 | /AUTHORS 12 | /Build/ 13 | /ChangeLog 14 | /Debug/ 15 | /INSTALL 16 | /Makefile 17 | /Makefile.in 18 | /NEWS 19 | /README 20 | /TestImages 21 | /VERSION 22 | /aclocal.m4 23 | /amcompat.m4 24 | /ar-lib 25 | /autom4te.cache 26 | /autoscan.log 27 | /compile 28 | /conf/config.h 29 | /conf/config.h.in 30 | /conf/stamp-h1 31 | /config.* 32 | /configure 33 | /configure-stamp-* 34 | /cscope.files 35 | /cscope.log 36 | /depcomp 37 | /install-sh 38 | /install-stamp-* 39 | /libXpin.ncb 40 | /libXpin.suo 41 | /libtool 42 | /ltmain.sh 43 | /m4lib 44 | /missing 45 | -------------------------------------------------------------------------------- /ABOUT-THIS-FORK.md: -------------------------------------------------------------------------------- 1 | To be re-integrated into git@github.com:SimPrints/libAFIS.git at a later stage 2 | -- jordan@teddy-net.com 3 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | See LICENSE.md 2 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, SimPrints technology ltd 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | 8 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | 10 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 11 | 12 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /LibAFIS.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.23107.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibAFIS", "Sources\LibAFIS.vcxproj", "{B21F09C2-2066-4FAF-B539-D6D70730B545}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {B21F09C2-2066-4FAF-B539-D6D70730B545}.Debug|x64.ActiveCfg = Debug|x64 17 | {B21F09C2-2066-4FAF-B539-D6D70730B545}.Debug|x64.Build.0 = Debug|x64 18 | {B21F09C2-2066-4FAF-B539-D6D70730B545}.Debug|x86.ActiveCfg = Debug|Win32 19 | {B21F09C2-2066-4FAF-B539-D6D70730B545}.Debug|x86.Build.0 = Debug|Win32 20 | {B21F09C2-2066-4FAF-B539-D6D70730B545}.Release|x64.ActiveCfg = Release|x64 21 | {B21F09C2-2066-4FAF-B539-D6D70730B545}.Release|x64.Build.0 = Release|x64 22 | {B21F09C2-2066-4FAF-B539-D6D70730B545}.Release|x86.ActiveCfg = Release|Win32 23 | {B21F09C2-2066-4FAF-B539-D6D70730B545}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- makefile-automake -*- 2 | # 3 | # Configuration bootstrap, top level makefile 4 | # 5 | # $Id$ 6 | # 7 | # Blame: Jordan Hrycaj 8 | 9 | # recommended by libtoolize 10 | ACLOCAL_AMFLAGS = -I m4lib 11 | 12 | SUBDIRS = boot Sources 13 | CLEANFILES = 14 | BUILT_SOURCES = boot/Makefile 15 | 16 | # --------------------------------------------------------------------------- 17 | # Auto-for-build configuration 18 | # --------------------------------------------------------------------------- 19 | 20 | help: 21 | @echo 22 | @echo "$(MAKE) [target]" 23 | @echo 24 | @echo "target: all [dist]clean -- standard targets" 25 | @echo " | test -- run legacy tests" 26 | @echo 27 | 28 | # Build environment (unused yet) 29 | .PHONY: prepare 30 | prepare: $(BUILT_SOURCES) 31 | 32 | boot/Makefile: 33 | $(MAKE) -C boot -f Build Makefile 34 | 35 | # --------------------------------------------------------------------------- 36 | # Legacy tests 37 | # --------------------------------------------------------------------------- 38 | 39 | test: 40 | $(MAKE) -C Sources test 41 | 42 | # --------------------------------------------------------------------------- 43 | # Auto configuration helper 44 | # --------------------------------------------------------------------------- 45 | 46 | .PHONY: libtool 47 | libtool: $(LIBTOOL_DEPS) 48 | $(SHELL) ./config.status --recheck 49 | 50 | .PHONY: autoreconf reconf 51 | autoreconf reconf: libtool 52 | rm -f $(AUTOGENERATED) 53 | touch configure.ac 54 | autoreconf 55 | 56 | # --------------------------------------------------------------------------- 57 | # End 58 | # --------------------------------------------------------------------------- 59 | -------------------------------------------------------------------------------- /Sources/.gitignore: -------------------------------------------------------------------------------- 1 | /all_tests 2 | /.deps 3 | /extract 4 | /lib*.la 5 | /lib*.lo 6 | /.libs 7 | /Makefile 8 | /Makefile.in 9 | /*.o 10 | -------------------------------------------------------------------------------- /Sources/Extraction/.gitignore: -------------------------------------------------------------------------------- 1 | /.deps 2 | /.dirstamp 3 | /lib*.la 4 | /lib*.lo 5 | /.libs 6 | /Makefile 7 | /Makefile.in 8 | /*.o 9 | -------------------------------------------------------------------------------- /Sources/Extraction/Binarisaion/readme.md: -------------------------------------------------------------------------------- 1 | #[Binarisation Wiki](../../../../../wiki/Binarisation) 2 | 3 | This folder is empty for now, as a placeholder for some file moves we shall do at the end. 4 | -------------------------------------------------------------------------------- /Sources/Extraction/Detection/readme.md: -------------------------------------------------------------------------------- 1 | #[Minutiae detection Wiki](../../../../../wiki/Minutiae-detection) 2 | 3 | This folder is empty for now, as a placeholder for some file moves we shall do at the end. 4 | -------------------------------------------------------------------------------- /Sources/Extraction/Enhancement/readme.md: -------------------------------------------------------------------------------- 1 | #[Enhancement Wiki](../../../../../wiki/Enhancement) 2 | 3 | This folder is empty for now, as a placeholder for some file moves we shall do at the end. 4 | -------------------------------------------------------------------------------- /Sources/Extraction/Extract.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include "General/Array.h" 3 | #include "General/BinaryMap.h" 4 | 5 | struct perfdata { 6 | struct timeval start; 7 | struct timeval start_histogram; 8 | struct timeval start_segmentation; 9 | struct timeval start_equalization; 10 | struct timeval start_orientation; 11 | struct timeval start_binarisation; 12 | struct timeval start_thinning; 13 | struct timeval start_detection; 14 | struct timeval start_filtering; 15 | struct timeval end; 16 | }; 17 | 18 | void Extract(UInt8Array2D *image, struct perfdata *perfdata, UInt8Array2D *binarized, UInt8Array2D *thinned); 19 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/.gitignore: -------------------------------------------------------------------------------- 1 | /.deps 2 | /.dirstamp 3 | /lib*.la 4 | /lib*.lo 5 | /.libs 6 | /Makefile 7 | /Makefile.in 8 | /*.o 9 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/AbsoluteContrast.c: -------------------------------------------------------------------------------- 1 | #include "AbsoluteContrast.h" 2 | 3 | void AbsoluteContrast_DetectLowContrast(const int limit, const UInt8Array2D *contrast, BinaryMap *output) 4 | { 5 | for (int x = 0; x < contrast->sizeX; ++x) { 6 | for (int y = 0; y < contrast->sizeY; ++y) { 7 | if (contrast->data[x][y] < limit) { 8 | BinaryMap_SetBitOne(output, x, y); 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/AbsoluteContrast.h: -------------------------------------------------------------------------------- 1 | #ifndef FILTERS_ABSOLUTECONTRAST_H 2 | #define FILTERS_ABSOLUTECONTRAST_H 3 | 4 | #include 5 | 6 | #include "General/Array.h" 7 | #include "General/BinaryMap.h" 8 | 9 | void AbsoluteContrast_DetectLowContrast(const int limit, const UInt8Array2D *contrast, BinaryMap *output); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/ClippedContrast.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "ClippedContrast.h" 4 | 5 | ClippedContrast ClippedContrast_Construct(void) 6 | { 7 | ClippedContrast cc = { 8 | .clipFraction = 0.08f /* Upper = 0.4 */ 9 | }; 10 | return cc; 11 | } 12 | 13 | void ClippedContrast_Compute(const ClippedContrast *me, const BlockMap *blocks, const Int16Array3D *histogram, UInt8Array2D *output) 14 | { 15 | for (int y = RectangleC_GetBottom(&blocks->allBlocks); y < RectangleC_GetTop(&blocks->allBlocks); y++) 16 | { 17 | for (int x = RectangleC_GetLeft(&blocks->allBlocks); x < RectangleC_GetRight(&blocks->allBlocks); x++) 18 | { 19 | int area = 0; 20 | 21 | //TODO: Possibly just block size squared 22 | for (int i = 0; i < 256; ++i) 23 | { 24 | area += histogram->data[x][y][i]; 25 | } 26 | 27 | int clipLimit = (area * me->clipFraction); 28 | 29 | int accumulator = 0; 30 | int lowerBound = 255; 31 | 32 | for (int i = 0; i < 256; ++i) { 33 | accumulator += histogram->data[x][y][i]; 34 | 35 | if (accumulator > clipLimit) { 36 | lowerBound = i; 37 | break; 38 | } 39 | } 40 | 41 | accumulator = 0; 42 | int upperBound = 0; 43 | for (int i = 255; i >= 0; --i) 44 | { 45 | accumulator += histogram->data[x][y][i]; 46 | if (accumulator > clipLimit) 47 | { 48 | upperBound = i; 49 | break; 50 | } 51 | } 52 | 53 | output->data[x][y] = upperBound - lowerBound; 54 | 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/ClippedContrast.h: -------------------------------------------------------------------------------- 1 | #ifndef FILTERS_CLIPPEDCONTRAST_H 2 | #define FILTERS_CLIPPEDCONTRAST_H 3 | 4 | #include 5 | 6 | #include "General/Array.h" 7 | #include "General/BinaryMap.h" 8 | #include "General/BlockMap.h" 9 | 10 | typedef struct ClippedContrast ClippedContrast; 11 | 12 | struct ClippedContrast 13 | { 14 | float clipFraction; /* Upper = 0.4 */ 15 | }; 16 | 17 | ClippedContrast ClippedContrast_Construct(void); 18 | 19 | /********************************************** 20 | * output - allocated array that is 21 | blockColumns x blockRows 22 | * 23 | **********************************************/ 24 | void ClippedContrast_Compute(const ClippedContrast *me, const BlockMap *blocks, const Int16Array3D *histogram, UInt8Array2D *output); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/CrossRemover.c: -------------------------------------------------------------------------------- 1 | #include "CrossRemover.h" 2 | 3 | void CrossRemover_Remove(BinaryMap *input) 4 | { 5 | /* TODO: Implement CrossRemover_Remove() */ 6 | } 7 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/CrossRemover.h: -------------------------------------------------------------------------------- 1 | #ifndef FILTERS_CROSSREMOVER_H 2 | #define FILTERS_CROSSREMOVER_H 3 | 4 | #include "General/BinaryMap.h" 5 | 6 | void CrossRemover_Remove(BinaryMap *input); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/Equalizer.h: -------------------------------------------------------------------------------- 1 | #ifndef FILTERS_EQUALIZER_H 2 | #define FILTERS_EQUALIZER_H 3 | 4 | #include 5 | 6 | #include "General/Array.h" 7 | #include "General/BlockMap.h" 8 | #include "General/BinaryMap.h" 9 | 10 | typedef struct Equalizer Equalizer; 11 | 12 | struct Equalizer 13 | { 14 | float maxScaling; /* Lower = 1, Upper = 10 */ 15 | float minScaling; /* Lower = 0.1 */ 16 | const float rangeMin; 17 | const float rangeMax; 18 | const float rangeSize; 19 | FloatArray1D toFloatTable; 20 | }; 21 | 22 | Equalizer Equalizer_Construct(void); 23 | void Equalizer_Destruct(Equalizer *me); 24 | 25 | /************************************************************ 26 | * output - A constructed FloatArray2D that is the same size 27 | * as the image arrary 28 | * 29 | ************************************************************/ 30 | void Equalizer_Equalize(const Equalizer *me, BlockMap *blocks, UInt8Array2D *image, Int16Array3D *histogram, BinaryMap *blockMask, FloatArray2D *output); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/HillOrientation.h: -------------------------------------------------------------------------------- 1 | #ifndef FILTERS_HILLORIENTATION_H 2 | #define FILTERS_HILLORIENTATION_H 3 | 4 | #include 5 | 6 | #include "General/Array.h" 7 | #include "General/Point.h" 8 | #include "General/PointF.h" 9 | #include "General/BlockMap.h" 10 | #include "General/BinaryMap.h" 11 | #include "General/List.h" 12 | 13 | /********************************************************************************* 14 | * output - preallocated array - 1st dimension should be equal to number of block rows 15 | 2nd dimension should be equal to number of block columns 16 | ***********************************************************************************/ 17 | void HillOrientation_Detect(const FloatArray2D image, const Size imageDimensions, const BinaryMap * blockMask, const BlockMap * blocks, UInt16Array2D *output); 18 | BoolArray2D HillOrientation_BlockMapToPixelMask(const Size imageDimensions, const BinaryMap * blockMask, const BlockMap * blocks); 19 | 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/ImageInverter.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "ImageInverter.h" 4 | 5 | UInt8Array2D ImageInverter_GetInverted(UInt8Array2D *image) 6 | { 7 | UInt8Array2D result = UInt8Array2D_Construct(image->sizeX, image->sizeY); 8 | 9 | for (int i = 0; i < image->sizeX; ++i) 10 | for (int j = 0; j < image->sizeY; ++j) 11 | result.data[i][j] = 255 - image->data[i][j]; 12 | 13 | return result; 14 | } 15 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/ImageInverter.h: -------------------------------------------------------------------------------- 1 | #ifndef FILTERS_IMAGEINVERTER_H 2 | #define FILTERS_IMAGEINVERTER_H 3 | 4 | #include "General/Array.h" 5 | 6 | UInt8Array2D ImageInverter_GetInverted(UInt8Array2D *image); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/InnerMask.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "InnerMask.h" 4 | #include "General/RectangleC.h" 5 | 6 | InnerMask InnerMask_Construct(void) 7 | { 8 | InnerMask im = {.minBorderDistance = 14 }; 9 | 10 | return im; 11 | } 12 | 13 | static void InnerMask_ShrinkBy(BinaryMap* temporary, const BinaryMap* inner, int amount) 14 | { 15 | RectangleC innerA = RectangleC_ConstructFrom4Ints(amount,0,inner->width - amount,inner->height); 16 | RectangleC innerB = RectangleC_ConstructFrom4Ints(0,0,inner->width - amount,inner->height); 17 | RectangleC innerC = RectangleC_ConstructFrom4Ints(0,amount,inner->width,inner->height-amount); 18 | RectangleC innerD = RectangleC_ConstructFrom4Ints(0,0,inner->width,inner->height-amount); 19 | 20 | Point origin = Point_Construct(0,0); 21 | Point left = Point_Construct(amount, 0); 22 | Point up = Point_Construct(0, amount); 23 | 24 | BinaryMap_Clear(temporary); 25 | BinaryMap_CopyToArea(temporary, inner, &innerA, &origin); 26 | BinaryMap_AndArea(temporary, inner, &innerB, &left); 27 | BinaryMap_AndArea(temporary, inner, &innerC, &origin); 28 | BinaryMap_AndArea(temporary, inner, &innerD, &up); 29 | 30 | BinaryMap_CopyTo(inner, temporary); 31 | } 32 | 33 | void InnerMask_Compute(const InnerMask *me, const BinaryMap *outer, BinaryMap* inner) 34 | { 35 | Size size = BinaryMap_GetSize(outer); 36 | BinaryMap temporary = BinaryMap_ConstructFromSize(&size); 37 | int total = 1; 38 | 39 | if (me->minBorderDistance >= 1) 40 | { 41 | InnerMask_ShrinkBy(&temporary, inner, 1); 42 | } 43 | 44 | for (int step = 1; total + step <= me->minBorderDistance; step *= 2) 45 | { 46 | InnerMask_ShrinkBy(&temporary, inner, step); 47 | total += step; 48 | } 49 | 50 | if (total < me->minBorderDistance) 51 | { 52 | InnerMask_ShrinkBy(&temporary, inner, me->minBorderDistance - total); 53 | } 54 | 55 | BinaryMap_Destruct(&temporary); 56 | } 57 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/InnerMask.h: -------------------------------------------------------------------------------- 1 | #ifndef FILTERS_INNERMASK_H 2 | #define FILTERS_INNERMASK_H 3 | 4 | #include 5 | 6 | #include "General/BinaryMap.h" 7 | 8 | typedef struct InnerMask InnerMask; 9 | 10 | struct InnerMask 11 | { 12 | int32_t minBorderDistance; /* Lower = 0, Upper = 50 */ 13 | }; 14 | 15 | InnerMask InnerMask_Construct(void); 16 | 17 | // inner should be allocated to be the same size as outer 18 | void InnerMask_Compute(const InnerMask *me, const BinaryMap *outer, BinaryMap* inner); 19 | #endif 20 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/LinesByOrientation.h: -------------------------------------------------------------------------------- 1 | #ifndef FILTERS_LINESBYORIENTATION_H 2 | #define FILTERS_LINESBYORIENTATION_H 3 | 4 | #include 5 | 6 | #include "General/Array.h" 7 | 8 | void LinesByOrientation_ConstructLines(int32_t angularResoltuion, int32_t radius, float stepFactor, PointArray2D *lines); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/LocalHistogram.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "LocalHistogram.h" 5 | 6 | void LocalHistogram_Analyze(const BlockMap *blocks, const UInt8Array2D *image, Int16Array3D *histogram) 7 | { 8 | Point block; 9 | for (block.x = RectangleC_GetLeft(&blocks->allBlocks); block.x < RectangleC_GetRight(&blocks->allBlocks); ++block.x) 10 | { 11 | for (block.y = RectangleC_GetBottom(&blocks->allBlocks); block.y < RectangleC_GetTop(&blocks->allBlocks); ++block.y) 12 | { 13 | RectangleC area = RectangleGrid_GetRectangleCFromPoint(&blocks->blockAreas, &block); 14 | for (int x = RectangleC_GetLeft(&area); x < RectangleC_GetRight(&area); ++x) 15 | { 16 | for (int y = RectangleC_GetBottom(&area); y < RectangleC_GetTop(&area); ++y) 17 | { 18 | ++histogram->data[block.x][block.y][image->data[x][y]]; 19 | } 20 | } 21 | } 22 | } 23 | } 24 | 25 | void LocalHistogram_SmoothAroundCorners(const Int16Array3D *input, Int16Array3D *output) 26 | { 27 | assert(output->sizeX == input->sizeX + 1); 28 | assert(output->sizeY == input->sizeY + 1); 29 | 30 | for (int x = 0; x < input->sizeX; x++) 31 | { 32 | for (int y = 0; y < input->sizeY; y++) 33 | { 34 | for (int z = 0; z < input->sizeZ; z++) 35 | { 36 | output->data[x][y][z] += input->data[x][y][z]; 37 | output->data[x][y+1][z] += input->data[x][y][z]; 38 | output->data[x+1][y][z] += input->data[x][y][z]; 39 | output->data[x+1][y+1][z] += input->data[x][y][z]; 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/LocalHistogram.h: -------------------------------------------------------------------------------- 1 | #ifndef FILTERS_LOCALHISTOGRAM_H 2 | #define FILTERS_LOCALHISTOGRAM_H 3 | 4 | #include "General/Array.h" 5 | #include "General/BlockMap.h" 6 | 7 | void LocalHistogram_Analyze(const BlockMap *blocks, const UInt8Array2D *image, Int16Array3D *histogram); 8 | void LocalHistogram_SmoothAroundCorners(const Int16Array3D *input, Int16Array3D *output); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- makefile-automake -*- 2 | # 3 | # Build library 4 | # 5 | # $Id$ 6 | # 7 | # Blame: Jordan Hrycaj 8 | 9 | # --------------------------------------------------------------------------- 10 | # Target 11 | # --------------------------------------------------------------------------- 12 | 13 | all-local:: SOURCES 14 | 15 | SOURCES: Makefile 16 | @rm -f $@ 17 | @echo ">>> Generating $@" 18 | @echo "# Generated from $(subdir)/Makefile.am" >> $@ 19 | @d=`basename $(subdir)`;\ 20 | for s in $(srcs); do \ 21 | echo "srcs += $$d/$$s"; done >> $@ 22 | @echo "# End" >> $@ 23 | 24 | # --------------------------------------------------------------------------- 25 | # Sources 26 | # --------------------------------------------------------------------------- 27 | 28 | srcs = AbsoluteContrast.c Equalizer.c InnerMask.c OrientedSmoother.c 29 | srcs += Thinner.c ClippedContrast.c HillOrientation.c LinesByOrientation.c 30 | srcs += RelativeContrast.c ThresholdBinarizer.c CrossRemover.c 31 | srcs += ImageInverter.c LocalHistogram.c SegmentationMask.c VotingFilter.c 32 | 33 | # --------------------------------------------------------------------------- 34 | # End 35 | # --------------------------------------------------------------------------- 36 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/OrientedSmoother.h: -------------------------------------------------------------------------------- 1 | #ifndef FILTERS_ORIENTEDSMOOTHER_H 2 | #define FILTERS_ORIENTEDSMOOTHER_H 3 | 4 | #include 5 | 6 | #include "General/BlockMap.h" 7 | #include "General/BinaryMap.h" 8 | #include "LinesByOrientation.h" 9 | 10 | typedef struct SmootherConfig SmootherConfig; 11 | 12 | struct SmootherConfig { 13 | int radius; 14 | int angularResolution; 15 | float stepFactor; 16 | }; 17 | 18 | void OrientedSmoother_Smooth 19 | (const SmootherConfig config, 20 | const FloatArray2D *input, 21 | const UInt16Array2D *orientation, 22 | const BinaryMap *mask, 23 | const BlockMap *blocks, 24 | const uint8_t angleOffset, 25 | FloatArray2D *output); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/RelativeContrast.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "RelativeContrast.h" 3 | 4 | #define MIN(X,Y) ((X) < (Y) ? (X) : (Y)) 5 | #define MAX(X,Y) ((X) > (Y) ? (X) : (Y)) 6 | 7 | RelativeContrast RelativeContrast_Construct(void) 8 | { 9 | RelativeContrast rc = { 10 | .sampleSize = 168568, /* Lower = 10 * 10, Upper = 2000 * 2000 */ 11 | .sampleFraction = 0.49f, 12 | .relativeLimit = 0.34f 13 | }; 14 | 15 | return rc; 16 | } 17 | 18 | static int reverse_compare(const uint8_t *a, const uint8_t *b) { 19 | return ((int) *b) - ((int) *a); 20 | } 21 | 22 | void RelativeContrast_DetectLowContrast(const RelativeContrast *me, const UInt8Array2D *contrast, const BlockMap *blocks, BinaryMap *output) 23 | { 24 | const int nElements = contrast->sizeX * contrast->sizeY; 25 | uint8_t *sortedContrast = (uint8_t *) malloc(nElements * sizeof(uint8_t)); 26 | 27 | int i = 0; 28 | for (int x = 0; x < contrast->sizeX; ++x) { 29 | for (int y = 0; y < contrast->sizeY; ++y) { 30 | sortedContrast[i++] = contrast->data[x][y]; 31 | } 32 | } 33 | 34 | qsort(sortedContrast, nElements, sizeof(uint8_t), (int (*)(const void *, const void *)) reverse_compare); 35 | 36 | int pixelsPerBlock = (blocks->pixelCount.width * blocks->pixelCount.height) / (blocks->allBlocks.width * blocks->allBlocks.height); 37 | int sampleCount = MIN(nElements, me->sampleSize / pixelsPerBlock); 38 | int consideredBlocks = MAX((int) (sampleCount * me->sampleFraction), 1); 39 | 40 | int averageContrast = 0; 41 | 42 | for (int i = 0; i < consideredBlocks; ++i) { 43 | averageContrast += sortedContrast[i]; 44 | } 45 | 46 | averageContrast /= consideredBlocks; 47 | uint8_t limit = (uint8_t)(averageContrast * me->relativeLimit); 48 | 49 | for (int x = 0; x < output->width; x++) { 50 | for (int y = 0; y < output->height; y++) { 51 | if (contrast->data[x][y] < limit) { 52 | BinaryMap_SetBitOne(output, x, y); 53 | } 54 | } 55 | } 56 | 57 | free(sortedContrast); 58 | } 59 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/RelativeContrast.h: -------------------------------------------------------------------------------- 1 | #ifndef FILTERS_RELATIVECONTRAST_H 2 | #define FILTERS_RELATIVECONTRAST_H 3 | 4 | #include 5 | 6 | #include "General/BlockMap.h" 7 | #include "General/BinaryMap.h" 8 | #include "LinesByOrientation.h" 9 | 10 | typedef struct RelativeContrast RelativeContrast; 11 | 12 | struct RelativeContrast 13 | { 14 | int32_t sampleSize; /* Lower = 10 * 10, Upper = 2000 * 2000 */ 15 | float sampleFraction; 16 | float relativeLimit; 17 | }; 18 | 19 | RelativeContrast RelativeContrast_Construct(void); 20 | void RelativeContrast_DetectLowContrast(const RelativeContrast *me, const UInt8Array2D *contrast, const BlockMap *blocks, BinaryMap *output); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/SOURCES: -------------------------------------------------------------------------------- 1 | # Generated from Sources/Extraction/Filters/Makefile.am 2 | srcs += Filters/AbsoluteContrast.c 3 | srcs += Filters/Equalizer.c 4 | srcs += Filters/InnerMask.c 5 | srcs += Filters/OrientedSmoother.c 6 | srcs += Filters/Thinner.c 7 | srcs += Filters/ClippedContrast.c 8 | srcs += Filters/HillOrientation.c 9 | srcs += Filters/LinesByOrientation.c 10 | srcs += Filters/RelativeContrast.c 11 | srcs += Filters/ThresholdBinarizer.c 12 | srcs += Filters/CrossRemover.c 13 | srcs += Filters/ImageInverter.c 14 | srcs += Filters/LocalHistogram.c 15 | srcs += Filters/SegmentationMask.c 16 | srcs += Filters/VotingFilter.c 17 | # End 18 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/SegmentationMask.h: -------------------------------------------------------------------------------- 1 | #ifndef FILTERS_SEGMENTATIONMASK_H 2 | #define FILTERS_SEGMENTATIONMASK_H 3 | 4 | #include 5 | 6 | #include "General/BlockMap.h" 7 | #include "General/BinaryMap.h" 8 | #include "ClippedContrast.h" 9 | #include "AbsoluteContrast.h" 10 | #include "RelativeContrast.h" 11 | #include "VotingFilter.h" 12 | 13 | typedef struct SegmentationMask SegmentationMask; 14 | 15 | struct SegmentationMask 16 | { 17 | ClippedContrast contrast; 18 | int absoluteContrastLimit; 19 | RelativeContrast relativeContrast; 20 | VotingFilter lowContrastMajority; 21 | VotingFilter blockErrorFilter; 22 | VotingFilter innerMaskFilter; 23 | }; 24 | 25 | SegmentationMask SegmentationMask_Construct(void); 26 | 27 | /***************************************************** 28 | * output - A pre-allocated BinaryMap that is number 29 | * of block columns in the first dimension 30 | * and the number of block rows in the second 31 | * dimension 32 | * 33 | ****************************************************/ 34 | void SegmentationMask_ComputeMask(const SegmentationMask *me, const BlockMap *blocks, const Int16Array3D *histogram, BinaryMap *output); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/Thinner.h: -------------------------------------------------------------------------------- 1 | #ifndef FILTERS_THINNER_H 2 | #define FILTERS_THINNER_H 3 | 4 | #include 5 | 6 | #include "General/BinaryMap.h" 7 | 8 | typedef struct Thinner Thinner; 9 | 10 | struct Thinner 11 | { 12 | int32_t maxIterations; /* Lower = 5, Upper = 50 */ 13 | }; 14 | 15 | Thinner Thinner_Construct(void); 16 | 17 | // skeleton should be allocated to be size of input 18 | void Thinner_Thin(const Thinner *me, const BinaryMap *input, BinaryMap* skeleton); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/ThresholdBinarizer.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "ThresholdBinarizer.h" 4 | 5 | 6 | void ThresholdBinarizer_Binarize(const FloatArray2D *input, const FloatArray2D *baseline, const BinaryMap *mask, const BlockMap *blocks, BinaryMap *binarized) 7 | { 8 | for (int blockY = 0; blockY < blocks->allBlocks.height; blockY++) 9 | { 10 | for (int blockX = 0; blockX < blocks->allBlocks.width; blockX++) 11 | { 12 | if (BinaryMap_GetBit(mask, blockX, blockY)) 13 | { 14 | RectangleC rectangle = RectangleGrid_GetRectangleCFromCoordinates(&(blocks->blockAreas), blockX, blockY); 15 | for (int y = RectangleC_GetBottom(&rectangle); y < RectangleC_GetTop(&rectangle); y++) 16 | { 17 | for (int x = RectangleC_GetLeft(&rectangle); x < RectangleC_GetRight(&rectangle); x++) 18 | { 19 | if (input->data[x][y] - baseline->data[x][y] > 0) 20 | { 21 | BinaryMap_SetBitOne(binarized, x, y); 22 | } 23 | } 24 | } 25 | 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/ThresholdBinarizer.h: -------------------------------------------------------------------------------- 1 | #ifndef FILTERS_THRESHOLDBINARIZER_H 2 | #define FILTERS_THRESHOLDBINARIZER_H 3 | 4 | #include "General/Array.h" 5 | #include "General/BlockMap.h" 6 | #include "General/BinaryMap.h" 7 | 8 | /********************************************************* 9 | * output - output should be the same dimensions as input 10 | * 11 | *********************************************************/ 12 | void ThresholdBinarizer_Binarize(const FloatArray2D *input, const FloatArray2D *baseline, const BinaryMap *mask, const BlockMap *blocks, BinaryMap *output); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/VotingFilter.h: -------------------------------------------------------------------------------- 1 | #ifndef FILTERS_VOTINGFILTER_H 2 | #define FILTERS_VOTINGFILTER_H 3 | 4 | #include 5 | #include "General/BinaryMap.h" 6 | 7 | typedef struct VotingFilter VotingFilter; 8 | 9 | struct VotingFilter 10 | { 11 | int32_t radius; /* Upper = 10 */ 12 | float majority; /* Lower = 0.51 */ 13 | int32_t borderDistance; /* Lower = 0, Upper = 20 */ 14 | }; 15 | 16 | VotingFilter VotingFilter_Construct(void); 17 | void VotingFilter_Filter(const VotingFilter *me, const BinaryMap *input, BinaryMap *output); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /Sources/Extraction/Filters/readme.md: -------------------------------------------------------------------------------- 1 | #[Minutiae filtering Wiki](../../../../../wiki/Minutiae-filtering) 2 | -------------------------------------------------------------------------------- /Sources/Extraction/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- makefile-automake -*- 2 | # 3 | # Build library 4 | # 5 | # $Id$ 6 | # 7 | # Blame: Jordan Hrycaj 8 | 9 | SUBDIRS = Filters Model MinutiaeDetection 10 | 11 | # --------------------------------------------------------------------------- 12 | # Target 13 | # --------------------------------------------------------------------------- 14 | 15 | all-local:: SOURCES 16 | 17 | SOURCES: Makefile Filters/SOURCES Model/SOURCES MinutiaeDetection/SOURCES 18 | @rm -f $@ 19 | @echo ">>> Generating $@" 20 | @echo "# Generated from $(subdir)/Makefile.am" >> $@ 21 | @d=`basename $(subdir)`;\ 22 | for s in $(srcs); do \ 23 | echo "srcs += $$d/$$s"; done >> $@ 24 | @echo "# End" >> $@ 25 | 26 | # --------------------------------------------------------------------------- 27 | # Sources 28 | # --------------------------------------------------------------------------- 29 | 30 | srcs = Extract.c 31 | 32 | include Filters/SOURCES 33 | include Model/SOURCES 34 | include MinutiaeDetection/SOURCES 35 | 36 | # --------------------------------------------------------------------------- 37 | # End 38 | # --------------------------------------------------------------------------- 39 | -------------------------------------------------------------------------------- /Sources/Extraction/MinutiaeDetection/.gitignore: -------------------------------------------------------------------------------- 1 | /.deps 2 | /.dirstamp 3 | /lib*.la 4 | /lib*.lo 5 | /.libs 6 | /Makefile 7 | /Makefile.in 8 | /*.o 9 | -------------------------------------------------------------------------------- /Sources/Extraction/MinutiaeDetection/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- makefile-automake -*- 2 | # 3 | # Build library 4 | # 5 | # $Id$ 6 | # 7 | # Blame: Jordan Hrycaj 8 | 9 | # --------------------------------------------------------------------------- 10 | # Target 11 | # --------------------------------------------------------------------------- 12 | 13 | all-local:: SOURCES 14 | 15 | SOURCES: Makefile 16 | @rm -f $@ 17 | @echo ">>> Generating $@" 18 | @echo "# Generated from $(subdir)/Makefile.am" >> $@ 19 | @d=`basename $(subdir)`;\ 20 | for s in $(srcs); do \ 21 | echo "srcs += $$d/$$s"; done >> $@ 22 | @echo "# End" >> $@ 23 | 24 | # --------------------------------------------------------------------------- 25 | # Sources 26 | # --------------------------------------------------------------------------- 27 | 28 | srcs = MinutiaeDetection.c 29 | 30 | # --------------------------------------------------------------------------- 31 | # End 32 | # --------------------------------------------------------------------------- 33 | -------------------------------------------------------------------------------- /Sources/Extraction/MinutiaeDetection/MinutiaeDetection.h: -------------------------------------------------------------------------------- 1 | #ifndef MINUTIAE_DETECTION_H 2 | #define MINUTIAE_DETECTION_H 3 | 4 | #include "General/BinaryMap.h" 5 | #include "General/List.h" 6 | 7 | void FindMinutiae(BinaryMap* image, List* outputMinutiae); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /Sources/Extraction/MinutiaeDetection/SOURCES: -------------------------------------------------------------------------------- 1 | # Generated from Sources/Extraction/MinutiaeDetection/Makefile.am 2 | srcs += MinutiaeDetection/MinutiaeDetection.c 3 | # End 4 | -------------------------------------------------------------------------------- /Sources/Extraction/Model/.gitignore: -------------------------------------------------------------------------------- 1 | /.deps 2 | /.dirstamp 3 | /lib*.la 4 | /lib*.lo 5 | /.libs 6 | /Makefile 7 | /Makefile.in 8 | /*.o 9 | -------------------------------------------------------------------------------- /Sources/Extraction/Model/DotRemover.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "Extraction/Model/Minutia.h" 5 | #include "DotRemover.h" 6 | 7 | void DotRemover_Filter(List *minutiae) 8 | { 9 | for (ListElement *i = minutiae->head, *next = NULL; i != NULL; i = next) 10 | { 11 | Minutia *minutia = (Minutia *) i->data; 12 | assert(minutia != NULL); 13 | 14 | //Get the next element here as i may be freed in List_Remove 15 | next = i->next; 16 | if (List_GetCount(Minutia_GetRidges(minutia)) == 0) 17 | { 18 | int32_t ret = List_Remove(minutiae, i, NULL); 19 | assert(ret == 0); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Sources/Extraction/Model/DotRemover.h: -------------------------------------------------------------------------------- 1 | #ifndef MODEL_DOTREMOVER_H 2 | #define MODEL_DOTREMOVER_H 3 | 4 | #include "SkeletonBuilder.h" 5 | 6 | void DotRemover_Filter(List *minutiae); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /Sources/Extraction/Model/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- makefile-automake -*- 2 | # 3 | # Build library 4 | # 5 | # $Id$ 6 | # 7 | # Blame: Jordan Hrycaj 8 | 9 | # --------------------------------------------------------------------------- 10 | # Target 11 | # --------------------------------------------------------------------------- 12 | 13 | all-local:: SOURCES 14 | 15 | SOURCES: Makefile 16 | @rm -f $@ 17 | @echo ">>> Generating $@" 18 | @echo "# Generated from $(subdir)/Makefile.am" >> $@ 19 | @d=`basename $(subdir)`;\ 20 | for s in $(srcs); do \ 21 | echo "srcs += $$d/$$s"; done >> $@ 22 | @echo "# End" >> $@ 23 | 24 | # --------------------------------------------------------------------------- 25 | # Sources 26 | # --------------------------------------------------------------------------- 27 | 28 | srcs = DotRemover.c Minutia.c Ridge.c SkeletonBuilder.c 29 | 30 | # --------------------------------------------------------------------------- 31 | # End 32 | # --------------------------------------------------------------------------- 33 | -------------------------------------------------------------------------------- /Sources/Extraction/Model/Minutia.c: -------------------------------------------------------------------------------- 1 | #include "Minutia.h" 2 | #include 3 | 4 | List* Minutia_GetRidges(const Minutia *me) 5 | { 6 | return (List *) &me->ridges; 7 | } 8 | 9 | void Minutia_AttachStart(Minutia *me, Ridge *ridge) 10 | { 11 | if (!List_ContainsData(&me->ridges, ridge)) 12 | { 13 | List_AddData(&me->ridges, ridge); 14 | Ridge_SetStart(ridge, me); 15 | } 16 | } 17 | 18 | void Minutia_DetachStart(Minutia *me, Ridge *ridge) 19 | { 20 | if (List_ContainsData(&me->ridges, ridge)) 21 | { 22 | List_RemoveData(&me->ridges, ridge); 23 | if (Ridge_GetStart(ridge) == me) 24 | Ridge_SetStart(ridge, NULL); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Sources/Extraction/Model/Minutia.h: -------------------------------------------------------------------------------- 1 | #ifndef MODEL_MINUTIA_H 2 | #define MODEL_MINUTIA_H 3 | 4 | typedef struct Minutia Minutia; 5 | 6 | #include "General/Point.h" 7 | #include "General/List.h" 8 | #include "Extraction/Model/Ridge.h" 9 | 10 | typedef enum { None, RidgeEnd, Bifurcation } MinutiaType; 11 | 12 | struct Minutia 13 | { 14 | MinutiaType minutiaType; 15 | Point position; 16 | List ridges; 17 | }; 18 | 19 | List* Minutia_GetRidges(const Minutia *me); 20 | void Minutia_AttachStart(Minutia *me, Ridge *ridge); 21 | void Minutia_DetachStart(Minutia *me, Ridge *ridge); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /Sources/Extraction/Model/Ridge.c: -------------------------------------------------------------------------------- 1 | #include "Ridge.h" 2 | #include 3 | 4 | Ridge Ridge_Construct(void) 5 | { 6 | Ridge sbr; 7 | sbr.points = List_Construct(); 8 | return sbr; 9 | } 10 | 11 | void Ridge_Destruct(Ridge *me) 12 | { 13 | } 14 | 15 | Minutia* Ridge_GetStart(const Ridge *me) 16 | { 17 | return me->startMinutia; 18 | } 19 | 20 | void Ridge_SetStart(Ridge *me, Minutia *value) 21 | { 22 | if (me->startMinutia != value) 23 | { 24 | if (me->startMinutia != NULL) 25 | { 26 | Minutia *detachFrom = me->startMinutia; 27 | me->startMinutia = NULL; 28 | Minutia_DetachStart(detachFrom, me); 29 | } 30 | me->startMinutia = value; 31 | if (me->startMinutia != NULL) 32 | Minutia_AttachStart(me->startMinutia, me); 33 | me->reversed->endMinutia = value; 34 | } 35 | } 36 | 37 | Minutia* Ridge_GetEnd(const Ridge *me) 38 | { 39 | return me->endMinutia; 40 | } 41 | 42 | void Ridge_SetEnd(Ridge *me, Minutia *value) 43 | { 44 | if (me->endMinutia != value) 45 | { 46 | me->endMinutia = value; 47 | Ridge_SetStart(me->reversed, value); 48 | } 49 | } 50 | 51 | void Ridge_Detach(Ridge *me) 52 | { 53 | Ridge_SetStart(me, NULL); 54 | Ridge_SetEnd(me, NULL); 55 | } 56 | -------------------------------------------------------------------------------- /Sources/Extraction/Model/Ridge.h: -------------------------------------------------------------------------------- 1 | #ifndef MODEL_RIDGE_H 2 | #define MODEL_RIDGE_H 3 | 4 | typedef struct Ridge Ridge; 5 | 6 | #include "General/List.h" 7 | #include "Extraction/Model/Minutia.h" 8 | 9 | struct Ridge 10 | { 11 | List points; 12 | Minutia *startMinutia; 13 | Minutia *endMinutia; 14 | Ridge *reversed; 15 | }; 16 | 17 | Ridge Ridge_Construct(void); 18 | void Ridge_Destruct(Ridge *me); 19 | Minutia* Ridge_GetStart(const Ridge *me); 20 | void Ridge_SetStart(Ridge *me, Minutia *value); 21 | Minutia* Ridge_GetEnd(const Ridge *me); 22 | void Ridge_SetEnd(Ridge *me, Minutia *value); 23 | void Ridge_Detach(Ridge *me); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /Sources/Extraction/Model/SOURCES: -------------------------------------------------------------------------------- 1 | # Generated from Sources/Extraction/Model/Makefile.am 2 | srcs += Model/DotRemover.c 3 | srcs += Model/Minutia.c 4 | srcs += Model/Ridge.c 5 | srcs += Model/SkeletonBuilder.c 6 | # End 7 | -------------------------------------------------------------------------------- /Sources/Extraction/Model/SkeletonBuilder.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "SkeletonBuilder.h" 4 | 5 | List* SkeletonBuilder_GetMinutiae(const SkeletonBuilder *me) 6 | { 7 | return (List *) &me->allMinutiae; 8 | } 9 | 10 | void SkeletonBuilder_AddMinutia(SkeletonBuilder *me, Minutia *minutia) 11 | { 12 | List_AddData(&me->allMinutiae, minutia); 13 | } 14 | 15 | void SkeletonBuilder_RemoveMinutia(SkeletonBuilder *me, Minutia *minutia) 16 | { 17 | List_RemoveData(&me->allMinutiae, minutia); 18 | } 19 | 20 | SkeletonBuilder SkeletonBuilder_Clone(const SkeletonBuilder *me); 21 | -------------------------------------------------------------------------------- /Sources/Extraction/Model/SkeletonBuilder.h: -------------------------------------------------------------------------------- 1 | #ifndef MODEL_SKELETONBUILDER_H 2 | #define MODEL_SKELETONBUILDER_H 3 | 4 | #include 5 | 6 | #include "General/Point.h" 7 | #include "General/List.h" 8 | #include "Extraction/Model/Minutia.h" 9 | 10 | typedef struct SkeletonBuilder SkeletonBuilder; 11 | 12 | struct SkeletonBuilder 13 | { 14 | List allMinutiae; 15 | }; 16 | 17 | List* SkeletonBuilder_GetMinutiae(const SkeletonBuilder *me); 18 | void SkeletonBuilder_AddMinutia(SkeletonBuilder *me, Minutia *minutia); 19 | void SkeletonBuilder_RemoveMinutia(SkeletonBuilder *me, Minutia *minutia); 20 | SkeletonBuilder SkeletonBuilder_Clone(const SkeletonBuilder *me); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /Sources/Extraction/Orientation/readme.md: -------------------------------------------------------------------------------- 1 | #[Orientation Wiki](../../../../../wiki/Orientation-map) 2 | 3 | This folder is empty for now, as a placeholder for some file moves we shall do at the end. 4 | -------------------------------------------------------------------------------- /Sources/Extraction/Ridge Tracing/readme.md: -------------------------------------------------------------------------------- 1 | #[Ridge thinning Wiki](../../../../../wiki/Ridge-thinning) 2 | 3 | This folder is empty for now, as a placeholder for some file moves we shall do at the end. 4 | -------------------------------------------------------------------------------- /Sources/Extraction/SOURCES: -------------------------------------------------------------------------------- 1 | # Generated from Sources/Extraction/Makefile.am 2 | srcs += Extraction/Extract.c 3 | srcs += Extraction/Filters/AbsoluteContrast.c 4 | srcs += Extraction/Filters/Equalizer.c 5 | srcs += Extraction/Filters/InnerMask.c 6 | srcs += Extraction/Filters/OrientedSmoother.c 7 | srcs += Extraction/Filters/Thinner.c 8 | srcs += Extraction/Filters/ClippedContrast.c 9 | srcs += Extraction/Filters/HillOrientation.c 10 | srcs += Extraction/Filters/LinesByOrientation.c 11 | srcs += Extraction/Filters/RelativeContrast.c 12 | srcs += Extraction/Filters/ThresholdBinarizer.c 13 | srcs += Extraction/Filters/CrossRemover.c 14 | srcs += Extraction/Filters/ImageInverter.c 15 | srcs += Extraction/Filters/LocalHistogram.c 16 | srcs += Extraction/Filters/SegmentationMask.c 17 | srcs += Extraction/Filters/VotingFilter.c 18 | srcs += Extraction/Model/DotRemover.c 19 | srcs += Extraction/Model/Minutia.c 20 | srcs += Extraction/Model/Ridge.c 21 | srcs += Extraction/Model/SkeletonBuilder.c 22 | srcs += Extraction/MinutiaeDetection/MinutiaeDetection.c 23 | # End 24 | -------------------------------------------------------------------------------- /Sources/Extraction/Segmentation/readme.md: -------------------------------------------------------------------------------- 1 | #[Segmentation Wiki](../../../../../wiki/Segmentation) 2 | 3 | This folder is empty for now, as a placeholder for some file moves we shall do at the end. 4 | -------------------------------------------------------------------------------- /Sources/General/.gitignore: -------------------------------------------------------------------------------- 1 | /.deps 2 | /.dirstamp 3 | /lib*.la 4 | /lib*.lo 5 | /.libs 6 | /Makefile 7 | /Makefile.in 8 | /*.o 9 | -------------------------------------------------------------------------------- /Sources/General/Angle.c: -------------------------------------------------------------------------------- 1 | #include "Angle.h" 2 | #include 3 | 4 | static const double PI = 3.14159265358979323846; 5 | 6 | static float Angle_atan(double x, double y) 7 | { 8 | double result = atan2(y, x); 9 | 10 | if (result < 0) 11 | { 12 | result += 2 * PI; 13 | } 14 | 15 | return result; 16 | } 17 | 18 | float Angle_FromFraction(float fraction) 19 | { 20 | return fraction * 2 * PI; 21 | } 22 | 23 | float Angle_ToFraction(float radians) 24 | { 25 | return radians / (2 * PI); 26 | } 27 | 28 | float Angle_ByBucketCenter(int32_t bucket, int32_t resolution) 29 | { 30 | return Angle_FromFraction((float)(2 * bucket + 1) / (float)(2 * resolution)); 31 | } 32 | 33 | PointF Angle_ToVector(float angle) 34 | { 35 | return PointF_Construct(cos(angle), sin(angle)); 36 | } 37 | 38 | float Angle_Atan(Point p) 39 | { 40 | return Angle_atan(p.x, p.y); 41 | } 42 | 43 | float Angle_AtanF(PointF p) { 44 | return Angle_atan(p.x, p.y); 45 | } 46 | 47 | float Angle_ToOrientation(float direction) 48 | { 49 | if (direction < PI) return 2 * direction; 50 | 51 | return 2 * (direction - PI); 52 | } 53 | 54 | float Angle_Add(float angle1, float angle2) 55 | { 56 | float result = angle1 + angle2; 57 | 58 | if (result < (2 * PI)) 59 | { 60 | return result; 61 | } 62 | 63 | return result - (2 * PI); 64 | } 65 | -------------------------------------------------------------------------------- /Sources/General/Angle.h: -------------------------------------------------------------------------------- 1 | #ifndef GENERAL_ANGLE_H 2 | #define GENERAL_ANGLE_H 3 | 4 | #include 5 | #include "General/Point.h" 6 | #include "General/PointF.h" 7 | 8 | float Angle_ByBucketCenter(int32_t bucket, int32_t resolution); 9 | float Angle_FromFraction(float fraction); 10 | float Angle_ToFraction(float radians); 11 | PointF Angle_ToVector(float angle); 12 | float Angle_Atan(Point p); 13 | float Angle_AtanF(PointF p); 14 | float Angle_ToOrientation(float direction); 15 | float Angle_Add(float angle1, float angle2); 16 | 17 | #endif -------------------------------------------------------------------------------- /Sources/General/BlockMap.h: -------------------------------------------------------------------------------- 1 | #ifndef GENERAL_BLOCKMAP_H 2 | #define GENERAL_BLOCKMAP_H 3 | 4 | #include "General/Calc.h" 5 | #include "General/Point.h" 6 | #include "General/PointF.h" 7 | #include "General/Size.h" 8 | #include "General/Array.h" 9 | #include "General/RectangleC.h" 10 | 11 | typedef struct PointGrid PointGrid; 12 | typedef struct RectangleGrid RectangleGrid; 13 | typedef struct BlockMap BlockMap; 14 | 15 | struct PointGrid 16 | { 17 | Int32Array1D allX; 18 | Int32Array1D allY; 19 | }; 20 | 21 | struct RectangleGrid 22 | { 23 | PointGrid corners; 24 | }; 25 | 26 | struct BlockMap 27 | { 28 | Size pixelCount; 29 | Size blockCount; 30 | Size cornerCount; 31 | RectangleC allBlocks; 32 | RectangleC allCorners; 33 | PointGrid corners; 34 | RectangleGrid blockAreas; 35 | PointGrid blockCenters; 36 | RectangleGrid cornerAreas; 37 | int maxBlockSize; 38 | }; 39 | 40 | BlockMap BlockMap_Construct(const Size *pixelSize, int maxBlockSize); 41 | void BlockMap_Destruct(BlockMap *me); 42 | 43 | PointGrid PointGrid_Construct(const Size *s); 44 | void PointGrid_Destruct(PointGrid *me); 45 | Point PointGrid_GetPointFromCoordinates(const PointGrid *me, int x, int y); 46 | Point PointGrid_GetPointFromPoint(const PointGrid *me, const Point *at); 47 | 48 | RectangleGrid RectangleGrid_Construct(const PointGrid *c); 49 | RectangleC RectangleGrid_GetRectangleCFromCoordinates(const RectangleGrid *me, int x, int y); 50 | RectangleC RectangleGrid_GetRectangleCFromPoint(const RectangleGrid *me, const Point *at); 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /Sources/General/Calc.c: -------------------------------------------------------------------------------- 1 | #include "General/Point.h" 2 | #include "General/PointF.h" 3 | #include "General/Size.h" 4 | #include "General/Calc.h" 5 | #include "General/SizeF.h" 6 | 7 | int Calc_DivRoundUp(int input, int divider) 8 | { 9 | return (input + divider - 1) / divider; 10 | } 11 | 12 | int Calc_InterpolateFrom3Ints(int index, int count, int range) 13 | { 14 | return (index * range + count / 2) / count; 15 | } 16 | 17 | Point Calc_Add2Points(const Point *p1, const Point *p2) 18 | { 19 | Size s = Size_ConstructFromPoint(p2); 20 | return Point_AddSize(p1, &s); 21 | } 22 | 23 | PointF Calc_Add2PointsF(const PointF *p1, const PointF *p2) { 24 | SizeF s = SizeF_ConstructFromPointF(p2); 25 | return PointF_AddSizeF(p1, &s); 26 | } 27 | 28 | PointF Calc_Scalar_Multiply(float scalar, PointF p) { 29 | return (PointF) { .x = scalar * p.x, .y = scalar * p.y }; 30 | } 31 | 32 | float Calc_InterpolateFrom3Floats(float value0, float value1, float fraction) 33 | { 34 | return value0 + fraction * (value1 - value0); 35 | } 36 | 37 | float Calc_InterpolateRect(float topLeft, float topRight, float bottomLeft, float bottomRight, const PointF *fraction) 38 | { 39 | float left = Calc_InterpolateFrom3Floats(bottomLeft, topLeft, fraction->y); 40 | float right = Calc_InterpolateFrom3Floats(bottomRight, topRight, fraction->y); 41 | return Calc_InterpolateFrom3Floats(left, right, fraction->x); 42 | } 43 | 44 | int Calc_CountBits(uint32_t value) 45 | { 46 | int count = 0; 47 | while (value != 0) 48 | { 49 | ++count; 50 | value &= value - 1; 51 | } 52 | return count; 53 | } 54 | 55 | -------------------------------------------------------------------------------- /Sources/General/Calc.h: -------------------------------------------------------------------------------- 1 | #ifndef GENERAL_CALC_H 2 | #define GENERAL_CALC_H 3 | #include 4 | 5 | #include "General/Point.h" 6 | #include "General/PointF.h" 7 | 8 | int Calc_DivRoundUp(int input, int divider); 9 | int Calc_InterpolateFrom3Ints(int index, int count, int range); 10 | Point Calc_Add2Points(const Point *p1, const Point *p2); 11 | float Calc_InterpolateFrom3Floats(float value0, float value1, float fraction); 12 | float Calc_InterpolateRect(float topLeft, float topRight, float bottomLeft, float bottomRight, const PointF *fraction); 13 | PointF Calc_Add2PointsF(const PointF *p1, const PointF *p2); 14 | PointF Calc_Scalar_Multiply(float scalar, PointF p1); 15 | int Calc_CountBits(uint32_t value); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /Sources/General/List.h: -------------------------------------------------------------------------------- 1 | #ifndef GENERAL_LIST_H 2 | #define GENERAL_LIST_H 3 | 4 | #include 5 | #include 6 | 7 | typedef struct ListElement 8 | { 9 | void *data; 10 | struct ListElement *prev; 11 | struct ListElement *next; 12 | } ListElement; 13 | 14 | typedef struct List 15 | { 16 | int32_t count; 17 | ListElement *head; 18 | ListElement *tail; 19 | } List; 20 | 21 | List List_Construct(void); 22 | 23 | // Note that this only destructs the list structure - NOT the data contained within 24 | void List_Destruct(List* me); 25 | 26 | // Destroy the elements and the list using the supplied free function 27 | void List_Destroy(List* me, void (*fr)(void* f)); 28 | int32_t List_GetCount(List *me); 29 | int32_t List_Remove(List *me, ListElement *item, void **data); 30 | 31 | void List_AddData(List *me, const void *data); 32 | bool List_ContainsData(const List *me, const void *data); 33 | int32_t List_RemoveData(List *me, const void *data); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Sources/General/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- makefile-automake -*- 2 | # 3 | # Build library 4 | # 5 | # $Id$ 6 | # 7 | # Blame: Jordan Hrycaj 8 | 9 | # --------------------------------------------------------------------------- 10 | # Target 11 | # --------------------------------------------------------------------------- 12 | 13 | all-local:: SOURCES 14 | 15 | SOURCES: Makefile 16 | @rm -f $@ 17 | @echo ">>> Generating $@" 18 | @echo "# Generated from $(subdir)/Makefile.am" >> $@ 19 | @d=`basename $(subdir)`;\ 20 | for s in $(srcs); do \ 21 | echo "srcs += $$d/$$s"; done >> $@ 22 | @echo "# End" >> $@ 23 | 24 | # --------------------------------------------------------------------------- 25 | # Sources 26 | # --------------------------------------------------------------------------- 27 | 28 | srcs = Angle.c BinaryMap.c Calc.c pgm.c PointF.c 29 | srcs += Range.c Size.c Array.c BlockMap.c List.c 30 | srcs += Point.c PolarPoint.c RectangleC.c SizeF.c 31 | 32 | # --------------------------------------------------------------------------- 33 | # End 34 | # --------------------------------------------------------------------------- 35 | -------------------------------------------------------------------------------- /Sources/General/Neighborhood.h: -------------------------------------------------------------------------------- 1 | #ifndef GENERAL_NEIGHBORHOOD_H 2 | #define GENERAL_NEIGHBORHOOD_H 3 | 4 | #include "General/Point.h" 5 | 6 | typedef struct Neighborhood Neighborhood; 7 | 8 | struct Neighborhood { 9 | Point EdgeNeighbors[4]; 10 | Point CornerNeighbors[8]; 11 | } 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /Sources/General/Point.c: -------------------------------------------------------------------------------- 1 | #include "General/Point.h" 2 | #include "General/Size.h" 3 | 4 | 5 | Point Point_Construct(int xx, int yy) 6 | { 7 | Point p; 8 | p.x = xx; 9 | p.y = yy; 10 | return p; 11 | } 12 | 13 | int Point_GetHashCode(void) 14 | { 15 | /* TODO */ 16 | return 0; 17 | } 18 | 19 | bool Point_IsSameAs(const Point *me, const Point *p) 20 | { 21 | return me == p; 22 | } 23 | 24 | bool Point_IsEqual(const Point *p1, const Point *p2) 25 | { 26 | return p1->x == p2->x && p1->y == p2->y; 27 | } 28 | 29 | bool Point_IsNotEqual(const Point *p1, const Point *p2) 30 | { 31 | return p1->x != p2->x || p1->y != p2->y; 32 | } 33 | 34 | Point Point_AddSize(const Point *p, const Size *s) 35 | { 36 | return Point_Construct(p->x + s->width, p->y + s->height); 37 | } 38 | 39 | Point Point_SubtractSize(const Point *p, const Size *s) 40 | { 41 | return Point_Construct(p->x - s->width, p->y - s->height); 42 | } 43 | -------------------------------------------------------------------------------- /Sources/General/Point.h: -------------------------------------------------------------------------------- 1 | #ifndef GENERAL_POINT_H 2 | #define GENERAL_POINT_H 3 | 4 | #include 5 | 6 | typedef struct Point Point; 7 | 8 | struct Point { 9 | int x; 10 | int y; 11 | }; 12 | 13 | #include "General/Size.h" 14 | 15 | Point Point_Construct(int xx, int yy); 16 | int Point_GetHashCode(void); 17 | bool Point_IsSameAs(const Point *me, const Point *p); 18 | bool Point_IsEqual(const Point *p1, const Point *p2); 19 | bool Point_IsNotEqual(const Point *p1, const Point *p2); 20 | Point Point_AddSize(const Point *p, const Size *s); 21 | Point Point_SubtractSize(const Point *p, const Size *s); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /Sources/General/PointF.c: -------------------------------------------------------------------------------- 1 | #include "General/Point.h" 2 | #include "General/SizeF.h" 3 | #include "General/PointF.h" 4 | 5 | 6 | PointF PointF_Construct(float xx, float yy) 7 | { 8 | PointF p; 9 | p.x = xx; 10 | p.y = yy; 11 | return p; 12 | } 13 | 14 | PointF PointF_ConstructFromPoint(const Point *p) 15 | { 16 | PointF q; 17 | q.x = p->x; 18 | q.y = p->y; 19 | return q; 20 | } 21 | 22 | PointF PointF_AddSizeF(const PointF *p, const SizeF *s) 23 | { 24 | return PointF_Construct(p->x + s->width, p->y + s->height); 25 | } 26 | 27 | PointF PointF_Multiply(float factor, const PointF *p) 28 | { 29 | return PointF_Construct(factor * p->x, factor * p->y); 30 | } 31 | -------------------------------------------------------------------------------- /Sources/General/PointF.h: -------------------------------------------------------------------------------- 1 | #ifndef GENERAL_POINTF_H 2 | #define GENERAL_POINTF_H 3 | 4 | #include 5 | 6 | #include "General/Point.h" 7 | 8 | 9 | typedef struct PointF PointF; 10 | 11 | struct PointF { 12 | float x; 13 | float y; 14 | }; 15 | 16 | #include "General/SizeF.h" 17 | 18 | PointF PointF_Construct(float xx, float yy); 19 | PointF PointF_ConstructFromPoint(const Point *p); 20 | PointF PointF_AddSizeF(const PointF *p, const SizeF *s); 21 | PointF Point_Multiply(float factor, const PointF *p); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /Sources/General/PolarPoint.c: -------------------------------------------------------------------------------- 1 | #include "General/PolarPoint.h" 2 | 3 | 4 | PolarPoint PolarPoint_Construct(int d, uint8_t a) 5 | { 6 | PolarPoint p; 7 | p.distance = d; 8 | p.angle = a; 9 | return p; 10 | } 11 | -------------------------------------------------------------------------------- /Sources/General/PolarPoint.h: -------------------------------------------------------------------------------- 1 | #ifndef GENERAL_POLARPOINT_H 2 | #define GENERAL_POLARPOINT_H 3 | 4 | #include 5 | 6 | typedef struct PolarPoint PolarPoint; 7 | 8 | struct PolarPoint { 9 | int distance; 10 | uint8_t angle; 11 | }; 12 | 13 | PolarPoint PolarPoint_Construct(int d, uint8_t a); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /Sources/General/Range.c: -------------------------------------------------------------------------------- 1 | #include "General/Range.h" 2 | #include "General/Calc.h" 3 | 4 | Range Range_Construct(int b, int e) 5 | { 6 | Range r; 7 | r.begin = b; 8 | r.end = e; 9 | return r; 10 | } 11 | 12 | Range Range_ConstructFromLength(int l) 13 | { 14 | Range r; 15 | r.begin = 0; 16 | r.end = l; 17 | return r; 18 | } 19 | 20 | int Range_GetLength(Range *me) 21 | { 22 | return me->end - me->begin; 23 | } 24 | 25 | int Range_Interpolate(Range *me, int index, int count) 26 | { 27 | return Calc_InterpolateFrom3Ints(index, count, Range_GetLength(me)) + me->begin; 28 | } 29 | -------------------------------------------------------------------------------- /Sources/General/Range.h: -------------------------------------------------------------------------------- 1 | #ifndef GENERAL_RANGE_H 2 | #define GENERAL_RANGE_H 3 | 4 | typedef struct Range Range; 5 | 6 | struct Range { 7 | int begin; 8 | int end; 9 | }; 10 | 11 | Range Range_Construct(int b, int e); 12 | Range Range_ConstructFromLength(int l); 13 | 14 | int Range_Interpolate(Range *me, int index, int count); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Sources/General/RectangleC.h: -------------------------------------------------------------------------------- 1 | #ifndef GENERAL_RECTANGLEC_H 2 | #define GENERAL_RECTANGLEC_H 3 | 4 | #include 5 | 6 | #include "General/Point.h" 7 | #include "General/PointF.h" 8 | #include "General/Range.h" 9 | #include "General/Size.h" 10 | 11 | typedef struct RectangleC RectangleC; 12 | 13 | struct RectangleC { 14 | int x; 15 | int y; 16 | int width; 17 | int height; 18 | }; 19 | 20 | int RectangleC_GetLeft(const RectangleC *me); 21 | void RectangleC_SetLeft(RectangleC *me, int value); 22 | int RectangleC_GetBottom(const RectangleC *me); 23 | void RectangleC_SetBottom(RectangleC *me, int value); 24 | int RectangleC_GetRight(const RectangleC *me); 25 | void RectangleC_SetRight(RectangleC *me, int value); 26 | int RectangleC_GetTop(const RectangleC *me); 27 | void RectangleC_SetTop(RectangleC *me, int value); 28 | Point RectangleC_GetPoint(const RectangleC *me); 29 | void RectangleC_SetPoint(RectangleC *me, const Point *value); 30 | Size RectangleC_GetSize(const RectangleC *me); 31 | void RectangleC_SetSize(RectangleC *me, const Size *value); 32 | Range RectangleC_GetRangeX(const RectangleC *me); 33 | Range RectangleC_GetRangeY(const RectangleC *me); 34 | Point RectangleC_GetCenter(const RectangleC *me); 35 | int RectangleC_GetTotalArea(const RectangleC *me); 36 | 37 | RectangleC RectangleC_ConstructFromRectangleC(const RectangleC *other); 38 | RectangleC RectangleC_ConstructFromPointSize(const Point *at, const Size *size); 39 | RectangleC RectangleC_ConstructFrom4Ints(int x, int y, int width, int height); 40 | RectangleC RectangleC_ConstructFrom2Points(const Point *begin, const Point *end); 41 | RectangleC RectangleC_ConstructFromSize(const Size *size); 42 | RectangleC RectangleC_ConstructFrom2Ints(int width, int height); 43 | 44 | bool RectangleC_Contains(const RectangleC *me, const Point *point); 45 | Point RectangleC_GetRelative(const RectangleC *me, const Point *absolute); 46 | PointF RectangleC_GetFraction(const RectangleC *me, const Point *absolute); 47 | void RectangleC_Shift(RectangleC *me, const Point *relative); 48 | RectangleC RectangleC_GetShifted(const RectangleC *me, const Point *relative); 49 | void RectangleC_Clip(RectangleC *me, const RectangleC *other); 50 | void RectangleC_Include(RectangleC *me, const Point *point); 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /Sources/General/SOURCES: -------------------------------------------------------------------------------- 1 | # Generated from Sources/General/Makefile.am 2 | srcs += General/Angle.c 3 | srcs += General/BinaryMap.c 4 | srcs += General/Calc.c 5 | srcs += General/pgm.c 6 | srcs += General/PointF.c 7 | srcs += General/Range.c 8 | srcs += General/Size.c 9 | srcs += General/Array.c 10 | srcs += General/BlockMap.c 11 | srcs += General/List.c 12 | srcs += General/Point.c 13 | srcs += General/PolarPoint.c 14 | srcs += General/RectangleC.c 15 | srcs += General/SizeF.c 16 | # End 17 | -------------------------------------------------------------------------------- /Sources/General/Size.c: -------------------------------------------------------------------------------- 1 | #include "General/Size.h" 2 | #include "General/Point.h" 3 | 4 | 5 | Size Size_Construct(int w, int h) 6 | { 7 | Size s; 8 | s.width = w; 9 | s.height = h; 10 | return s; 11 | } 12 | 13 | Size Size_ConstructFromPoint(const Point *p) 14 | { 15 | Size s; 16 | s.width = p->x; 17 | s.height = p->y; 18 | return s; 19 | } 20 | 21 | int Size_GetHashCode(void) 22 | { 23 | /* TODO */ 24 | return 0; 25 | } 26 | 27 | bool Size_IsSameAs(const Size *me, const Size *s) 28 | { 29 | return me == s; 30 | } 31 | 32 | bool Size_IsEqual(const Size *s1, const Size *s2) 33 | { 34 | return s1->width == s2->width && s1->height == s2->height; 35 | } 36 | 37 | bool Size_IsNotEqual(const Size *s1, const Size *s2) 38 | { 39 | return s1->width != s2->width || s1->height != s2->height; 40 | } 41 | -------------------------------------------------------------------------------- /Sources/General/Size.h: -------------------------------------------------------------------------------- 1 | #ifndef GENERAL_SIZE_H 2 | #define GENERAL_SIZE_H 3 | 4 | #include 5 | 6 | typedef struct Size Size; 7 | 8 | struct Size { 9 | int width; 10 | int height; 11 | }; 12 | 13 | #include "General/Point.h" 14 | 15 | Size Size_Construct(int w, int h); 16 | Size Size_ConstructFromPoint(const Point *p); 17 | int Size_GetHashCode(void); 18 | bool Size_IsSameAs(const Size *me, const Size *s); 19 | bool Size_IsEqual(const Size *s1, const Size *s2); 20 | bool Size_IsNotEqual(const Size *s1, const Size *s2); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /Sources/General/SizeF.c: -------------------------------------------------------------------------------- 1 | #include "General/PointF.h" 2 | #include "General/SizeF.h" 3 | 4 | 5 | SizeF SizeF_Construct(float w, float h) 6 | { 7 | SizeF s; 8 | s.width = w; 9 | s.height = h; 10 | return s; 11 | } 12 | 13 | SizeF SizeF_ConstructFromPointF(const PointF *p) 14 | { 15 | SizeF s; 16 | s.width = p->x; 17 | s.height = p->y; 18 | return s; 19 | } 20 | -------------------------------------------------------------------------------- /Sources/General/SizeF.h: -------------------------------------------------------------------------------- 1 | #ifndef GENERAL_SIZEF_H 2 | #define GENERAL_SIZEF_H 3 | 4 | typedef struct SizeF SizeF; 5 | 6 | struct SizeF { 7 | float width; 8 | float height; 9 | }; 10 | 11 | #include "General/PointF.h" 12 | 13 | SizeF SizeF_Construct(float w, float h); 14 | SizeF SizeF_ConstructFromPointF(const PointF *p); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Sources/General/pgm.h: -------------------------------------------------------------------------------- 1 | #ifndef GENERAL_PGM_H 2 | #define GENERAL_PGM_H 3 | 4 | #include "General/Array.h" 5 | 6 | UInt8Array2D pgm_read(const char* fname); 7 | 8 | void pgm_write(const char* fname, UInt8Array2D* p); 9 | 10 | #endif -------------------------------------------------------------------------------- /Sources/Matcher/.gitignore: -------------------------------------------------------------------------------- 1 | /.deps 2 | /.dirstamp 3 | /lib*.a 4 | /lib*.la 5 | /lib*.lo 6 | /.libs 7 | /Makefile 8 | /Makefile.in 9 | /*.o 10 | -------------------------------------------------------------------------------- /Sources/Matcher/BestMatchSkipper.c: -------------------------------------------------------------------------------- 1 | #include "Matcher/BestMatchSkipper.h" 2 | 3 | BestMatchSkipper BestMatchSkipper_Construct(int32_t persons, int32_t skip) 4 | { 5 | BestMatchSkipper r; 6 | 7 | r.collected = FloatArray2D_Construct(skip + 1, persons); 8 | for (int i=0;icollected); 20 | } 21 | 22 | void BestMatchSkipper_AddScore(const BestMatchSkipper* me, int32_t person, float score) 23 | { 24 | for (int nth = me->collected.sizeX - 1; nth >=0; --nth) 25 | { 26 | if (me->collected.data[nth][person] < score) 27 | { 28 | if (nth + 1 < me->collected.sizeX) 29 | me->collected.data[nth+1][person] = me->collected.data[nth][person]; 30 | 31 | me->collected.data[nth][person] = score; 32 | } 33 | } 34 | } 35 | 36 | 37 | float BestMatchSkipper_GetSkipScore(const BestMatchSkipper* me, int32_t person) 38 | { 39 | float score = 0; 40 | for (int nth = me->collected.sizeX - 1; nth >= 0; --nth) 41 | { 42 | if (me->collected.data[nth][person] > 0) 43 | { 44 | score = me->collected.data[nth][person]; 45 | break; 46 | } 47 | } 48 | return score; 49 | } 50 | 51 | PersonsSkipScore* GetSortedScores(const BestMatchSkipper* me, int* size) 52 | { 53 | return 0; 54 | } 55 | -------------------------------------------------------------------------------- /Sources/Matcher/BestMatchSkipper.h: -------------------------------------------------------------------------------- 1 | #ifndef _BESTMATCHSKIPPER_H_ 2 | #define _BESTMATCHSKIPPER_H_ 3 | 4 | #include "General/Array.h" 5 | #include 6 | 7 | typedef struct PersonsSkipScore PersonsSkipScore; 8 | 9 | struct PersonsSkipScore { 10 | int32_t person; 11 | float score; 12 | }; 13 | 14 | typedef struct BestMatchSkipper BestMatchSkipper; 15 | 16 | struct BestMatchSkipper { 17 | FloatArray2D collected; 18 | }; 19 | 20 | BestMatchSkipper BestMatchSkipper_Construct(int32_t persons, int32_t skip); 21 | void BestMatchSkipper_Destruct(BestMatchSkipper* me); 22 | void BestMatchSkipper_AddScore(const BestMatchSkipper* me, int32_t person, float score); 23 | float BestMatchSkipper_GetSkipScore(const BestMatchSkipper* me, int32_t person); 24 | struct PersonsSkipScore* GetSortedScores(const BestMatchSkipper* me, int* size); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /Sources/Matcher/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- makefile-automake -*- 2 | # 3 | # Build library 4 | # 5 | # $Id$ 6 | # 7 | # Blame: Jordan Hrycaj 8 | 9 | SUBDIRS = Minutia 10 | 11 | # --------------------------------------------------------------------------- 12 | # Target 13 | # --------------------------------------------------------------------------- 14 | 15 | all-local:: SOURCES 16 | 17 | SOURCES: Makefile Minutia/SOURCES 18 | @rm -f $@ 19 | @echo ">>> Generating $@" 20 | @echo "# Generated from $(subdir)/Makefile.am" >> $@ 21 | @d=`basename $(subdir)`;\ 22 | for s in $(srcs); do \ 23 | echo "srcs += $$d/$$s"; done >> $@ 24 | @echo "# End" >> $@ 25 | 26 | # --------------------------------------------------------------------------- 27 | # Sources 28 | # --------------------------------------------------------------------------- 29 | 30 | srcs = 31 | 32 | include Minutia/SOURCES 33 | 34 | srcs += BestMatchSkipper.c 35 | 36 | # --------------------------------------------------------------------------- 37 | # End 38 | # --------------------------------------------------------------------------- 39 | -------------------------------------------------------------------------------- /Sources/Matcher/Minutia/.gitignore: -------------------------------------------------------------------------------- 1 | /.deps 2 | /.dirstamp 3 | /lib*.la 4 | /lib*.lo 5 | /.libs 6 | /Makefile 7 | /Makefile.in 8 | /*.o 9 | -------------------------------------------------------------------------------- /Sources/Matcher/Minutia/EdgeLocation.h: -------------------------------------------------------------------------------- 1 | #ifndef _EDGELOCATION_H_ 2 | #define _EDGELOCATION_H_ 3 | 4 | #include 5 | 6 | struct EdgeLocation { 7 | uint16_t reference; 8 | uint16_t neighbour; 9 | }; 10 | 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Sources/Matcher/Minutia/EdgeShape.h: -------------------------------------------------------------------------------- 1 | #ifndef _EDGESHAPE_H_ 2 | #define _EDGESHAPE_H_ 3 | 4 | #include 5 | 6 | typedef struct EdgeShape EdgeShape; 7 | 8 | struct EdgeShape 9 | { 10 | int16_t length; 11 | uint8_t referenceAngle; 12 | uint8_t neighbourAngle; 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /Sources/Matcher/Minutia/IndexedEdge.h: -------------------------------------------------------------------------------- 1 | #ifndef _INDEXEDEDGE_H_ 2 | #define _INDEXEDEDGE_H_ 3 | 4 | #include "Matcher/Minutia/EdgeShape.h" 5 | #include "Matcher/Minutia/EdgeLocation.h" 6 | 7 | typedef struct IndexedEdge IndexedEdge; 8 | 9 | struct IndexedEdge 10 | { 11 | EdgeShape shape; 12 | EdgeLocation location; 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /Sources/Matcher/Minutia/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- makefile-automake -*- 2 | # 3 | # Build library 4 | # 5 | # $Id$ 6 | # 7 | # Blame: Jordan Hrycaj 8 | 9 | # --------------------------------------------------------------------------- 10 | # Target 11 | # --------------------------------------------------------------------------- 12 | 13 | all-local:: SOURCES 14 | 15 | SOURCES: Makefile 16 | @rm -f $@ 17 | @echo ">>> Generating $@" 18 | @echo "# Generated from $(subdir)/Makefile.am" >> $@ 19 | @d=`basename $(subdir)`;\ 20 | for s in $(srcs); do \ 21 | echo "srcs += $$d/$$s"; done >> $@ 22 | @echo "# End" >> $@ 23 | 24 | # --------------------------------------------------------------------------- 25 | # Sources 26 | # --------------------------------------------------------------------------- 27 | 28 | srcs = PairInfo.c 29 | 30 | # --------------------------------------------------------------------------- 31 | # End 32 | # --------------------------------------------------------------------------- 33 | -------------------------------------------------------------------------------- /Sources/Matcher/Minutia/MinutiaPair.h: -------------------------------------------------------------------------------- 1 | #ifndef _MINUTIAPAIR_H_ 2 | #define _MINUTIAPAIR_H_ 3 | 4 | #include 5 | 6 | typedef struct MinutiaPair MinutiaPair; 7 | 8 | struct MinutiaPair { 9 | uint16_t probe; 10 | uint16_t candidate; 11 | }; 12 | 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /Sources/Matcher/Minutia/NeighbourEdge.h: -------------------------------------------------------------------------------- 1 | #ifndef _NEIGHBOUREDGE_H_ 2 | #define _NEIGHBOUREDGE_H_ 3 | 4 | #include "Matcher/Minutia/EdgeShape.h" 5 | 6 | typedef struct NeighbourEdge NeighbourEdge; 7 | 8 | struct NeighbourEdge 9 | { 10 | EdgeShape edge; 11 | int32_t neighbour; 12 | }; 13 | 14 | #endif 15 | 16 | -------------------------------------------------------------------------------- /Sources/Matcher/Minutia/PairInfo.c: -------------------------------------------------------------------------------- 1 | #include "Matcher/Minutia/PairInfo.h" 2 | 3 | PairInfo PairInfo_Clone(const PairInfo* me) { 4 | PairInfo p; 5 | p.pair = me->pair; 6 | p.reference = me->reference; 7 | p.supportingEdges = me->supportingEdges; 8 | 9 | return p; 10 | } 11 | -------------------------------------------------------------------------------- /Sources/Matcher/Minutia/PairInfo.h: -------------------------------------------------------------------------------- 1 | #ifndef _PAIRINFO_H_ 2 | #define _PAIRINFO_H_ 3 | 4 | #include "Matcher/Minutia/MinutiaPair.h" 5 | 6 | typedef struct PairInfo PairInfo; 7 | 8 | struct PairInfo { 9 | MinutiaPair pair; 10 | MinutiaPair reference; 11 | int supportingEdges; 12 | }; 13 | 14 | #endif 15 | 16 | -------------------------------------------------------------------------------- /Sources/Matcher/Minutia/SOURCES: -------------------------------------------------------------------------------- 1 | # Generated from Sources/Matcher/Minutia/Makefile.am 2 | srcs += Minutia/PairInfo.c 3 | # End 4 | -------------------------------------------------------------------------------- /Sources/Matcher/SOURCES: -------------------------------------------------------------------------------- 1 | # Generated from Sources/Matcher/Makefile.am 2 | srcs += Matcher/Minutia/PairInfo.c 3 | srcs += Matcher/BestMatchSkipper.c 4 | # End 5 | -------------------------------------------------------------------------------- /Sources/Matcher/readme.md: -------------------------------------------------------------------------------- 1 | #[Matching Wiki](../../../../wiki/Matching) 2 | -------------------------------------------------------------------------------- /Sources/Tests/.gitignore: -------------------------------------------------------------------------------- 1 | /.deps 2 | /.dirstamp 3 | /lib*.la 4 | /lib*.lo 5 | /.libs 6 | /Makefile 7 | /Makefile.in 8 | /*.o 9 | -------------------------------------------------------------------------------- /Sources/Tests/DataStructures/.gitignore: -------------------------------------------------------------------------------- 1 | /.deps 2 | /.dirstamp 3 | /lib*.la 4 | /lib*.lo 5 | /.libs 6 | /Makefile 7 | /Makefile.in 8 | /*.o 9 | -------------------------------------------------------------------------------- /Sources/Tests/DataStructures/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- makefile-automake -*- 2 | # 3 | # Build library 4 | # 5 | # $Id$ 6 | # 7 | # Blame: Jordan Hrycaj 8 | 9 | # --------------------------------------------------------------------------- 10 | # Target 11 | # --------------------------------------------------------------------------- 12 | 13 | all-local:: SOURCES 14 | 15 | SOURCES: Makefile 16 | @rm -f $@ 17 | @echo ">>> Generating $@" 18 | @echo "# Generated from $(subdir)/Makefile.am" >> $@ 19 | @d=`basename $(subdir)`;\ 20 | for s in $(tsrc); do \ 21 | echo "tsrc += $$d/$$s"; done >> $@ 22 | @echo "# End" >> $@ 23 | 24 | # --------------------------------------------------------------------------- 25 | # Sources 26 | # --------------------------------------------------------------------------- 27 | 28 | tsrc = Test_DataStructures.c TestRunner_DataStructures.c 29 | 30 | # --------------------------------------------------------------------------- 31 | # End 32 | # --------------------------------------------------------------------------- 33 | -------------------------------------------------------------------------------- /Sources/Tests/DataStructures/SOURCES: -------------------------------------------------------------------------------- 1 | # Generated from Sources/Tests/DataStructures/Makefile.am 2 | tsrc += DataStructures/Test_DataStructures.c 3 | tsrc += DataStructures/TestRunner_DataStructures.c 4 | # End 5 | -------------------------------------------------------------------------------- /Sources/Tests/DataStructures/TestRunner_DataStructures.c: -------------------------------------------------------------------------------- 1 | #include "unity.h" 2 | #include "unity_fixture.h" 3 | 4 | TEST_GROUP_RUNNER(DataStructures) 5 | { 6 | RUN_TEST_CASE(DataStructures, BlockMap_SanityCheck); 7 | RUN_TEST_CASE(DataStructures, Image_SanityCheck); 8 | RUN_TEST_CASE(DataStructures, Histogram_SanityCheck); 9 | RUN_TEST_CASE(DataStructures, TwoDFloatArray_SanityCheck); 10 | RUN_TEST_CASE(DataStructures, TwoDByteArray_SanityCheck); 11 | RUN_TEST_CASE(DataStructures, Int_SanityCheck); 12 | RUN_TEST_CASE(DataStructures, Float_SanityCheck); 13 | RUN_TEST_CASE(DataStructures, Two2PointArray_SanityCheck); 14 | } 15 | -------------------------------------------------------------------------------- /Sources/Tests/Extraction/.gitignore: -------------------------------------------------------------------------------- 1 | /.deps 2 | /.dirstamp 3 | /lib*.la 4 | /lib*.lo 5 | /.libs 6 | /Makefile 7 | /Makefile.in 8 | /*.o 9 | -------------------------------------------------------------------------------- /Sources/Tests/Extraction/Filters/.gitignore: -------------------------------------------------------------------------------- 1 | /.deps 2 | /.dirstamp 3 | /lib*.la 4 | /lib*.lo 5 | /.libs 6 | /Makefile 7 | /Makefile.in 8 | /*.o 9 | -------------------------------------------------------------------------------- /Sources/Tests/Extraction/Filters/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- makefile-automake -*- 2 | # 3 | # Build library 4 | # 5 | # $Id$ 6 | # 7 | # Blame: Jordan Hrycaj 8 | 9 | SUBDIRS = runners 10 | 11 | # --------------------------------------------------------------------------- 12 | # Target 13 | # --------------------------------------------------------------------------- 14 | 15 | all-local:: SOURCES 16 | 17 | SOURCES: Makefile runners/SOURCES 18 | @rm -f $@ 19 | @echo ">>> Generating $@" 20 | @echo "# Generated from $(subdir)/Makefile.am" >> $@ 21 | @d=`basename $(subdir)`;\ 22 | for s in $(tsrc); do \ 23 | echo "tsrc += $$d/$$s"; done >> $@ 24 | @echo "# End" >> $@ 25 | 26 | # --------------------------------------------------------------------------- 27 | # Sources 28 | # --------------------------------------------------------------------------- 29 | 30 | tsrc = Test_HillOrientation.c Test_LocalHistogram.c Test_Thinner.c 31 | tsrc += Test_LinesByOrientation.c Test_OrientedSmoother.c Test_VotingFilter.c 32 | 33 | include runners/SOURCES 34 | 35 | # --------------------------------------------------------------------------- 36 | # End 37 | # --------------------------------------------------------------------------- 38 | -------------------------------------------------------------------------------- /Sources/Tests/Extraction/Filters/SOURCES: -------------------------------------------------------------------------------- 1 | # Generated from Sources/Tests/Extraction/Filters/Makefile.am 2 | tsrc += Filters/Test_HillOrientation.c 3 | tsrc += Filters/Test_LocalHistogram.c 4 | tsrc += Filters/Test_Thinner.c 5 | tsrc += Filters/Test_LinesByOrientation.c 6 | tsrc += Filters/Test_OrientedSmoother.c 7 | tsrc += Filters/Test_VotingFilter.c 8 | tsrc += Filters/runners/TestRunner_HillOrientation.c 9 | tsrc += Filters/runners/TestRunner_OrientedSmoother.c 10 | tsrc += Filters/runners/TestRunner_LinesByOrientation.c 11 | tsrc += Filters/runners/TestRunner_Thinner.c 12 | tsrc += Filters/runners/TestRunner_LocalHistogram.c 13 | tsrc += Filters/runners/TestRunner_VotingFilter.c 14 | # End 15 | -------------------------------------------------------------------------------- /Sources/Tests/Extraction/Filters/Test_Thinner.c: -------------------------------------------------------------------------------- 1 | #include "Extraction/Filters/Thinner.h" 2 | #include "General/BinaryMap.h" 3 | #include "Utils/IO/BinaryMapIO.h" 4 | #include "Utils/IO/SimpleDataTypesIO.h" 5 | #include "unity.h" 6 | #include "unity_fixture.h" 7 | 8 | #include 9 | 10 | TEST_GROUP(Thinner); 11 | 12 | TEST_SETUP(Thinner) 13 | { 14 | } 15 | 16 | TEST_TEAR_DOWN(Thinner) 17 | { 18 | } 19 | 20 | TEST(Thinner, Thinner_PassThrough) 21 | { 22 | Thinner_Construct(); 23 | } 24 | 25 | TEST(Thinner, Thinner_Thin) 26 | { 27 | Thinner t = Thinner_Construct(); 28 | BinaryMap bm = BinaryMap_Construct(3,3); 29 | BinaryMap out = BinaryMap_Construct(3,3); 30 | 31 | Thinner_Thin(&t, &bm, &out); 32 | 33 | BinaryMap_Destruct(&bm); 34 | BinaryMap_Destruct(&out); 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Tests/Extraction/Filters/runners/.gitignore: -------------------------------------------------------------------------------- 1 | /.deps 2 | /.dirstamp 3 | /lib*.la 4 | /lib*.lo 5 | /.libs 6 | /Makefile 7 | /Makefile.in 8 | /*.o 9 | -------------------------------------------------------------------------------- /Sources/Tests/Extraction/Filters/runners/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- makefile-automake -*- 2 | # 3 | # Build library 4 | # 5 | # $Id$ 6 | # 7 | # Blame: Jordan Hrycaj 8 | 9 | # --------------------------------------------------------------------------- 10 | # Target 11 | # --------------------------------------------------------------------------- 12 | 13 | all-local:: SOURCES 14 | 15 | SOURCES: Makefile 16 | @rm -f $@ 17 | @echo ">>> Generating $@" 18 | @echo "# Generated from $(subdir)/Makefile.am" >> $@ 19 | @d=`basename $(subdir)`;\ 20 | for s in $(tsrc); do \ 21 | echo "tsrc += $$d/$$s"; done >> $@ 22 | @echo "# End" >> $@ 23 | 24 | # --------------------------------------------------------------------------- 25 | # Sources 26 | # --------------------------------------------------------------------------- 27 | 28 | tsrc = TestRunner_HillOrientation.c TestRunner_OrientedSmoother.c 29 | tsrc += TestRunner_LinesByOrientation.c TestRunner_Thinner.c 30 | tsrc += TestRunner_LocalHistogram.c TestRunner_VotingFilter.c 31 | 32 | # --------------------------------------------------------------------------- 33 | # End 34 | # --------------------------------------------------------------------------- 35 | -------------------------------------------------------------------------------- /Sources/Tests/Extraction/Filters/runners/SOURCES: -------------------------------------------------------------------------------- 1 | # Generated from Sources/Tests/Extraction/Filters/runners/Makefile.am 2 | tsrc += runners/TestRunner_HillOrientation.c 3 | tsrc += runners/TestRunner_OrientedSmoother.c 4 | tsrc += runners/TestRunner_LinesByOrientation.c 5 | tsrc += runners/TestRunner_Thinner.c 6 | tsrc += runners/TestRunner_LocalHistogram.c 7 | tsrc += runners/TestRunner_VotingFilter.c 8 | # End 9 | -------------------------------------------------------------------------------- /Sources/Tests/Extraction/Filters/runners/TestRunner_HillOrientation.c: -------------------------------------------------------------------------------- 1 | #include "unity.h" 2 | #include "unity_fixture.h" 3 | 4 | TEST_GROUP_RUNNER(HillOrientation) 5 | { 6 | RUN_TEST_CASE(HillOrientation, VisualiseOrientations); 7 | RUN_TEST_CASE(HillOrientation, VisualisePixelMask); 8 | RUN_TEST_CASE(HillOrientation, ComputeOrientations); 9 | } 10 | -------------------------------------------------------------------------------- /Sources/Tests/Extraction/Filters/runners/TestRunner_LinesByOrientation.c: -------------------------------------------------------------------------------- 1 | #include "unity.h" 2 | #include "unity_fixture.h" 3 | 4 | TEST_GROUP_RUNNER(LinesByOrientation) 5 | { 6 | RUN_TEST_CASE(LinesByOrientation, LinesByOrientation_ConstructLines_lines_are_correct); 7 | } 8 | -------------------------------------------------------------------------------- /Sources/Tests/Extraction/Filters/runners/TestRunner_LocalHistogram.c: -------------------------------------------------------------------------------- 1 | #include "unity.h" 2 | #include "unity_fixture.h" 3 | 4 | extern int Test_LocalHistogram_testNumber; 5 | 6 | TEST_GROUP_RUNNER(LocalHistogram) 7 | { 8 | RUN_TEST_CASE(LocalHistogram, LocalHistogram_Analyze_same_values_go_into_same_bucket); 9 | RUN_TEST_CASE(LocalHistogram, LocalHistogram_Analyze_different_values_go_into_different_buckets); 10 | RUN_TEST_CASE(LocalHistogram, LocalHistogram_Analyze_multiple_blocks); 11 | RUN_TEST_CASE(LocalHistogram, LocalHistogram_SmoothAroundCorners_2x2x1); 12 | RUN_TEST_CASE(LocalHistogram, LocalHistogram_Regression_Analyze); 13 | RUN_TEST_CASE(LocalHistogram, LocalHistogram_Regression_SmoothAroundCorners); 14 | } 15 | -------------------------------------------------------------------------------- /Sources/Tests/Extraction/Filters/runners/TestRunner_OrientedSmoother.c: -------------------------------------------------------------------------------- 1 | #include "unity.h" 2 | #include "unity_fixture.h" 3 | 4 | TEST_GROUP_RUNNER(OrientedSmoother) 5 | { 6 | RUN_TEST_CASE(OrientedSmoother, CalculationsMatchSourceAFISOn7x9); 7 | RUN_TEST_CASE(OrientedSmoother, VisualiseSmoother); 8 | } 9 | -------------------------------------------------------------------------------- /Sources/Tests/Extraction/Filters/runners/TestRunner_Thinner.c: -------------------------------------------------------------------------------- 1 | #include "unity.h" 2 | #include "unity_fixture.h" 3 | 4 | TEST_GROUP_RUNNER(Thinner) 5 | { 6 | RUN_TEST_CASE(Thinner, Thinner_PassThrough); 7 | RUN_TEST_CASE(Thinner, Thinner_Thin); 8 | } 9 | -------------------------------------------------------------------------------- /Sources/Tests/Extraction/Filters/runners/TestRunner_VotingFilter.c: -------------------------------------------------------------------------------- 1 | #include "unity.h" 2 | #include "unity_fixture.h" 3 | 4 | extern int Test_VotingFilter_testNumber; 5 | 6 | TEST_GROUP_RUNNER(VotingFilter) 7 | { 8 | int tests[] = { 9 | 1, 6, 7, 13, -1 10 | }; 11 | 12 | for (int i = 0; tests[i] >= 0; i++) 13 | { 14 | Test_VotingFilter_testNumber = tests[i]; 15 | RUN_TEST_CASE(VotingFilter, VotingFilter_Filter); 16 | } 17 | RUN_TEST_CASE(VotingFilter, VotingFilter_regression_tests_against_sourceAfis); 18 | } 19 | -------------------------------------------------------------------------------- /Sources/Tests/Extraction/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- makefile-automake -*- 2 | # 3 | # Build library 4 | # 5 | # $Id$ 6 | # 7 | # Blame: Jordan Hrycaj 8 | 9 | SUBDIRS = Filters Model 10 | 11 | # --------------------------------------------------------------------------- 12 | # Target 13 | # --------------------------------------------------------------------------- 14 | 15 | all-local:: SOURCES 16 | 17 | SOURCES: Makefile Filters/SOURCES Model/SOURCES 18 | @rm -f $@ 19 | @echo ">>> Generating $@" 20 | @echo "# Generated from $(subdir)/Makefile.am" >> $@ 21 | @d=`basename $(subdir)`;\ 22 | for s in $(tsrc); do \ 23 | echo "tsrc += $$d/$$s"; done >> $@ 24 | @echo "# End" >> $@ 25 | 26 | # --------------------------------------------------------------------------- 27 | # Sources 28 | # --------------------------------------------------------------------------- 29 | 30 | tsrc = 31 | 32 | include Filters/SOURCES 33 | include Model/SOURCES 34 | 35 | # --------------------------------------------------------------------------- 36 | # End 37 | # --------------------------------------------------------------------------- 38 | 39 | -------------------------------------------------------------------------------- /Sources/Tests/Extraction/Model/.gitignore: -------------------------------------------------------------------------------- 1 | /.deps 2 | /.dirstamp 3 | /lib*.la 4 | /lib*.lo 5 | /.libs 6 | /Makefile 7 | /Makefile.in 8 | /*.o 9 | -------------------------------------------------------------------------------- /Sources/Tests/Extraction/Model/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- makefile-automake -*- 2 | # 3 | # Build library 4 | # 5 | # $Id$ 6 | # 7 | # Blame: Jordan Hrycaj 8 | 9 | SUBDIRS = runners 10 | 11 | # --------------------------------------------------------------------------- 12 | # Target 13 | # --------------------------------------------------------------------------- 14 | 15 | all-local:: SOURCES 16 | 17 | SOURCES: Makefile runners/SOURCES 18 | @rm -f $@ 19 | @echo ">>> Generating $@" 20 | @echo "# Generated from $(subdir)/Makefile.am" >> $@ 21 | @d=`basename $(subdir)`;\ 22 | for s in $(tsrc); do \ 23 | echo "tsrc += $$d/$$s"; done >> $@ 24 | @echo "# End" >> $@ 25 | 26 | # --------------------------------------------------------------------------- 27 | # Sources 28 | # --------------------------------------------------------------------------- 29 | 30 | tsrc = Test_DotRemover.c 31 | 32 | include runners/SOURCES 33 | 34 | # --------------------------------------------------------------------------- 35 | # End 36 | # --------------------------------------------------------------------------- 37 | -------------------------------------------------------------------------------- /Sources/Tests/Extraction/Model/SOURCES: -------------------------------------------------------------------------------- 1 | # Generated from Sources/Tests/Extraction/Model/Makefile.am 2 | tsrc += Model/Test_DotRemover.c 3 | tsrc += Model/runners/TestRunner_DotRemover.c 4 | # End 5 | -------------------------------------------------------------------------------- /Sources/Tests/Extraction/Model/Test_DotRemover.c: -------------------------------------------------------------------------------- 1 | #include "unity.h" 2 | #include "unity_fixture.h" 3 | #include "General/List.h" 4 | #include "General/Point.h" 5 | #include "Extraction/Model/Minutia.h" 6 | #include "Extraction/Model/DotRemover.h" 7 | 8 | #include 9 | 10 | TEST_GROUP(DotRemover); 11 | 12 | TEST_SETUP(DotRemover) 13 | { 14 | } 15 | 16 | TEST_TEAR_DOWN(DotRemover) 17 | { 18 | } 19 | 20 | TEST(DotRemover, DotRemover_Filter_correct_minutia_is_removed) 21 | { 22 | Minutia minutiaWithoutRidges = { 23 | .position = Point_Construct(0, 0), 24 | .minutiaType = RidgeEnd, 25 | .ridges = List_Construct() 26 | }; 27 | 28 | List ridges = List_Construct(); 29 | List_AddData(&ridges, NULL); // fake ridge 30 | 31 | Minutia minutiaWithRidge = { 32 | .position = Point_Construct(1, 1), 33 | .minutiaType = RidgeEnd, 34 | .ridges = ridges 35 | }; 36 | 37 | List minutiae = List_Construct(); 38 | List_AddData(&minutiae, &minutiaWithoutRidges); 39 | List_AddData(&minutiae, &minutiaWithRidge); 40 | 41 | DotRemover_Filter(&minutiae); 42 | 43 | TEST_ASSERT_EQUAL_INT(1, List_GetCount(&minutiae)); 44 | 45 | Minutia *remainingMinutia = (Minutia *) minutiae.head->data; 46 | 47 | TEST_ASSERT_EQUAL_INT(1, remainingMinutia->position.x); 48 | 49 | List_Destruct(&ridges); 50 | List_Destruct(&minutiae); 51 | } 52 | -------------------------------------------------------------------------------- /Sources/Tests/Extraction/Model/runners/.gitignore: -------------------------------------------------------------------------------- 1 | /.deps 2 | /.dirstamp 3 | /lib*.la 4 | /lib*.lo 5 | /.libs 6 | /Makefile 7 | /Makefile.in 8 | /*.o 9 | -------------------------------------------------------------------------------- /Sources/Tests/Extraction/Model/runners/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- makefile-automake -*- 2 | # 3 | # Build library 4 | # 5 | # $Id$ 6 | # 7 | # Blame: Jordan Hrycaj 8 | 9 | # --------------------------------------------------------------------------- 10 | # Target 11 | # --------------------------------------------------------------------------- 12 | 13 | all-local:: SOURCES 14 | 15 | SOURCES: Makefile 16 | @rm -f $@ 17 | @echo ">>> Generating $@" 18 | @echo "# Generated from $(subdir)/Makefile.am" >> $@ 19 | @d=`basename $(subdir)`;\ 20 | for s in $(tsrc); do \ 21 | echo "tsrc += $$d/$$s"; done >> $@ 22 | @echo "# End" >> $@ 23 | 24 | # --------------------------------------------------------------------------- 25 | # Sources 26 | # --------------------------------------------------------------------------- 27 | 28 | tsrc = TestRunner_DotRemover.c 29 | 30 | # --------------------------------------------------------------------------- 31 | # End 32 | # --------------------------------------------------------------------------- 33 | -------------------------------------------------------------------------------- /Sources/Tests/Extraction/Model/runners/SOURCES: -------------------------------------------------------------------------------- 1 | # Generated from Sources/Tests/Extraction/Model/runners/Makefile.am 2 | tsrc += runners/TestRunner_DotRemover.c 3 | # End 4 | -------------------------------------------------------------------------------- /Sources/Tests/Extraction/Model/runners/TestRunner_DotRemover.c: -------------------------------------------------------------------------------- 1 | #include "unity.h" 2 | #include "unity_fixture.h" 3 | 4 | TEST_GROUP_RUNNER(DotRemover) 5 | { 6 | RUN_TEST_CASE(DotRemover, DotRemover_Filter_correct_minutia_is_removed); 7 | } 8 | -------------------------------------------------------------------------------- /Sources/Tests/Extraction/SOURCES: -------------------------------------------------------------------------------- 1 | # Generated from Sources/Tests/Extraction/Makefile.am 2 | tsrc += Extraction/Filters/Test_HillOrientation.c 3 | tsrc += Extraction/Filters/Test_LocalHistogram.c 4 | tsrc += Extraction/Filters/Test_Thinner.c 5 | tsrc += Extraction/Filters/Test_LinesByOrientation.c 6 | tsrc += Extraction/Filters/Test_OrientedSmoother.c 7 | tsrc += Extraction/Filters/Test_VotingFilter.c 8 | tsrc += Extraction/Filters/runners/TestRunner_HillOrientation.c 9 | tsrc += Extraction/Filters/runners/TestRunner_OrientedSmoother.c 10 | tsrc += Extraction/Filters/runners/TestRunner_LinesByOrientation.c 11 | tsrc += Extraction/Filters/runners/TestRunner_Thinner.c 12 | tsrc += Extraction/Filters/runners/TestRunner_LocalHistogram.c 13 | tsrc += Extraction/Filters/runners/TestRunner_VotingFilter.c 14 | tsrc += Extraction/Model/Test_DotRemover.c 15 | tsrc += Extraction/Model/runners/TestRunner_DotRemover.c 16 | # End 17 | -------------------------------------------------------------------------------- /Sources/Tests/General/.gitignore: -------------------------------------------------------------------------------- 1 | /.deps 2 | /.dirstamp 3 | /lib*.la 4 | /lib*.lo 5 | /.libs 6 | /Makefile 7 | /Makefile.in 8 | /*.o 9 | -------------------------------------------------------------------------------- /Sources/Tests/General/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- makefile-automake -*- 2 | # 3 | # Build library 4 | # 5 | # $Id$ 6 | # 7 | # Blame: Jordan Hrycaj 8 | 9 | SUBDIRS = runners 10 | 11 | # --------------------------------------------------------------------------- 12 | # Target 13 | # --------------------------------------------------------------------------- 14 | 15 | all-local:: SOURCES 16 | 17 | SOURCES: Makefile runners/SOURCES 18 | @rm -f $@ 19 | @echo ">>> Generating $@" 20 | @echo "# Generated from $(subdir)/Makefile.am" >> $@ 21 | @d=`basename $(subdir)`;\ 22 | for s in $(tsrc); do \ 23 | echo "tsrc += $$d/$$s"; done >> $@ 24 | @echo "# End" >> $@ 25 | 26 | # --------------------------------------------------------------------------- 27 | # Sources 28 | # --------------------------------------------------------------------------- 29 | 30 | tsrc = Test_BinaryMap.c Test_Equalizer.c Test_Pgm.c Test_Array.c 31 | tsrc += Test_Calc.c Test_MinutiaeDetection.c Test_Point.c 32 | 33 | include runners/SOURCES 34 | 35 | # --------------------------------------------------------------------------- 36 | # End 37 | # --------------------------------------------------------------------------- 38 | 39 | -------------------------------------------------------------------------------- /Sources/Tests/General/SOURCES: -------------------------------------------------------------------------------- 1 | # Generated from Sources/Tests/General/Makefile.am 2 | tsrc += General/Test_BinaryMap.c 3 | tsrc += General/Test_Equalizer.c 4 | tsrc += General/Test_Pgm.c 5 | tsrc += General/Test_Array.c 6 | tsrc += General/Test_Calc.c 7 | tsrc += General/Test_MinutiaeDetection.c 8 | tsrc += General/Test_Point.c 9 | tsrc += General/runners/TestRunner_Array.c 10 | tsrc += General/runners/TestRunner_Calc.c 11 | tsrc += General/runners/TestRunner_MinutiaeDetection.c 12 | tsrc += General/runners/TestRunner_Point.c 13 | tsrc += General/runners/TestRunner_BinaryMap.c 14 | tsrc += General/runners/TestRunner_Equalizer.c 15 | tsrc += General/runners/TestRunner_Pgm.c 16 | # End 17 | -------------------------------------------------------------------------------- /Sources/Tests/General/Test_Array.c: -------------------------------------------------------------------------------- 1 | #include "General/Array.h" 2 | #include "unity.h" 3 | #include "unity_fixture.h" 4 | 5 | TEST_GROUP(Array); 6 | 7 | TEST_SETUP(Array) 8 | { 9 | } 10 | 11 | TEST_TEAR_DOWN(Array) 12 | { 13 | } 14 | 15 | #define SIZEX 2 16 | #define SIZEY 4 17 | #define SIZEZ 3 18 | 19 | TEST(Array, Array2D_Construct) 20 | { 21 | UInt32Array2D a = UInt32Array2D_Construct(SIZEX, SIZEY); 22 | 23 | for (int i = 0; i < SIZEX; i++) 24 | for (int j = 0; j < SIZEY; j++) 25 | a.data[i][j] = (i << 4) + j; 26 | 27 | uint32_t e[] = { 28 | 0x00, 0x01, 0x02, 0x03, 29 | 0x10, 0x11, 0x12, 0x13, 30 | }; 31 | 32 | TEST_ASSERT_EQUAL_HEX32_ARRAY(e, UInt32Array2D_GetStorage(&a), SIZEX * SIZEY); 33 | 34 | UInt32Array2D_Destruct(&a); 35 | } 36 | 37 | TEST(Array, Array3D_Construct) 38 | { 39 | Int16Array3D a = Int16Array3D_Construct(SIZEX, SIZEY, SIZEZ); 40 | 41 | for (int i = 0; i < SIZEX; i++) 42 | for (int j = 0; j < SIZEY; j++) 43 | for (int k = 0; k < SIZEZ; k++) 44 | a.data[i][j][k] = (i << 8) + (j << 4) + k; 45 | 46 | int16_t e[] = { 47 | 0x000, 0x001, 0x002, 48 | 0x010, 0x011, 0x012, 49 | 0x020, 0x021, 0x022, 50 | 0x030, 0x031, 0x032, 51 | 0x100, 0x101, 0x102, 52 | 0x110, 0x111, 0x112, 53 | 0x120, 0x121, 0x122, 54 | 0x130, 0x131, 0x132, 55 | }; 56 | 57 | TEST_ASSERT_EQUAL_HEX16_ARRAY(e, Int16Array3D_GetStorage(&a), SIZEX * SIZEY * SIZEZ); 58 | 59 | Int16Array3D_Destruct(&a); 60 | } 61 | -------------------------------------------------------------------------------- /Sources/Tests/General/Test_Calc.c: -------------------------------------------------------------------------------- 1 | #include "General/Calc.h" 2 | #include "unity.h" 3 | #include "unity_fixture.h" 4 | 5 | TEST_GROUP(Calc); 6 | 7 | TEST_SETUP(Calc) 8 | { 9 | } 10 | 11 | TEST_TEAR_DOWN(Calc) 12 | { 13 | } 14 | 15 | 16 | TEST(Calc, CountBits) 17 | { 18 | TEST_ASSERT_EQUAL_INT_MESSAGE(1, Calc_CountBits(1), "Population count of 1 is 1"); 19 | } -------------------------------------------------------------------------------- /Sources/Tests/General/Test_Point.c: -------------------------------------------------------------------------------- 1 | #include "General/Point.h" 2 | #include "unity.h" 3 | #include "unity_fixture.h" 4 | 5 | TEST_GROUP(Point); 6 | 7 | TEST_SETUP(Point) 8 | { 9 | } 10 | 11 | TEST_TEAR_DOWN(Point) 12 | { 13 | } 14 | 15 | 16 | TEST(Point, Point_Construct) 17 | { 18 | Point p = Point_Construct(2, 4); 19 | 20 | TEST_ASSERT_EQUAL(2, p.x); 21 | TEST_ASSERT_EQUAL(4, p.y); 22 | } 23 | -------------------------------------------------------------------------------- /Sources/Tests/General/runners/.gitignore: -------------------------------------------------------------------------------- 1 | /.deps 2 | /.dirstamp 3 | /lib*.la 4 | /lib*.lo 5 | /.libs 6 | /Makefile 7 | /Makefile.in 8 | /*.o 9 | -------------------------------------------------------------------------------- /Sources/Tests/General/runners/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- makefile-automake -*- 2 | # 3 | # Build library 4 | # 5 | # $Id$ 6 | # 7 | # Blame: Jordan Hrycaj 8 | 9 | # --------------------------------------------------------------------------- 10 | # Target 11 | # --------------------------------------------------------------------------- 12 | 13 | all-local:: SOURCES 14 | 15 | SOURCES: Makefile 16 | @rm -f $@ 17 | @echo ">>> Generating $@" 18 | @echo "# Generated from $(subdir)/Makefile.am" >> $@ 19 | @d=`basename $(subdir)`;\ 20 | for s in $(tsrc); do \ 21 | echo "tsrc += $$d/$$s"; done >> $@ 22 | @echo "# End" >> $@ 23 | 24 | # --------------------------------------------------------------------------- 25 | # Sources 26 | # --------------------------------------------------------------------------- 27 | 28 | tsrc = TestRunner_Array.c TestRunner_Calc.c TestRunner_MinutiaeDetection.c 29 | tsrc += TestRunner_Point.c TestRunner_BinaryMap.c TestRunner_Equalizer.c 30 | tsrc += TestRunner_Pgm.c 31 | 32 | # --------------------------------------------------------------------------- 33 | # End 34 | # --------------------------------------------------------------------------- 35 | -------------------------------------------------------------------------------- /Sources/Tests/General/runners/SOURCES: -------------------------------------------------------------------------------- 1 | # Generated from Sources/Tests/General/runners/Makefile.am 2 | tsrc += runners/TestRunner_Array.c 3 | tsrc += runners/TestRunner_Calc.c 4 | tsrc += runners/TestRunner_MinutiaeDetection.c 5 | tsrc += runners/TestRunner_Point.c 6 | tsrc += runners/TestRunner_BinaryMap.c 7 | tsrc += runners/TestRunner_Equalizer.c 8 | tsrc += runners/TestRunner_Pgm.c 9 | # End 10 | -------------------------------------------------------------------------------- /Sources/Tests/General/runners/TestRunner_Array.c: -------------------------------------------------------------------------------- 1 | #include "unity.h" 2 | #include "unity_fixture.h" 3 | 4 | TEST_GROUP_RUNNER(Array) 5 | { 6 | RUN_TEST_CASE(Array, Array2D_Construct); 7 | RUN_TEST_CASE(Array, Array3D_Construct); 8 | } 9 | -------------------------------------------------------------------------------- /Sources/Tests/General/runners/TestRunner_BinaryMap.c: -------------------------------------------------------------------------------- 1 | #include "unity.h" 2 | #include "unity_fixture.h" 3 | 4 | TEST_GROUP_RUNNER(BinaryMap) 5 | { 6 | RUN_TEST_CASE(BinaryMap, BinaryMap_Or); 7 | RUN_TEST_CASE(BinaryMap, BinaryMap_And); 8 | RUN_TEST_CASE(BinaryMap, BinaryMap_AndNot); 9 | RUN_TEST_CASE(BinaryMap, BinaryMap_AndArea); 10 | } 11 | -------------------------------------------------------------------------------- /Sources/Tests/General/runners/TestRunner_Calc.c: -------------------------------------------------------------------------------- 1 | #include "unity.h" 2 | #include "unity_fixture.h" 3 | 4 | TEST_GROUP_RUNNER(Calc) 5 | { 6 | RUN_TEST_CASE(Calc, CountBits); 7 | } 8 | -------------------------------------------------------------------------------- /Sources/Tests/General/runners/TestRunner_Equalizer.c: -------------------------------------------------------------------------------- 1 | #include "unity.h" 2 | #include "unity_fixture.h" 3 | 4 | TEST_GROUP_RUNNER(Equalizer) 5 | { 6 | RUN_TEST_CASE(Equalizer, Equalizer_Equals_SourceAFIS_Output_3x3); 7 | } 8 | -------------------------------------------------------------------------------- /Sources/Tests/General/runners/TestRunner_MinutiaeDetection.c: -------------------------------------------------------------------------------- 1 | #include "unity.h" 2 | #include "unity_fixture.h" 3 | 4 | TEST_GROUP_RUNNER(MinutiaeDetection) 5 | { 6 | RUN_TEST_CASE(MinutiaeDetection, CanDetectARidgeEnding); 7 | RUN_TEST_CASE(MinutiaeDetection, CanDetectABifurcation); 8 | RUN_TEST_CASE(MinutiaeDetection, CanCountMinutiaeRidges); 9 | RUN_TEST_CASE(MinutiaeDetection, CanCountBifurcationRidges); 10 | } 11 | -------------------------------------------------------------------------------- /Sources/Tests/General/runners/TestRunner_Pgm.c: -------------------------------------------------------------------------------- 1 | #include "unity.h" 2 | #include "unity_fixture.h" 3 | 4 | TEST_GROUP_RUNNER(Pgm) 5 | { 6 | RUN_TEST_CASE(Pgm, Pgm_Read); 7 | } 8 | -------------------------------------------------------------------------------- /Sources/Tests/General/runners/TestRunner_Point.c: -------------------------------------------------------------------------------- 1 | #include "unity.h" 2 | #include "unity_fixture.h" 3 | 4 | TEST_GROUP_RUNNER(Point) 5 | { 6 | RUN_TEST_CASE(Point, Point_Construct); 7 | } 8 | -------------------------------------------------------------------------------- /Sources/Tests/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- makefile-automake -*- 2 | # 3 | # Build library 4 | # 5 | # $Id$ 6 | # 7 | # Blame: Jordan Hrycaj 8 | 9 | SUBDIRS = DataStructures Extraction General Matcher 10 | 11 | # --------------------------------------------------------------------------- 12 | # Target 13 | # --------------------------------------------------------------------------- 14 | 15 | all-local:: SOURCES 16 | 17 | SOURCES: Makefile DataStructures/SOURCES Extraction/SOURCES \ 18 | General/SOURCES Matcher/SOURCES 19 | @rm -f $@ 20 | @echo ">>> Generating $@" 21 | @echo "# Generated from $(subdir)/Makefile.am" >> $@ 22 | @d=`basename $(subdir)`;\ 23 | for s in $(tsrc); do \ 24 | echo "tsrc += $$d/$$s"; done >> $@ 25 | @echo "# End" >> $@ 26 | 27 | # --------------------------------------------------------------------------- 28 | # Sources 29 | # --------------------------------------------------------------------------- 30 | 31 | tsrc = 32 | 33 | include DataStructures/SOURCES 34 | include Extraction/SOURCES 35 | include General/SOURCES 36 | include Matcher/SOURCES 37 | 38 | # --------------------------------------------------------------------------- 39 | # End 40 | # --------------------------------------------------------------------------- 41 | -------------------------------------------------------------------------------- /Sources/Tests/Matcher/.gitignore: -------------------------------------------------------------------------------- 1 | /.deps 2 | /.dirstamp 3 | /lib*.la 4 | /lib*.lo 5 | /.libs 6 | /Makefile 7 | /Makefile.in 8 | /*.o 9 | -------------------------------------------------------------------------------- /Sources/Tests/Matcher/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- makefile-automake -*- 2 | # 3 | # Build library 4 | # 5 | # $Id$ 6 | # 7 | # Blame: Jordan Hrycaj 8 | 9 | SUBDIRS = runners 10 | 11 | # --------------------------------------------------------------------------- 12 | # Target 13 | # --------------------------------------------------------------------------- 14 | 15 | all-local:: SOURCES 16 | 17 | SOURCES: Makefile runners/SOURCES 18 | @rm -f $@ 19 | @echo ">>> Generating $@" 20 | @echo "# Generated from $(subdir)/Makefile.am" >> $@ 21 | @d=`basename $(subdir)`;\ 22 | for s in $(tsrc); do \ 23 | echo "tsrc += $$d/$$s"; done >> $@ 24 | @echo "# End" >> $@ 25 | 26 | # --------------------------------------------------------------------------- 27 | # Sources 28 | # --------------------------------------------------------------------------- 29 | 30 | tsrc = Test_BestMatchSkipper.c 31 | 32 | include runners/SOURCES 33 | 34 | # --------------------------------------------------------------------------- 35 | # End 36 | # --------------------------------------------------------------------------- 37 | 38 | -------------------------------------------------------------------------------- /Sources/Tests/Matcher/SOURCES: -------------------------------------------------------------------------------- 1 | # Generated from Sources/Tests/Matcher/Makefile.am 2 | tsrc += Matcher/Test_BestMatchSkipper.c 3 | tsrc += Matcher/runners/TestRunner_BestMatchSkipper.c 4 | # End 5 | -------------------------------------------------------------------------------- /Sources/Tests/Matcher/Test_BestMatchSkipper.c: -------------------------------------------------------------------------------- 1 | #include "Matcher/BestMatchSkipper.h" 2 | #include "unity.h" 3 | #include "unity_fixture.h" 4 | 5 | TEST_GROUP(BestMatchSkipper); 6 | 7 | TEST_SETUP(BestMatchSkipper) 8 | { 9 | } 10 | 11 | TEST_TEAR_DOWN(BestMatchSkipper) 12 | { 13 | } 14 | 15 | TEST(BestMatchSkipper, BestMatchSkipper_Construct) 16 | { 17 | BestMatchSkipper b = BestMatchSkipper_Construct(3,4); 18 | 19 | for (int i=0;i<3;++i) 20 | for (int j=0;j<5;++j) // (+1) 21 | TEST_ASSERT_EQUAL_INT_MESSAGE(-1, b.collected.data[i][j], "All inited to -1"); 22 | 23 | BestMatchSkipper_Destruct(&b); 24 | } 25 | 26 | TEST(BestMatchSkipper, BestMatchSkipper_Scores) 27 | { 28 | BestMatchSkipper b = BestMatchSkipper_Construct(3,2); 29 | float skipScore; 30 | 31 | BestMatchSkipper_AddScore(&b, 0,1.1); 32 | BestMatchSkipper_AddScore(&b, 1,1.2); 33 | BestMatchSkipper_AddScore(&b, 2,1.4); 34 | 35 | skipScore = BestMatchSkipper_GetSkipScore(&b, 2); 36 | TEST_ASSERT_EQUAL_FLOAT_MESSAGE(1.4, skipScore, "Skip score"); 37 | BestMatchSkipper_Destruct(&b); 38 | } 39 | -------------------------------------------------------------------------------- /Sources/Tests/Matcher/runners/.gitignore: -------------------------------------------------------------------------------- 1 | /.deps 2 | /.dirstamp 3 | /lib*.la 4 | /lib*.lo 5 | /.libs 6 | /Makefile 7 | /Makefile.in 8 | /*.o 9 | -------------------------------------------------------------------------------- /Sources/Tests/Matcher/runners/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- makefile-automake -*- 2 | # 3 | # Build library 4 | # 5 | # $Id$ 6 | # 7 | # Blame: Jordan Hrycaj 8 | 9 | # --------------------------------------------------------------------------- 10 | # Target 11 | # --------------------------------------------------------------------------- 12 | 13 | all-local:: SOURCES 14 | 15 | SOURCES: Makefile 16 | @rm -f $@ 17 | @echo ">>> Generating $@" 18 | @echo "# Generated from $(subdir)/Makefile.am" >> $@ 19 | @d=`basename $(subdir)`;\ 20 | for s in $(tsrc); do \ 21 | echo "tsrc += $$d/$$s"; done >> $@ 22 | @echo "# End" >> $@ 23 | 24 | # --------------------------------------------------------------------------- 25 | # Sources 26 | # --------------------------------------------------------------------------- 27 | 28 | tsrc = TestRunner_BestMatchSkipper.c 29 | 30 | # --------------------------------------------------------------------------- 31 | # End 32 | # --------------------------------------------------------------------------- 33 | -------------------------------------------------------------------------------- /Sources/Tests/Matcher/runners/SOURCES: -------------------------------------------------------------------------------- 1 | # Generated from Sources/Tests/Matcher/runners/Makefile.am 2 | tsrc += runners/TestRunner_BestMatchSkipper.c 3 | # End 4 | -------------------------------------------------------------------------------- /Sources/Tests/Matcher/runners/TestRunner_BestMatchSkipper.c: -------------------------------------------------------------------------------- 1 | #include "unity.h" 2 | #include "unity_fixture.h" 3 | 4 | TEST_GROUP_RUNNER(BestMatchSkipper) 5 | { 6 | RUN_TEST_CASE(BestMatchSkipper, BestMatchSkipper_Construct); 7 | RUN_TEST_CASE(BestMatchSkipper, BestMatchSkipper_Scores); 8 | } 9 | -------------------------------------------------------------------------------- /Sources/Tests/SOURCES: -------------------------------------------------------------------------------- 1 | # Generated from Sources/Tests/Makefile.am 2 | tsrc += Tests/DataStructures/Test_DataStructures.c 3 | tsrc += Tests/DataStructures/TestRunner_DataStructures.c 4 | tsrc += Tests/Extraction/Filters/Test_HillOrientation.c 5 | tsrc += Tests/Extraction/Filters/Test_LocalHistogram.c 6 | tsrc += Tests/Extraction/Filters/Test_Thinner.c 7 | tsrc += Tests/Extraction/Filters/Test_LinesByOrientation.c 8 | tsrc += Tests/Extraction/Filters/Test_OrientedSmoother.c 9 | tsrc += Tests/Extraction/Filters/Test_VotingFilter.c 10 | tsrc += Tests/Extraction/Filters/runners/TestRunner_HillOrientation.c 11 | tsrc += Tests/Extraction/Filters/runners/TestRunner_OrientedSmoother.c 12 | tsrc += Tests/Extraction/Filters/runners/TestRunner_LinesByOrientation.c 13 | tsrc += Tests/Extraction/Filters/runners/TestRunner_Thinner.c 14 | tsrc += Tests/Extraction/Filters/runners/TestRunner_LocalHistogram.c 15 | tsrc += Tests/Extraction/Filters/runners/TestRunner_VotingFilter.c 16 | tsrc += Tests/Extraction/Model/Test_DotRemover.c 17 | tsrc += Tests/Extraction/Model/runners/TestRunner_DotRemover.c 18 | tsrc += Tests/General/Test_BinaryMap.c 19 | tsrc += Tests/General/Test_Equalizer.c 20 | tsrc += Tests/General/Test_Pgm.c 21 | tsrc += Tests/General/Test_Array.c 22 | tsrc += Tests/General/Test_Calc.c 23 | tsrc += Tests/General/Test_MinutiaeDetection.c 24 | tsrc += Tests/General/Test_Point.c 25 | tsrc += Tests/General/runners/TestRunner_Array.c 26 | tsrc += Tests/General/runners/TestRunner_Calc.c 27 | tsrc += Tests/General/runners/TestRunner_MinutiaeDetection.c 28 | tsrc += Tests/General/runners/TestRunner_Point.c 29 | tsrc += Tests/General/runners/TestRunner_BinaryMap.c 30 | tsrc += Tests/General/runners/TestRunner_Equalizer.c 31 | tsrc += Tests/General/runners/TestRunner_Pgm.c 32 | tsrc += Tests/Matcher/Test_BestMatchSkipper.c 33 | tsrc += Tests/Matcher/runners/TestRunner_BestMatchSkipper.c 34 | # End 35 | -------------------------------------------------------------------------------- /Sources/Tests/all_tests.c: -------------------------------------------------------------------------------- 1 | #ifdef _MSC_VER 2 | #include 3 | #else 4 | #include 5 | #endif 6 | #include "unity_fixture.h" 7 | 8 | static void RunAllTests(void) 9 | { 10 | printf("\nOrientation tests\n"); 11 | RUN_TEST_GROUP(HillOrientation); 12 | 13 | printf("\nOriented smoother tests\n"); 14 | RUN_TEST_GROUP(OrientedSmoother); 15 | 16 | printf("\nPoint tests\n"); 17 | RUN_TEST_GROUP(Point); 18 | 19 | printf("\nArray tests\n"); 20 | RUN_TEST_GROUP(Array); 21 | 22 | printf("\nBinaryMap tests\n"); 23 | RUN_TEST_GROUP(BinaryMap); 24 | 25 | printf("\nCalc tests\n"); 26 | RUN_TEST_GROUP(Calc); 27 | 28 | printf("\nPgm tests\n"); 29 | RUN_TEST_GROUP(Pgm); 30 | 31 | printf("\nVoting filter tests\n"); 32 | RUN_TEST_GROUP(VotingFilter); 33 | 34 | printf("\nLocal histogram tests\n"); 35 | RUN_TEST_GROUP(LocalHistogram); 36 | 37 | printf("\nLines by orientation tests\n"); 38 | RUN_TEST_GROUP(LinesByOrientation); 39 | 40 | printf("\nEnsure we an load serialised binary data\n"); 41 | RUN_TEST_GROUP(DataStructures); 42 | 43 | printf("\nEqualizer tests\n"); 44 | RUN_TEST_GROUP(Equalizer); 45 | 46 | printf("\nThinner tests\n"); 47 | RUN_TEST_GROUP(Thinner); 48 | 49 | printf("\nMinutiae detection tests\n"); 50 | RUN_TEST_GROUP(MinutiaeDetection); 51 | 52 | printf("\nDot remover tests\n"); 53 | RUN_TEST_GROUP(DotRemover); 54 | 55 | printf("\nBestMatchSkipper tests\n"); 56 | RUN_TEST_GROUP(BestMatchSkipper); 57 | } 58 | 59 | int main(int argc, const char * argv[]) 60 | { 61 | if (argc == 2) 62 | { 63 | chdir(argv[1]); 64 | } 65 | return UnityMain(argc, argv, RunAllTests); 66 | } 67 | -------------------------------------------------------------------------------- /Sources/Utils/.gitignore: -------------------------------------------------------------------------------- 1 | /.deps 2 | /.dirstamp 3 | /lib*.a 4 | /lib*.la 5 | /lib*.lo 6 | /.libs 7 | /Makefile 8 | /Makefile.in 9 | /*.o 10 | -------------------------------------------------------------------------------- /Sources/Utils/IO/.gitignore: -------------------------------------------------------------------------------- 1 | /.deps 2 | /.dirstamp 3 | /lib*.a 4 | /lib*.la 5 | /lib*.lo 6 | /.libs 7 | /Makefile 8 | /Makefile.in 9 | /*.o 10 | -------------------------------------------------------------------------------- /Sources/Utils/IO/ArrayIO.h: -------------------------------------------------------------------------------- 1 | #ifndef UTILS_IO_ARRAY_H 2 | #define UTILS_IO_ARRAY_H 3 | 4 | #include 5 | #include "General/Array.h" 6 | #include "General/Point.h" 7 | 8 | Int32Array1D ArrayIO_Int32Array1D_ConstructFromStream(FILE *); 9 | void ArrayIO_Int32Array1D_Printf(const Int32Array1D *); 10 | 11 | UInt8Array2D ArrayIO_UInt8Array2D_ConstructFromFile(const char *); 12 | UInt8Array2D ArrayIO_UInt8Array2D_ConstructFromStream(FILE *); 13 | void ArrayIO_UInt8Array2D_Printf(const UInt8Array2D *); 14 | 15 | FloatArray2D ArrayIO_FloatArray2D_ConstructFromFile(const char *); 16 | FloatArray2D ArrayIO_FloatArray2D_ConstructFromStream(FILE *); 17 | void ArrayIO_FloatArray2D_Printf(const FloatArray2D *); 18 | 19 | PointArray2D ArrayIO_Point2D_ConstructFromFile(const char *); 20 | PointArray2D ArrayIO_PointArray2D_ConstructFromStream(FILE *); 21 | void ArrayIO_PointArray2D_Printf(const PointArray2D *); 22 | 23 | Int16Array3D ArrayIO_Int16Array3D_ConstructFromFile(const char *); 24 | Int16Array3D ArrayIO_Int16Array3D_ConstructFromStream(FILE *); 25 | void ArrayIO_Int16Array3D_Printf(const Int16Array3D *); 26 | 27 | UInt8Array2D ArrayIO_UInt8Array2D_Transpose(const UInt8Array2D *); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /Sources/Utils/IO/BinaryMapIO.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "BinaryMapIO.h" 6 | 7 | BinaryMap BinaryMapIO_ConstructFromFile(const char *filename) 8 | { 9 | int ret; 10 | BinaryMap bm = { 11 | .wordShift = 5, 12 | .wordMask = 31, 13 | .wordSize = 32, 14 | .wordBytes = 32 / 8 15 | }; 16 | 17 | /* Open file */ 18 | FILE *f = fopen(filename, "rb"); 19 | assert(f != NULL); 20 | 21 | /* Read .wordWidth, .width and .height */ 22 | ret = fread(&bm, sizeof(int32_t), 3, f); 23 | assert(ret == 3); 24 | 25 | /* Allocate array for map */ 26 | bm.map = UInt32Array2D_Construct(bm.height, bm.wordWidth); 27 | 28 | /* Read map */ 29 | ret = fread(UInt32Array2D_GetStorage(&bm.map), sizeof(uint32_t), bm.height * bm.wordWidth, f); 30 | assert(ret == bm.height * bm.wordWidth); 31 | 32 | /* Check end of file */ 33 | uint8_t tmp; 34 | ret = fread(&tmp, sizeof(uint8_t), 1, f); 35 | assert(ret == 0 && feof(f)); 36 | 37 | /* Close file */ 38 | ret = fclose(f); 39 | assert(ret != EOF); 40 | 41 | return bm; 42 | } 43 | 44 | void BinaryMapIO_Printf(const BinaryMap *me) 45 | { 46 | printf("\nBinaryMap"); 47 | printf("\n wordWidth = %d\n width = %d\n height = %d\n wordShift = %d\n wordMask = %u\n wordSize = %d\n wordBytes = %d", \ 48 | me->wordWidth, me->width, me->height, me->wordShift, me->wordMask, me->wordSize, me->wordBytes); 49 | 50 | printf("\n map (%dx%d)", me->map.sizeX, me->map.sizeY); 51 | for (int i=0; i < me->map.sizeX && i < 8; i++) { 52 | printf("\n "); 53 | for (int j=0; j < me->map.sizeY; j++) 54 | printf("%08X,", me->map.data[i][j]); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Sources/Utils/IO/BinaryMapIO.h: -------------------------------------------------------------------------------- 1 | #ifndef UTILS_IO_BINARYMAP_H 2 | #define UTILS_IO_BINARYMAP_H 3 | 4 | #include "General/BinaryMap.h" 5 | 6 | BinaryMap BinaryMapIO_ConstructFromFile(const char *filename); 7 | void BinaryMapIO_Printf(const BinaryMap *me); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /Sources/Utils/IO/BlockMapIO.h: -------------------------------------------------------------------------------- 1 | #ifndef UTILS_IO_BLOCKMAP_H 2 | #define UTILS_IO_BLOCKMAP_H 3 | 4 | #include "General/BlockMap.h" 5 | 6 | BlockMap BlockMapIO_ConstructFromFile(const char *filename); 7 | void BlockMapIO_Printf(const BlockMap *me); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /Sources/Utils/IO/HistogramIO.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "ArrayIO.h" 6 | #include "ImageIO.h" 7 | 8 | Int16Array3D HistogramIO_ConstructFromFile(const char *filename) 9 | { 10 | int ret; 11 | Int16Array3D result ; 12 | 13 | /* Open file */ 14 | FILE *f = fopen(filename, "rb"); 15 | assert(f != NULL); 16 | 17 | result = ArrayIO_Int16Array3D_ConstructFromStream(f); 18 | 19 | /* Check end of file */ 20 | uint8_t tmp; 21 | ret = fread(&tmp, sizeof(uint8_t), 1, f); 22 | assert(ret == 0 && feof(f)); 23 | 24 | /* Close file */ 25 | ret = fclose(f); 26 | assert(ret != EOF); 27 | 28 | return result; 29 | } 30 | 31 | void HistogramIO_Printf(const Int16Array3D *image) 32 | { 33 | printf("\nHistogram"); 34 | ArrayIO_Int16Array3D_Printf(image); 35 | } 36 | -------------------------------------------------------------------------------- /Sources/Utils/IO/HistogramIO.h: -------------------------------------------------------------------------------- 1 | #ifndef UTILS_IO_HISTOGRAM_H 2 | #define UTILS_IO_HISTOGRAM_H 3 | 4 | #include "General/BinaryMap.h" 5 | 6 | Int16Array3D HistogramIO_ConstructFromFile(const char *filename); 7 | void HistogramIO_Printf(const Int16Array3D *); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /Sources/Utils/IO/ImageIO.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "ArrayIO.h" 6 | #include "ImageIO.h" 7 | 8 | UInt8Array2D ImageIO_ConstructFromFile(const char *filename) 9 | { 10 | int ret; 11 | UInt8Array2D result ; 12 | 13 | /* Open file */ 14 | FILE *f = fopen(filename, "rb"); 15 | assert(f != NULL); 16 | 17 | result = ArrayIO_UInt8Array2D_ConstructFromStream(f); 18 | 19 | /* Check end of file */ 20 | uint8_t tmp; 21 | ret = fread(&tmp, sizeof(uint8_t), 1, f); 22 | assert(ret == 0 && feof(f)); 23 | 24 | /* Close file */ 25 | ret = fclose(f); 26 | assert(ret != EOF); 27 | 28 | return result; 29 | } 30 | 31 | void ImageIO_Printf(const UInt8Array2D *image) 32 | { 33 | int x, y; 34 | printf("\nImage"); 35 | printf("\n\twidth %d, height %d", image->sizeX, image->sizeY); 36 | for (y = 0; y < image->sizeY; y++) 37 | { 38 | printf("\n\t"); 39 | for (x = 0; x < image->sizeX; x++) 40 | { 41 | printf("%02x ", image->data[y][x]); 42 | } 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /Sources/Utils/IO/ImageIO.h: -------------------------------------------------------------------------------- 1 | #ifndef UTILS_IO_IMAGE_H 2 | #define UTILS_IO_IMAGE_H 3 | 4 | #include "General/BinaryMap.h" 5 | 6 | UInt8Array2D ImageIO_ConstructFromFile(const char *filename); 7 | void ImageIO_Printf(const UInt8Array2D *); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /Sources/Utils/IO/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- makefile-automake -*- 2 | # 3 | # Build library 4 | # 5 | # $Id$ 6 | # 7 | # Blame: Jordan Hrycaj 8 | 9 | # --------------------------------------------------------------------------- 10 | # Target 11 | # --------------------------------------------------------------------------- 12 | 13 | all-local:: SOURCES 14 | 15 | SOURCES: Makefile 16 | @rm -f $@ 17 | @echo ">>> Generating $@" 18 | @echo "# Generated from $(subdir)/Makefile.am" >> $@ 19 | @d=`basename $(subdir)`;\ 20 | for s in $(usrc); do \ 21 | echo "usrc += $$d/$$s"; done >> $@ 22 | @echo "# End" >> $@ 23 | 24 | # --------------------------------------------------------------------------- 25 | # Sources 26 | # --------------------------------------------------------------------------- 27 | 28 | usrc = ArrayIO.c BinaryMapIO.c BlockMapIO.c 29 | usrc+= HistogramIO.c ImageIO.c SimpleDataTypesIO.c 30 | 31 | # --------------------------------------------------------------------------- 32 | # End 33 | # --------------------------------------------------------------------------- 34 | -------------------------------------------------------------------------------- /Sources/Utils/IO/SOURCES: -------------------------------------------------------------------------------- 1 | # Generated from Sources/Utils/IO/Makefile.am 2 | usrc += IO/ArrayIO.c 3 | usrc += IO/BinaryMapIO.c 4 | usrc += IO/BlockMapIO.c 5 | usrc += IO/HistogramIO.c 6 | usrc += IO/ImageIO.c 7 | usrc += IO/SimpleDataTypesIO.c 8 | # End 9 | -------------------------------------------------------------------------------- /Sources/Utils/IO/SimpleDataTypesIO.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "SimpleDataTypesIO.h" 5 | 6 | int32_t Int32_ConstructFromFile(const char * filename) 7 | { 8 | int ret; 9 | int32_t result; 10 | 11 | /* Open file */ 12 | FILE *f = fopen(filename, "rb"); 13 | assert(f != NULL); 14 | 15 | fread(&result, sizeof(int32_t), 1, f); 16 | 17 | /* Check end of file */ 18 | uint8_t tmp; 19 | ret = fread(&tmp, sizeof(uint8_t), 1, f); 20 | assert(ret == 0 && feof(f)); 21 | 22 | /* Close file */ 23 | ret = fclose(f); 24 | assert(ret != EOF); 25 | 26 | return result; 27 | } 28 | 29 | float Float_ConstructFromFile (const char* filename) 30 | { 31 | int ret; 32 | float result; 33 | 34 | /* Open file */ 35 | FILE *f = fopen(filename, "rb"); 36 | assert(f != NULL); 37 | 38 | fread(&result, sizeof(float), 1, f); 39 | 40 | /* Check end of file */ 41 | uint8_t tmp; 42 | ret = fread(&tmp, sizeof(uint8_t), 1, f); 43 | assert(ret == 0 && feof(f)); 44 | 45 | /* Close file */ 46 | ret = fclose(f); 47 | assert(ret != EOF); 48 | 49 | return result; 50 | } 51 | -------------------------------------------------------------------------------- /Sources/Utils/IO/SimpleDataTypesIO.h: -------------------------------------------------------------------------------- 1 | #ifndef UTILS_IO_SIMPLEDATATYPES_H 2 | #define UTILS_IO_SIMPLEDATATYPES_H 3 | 4 | #include 5 | #include 6 | 7 | int32_t Int32_ConstructFromFile(const char *); 8 | float Float_ConstructFromFile(const char *); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /Sources/Utils/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- makefile-automake -*- 2 | # 3 | # Build library 4 | # 5 | # $Id$ 6 | # 7 | # Blame: Jordan Hrycaj 8 | 9 | SUBDIRS = IO Misc Unity 10 | 11 | # --------------------------------------------------------------------------- 12 | # Target 13 | # --------------------------------------------------------------------------- 14 | 15 | all-local:: SOURCES 16 | 17 | SOURCES: Makefile IO/SOURCES Misc/SOURCES Unity/SOURCES 18 | @rm -f $@ 19 | @echo ">>> Generating $@" 20 | @echo "# Generated from $(subdir)/Makefile.am" >> $@ 21 | @d=`basename $(subdir)`;\ 22 | for s in $(usrc); do \ 23 | echo "usrc += $$d/$$s"; done >> $@ 24 | @echo "# End" >> $@ 25 | 26 | # --------------------------------------------------------------------------- 27 | # Sources 28 | # --------------------------------------------------------------------------- 29 | 30 | usrc = 31 | 32 | include IO/SOURCES 33 | include Misc/SOURCES 34 | include Unity/SOURCES 35 | 36 | # --------------------------------------------------------------------------- 37 | # End 38 | # --------------------------------------------------------------------------- 39 | -------------------------------------------------------------------------------- /Sources/Utils/Misc/.gitignore: -------------------------------------------------------------------------------- 1 | /.deps 2 | /.dirstamp 3 | /lib*.a 4 | /lib*.la 5 | /lib*.lo 6 | /.libs 7 | /Makefile 8 | /Makefile.in 9 | /*.o 10 | -------------------------------------------------------------------------------- /Sources/Utils/Misc/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- makefile-automake -*- 2 | # 3 | # Build library 4 | # 5 | # $Id$ 6 | # 7 | # Blame: Jordan Hrycaj 8 | 9 | # --------------------------------------------------------------------------- 10 | # Target 11 | # --------------------------------------------------------------------------- 12 | 13 | all-local:: SOURCES 14 | 15 | SOURCES: Makefile 16 | @rm -f $@ 17 | @echo ">>> Generating $@" 18 | @echo "# Generated from $(subdir)/Makefile.am" >> $@ 19 | @d=`basename $(subdir)`;\ 20 | for s in $(usrc); do \ 21 | echo "usrc += $$d/$$s"; done >> $@ 22 | @echo "# End" >> $@ 23 | 24 | # --------------------------------------------------------------------------- 25 | # Sources 26 | # --------------------------------------------------------------------------- 27 | 28 | # binarise.c ignored 29 | 30 | usrc = 31 | 32 | # --------------------------------------------------------------------------- 33 | # End 34 | # --------------------------------------------------------------------------- 35 | -------------------------------------------------------------------------------- /Sources/Utils/Misc/SOURCES: -------------------------------------------------------------------------------- 1 | # Generated from Sources/Utils/Misc/Makefile.am 2 | # End 3 | -------------------------------------------------------------------------------- /Sources/Utils/Misc/binarise.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | enum { 5 | OPTVAL_NONE = 100, 6 | OPTVAL_INT32 7 | }; 8 | 9 | static struct option long_options[] = { 10 | {"int32", no_argument, NULL, OPTVAL_INT32}, 11 | {0, 0, 0, 0} 12 | }; 13 | 14 | int main(int argc, char* argv[]) 15 | { 16 | while (1) 17 | { 18 | int format = OPTVAL_NONE; 19 | 20 | /* getopt_long stores the option index here. */ 21 | int option_index = 0; 22 | 23 | int c = getopt_long(argc, argv, "", long_options, &option_index); 24 | 25 | /* Detect the end of the options. */ 26 | if (c == -1) break; 27 | 28 | switch (c) 29 | { 30 | case OPTVAL_INT32: 31 | format = OPTVAL_INT32; 32 | break; 33 | case '?': 34 | break; 35 | default: 36 | break; 37 | } 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Sources/Utils/SOURCES: -------------------------------------------------------------------------------- 1 | # Generated from Sources/Utils/Makefile.am 2 | usrc += Utils/IO/ArrayIO.c 3 | usrc += Utils/IO/BinaryMapIO.c 4 | usrc += Utils/IO/BlockMapIO.c 5 | usrc += Utils/IO/HistogramIO.c 6 | usrc += Utils/IO/ImageIO.c 7 | usrc += Utils/IO/SimpleDataTypesIO.c 8 | usrc += Utils/Unity/unity_fixture.c 9 | # End 10 | -------------------------------------------------------------------------------- /Sources/Utils/Unity/.gitignore: -------------------------------------------------------------------------------- 1 | /.deps 2 | /.dirstamp 3 | /lib*.a 4 | /lib*.la 5 | /lib*.lo 6 | /.libs 7 | /Makefile 8 | /Makefile.in 9 | /*.o 10 | -------------------------------------------------------------------------------- /Sources/Utils/Unity/Makefile.am: -------------------------------------------------------------------------------- 1 | # $Id$ 2 | # 3 | # Blame: Jordan Hrycaj 4 | 5 | # --------------------------------------------------------------------------- 6 | # Target 7 | # --------------------------------------------------------------------------- 8 | 9 | all-local:: SOURCES 10 | 11 | SOURCES: Makefile 12 | @rm -f $@ 13 | @echo ">>> Generating $@" 14 | @echo "# Generated from $(subdir)/Makefile.am" >> $@ 15 | @d=`basename $(subdir)`;\ 16 | for s in $(usrc); do \ 17 | echo "usrc += $$d/$$s"; done >> $@ 18 | @echo "# End" >> $@ 19 | 20 | # --------------------------------------------------------------------------- 21 | # Sources 22 | # --------------------------------------------------------------------------- 23 | 24 | # unity.c compiled directly - compiler flag dependent 25 | 26 | usrc = unity_fixture.c 27 | 28 | # --------------------------------------------------------------------------- 29 | # End 30 | # --------------------------------------------------------------------------- 31 | -------------------------------------------------------------------------------- /Sources/Utils/Unity/SOURCES: -------------------------------------------------------------------------------- 1 | # Generated from Sources/Utils/Unity/Makefile.am 2 | usrc += Unity/unity_fixture.c 3 | # End 4 | -------------------------------------------------------------------------------- /Sources/Utils/Unity/unity_fixture_internals.h: -------------------------------------------------------------------------------- 1 | //- Copyright (c) 2010 James Grenning and Contributed to Unity Project 2 | /* ========================================== 3 | Unity Project - A Test Framework for C 4 | Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams 5 | [Released under MIT License. Please refer to license.txt for details] 6 | ========================================== */ 7 | 8 | #ifndef UNITY_FIXTURE_INTERNALS_H_ 9 | #define UNITY_FIXTURE_INTERNALS_H_ 10 | 11 | typedef struct _UNITY_FIXTURE_T 12 | { 13 | int Verbose; 14 | unsigned int RepeatCount; 15 | const char* NameFilter; 16 | const char* GroupFilter; 17 | } UNITY_FIXTURE_T; 18 | 19 | typedef void unityfunction(void); 20 | void UnityTestRunner(unityfunction * setup, 21 | unityfunction * body, 22 | unityfunction * teardown, 23 | const char * printableName, 24 | const char * group, 25 | const char * name, 26 | const char * file, int line); 27 | 28 | void UnityIgnoreTest(const char * printableName, const char * group, const char * name); 29 | void UnityMalloc_StartTest(void); 30 | void UnityMalloc_EndTest(void); 31 | UNITY_COUNTER_TYPE UnityFailureCount(void); 32 | UNITY_COUNTER_TYPE UnityIgnoreCount(void); 33 | UNITY_COUNTER_TYPE UnityTestsCount(void); 34 | int UnityGetCommandLineOptions(int argc, const char* argv[]); 35 | void UnityConcludeFixtureTest(void); 36 | 37 | void UnityPointer_Set(void ** ptr, void * newValue); 38 | void UnityPointer_UndoAllSets(void); 39 | void UnityPointer_Init(void); 40 | 41 | void UnityAssertEqualPointer(const void * expected, 42 | const void * actual, 43 | const char* msg, 44 | const UNITY_LINE_TYPE lineNumber); 45 | 46 | #endif /* UNITY_FIXTURE_INTERNALS_H_ */ 47 | -------------------------------------------------------------------------------- /Sources/Utils/Unity/unity_fixture_malloc_overrides.h: -------------------------------------------------------------------------------- 1 | //- Copyright (c) 2010 James Grenning and Contributed to Unity Project 2 | /* ========================================== 3 | Unity Project - A Test Framework for C 4 | Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams 5 | [Released under MIT License. Please refer to license.txt for details] 6 | ========================================== */ 7 | 8 | #ifndef UNITY_FIXTURE_MALLOC_OVERRIDES_H_ 9 | #define UNITY_FIXTURE_MALLOC_OVERRIDES_H_ 10 | 11 | #include 12 | 13 | // This function is used by the Unity Fixture to allocate memory on 14 | // the heap and can be overridden with platform-specific heap 15 | // implementations. For example, when using FreeRTOS 16 | // UNITY_FIXTURE_MALLOC becomes pvPortMalloc(). 17 | 18 | #ifndef UNITY_FIXTURE_MALLOC 19 | #define UNITY_FIXTURE_MALLOC( SIZE ) malloc( ( SIZE ) ) 20 | #else 21 | extern void * UNITY_FIXTURE_MALLOC(size_t size); 22 | #endif 23 | 24 | // This function is used by the Unity Fixture to release memory in the 25 | // heap and can be overridden with platform-specific heap 26 | // implementations. For example, when using FreeRTOS 27 | // UNITY_FIXTURE_FREE becomes vPortFree(). 28 | 29 | #ifndef UNITY_FIXTURE_FREE 30 | #define UNITY_FIXTURE_FREE( PTR ) free( ( PTR ) ) 31 | #else 32 | extern void UNITY_FIXTURE_FREE(void *ptr); 33 | #endif 34 | 35 | #define malloc unity_malloc 36 | #define calloc unity_calloc 37 | #define realloc unity_realloc 38 | #define free unity_free 39 | 40 | void* unity_malloc(size_t size); 41 | void* unity_calloc(size_t num, size_t size); 42 | void* unity_realloc(void * oldMem, size_t size); 43 | void unity_free(void * mem); 44 | 45 | #endif /* UNITY_FIXTURE_MALLOC_OVERRIDES_H_ */ 46 | -------------------------------------------------------------------------------- /TestData/DataStructures/101_1.tif.12.Equalize.2DFloatArray.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/TestData/DataStructures/101_1.tif.12.Equalize.2DFloatArray.dat -------------------------------------------------------------------------------- /TestData/DataStructures/101_1.tif.12.Equalize.blocks.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/TestData/DataStructures/101_1.tif.12.Equalize.blocks.dat -------------------------------------------------------------------------------- /TestData/DataStructures/101_1.tif.12.Equalize.histgram.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/TestData/DataStructures/101_1.tif.12.Equalize.histgram.dat -------------------------------------------------------------------------------- /TestData/DataStructures/101_1.tif.12.Equalize.image.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/TestData/DataStructures/101_1.tif.12.Equalize.image.dat -------------------------------------------------------------------------------- /TestData/DataStructures/101_1.tif.15.LinesByOrientation.StepFactor.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/TestData/DataStructures/101_1.tif.15.LinesByOrientation.StepFactor.dat -------------------------------------------------------------------------------- /TestData/DataStructures/101_1.tif.15.LinesByOrientation.result.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/TestData/DataStructures/101_1.tif.15.LinesByOrientation.result.dat -------------------------------------------------------------------------------- /TestData/DataStructures/101_1.tif.17.LinesByOrientation.result.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/TestData/DataStructures/101_1.tif.17.LinesByOrientation.result.dat -------------------------------------------------------------------------------- /TestData/DataStructures/101_1.tif.4.ClippedContrast.result.dat: -------------------------------------------------------------------------------- 1 | 8"2.+.21"+,4=62/.;*%!'258/477;565/&///"*,A9681;42>>7.,3)0%20>:8A?CCH6H'(--++ $+359.FCCJ@F>?8$9+)!$%+76?@IHJ@<;;/!/**,)--95>UOA>;>7.,3)0%20>:8A?CCH6H'(--++ $+359.FCCJ@F>?8$9+)!$%+76?@IHJ@<;;/!/**,)--95>UOA>;>7.,3)0%20>:8A?CCH6H'(--++ $+359.FCCJ@F>?8$9+)!$%+76?@IHJ@<;;/!/**,)--95>UOA>;>7.,3)0%20>:8A?CCH6H'(--++ $+359.FCCJ@F>?8$9+)!$%+76?@IHJ@<;;/!/**,)--95>UOA>; 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /TestData/Minutiae test program/MinutiaeTestApp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("ConsoleApplication1")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("ConsoleApplication1")] 12 | [assembly: AssemblyCopyright("Copyright © 2015")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("02b7a21d-2dac-4978-9df1-c0ba9f4e27a5")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /TestData/Minutiae test program/MinutiaeTestApp/obj/Debug/MinutiaeTestApp.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\Tristramnorman\Documents\GitHub\libAFIS\TestData\Minutiae test program\ConsoleApplication1\ConsoleApplication1\bin\Debug\ConsoleApplication1.exe.config 2 | C:\Users\Tristramnorman\Documents\GitHub\libAFIS\TestData\Minutiae test program\ConsoleApplication1\ConsoleApplication1\bin\Debug\ConsoleApplication1.exe 3 | C:\Users\Tristramnorman\Documents\GitHub\libAFIS\TestData\Minutiae test program\ConsoleApplication1\ConsoleApplication1\bin\Debug\ConsoleApplication1.pdb 4 | C:\Users\Tristramnorman\Documents\GitHub\libAFIS\TestData\Minutiae test program\ConsoleApplication1\ConsoleApplication1\bin\Debug\SourceAFIS.xml 5 | C:\Users\Tristramnorman\Documents\GitHub\libAFIS\TestData\Minutiae test program\ConsoleApplication1\ConsoleApplication1\obj\Debug\MinutiaeTestApp.csprojResolveAssemblyReference.cache 6 | C:\Users\Tristramnorman\Documents\GitHub\libAFIS\TestData\Minutiae test program\ConsoleApplication1\ConsoleApplication1\obj\Debug\ConsoleApplication1.exe 7 | C:\Users\Tristramnorman\Documents\GitHub\libAFIS\TestData\Minutiae test program\ConsoleApplication1\ConsoleApplication1\obj\Debug\ConsoleApplication1.pdb 8 | C:\Users\Tristramnorman\Documents\GitHub\libAFIS\TestData\Minutiae test program\MinutiaeTestApp\bin\Debug\ConsoleApplication1.exe.config 9 | C:\Users\Tristramnorman\Documents\GitHub\libAFIS\TestData\Minutiae test program\MinutiaeTestApp\obj\Debug\ConsoleApplication1.exe 10 | C:\Users\Tristramnorman\Documents\GitHub\libAFIS\TestData\Minutiae test program\MinutiaeTestApp\obj\Debug\ConsoleApplication1.pdb 11 | C:\Users\Tristramnorman\Documents\GitHub\libAFIS\TestData\Minutiae test program\MinutiaeTestApp\bin\Debug\ConsoleApplication1.exe 12 | C:\Users\Tristramnorman\Documents\GitHub\libAFIS\TestData\Minutiae test program\MinutiaeTestApp\bin\Debug\ConsoleApplication1.pdb 13 | C:\Users\Tristramnorman\Documents\GitHub\libAFIS\TestData\Minutiae test program\MinutiaeTestApp\bin\Debug\SourceAFIS.xml 14 | C:\Users\Tristramnorman\Documents\GitHub\libAFIS\TestData\Minutiae test program\MinutiaeTestApp\obj\Debug\MinutiaeTestApp.csprojResolveAssemblyReference.cache 15 | -------------------------------------------------------------------------------- /TestData/README.md: -------------------------------------------------------------------------------- 1 | ## Data Files for Unit Tests 2 | 3 | This directory contains data files for unit tests. Each unit test has some *input* data and some *expected* output which is generated using the original C# code. When a unit test is executed it generates some *actual* output from the input data. Then the actual output is compared to the expected output to determine if the unit test passed or failed. Each unit test can be run several times using different input data. Test data is organised in a directory structure that matches the organisation of source code modules. 4 | 5 | Test data is saved in binary files using the following naming pattern. 6 | 7 | * for input data: `nxxx_dy_in.dat`, 8 | * for expected output: `nxxx_dy_exp.dat`, 9 | 10 | where *xxx* is the serial number of test for the current module, *y* is the serial number of data (input or output) for the component under test. 11 | 12 | For example the the `LocalHistogram_Analyze()` function has two input parameters and returns one object: 13 | 14 | ~~~ 15 | Int16Array3D LocalHistogram_Analyze(const BlockMap *blocks, const UInt8Array2D *image); 16 | ~~~ 17 | 18 | Therefore, a unit test for this function uses the following three data files: `n001_d1_in.dat`, `n001_d2_in.dat` and `n001_d1_exp.dat` representing a `BlockMap`, a `UInt8Array2D` and a `Int16Array3D` object respectively. 19 | 20 | ### Manually extracted minutiae 21 | This folder contains minutiae that have been extracted by eye in order to be able to test against what is hopefully a full perfect (no false) set of minutiae. There is a xlst template file that you can enter minutiae details into that will generate the hex for the ISO template. The template file contains a number of minutiae as examples which should be removed when creating new templates. 22 | -------------------------------------------------------------------------------- /TestImages/Person1/Bas1440999265-Hamster-0-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/TestImages/Person1/Bas1440999265-Hamster-0-0.png -------------------------------------------------------------------------------- /TestImages/Person1/Bas1440999265-Hamster-0-0.png.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/TestImages/Person1/Bas1440999265-Hamster-0-0.png.pgm -------------------------------------------------------------------------------- /TestImages/Person1/Bas1440999265-Hamster-0-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/TestImages/Person1/Bas1440999265-Hamster-0-1.png -------------------------------------------------------------------------------- /TestImages/Person1/Bas1440999265-Hamster-0-1.png.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/TestImages/Person1/Bas1440999265-Hamster-0-1.png.pgm -------------------------------------------------------------------------------- /TestImages/Person1/Bas1440999265-Hamster-0-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/TestImages/Person1/Bas1440999265-Hamster-0-2.png -------------------------------------------------------------------------------- /TestImages/Person1/Bas1440999265-Hamster-0-2.png.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/TestImages/Person1/Bas1440999265-Hamster-0-2.png.pgm -------------------------------------------------------------------------------- /TestImages/Person1/Bas1440999265-Hamster-1-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/TestImages/Person1/Bas1440999265-Hamster-1-0.png -------------------------------------------------------------------------------- /TestImages/Person1/Bas1440999265-Hamster-1-0.png.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/TestImages/Person1/Bas1440999265-Hamster-1-0.png.pgm -------------------------------------------------------------------------------- /TestImages/Person1/Bas1440999265-Hamster-1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/TestImages/Person1/Bas1440999265-Hamster-1-1.png -------------------------------------------------------------------------------- /TestImages/Person1/Bas1440999265-Hamster-1-1.png.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/TestImages/Person1/Bas1440999265-Hamster-1-1.png.pgm -------------------------------------------------------------------------------- /TestImages/Person1/Bas1440999265-Hamster-1-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/TestImages/Person1/Bas1440999265-Hamster-1-2.png -------------------------------------------------------------------------------- /TestImages/Person1/Bas1440999265-Hamster-1-2.png.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/TestImages/Person1/Bas1440999265-Hamster-1-2.png.pgm -------------------------------------------------------------------------------- /TestImages/Person2/Bas1440999687-Hamster-0-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/TestImages/Person2/Bas1440999687-Hamster-0-0.png -------------------------------------------------------------------------------- /TestImages/Person2/Bas1440999687-Hamster-0-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/TestImages/Person2/Bas1440999687-Hamster-0-1.png -------------------------------------------------------------------------------- /TestImages/Person2/Bas1440999687-Hamster-0-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/TestImages/Person2/Bas1440999687-Hamster-0-2.png -------------------------------------------------------------------------------- /TestImages/Person2/Bas1440999687-Hamster-1-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/TestImages/Person2/Bas1440999687-Hamster-1-0.png -------------------------------------------------------------------------------- /TestImages/Person2/Bas1440999687-Hamster-1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/TestImages/Person2/Bas1440999687-Hamster-1-1.png -------------------------------------------------------------------------------- /TestImages/Person2/Bas1440999687-Hamster-1-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/TestImages/Person2/Bas1440999687-Hamster-1-2.png -------------------------------------------------------------------------------- /acinclude.m4: -------------------------------------------------------------------------------- 1 | # -*- m4 -*- 2 | # 3 | # auto configuration includes list 4 | # 5 | # $Id$ 6 | # 7 | # Blame: Jordan Hrycaj 8 | # 9 | 10 | m4_include([VERSION]) 11 | m4_include([amcompat.m4]) 12 | 13 | m4_include([tools/ac/ac_config_init.m4]) 14 | m4_include([tools/ac/ac_check_config_shell.m4]) 15 | m4_include([tools/ac/ac_subst_basedir.m4]) 16 | 17 | # End 18 | -------------------------------------------------------------------------------- /boot/.gitignore: -------------------------------------------------------------------------------- 1 | /AUTHORS 2 | /COPYING 3 | /ChangeLog 4 | /INSTALL 5 | /Makefile 6 | /Makefile.in 7 | /NEWS 8 | /README 9 | /VERSION 10 | /acinclude.m4 11 | /aclocal.m4 12 | /amcompat.m4 13 | /ar-lib 14 | /autom4te.cache 15 | /compile 16 | /config.* 17 | /config4build 18 | /configure 19 | /install-sh 20 | /libtool 21 | /ltmain.sh 22 | /m4lib 23 | /missing 24 | /stamp-h1 25 | /tools -------------------------------------------------------------------------------- /boot/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- makefile-automake -*- 2 | # 3 | # Cc-for-build environment makefile 4 | # 5 | # $Id$ 6 | # 7 | # Blame: Jordan Hrycaj 8 | 9 | # recommended by libtoolize 10 | ACLOCAL_AMFLAGS = -I m4lib 11 | 12 | SUBDIRS = gen 13 | CLEANFILES = 14 | 15 | # --------------------------------------------------------------------------- 16 | # Main 17 | # --------------------------------------------------------------------------- 18 | 19 | .PHONY: all-local 20 | all-local:: 21 | 22 | # --------------------------------------------------------------------------- 23 | # Auto configuration helper 24 | # --------------------------------------------------------------------------- 25 | 26 | .PHONY: libtool 27 | libtool: $(LIBTOOL_DEPS) 28 | $(SHELL) ./config.status --recheck 29 | 30 | .PHONY: autoreconf reconf 31 | autoreconf reconf: libtool 32 | rm -f $(AUTOGENERATED) 33 | touch configure.ac 34 | autoreconf 35 | 36 | # --------------------------------------------------------------------------- 37 | # End 38 | # --------------------------------------------------------------------------- 39 | -------------------------------------------------------------------------------- /boot/configure.ac: -------------------------------------------------------------------------------- 1 | # -*- autoconf -*- 2 | # 3 | # $Id$ 4 | # 5 | # Blame: Jordan Hrycaj 6 | 7 | AC_PREREQ([2.69]) 8 | AC_INIT([libAFIS compile time helpers], 9 | [m4_esyscmd_s([sed s/\#// VERSION])], 10 | [jordan@teddy-net.com], 11 | [boot]) 12 | 13 | AC_CONFIG_HEADERS([config.h]) 14 | AC_CONFIG_SRCDIR([acinclude.m4]) 15 | AC_CONFIG_INIT 16 | AC_CONFIG_MACRO_DIR([m4lib]) 17 | 18 | AC_LANG(C) 19 | dnl # Enable ISO features if possible. On Linux, setting _XOPEN_SOURCE 20 | dnl # includes POSIX and XPG things. Set to 500 if Single Unix 21 | dnl # conformance is wanted, to 600 for the upcoming sixth revision. 22 | dnl # AC_DEFINE([_XOPEN_SOURCE],[600],[set minimum standard conformance]) 23 | 24 | # Libtool 25 | LT_PREREQ([2.4.2]) 26 | LT_INIT 27 | AC_SUBST([LIBTOOL_DEPS]) 28 | AC_PROG_LIBTOOL 29 | 30 | # Checks for programs. 31 | AC_PROG_CC 32 | AC_PROG_CPP 33 | AC_PROG_CC_C99 34 | AC_C_RESTRICT 35 | AC_PROG_LN_S 36 | AC_PROG_MAKE_SET 37 | AC_PROG_MKDIR_P 38 | 39 | # Checks for libraries. 40 | # FIXME: Replace `main' with a function in `-lm': 41 | AC_CHECK_LIB([m], [main]) 42 | 43 | # Checks for header files. 44 | AC_CHECK_HEADERS([limits.h stddef.h stdint.h stdlib.h]) 45 | AC_CHECK_HEADERS([string.h sys/time.h unistd.h]) 46 | 47 | # Checks for typedefs, structures, and compiler characteristics. 48 | AC_CHECK_HEADER_STDBOOL 49 | AC_TYPE_INT16_T 50 | AC_TYPE_INT32_T 51 | AC_TYPE_SIZE_T 52 | AC_TYPE_UINT16_T 53 | AC_TYPE_UINT32_T 54 | AC_TYPE_UINT8_T 55 | 56 | # Checks for library functions. 57 | AC_FUNC_MALLOC 58 | AC_FUNC_REALLOC 59 | AC_CHECK_FUNCS([gettimeofday memset strstr]) 60 | 61 | AC_CONFIG_FILES([Makefile 62 | gen/Makefile]) 63 | 64 | # Output, write configs 65 | AC_OUTPUT 66 | 67 | # End 68 | -------------------------------------------------------------------------------- /boot/gen/.gitignore: -------------------------------------------------------------------------------- 1 | /Makefile 2 | /Makefile.in 3 | -------------------------------------------------------------------------------- /boot/gen/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- makefile-automake -*- 2 | # 3 | # Configuration bootstrap, cc-for-build environment (example) 4 | # 5 | # $Id$ 6 | # 7 | # Blame: Jordan Hrycaj 8 | 9 | # --------------------------------------------------------------------------- 10 | # Main 11 | # --------------------------------------------------------------------------- 12 | 13 | .PHONY: all-local 14 | all-local:: 15 | 16 | # --------------------------------------------------------------------------- 17 | # End 18 | # --------------------------------------------------------------------------- 19 | -------------------------------------------------------------------------------- /logo/libAFIS logo_black.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/logo/libAFIS logo_black.ai -------------------------------------------------------------------------------- /logo/libAFIS logo_blue.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/logo/libAFIS logo_blue.ai -------------------------------------------------------------------------------- /logo/libAFIS.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simprints/libAFIS/4865711ef616212b4264eee395f4272cb5abe3f5/logo/libAFIS.jpg -------------------------------------------------------------------------------- /tools/ac/.gitattributes: -------------------------------------------------------------------------------- 1 | *.m4 ident eol=lf -------------------------------------------------------------------------------- /tools/ac/ac_check_config_shell.m4: -------------------------------------------------------------------------------- 1 | # -*- m4 -*- 2 | # 3 | # $Id: abb51512ac749e9e922cf06bfb2423fdbbf2d40d $ 4 | # 5 | # Blame: Jordan Hrycaj 6 | 7 | # --------------------------------------------------------------------------- 8 | # Check environment for certain Bourne shell quirks 9 | # --------------------------------------------------------------------------- 10 | 11 | AC_DEFUN([AC_CHECK_CONFIG_SHELL],[ 12 | have_bash=no 13 | case $CONFIG_SHELL in */bash) have_bash=yes ; esac 14 | 15 | need_config_shell=no 16 | case $build_os in 17 | *UnixWare*) test $have_bash = no && 18 | need_config_shell="" 19 | esac 20 | case $host_os in 21 | *UnixWare*) test $have_bash = no && 22 | need_config_shell="" 23 | esac 24 | 25 | if test $need_config_shell != no 26 | then 27 | for d in /sbin /bin /usr/bin /usr/local/bin 28 | do 29 | test -x $d/bash || continue 30 | need_config_shell=$d/bash 31 | break 32 | done 33 | 34 | m="Please set the environment variable CONFIG_SHELL" 35 | n="export CONFIG_SHELL; CONFIG_SHELL=$need_config_shell" 36 | AC_MSG_ERROR([$m, e.g. as "$n"]) 37 | fi 38 | ]) 39 | 40 | # --------------------------------------------------------------------------- 41 | # End 42 | # --------------------------------------------------------------------------- 43 | -------------------------------------------------------------------------------- /tools/ac/ac_subst_basedir.m4: -------------------------------------------------------------------------------- 1 | # -*- m4 -*- 2 | # 3 | # $Id: d00adcec5a504aa2180d39e66ab0fc02d51fc97e $ 4 | # 5 | # Blame: Jordan Hrycaj 6 | 7 | # --------------------------------------------------------------------------- 8 | # Makefile.am: XXX_DIR 9 | # --------------------------------------------------------------------------- 10 | 11 | AC_DEFUN([_AC_SUBST_BASEDIR],[ 12 | $1=$BASE_DIR/$2 13 | AC_SUBST($1) 14 | ]) 15 | 16 | AC_DEFUN([AC_SUBST_BASEDIR],[ 17 | if test -z "$BASE_DIR" 18 | then 19 | BASE_DIR=$ac_pwd 20 | AC_SUBST([BASE_DIR]) 21 | fi 22 | _AC_SUBST_BASEDIR(m4_translit(m4_bpatsubst([$1],[.*/]),[a-z],[A-Z])_DIR,$1) 23 | ]) 24 | 25 | # --------------------------------------------------------------------------- 26 | # End 27 | # --------------------------------------------------------------------------- 28 | -------------------------------------------------------------------------------- /tools/am/compat-1.11: -------------------------------------------------------------------------------- 1 | AC_DEFUN([AM_PROG_AR]) 2 | -------------------------------------------------------------------------------- /tools/am/compat-1.12: -------------------------------------------------------------------------------- 1 | AC_DEFUN([AM_PROG_AR]) 2 | -------------------------------------------------------------------------------- /tools/am/compat-1.13: -------------------------------------------------------------------------------- 1 | AC_DEFUN([AM_PROG_AR]) 2 | --------------------------------------------------------------------------------