void IPLUndistort::init() { // init _result = NULL; // basic settings setClassName("IPLUndistort"); setTitle("Undistort Image"); setDescription("The function transforms an image to compensate radial and tangential lens distortion."); setCategory(IPLProcess::CATEGORY_GEOMETRY); setOpenCVSupport(IPLProcess::OPENCV_ONLY); setKeywords("distortion, undistortion, barrel, lens correction"); // inputs and outputs addInput("Image", IPL_IMAGE_COLOR); addOutput("Image", IPL_IMAGE_COLOR); // properties addProcessPropertyInt("f", "f", "Focal Length", 1000, IPL_WIDGET_SLIDER, 0, 10000.0); addProcessPropertyDouble("p1", "p1", "", 0.0, IPL_WIDGET_SLIDER, -10.0, 10.0); addProcessPropertyDouble("p2", "p2", "Tangential Distortion", 0.0, IPL_WIDGET_SLIDER, -10.0, 10.0); addProcessPropertyDouble("k1", "k1", "", 0.0, IPL_WIDGET_SLIDER, -100.0, 100.0); addProcessPropertyDouble("k2", "k2", "", 0.0, IPL_WIDGET_SLIDER, -100.0, 100.0); addProcessPropertyDouble("k3", "k3", "Radial Distortion", 0.0, IPL_WIDGET_SLIDER, -100.0, 100.0); }
void IPLCanny::init() { // init _result = NULL; _binaryImage = NULL; _orientedImage = NULL; // basic settings setClassName("IPLCanny"); setTitle("Canny Edge Detector"); setCategory(IPLProcess::CATEGORY_LOCALOPERATIONS); setOpenCVSupport(IPLOpenCVSupport::OPENCV_ONLY); setDescription("The Canny edge detector delivers the magnitude and the gradient of the edge " "image. Thresholding has to be done by an appropriate operator. The σ value " "is used for both, smoothing and derivation operation."); // inputs and outputs addInput("Image", IPLData::IMAGE_COLOR); addOutput("Magnitude", IPLImage::IMAGE_GRAYSCALE); addOutput("Edge", IPLImage::IMAGE_GRAYSCALE); addOutput("Gradient", IPLImage::IMAGE_GRAYSCALE); // properties addProcessPropertyInt("window", "Window", "", 3, IPL_WIDGET_SLIDER_ODD, 3, 7); addProcessPropertyDouble("sigma", "Sigma", "", 1.5, IPL_WIDGET_SLIDER, 0.5, 10); addProcessPropertyDouble("lowThreshold", "Low Threshold", "", 0.3, IPL_WIDGET_SLIDER, 0.0, 1.0); addProcessPropertyDouble("highThreshold", "Hight Threshold", "Thresholds for the hysteresis procedure", 0.6, IPL_WIDGET_SLIDER, 0.0, 1.0); }
void IPLMedian::init() { // init _result = NULL; // basic settings setClassName("IPLMedian"); setTitle("Median Operator"); setCategory(IPLProcess::CATEGORY_MORPHOLOGY); setOpenCVSupport(IPLProcess::OPENCV_OPTIONAL); // inputs and outputs addInput("Image", IPLData::IMAGE_COLOR); addOutput("Image", IPLImage::IMAGE_COLOR); // properties addProcessPropertyInt("window", "Window", "", 3, IPL_WIDGET_SLIDER_ODD, 3, 9); }
void IPLGradientOperator::init() { // init _result = NULL; // basic settings setClassName("IPLGradientOperator"); setTitle("Gradient Operator"); setCategory(IPLProcess::CATEGORY_GRADIENTS); setKeywords("Fast Gradient, Roberts, Sobel, Cubic Spline"); // inputs and outputs addInput("Image", IPLData::IMAGE_GRAYSCALE); addOutput("Image", IPLData::IMAGE_ORIENTED); // set the openCV support setOpenCVSupport( IPLOpenCVSupport::OPENCV_ONLY ); // properties addProcessPropertyInt("algorithm", "Algorithm:Fast Gradient|Roberts|Sobel|Cubic Spline", "", 0, IPL_WIDGET_RADIOBUTTONS); }
void IPLHarrisCorner::init() { // init _result = NULL; // basic settings setClassName("IPLHarrisCorner"); setTitle("Harris Corner Detector"); setCategory(IPLProcess::CATEGORY_OBJECTS); setOpenCVSupport(IPLOpenCVSupport::OPENCV_ONLY); setDescription(""); // inputs and outputs addInput("Image", IPLData::IMAGE_COLOR); addOutput("Magnitude", IPLImage::IMAGE_GRAYSCALE); addOutput("Edge", IPLImage::IMAGE_GRAYSCALE); addOutput("Gradient", IPLImage::IMAGE_GRAYSCALE); // properties addProcessPropertyInt("threshold", "Threshold", "", 1, IPL_WIDGET_SLIDER, 1, 255); addProcessPropertyDouble("highThreshold", "High Threshold", "Thresholds for the hysteresis procedure", 0.6, IPL_WIDGET_SLIDER, 0.0, 1.0); }
void IPLConvolutionFilter::init() { // init _result = NULL; _offset = 0; _divisor = 0; _borders = 0; _kernel.clear(); // basic settings setClassName("IPLConvolutionFilter"); setTitle("2D Convolution"); setKeywords("filter"); setCategory(IPLProcess::CATEGORY_LOCALOPERATIONS); setDescription("Convolution of a kernel with image."); setOpenCVSupport(IPLOpenCVSupport::OPENCV_OPTIONAL); // default values // 0 0 0 // 0 1 0 // 0 0 0 int nrElements = 9; for(int i=0; i<nrElements; i++) { // set the center to 1, all others to 0 _kernel.push_back(i == nrElements/2 ? 1 : 0); } // inputs and outputs addInput("Image", IPLData::IMAGE_COLOR); addOutput("Image", IPLData::IMAGE_COLOR); // properties addProcessPropertyVectorInt("kernel", "Kernel", "", _kernel, IPL_WIDGET_KERNEL); addProcessPropertyBool("normalize", "Normalize", "Divisor is computed automatically", true, IPL_WIDGET_CHECKBOXES); addProcessPropertyInt("divisor", "Divisor", "", 1, IPL_WIDGET_SLIDER, 1, 512); addProcessPropertyDouble("offset", "Offset", "", 0.0, IPL_WIDGET_SLIDER, -1.0, 1.0); addProcessPropertyInt("borders", "Borders:Crop|Extend|Wrap", "Wrap is not available under OpenCV.", 0, IPL_WIDGET_RADIOBUTTONS, 0, 0); }
void IPLMorphologyBinary::init() { // init _result = NULL; // basic settings setClassName("IPLMorphologyBinary"); setTitle("Binary Morphology"); setCategory(IPLProcess::CATEGORY_MORPHOLOGY); setOpenCVSupport(IPLOpenCVSupport::OPENCV_OPTIONAL); // default value // 0 0 0 // 0 1 0 // 0 0 0 int nrElements = 9; _kernel.clear(); for(int i=0; i<nrElements; i++) { _kernel.push_back((i==4 ? 1 : 0)); } _operation = 0; _iterations = 1; // inputs and outputs addInput("Image", IPLImage::IMAGE_BW); addOutput("Image", IPLImage::IMAGE_BW); // properties addProcessPropertyVectorInt("kernel", "Kernel", "", _kernel, IPL_WIDGET_BINARY_MORPHOLOGY); addProcessPropertyInt("iterations", "Iterations", "Run the algorithm x times\nCaution: big kernels and too many iterations can take a long time to compute!", _iterations, IPL_WIDGET_SLIDER, 1, 16); addProcessPropertyInt("operation", "Operation:Dilate|Erode|Opening|Closing", "", _operation, IPL_WIDGET_RADIOBUTTONS); }