MCPcopy Create free account
hub / github.com/cpvrlab/ImagePlay / init

Method init

IPL/src/processes/IPLMorphologyBinary.cpp:25–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23#include <numeric>
24
25void IPLMorphologyBinary::init()
26{
27 // init
28 _result = NULL;
29
30 // basic settings
31 setClassName("IPLMorphologyBinary");
32 setTitle("Binary Morphology");
33 setCategory(IPLProcess::CATEGORY_MORPHOLOGY);
34 setOpenCVSupport(IPLOpenCVSupport::OPENCV_OPTIONAL);
35
36 // default value
37 // 0 0 0
38 // 0 1 0
39 // 0 0 0
40 int nrElements = 9;
41 _kernel.clear();
42 for(int i=0; i<nrElements; i++)
43 {
44 _kernel.push_back((i==4 ? 1 : 0));
45 }
46
47 _operation = 0;
48 _iterations = 1;
49
50 // inputs and outputs
51 addInput("Image", IPL_IMAGE_BW);
52 addOutput("Image", IPL_IMAGE_BW);
53
54 // properties
55 addProcessPropertyVectorInt("kernel", "Kernel", "", _kernel, IPL_WIDGET_BINARY_MORPHOLOGY);
56 addProcessPropertyInt("iterations", "Iterations",
57 "Run the algorithm x times\nCaution: big kernels and too many iterations can take a long time to compute!",
58 _iterations, IPL_WIDGET_SLIDER, 1, 16);
59 addProcessPropertyInt("operation", "Operation:Dilate|Erode|Opening|Closing", "", _operation, IPL_WIDGET_RADIOBUTTONS);
60}
61
62void IPLMorphologyBinary::destroy()
63{

Callers

nothing calls this directly

Calls 6

setClassNameFunction · 0.85
setTitleFunction · 0.85
setCategoryFunction · 0.85
setOpenCVSupportFunction · 0.85
clearMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected