00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _SO_SOGRAYSCALECORRELATIONPROCESSING2D_IMAGE_FILTER_H_
00025 #define _SO_SOGRAYSCALECORRELATIONPROCESSING2D_IMAGE_FILTER_H_
00026 #include <ImageViz/SoImageViz.h>
00027 #include <ImageViz/Engines/SoSubImageVizEngine.h>
00028 #include <ImageViz/Engines/SoImageVizEngineOutput.h>
00029 #include <ImageViz/Engines/SoImageVizEngine.h>
00030 #include <Inventor/fields/SoSFEnum.h>
00031
00032 #include <ImageViz/Fields/SoSFImageDataAdapter.h>
00033 #include <ImageViz/Engines/SoImageVizEngineAnalysisOutput.h>
00034
00035
00163 class SoGrayscaleCorrelationProcessing2d : public SoImageVizEngine
00164 {
00165
00166 SO_IMAGEVIZ_ENGINE_HEADER(SoGrayscaleCorrelationProcessing2d);
00167
00168 public:
00170 SoGrayscaleCorrelationProcessing2d();
00171
00175 class SbCorrelationDetail
00176 {
00177 public:
00178
00179 SbCorrelationDetail(SoImageAnalysisResult* analysis, int sequenceIndex=0);
00180
00182 inline float getMinComputed() const
00183 { return m_minComputed; }
00184
00186 inline float getMaxComputed() const
00187 { return m_maxComputed; }
00188
00190 inline float getMatchingPositionX() const
00191 { return m_matchingPositionX; }
00192
00194 inline float getMatchingPositionY() const
00195 { return m_matchingPositionY; }
00196
00198 inline float getMinTheoretical() const
00199 { return m_minTheoretical; }
00200
00202 inline float getMaxTheoretical() const
00203 { return m_maxTheoretical; }
00204
00205 private:
00206
00207 SbCorrelationDetail(){};
00208
00209 float m_minComputed;
00210 float m_maxComputed;
00211 float m_matchingPositionX;
00212 float m_matchingPositionY;
00213 float m_minTheoretical;
00214 float m_maxTheoretical;
00215 };
00216
00220 enum CorrelationCriterion{
00224 SIGNCHANGE = 0,
00228 SUBSTRACT = 1,
00232 MULTIPLY = 2
00233 };
00234
00238 SoSFEnum correlationCriterion;
00239
00241 SoSFImageDataAdapter inGrayImage;
00242
00244 SoSFImageDataAdapter inKernelImage;
00245
00250 enum OffsetMode{
00254 OFFSET_1 = 0,
00258 OFFSET_2 = 1,
00262 OFFSET_4 = 2,
00266 OFFSET_8 = 3
00267 };
00268
00272 SoSFEnum offsetMode;
00273
00278 enum CorrelationMode{
00282 DIRECT = 0,
00286 MEAN = 1,
00290 VARIANCE = 2,
00294 MEAN_VARIANCE = 3
00295 };
00296
00300 SoSFEnum correlationMode;
00301
00303 SoImageVizEngineOutput<SoSFImageDataAdapter,SoImageDataAdapter*> outMatchingImage;
00304
00306 SoImageVizEngineAnalysisOutput<SbCorrelationDetail> outResult;
00307
00308
00309 private:
00311 virtual ~SoGrayscaleCorrelationProcessing2d();
00312
00313 };
00314
00315 #endif