00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00024
00025 #include <qvip.h>
00026 #include <qvipp.h>
00027
00028 #include <QVMatrix>
00029 #include <QVHessianPointDetector>
00030
00031 QVHessianPointDetector::QVHessianPointDetector(QString name): QVProcessingBlock(name)
00032 {
00033 addProperty< QVImage<uChar,3> >("Input image", inputFlag|outputFlag);
00034 addProperty< QVImage<uChar,1> >("Feature response image", outputFlag);
00035 addProperty< QList < QPointF > >("Feature locations", outputFlag);
00036 addProperty< int >("Max number of corners", inputFlag, 300, "Maximal number of points to detect", 10, 1000);
00037 }
00038
00039 void QVHessianPointDetector::iterate()
00040 {
00041
00042 const QVImage<uChar> image = getPropertyValue< QVImage<uChar,3> >("Input image");
00043 const int maxNumberCorners = getPropertyValue< int >("Max number of corners");
00044 const int rows = image.getRows(), cols = image.getCols();
00045
00046 timeFlag("Read input properties");
00047
00048
00049 QVImage<sFloat> cornerResponseImage(cols, rows);
00050 FilterHessianCornerResponseImage(image, cornerResponseImage);
00051 setPropertyValue< QVImage<uChar> >("Feature response image", cornerResponseImage);
00052 timeFlag("Feature response image");
00053
00054
00055 const QList<QPointF> actualPoints = maximalPoints(cornerResponseImage).values();
00056 timeFlag("Get corners and intensity responses");
00057
00058 const int size = actualPoints.size();
00059 setPropertyValue< QList<QPointF> >("Feature locations", actualPoints.mid(MAX(0,size-maxNumberCorners),maxNumberCorners) );
00060 timeFlag("Store properties values");
00061 }
00062