areaDetector  3-5-0
EPICS areaDetector framework
NDPluginEdge.h
Go to the documentation of this file.
1 #ifndef NDPluginEdge_H
2 #define NDPluginEdge_H
3 
4 #include "NDPluginDriver.h"
5 
6 #define EDGE_VERSION 1
7 #define EDGE_REVISION 2
8 #define EDGE_MODIFICATION 0
9 
10 /* Output data type */
11 #define NDPluginEdgeLowThresholdString "LOW_THRESHOLD" /* (asynFloat32, r/w) Canny sensitivity */
12 #define NDPluginEdgeThresholdRatioString "THRESHOLD_RATIO" /* (asynFloat32, r/w) low threshold * ratio = high threshold */
13 #define NDPluginEdgeVerticalFoundString "VERTICAL_FOUND" /* (asynInt32, r/o) 1 we found it, 0 not */
14 #define NDPluginEdgeTopEdgeFoundString "TOP_EDGE_FOUND" /* (asynInt32, r/o) 1 we found it, 0 not */
15 #define NDPluginEdgeTopPixelString "TOP_PIXEL" /* (asynInt32, r/o) index of pixel or -1 if not found */
16 #define NDPluginEdgeBottomEdgeFoundString "BOTTOM_EDGE_FOUND" /* (asynInt32, r/o) 1 we found it, 0 not */
17 #define NDPluginEdgeBottomPixelString "BOTTOM_PIXEL" /* (asynInt32, r/o) index of pixel or -1 if not found */
18 #define NDPluginEdgeVerticalCenterString "VERTICAL_CENTER" /* (asynFloat64, r/o) average of vertical positions */
19 #define NDPluginEdgeVerticalSizeString "VERTICAL_SIZE" /* (asynInt32, r/o) Differance between top and bottom */
20 #define NDPluginEdgeHorizontalFoundString "HORIZONTAL_FOUND" /* (asynInt32, r/o) 1 we found it, 0 we did not */
21 #define NDPluginEdgeLeftEdgeFoundString "LEFT_EDGE_FOUND" /* (asynInt32, r/o) 1 of we found it, 0 if not */
22 #define NDPluginEdgeLeftPixelString "LEFT_PIXEL" /* (asynInt32, r/o) index of pixel (-1 if not found */
23 #define NDPluginEdgeRightEdgeFoundString "RIGHT_EDGE_FOUND" /* (asynInt32, r/o) 1 of we found it, 0 if not */
24 #define NDPluginEdgeRightPixelString "RIGHT_PIXEL" /* (asynInt32, r/o) index of pixel (-1 if not found) */
25 #define NDPluginEdgeHorizontalCenterString "HORIZONTAL_CENTER" /* (asynFloat64, r/o) average of horizontal positions */
26 #define NDPluginEdgeHorizontalSizeString "HORIZONTAL_SIZE" /* (asynInt32, r/o) difference between left and right */
27 
28 
31 class NDPluginEdge : public NDPluginDriver {
32 public:
33  NDPluginEdge(const char *portName, int queueSize, int blockingCallbacks,
34  const char *NDArrayPort, int NDArrayAddr,
35  int maxBuffers, size_t maxMemory,
36  int priority, int stackSize);
37  /* These methods override the virtual methods in the base class */
38  void processCallbacks(NDArray *pArray);
39 
40 protected:
41 
42  /* edge sensitivity */
44  #define FIRST_NDPLUGIN_EDGE_PARAM NDPluginEdgeLowThreshold
45 
46  /* threshold ratio (low * ratio = high, ratio is recommended to be 3) */
48 
49  /* 1 if vertical edge found (top and bottom found and are different */
51 
52  /* if we found a top edge */
54 
55  /* first edge position from the top (-1 for not found) */
57 
58  /* if we found a bottom edge */
60 
61  /* first edge position from the bottom (-1 for not found) */
63 
64  /* average of top and bottom */
66 
67  /* difference between top and bottom */
69 
70  /* 1 if horizontal edit found (left and right found and are different */
72 
73  /* 1 if left edge found */
75 
76  /* first edge position from left (-1 for not found) */
78 
79  /* 1 if right edge found */
81 
82  /* first edge position from right (-1 for not found) */
84 
85  /* average of left and right positions */
87 
88  /* difference between left and right positions */
90 
91 private:
92 
93 };
94 
95 #endif
Class from which actual plugin drivers are derived; derived from asynNDArrayDriver.
Definition: NDPluginDriver.h:56
int NDPluginEdgeLeftEdgeFound
Definition: NDPluginEdge.h:74
int NDPluginEdgeBottomPixel
Definition: NDPluginEdge.h:62
int NDPluginEdgeVerticalFound
Definition: NDPluginEdge.h:50
int NDPluginEdgeBottomEdgeFound
Definition: NDPluginEdge.h:59
void processCallbacks(NDArray *pArray)
Color Mode to CV Matrix.
Definition: NDPluginEdge.cpp:73
int NDPluginEdgeHorizontalCenter
Definition: NDPluginEdge.h:86
int NDPluginEdgeRightEdgeFound
Definition: NDPluginEdge.h:80
int NDPluginEdgeTopEdgeFound
Definition: NDPluginEdge.h:53
int NDPluginEdgeLeftPixel
Definition: NDPluginEdge.h:77
char * portName
The name of this asyn port.
Definition: asynPortDriver.h:179
int NDPluginEdgeThresholdRatio
Definition: NDPluginEdge.h:47
Does image processing operations.
Definition: NDPluginEdge.h:31
NDPluginEdge(const char *portName, int queueSize, int blockingCallbacks, const char *NDArrayPort, int NDArrayAddr, int maxBuffers, size_t maxMemory, int priority, int stackSize)
Constructor for NDPluginEdge; most parameters are simply passed to NDPluginDriver::NDPluginDriver.
Definition: NDPluginEdge.cpp:289
int NDPluginEdgeVerticalSize
Definition: NDPluginEdge.h:68
int NDPluginEdgeHorizontalSize
Definition: NDPluginEdge.h:89
int NDPluginEdgeLowThreshold
Definition: NDPluginEdge.h:43
N-dimensional array class; each array has a set of dimensions, a data type, pointer to data,...
Definition: NDArray.h:92
int NDPluginEdgeHorizontalFound
Definition: NDPluginEdge.h:71
int NDPluginEdgeRightPixel
Definition: NDPluginEdge.h:83
int NDPluginEdgeTopPixel
Definition: NDPluginEdge.h:56
int NDPluginEdgeVerticalCenter
Definition: NDPluginEdge.h:65