diff options
Diffstat (limited to 'src/c/imageProcessing')
-rw-r--r-- | src/c/imageProcessing/cvcore/imcvCreateImages.c | 2 | ||||
-rw-r--r-- | src/c/imageProcessing/cvcore/imcvGetImgSizes.c | 32 | ||||
-rw-r--r-- | src/c/imageProcessing/cvimgproc/imcvCvtColors.c | 27 | ||||
-rw-r--r-- | src/c/imageProcessing/cvimgproc/imcvThresholds.c | 27 | ||||
-rw-r--r-- | src/c/imageProcessing/includes/cvcore.h | 2 | ||||
-rw-r--r-- | src/c/imageProcessing/includes/cvhighgui.h | 2 | ||||
-rw-r--r-- | src/c/imageProcessing/includes/cvimgproc.h | 31 | ||||
-rw-r--r-- | src/c/imageProcessing/interfaces/int_cvcore.h | 3 | ||||
-rw-r--r-- | src/c/imageProcessing/interfaces/int_cvhighgui.h | 2 | ||||
-rw-r--r-- | src/c/imageProcessing/interfaces/int_cvimgproc.h | 32 |
10 files changed, 155 insertions, 5 deletions
diff --git a/src/c/imageProcessing/cvcore/imcvCreateImages.c b/src/c/imageProcessing/cvcore/imcvCreateImages.c index a7eeaec..4543b72 100644 --- a/src/c/imageProcessing/cvcore/imcvCreateImages.c +++ b/src/c/imageProcessing/cvcore/imcvCreateImages.c @@ -19,7 +19,7 @@ IplImage* imcvCreateImages(int width, int height, char *bit_depth, uint8 no_of_ch) { CvSize imageSize = cvSize (width,height); - IplImage *img = NULL; + IplImage* img = NULL; if (strcmp(bit_depth,"IPL_DEPTH_1U") == 0) img = cvCreateImage(imageSize,IPL_DEPTH_1U,no_of_ch); else if (strcmp(bit_depth,"IPL_DEPTH_8U") == 0) diff --git a/src/c/imageProcessing/cvcore/imcvGetImgSizes.c b/src/c/imageProcessing/cvcore/imcvGetImgSizes.c new file mode 100644 index 0000000..2faa627 --- /dev/null +++ b/src/c/imageProcessing/cvcore/imcvGetImgSizes.c @@ -0,0 +1,32 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/* Function to convert image object to other color space*/ + +#include "types.h" +#include "cvcore.h" +#include "cvimgproc.h" +#include <stdio.h> + +void imcvGetImgSizes(IplImage* src, double* imgsize) +{ + if(src != NULL) + { + imgsize[0] = src->width; + imgsize[1] = src->height; + } + else + { + printf("Error with input image"); + } + +}
\ No newline at end of file diff --git a/src/c/imageProcessing/cvimgproc/imcvCvtColors.c b/src/c/imageProcessing/cvimgproc/imcvCvtColors.c new file mode 100644 index 0000000..bc2a70e --- /dev/null +++ b/src/c/imageProcessing/cvimgproc/imcvCvtColors.c @@ -0,0 +1,27 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/* Function to convert image object to other color space*/ + +#include "types.h" +#include "cvcore.h" +#include "cvimgproc.h" +#include <stdio.h> + +uint8 imcvCvtColors(IplImage* src, IplImage* dst, char* code) +{ + + if(strcmp(code,"CV_BGR2GRAY") == 0) + cvCvtColor(src,dst,CV_RGB2GRAY); + + return 0; +}
\ No newline at end of file diff --git a/src/c/imageProcessing/cvimgproc/imcvThresholds.c b/src/c/imageProcessing/cvimgproc/imcvThresholds.c new file mode 100644 index 0000000..cd66c52 --- /dev/null +++ b/src/c/imageProcessing/cvimgproc/imcvThresholds.c @@ -0,0 +1,27 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/* Function to threshold a gray scale image*/ + +#include "types.h" +#include "cvcore.h" +#include "cvimgproc.h" +#include <stdio.h> + +IplImage* imcvThresholds(IplImage* src, double threshold, double maxvalue, char* type) +{ + dst = imcvCreates(src->width, src->height, src->,1); + if(strcmp(code,"CV_BGR2GRAY") == 0) + cvCvtColor(src,dst,CV_RGB2GRAY); + + return 0; +}
\ No newline at end of file diff --git a/src/c/imageProcessing/includes/cvcore.h b/src/c/imageProcessing/includes/cvcore.h index 317d99b..4f04e58 100644 --- a/src/c/imageProcessing/includes/cvcore.h +++ b/src/c/imageProcessing/includes/cvcore.h @@ -22,7 +22,7 @@ extern "C" { #include "opencv2/core/core.hpp" IplImage* imcvCreateImages(int width, int height, char *bit_depth, uint8 no_of_ch); - +void imcvGetImgSizes(IplImage* src, double* imgsize); #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/src/c/imageProcessing/includes/cvhighgui.h b/src/c/imageProcessing/includes/cvhighgui.h index cae3dd1..2e959a5 100644 --- a/src/c/imageProcessing/includes/cvhighgui.h +++ b/src/c/imageProcessing/includes/cvhighgui.h @@ -20,7 +20,7 @@ extern "C" { #include "types.h" #include "opencv2/core/core.hpp" -#include "opencv2/highgui.hpp" +#include "opencv2/highgui/highgui.hpp" IplImage* imcvLoadImages(char *filename, uint8 opentype); uint8 imcvShowImages(char *winname, IplImage* img); diff --git a/src/c/imageProcessing/includes/cvimgproc.h b/src/c/imageProcessing/includes/cvimgproc.h new file mode 100644 index 0000000..5d982e4 --- /dev/null +++ b/src/c/imageProcessing/includes/cvimgproc.h @@ -0,0 +1,31 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __CVIMGPROC_H__ +#define __CVIMGPROC_H__ + +#ifdef __cplusplus +extern "C" { +#endif + + +#include "types.h" +#include "opencv2/core/core.hpp" +#include "opencv2/imgproc/imgproc.hpp" + +uint8 imcvCvtColor(IplImage* src, IplImage* dst, char* code); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__CVIMGPROC_H__*/ diff --git a/src/c/imageProcessing/interfaces/int_cvcore.h b/src/c/imageProcessing/interfaces/int_cvcore.h index 9d83caa..5ae0055 100644 --- a/src/c/imageProcessing/interfaces/int_cvcore.h +++ b/src/c/imageProcessing/interfaces/int_cvcore.h @@ -19,11 +19,12 @@ extern "C" { #include "types.h" - +#include "cvcore.h" #define d0d0g2d0CV_CreateImageim0(width,height,depth,depth_size,no_of_ch) \ imcvCreateImages(width,height,depth,no_of_ch) +#define im0CV_GetImgSized2(img,imgsize) imcvGetImgSizes(img,imgsize) #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/src/c/imageProcessing/interfaces/int_cvhighgui.h b/src/c/imageProcessing/interfaces/int_cvhighgui.h index f08ac40..d8ecf1c 100644 --- a/src/c/imageProcessing/interfaces/int_cvhighgui.h +++ b/src/c/imageProcessing/interfaces/int_cvhighgui.h @@ -19,7 +19,7 @@ extern "C" { #include "types.h" -#include "opencv2/highgui.hpp" +#include "opencv2/highgui/highgui.hpp" #define g2d0CV_LoadImageim0(filename,name_size,loadtype) imcvLoadImages(filename,loadtype) #define g2im0CV_ShowImageu80(winname,win_size,img) imcvShowImages(winname,img) diff --git a/src/c/imageProcessing/interfaces/int_cvimgproc.h b/src/c/imageProcessing/interfaces/int_cvimgproc.h new file mode 100644 index 0000000..47192e1 --- /dev/null +++ b/src/c/imageProcessing/interfaces/int_cvimgproc.h @@ -0,0 +1,32 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __INT_CVIMGPROC_H__ +#define __INT_CVIMGPROC_H__ + +#ifdef __cplusplus +extern "C" { +#endif + + +#include "types.h" +#include "opencv2/imgproc/imgproc.hpp" + +#define im0im0g2CV_CvtColoru80(src,dst,code,code_size) imcvCvtColors(src,dst,code) +#define im0d0d0g2CV_Thresholdim0(src,threshold,maxvalue,thresh_type,type_size) + imcvThrehold(src,threshold,maxvalue,thresh_type) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_CVIMGPROC_H__*/ |