00001 /*======================================================================= 00002 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00003 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00004 *** *** 00005 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00006 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00007 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00008 *** *** 00009 *** RESTRICTED RIGHTS LEGEND *** 00010 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00011 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00012 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00013 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00014 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00015 *** *** 00016 *** COPYRIGHT (C) 1996-2019 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : ImageViz-Generator (Sep 2013) 00022 ** Modified by : ImageViz-Generator 00023 **=======================================================================*/ 00024 #ifndef _SO_SOAUTOTHRESHOLDINGPROCESSING_IMAGE_FILTER_H_ 00025 #define _SO_SOAUTOTHRESHOLDINGPROCESSING_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 <Inventor/fields/SoSFVec2f.h> 00033 #include <ImageViz/Fields/SoSFImageDataAdapter.h> 00034 #include <ImageViz/Engines/SoImageVizEngineAnalysisOutput.h> 00035 00036 00178 class SoAutoThresholdingProcessing : public SoImageVizEngine 00179 { 00180 00181 SO_IMAGEVIZ_ENGINE_HEADER(SoAutoThresholdingProcessing); 00182 00183 public: 00185 SoAutoThresholdingProcessing(); 00186 00190 SoSFEnum computeMode; 00191 00195 class SbAutoThresholdingDetail 00196 { 00197 public: 00198 00199 SbAutoThresholdingDetail(SoImageAnalysisResult* analysis, int sequenceIndex=0); 00200 00202 inline float getThreshold() const 00203 { return m_threshold; } 00204 00205 private: 00206 00207 SbAutoThresholdingDetail(){}; 00208 00209 float m_threshold; 00210 }; 00211 00215 enum ObjectLightness{ 00219 BRIGHT_OBJECTS = 0, 00223 DARK_OBJECTS = 1 00224 }; 00225 00229 SoSFEnum objectLightness; 00230 00232 SoSFImageDataAdapter inGrayImage; 00233 00235 SoSFVec2f intensityRangeInput; 00236 00240 enum ThresholdCriterion{ 00244 ENTROPY = 0, 00248 FACTORISATION = 1, 00252 MOMENTS = 2 00253 }; 00254 00258 SoSFEnum thresholdCriterion; 00259 00263 enum RangeMode{ 00267 MIN_MAX = 0, 00271 OTHER = 1 00272 }; 00273 00277 SoSFEnum rangeMode; 00278 00280 SoImageVizEngineOutput<SoSFImageDataAdapter,SoImageDataAdapter*> outBinaryImage; 00281 00283 SoImageVizEngineAnalysisOutput<SbAutoThresholdingDetail> outResult; 00284 00285 00286 private: 00288 virtual ~SoAutoThresholdingProcessing(); 00289 00290 }; 00291 00292 #endif