IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
CannySurfaces3dImgLvl3.h
1 // CannySurfaces3dImgLvl3.h:
3 // ----------------------
4 //
14 
15 #ifndef __IPSDKIPLFEATUREDETECTION_CANNYSURFACES3DIMGLVL3_H__
16 #define __IPSDKIPLFEATUREDETECTION_CANNYSURFACES3DIMGLVL3_H__
17 
20 
21 // Attributes headers
22 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Strip/ZStrip3d/OutZStrip3d.h>
23 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Strip/ZStrip3dWithKernel/InGxKnlZStrip3d.h>
24 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Strip/ZStrip3dWithKernel/InGyKnlZStrip3d.h>
25 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Strip/ZStrip3dWithKernel/InGzKnlZStrip3d.h>
26 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/DataItem/InCannyThresholds.h>
27 
28 namespace ipsdk {
29 namespace imaproc {
30 namespace fd {
31 
34 
35 // declare processing algorithm
36 IPSDK_DECLARE_PROCESSING_ALGORITHM(IPSDKIPLFeatureDetection, CannySurfaces3dImg,
38  (((ipsdk)(imaproc)(attr))(InGxKnlZStrip3d))
39  (((ipsdk)(imaproc)(attr))(InGyKnlZStrip3d))
40  (((ipsdk)(imaproc)(attr))(InGzKnlZStrip3d))
41  (((ipsdk)(imaproc)(attr))(InCannyThresholds))
42  (((ipsdk)(imaproc)(attr))(OutZStrip3d)))
43 
44  // implementation of image processing data identifier retrieval method
45  // for function selector usage
46  IPSDK_DECLARE_ALGORITHM_FUNCTION_SELECTOR(((STRIP)(InGxKnlZStrip3d)));
47 
48  // declaration of parsed data during processing
49  IPSDK_DECLARE_ALGORITHM_PARSED_DATA(((LINESTRIP)(InGxKnlZStrip3d))
50  ((LINESTRIP)(InGyKnlZStrip3d))
51  ((LINESTRIP)(InGzKnlZStrip3d))
52  ((LINESTRIP)(OutZStrip3d)));
53 
54 // methods
55 public:
56 
57 protected:
59  template <typename BufInType,
60  ipsdk::eInstructionSet::domain IS>
61  ipsdk::BoolResult genericProcessFunction(const ipsdk::processor::ProcessingInfo& info);
62 
63  template <typename BufInType, ipsdk::eInstructionSet::domain IS>
64  ipsdk::BoolResult processFunction(const ipsdk::processor::ProcessingInfo& info);
65 
66 
67  template <typename T, ipsdk::eInstructionSet::domain IS>
68  void computeSobelMagnitudeSquare(
69  ipUInt32 z,
70  ipUInt32 y,
71  const FragHybridBufferPtr& pGx,
72  const FragHybridBufferPtr& pGy,
73  const FragHybridBufferPtr& pGz,
74  const FragHybridBufferPtr& pGMag,
75  ipUInt64 nbData);
76 
77  template <typename BufInType, typename GradientT, ipsdk::eInstructionSet::domain IS, bool Normalize>
78  void computeSobelGradient(
79  const FragHybridBufferPtr& pGxSepX,
80  const FragHybridBufferPtr& pGySepX,
81  const FragHybridBufferPtr& pGzSepX,
82  const FragHybridBufferPtr& pGxSepY,
83  const FragHybridBufferPtr& pGySepY,
84  const FragHybridBufferPtr& pGzSepY,
85  const FragHybridBufferPtr& pGx,
86  const FragHybridBufferPtr& pGy,
87  const FragHybridBufferPtr& pGz,
88  const FragHybridBufferPtr& pGMag,
90 
91  template <typename BufInType, ipsdk::eInstructionSet::domain IS>
92  void computeGradientMagnitudeSquare(
93  const FragHybridBufferPtr& pGMag,
95 
96  core::ExecResult preProcess();
97 
98 // attributes
99 protected:
100  FragHybridBufferPtr _pGxSepXInitial;
101  FragHybridBufferPtr _pGySepXInitial;
102  FragHybridBufferPtr _pGzSepXInitial;
103  FragHybridBufferPtr _pGxSepYInitial;
104  FragHybridBufferPtr _pGySepYInitial;
105  FragHybridBufferPtr _pGzSepYInitial;
106  FragHybridBufferPtr _pGxInitial;
107  FragHybridBufferPtr _pGyInitial;
108  FragHybridBufferPtr _pGzInitial;
109  FragHybridBufferPtr _pGMagnitudeInitial;
110 
111  FragHybridBufferPtr _pGxSepXMain;
112  FragHybridBufferPtr _pGySepXMain;
113  FragHybridBufferPtr _pGzSepXMain;
114  FragHybridBufferPtr _pGxSepYMain;
115  FragHybridBufferPtr _pGySepYMain;
116  FragHybridBufferPtr _pGzSepYMain;
117  FragHybridBufferPtr _pGxMain;
118  FragHybridBufferPtr _pGyMain;
119  FragHybridBufferPtr _pGzMain;
120  FragHybridBufferPtr _pGMagnitudeMain;
121 
122  FragHybridBufferPtr _pGxSepXFinal;
123  FragHybridBufferPtr _pGySepXFinal;
124  FragHybridBufferPtr _pGzSepXFinal;
125  FragHybridBufferPtr _pGxSepYFinal;
126  FragHybridBufferPtr _pGySepYFinal;
127  FragHybridBufferPtr _pGzSepYFinal;
128  FragHybridBufferPtr _pGxFinal;
129  FragHybridBufferPtr _pGyFinal;
130  FragHybridBufferPtr _pGzFinal;
131  FragHybridBufferPtr _pGMagnitudeFinal;
132 
133  boost::scoped_array<ipUInt8> _pDiffKnlUInt8;
134  boost::scoped_array<ipUInt8> _pAvgKnlUInt8;
135 };
136 
139 
140 } // end of namespace fd
141 } // end of namespace imaproc
142 } // end of namespace ipsdk
143 
144 #endif // __IPSDKIPLFEATUREDETECTION_CANNYSURFACES3DIMGLVL3_H__
boost::shared_ptr< FragHybridBuffer > FragHybridBufferPtr
uint64_t ipUInt64
IPSDKBASEPROCESSING_API RulePtr none()
Definition of import/export macro for library.
#define IPSDK_DECLARE_PROCESSING_ALGORITHM(libraryName, algoName, RuleString, attributeSeq)
#define IPSDK_DECLARE_ALGORITHM_PARSED_DATA(dataSeq)
#define IPSDK_DECLARE_ALGORITHM_FUNCTION_SELECTOR(dataTypeSeq)
uint32_t ipUInt32