Alida-C++ 0.5
|
00001 /* 00002 * This file is part of Alida-C++ library for 00003 * 00004 * Automatic Logging of Process Information in Data Analysis. 00005 * 00006 * Copyright (C) 2012 - @YEAR@ 00007 * 00008 * This program is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU General Public License as published by 00010 * the Free Software Foundation, either version 3 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * This program is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00020 * 00021 * Fore more information on Alida, visit 00022 * 00023 * http://www.informatik.uni-halle.de/alida/ 00024 * 00025 */ 00026 00027 /* 00028 * Most recent change(s): 00029 * 00030 * $Rev: 68 $ 00031 * $Date: 2012-03-07 11:27:39 +0100 (Mi, 07 Mrz 2012) $ 00032 * $Author: moeller $ 00033 * 00034 */ 00035 00036 #include <math.h> 00037 #include <stdio.h> 00038 #include <fstream> 00039 #include <string> 00040 #include <iostream> 00041 00042 #include <opencv/cv.h> 00043 00044 #include "demo/demoOperatorOpenCV.h" 00045 #include "operator/aldOperatorManager.h" 00046 00047 REGISTER_OPERATOR(DemoOperatorOpenCV) 00048 00049 DemoOperatorOpenCV::DemoOperatorOpenCV() 00050 { 00051 DEFINE_PARAMETER(IplImage, inputImg, ALDOpParameterDescriptor::IN, 00052 true, false, "Input image", "Input image to be Gaussian filtered", NULL); 00053 00054 DEFINE_PARAMETER(float, sigma, ALDOpParameterDescriptor::IN, 00055 true, false, "Sigma", "Stddev of Gaussian", new float(1.4)); 00056 00057 DEFINE_PARAMETER(IplImage, outputImg, ALDOpParameterDescriptor::OUT, 00058 true, false, "Output image", "Gaussian filtered image", NULL); 00059 } 00060 00061 void DemoOperatorOpenCV::operate() 00062 { 00063 IplImage* image = ((IplImage*)(this->getParameter("inputImg"))); 00064 std::cout << "Bildgroesse: " << image->width << std::endl; 00065 IplImage* outimage= 00066 cvCreateImage(cvSize(image->width,image->height),IPL_DEPTH_8U,3); 00067 cvSmooth( image, outimage, CV_GAUSSIAN, 00068 *((float*)this->getParameter("sigma")),*((float*)this->getParameter("sigma"))); 00069 this->setParameter("outputImg", outimage); 00070 }