summaryrefslogtreecommitdiff
path: root/src/c/imageProcessing/cvcore
diff options
context:
space:
mode:
authorsiddhu89902016-08-18 15:47:18 +0530
committersiddhu89902016-08-18 15:47:18 +0530
commitc8fd6991786ccddb44547b619178bb391f3f9b96 (patch)
treecd1cacd7796d85875e8b2bb15780902c55f42db1 /src/c/imageProcessing/cvcore
parent24fbba33153e7758df4a990cb4c21ae8e53e6f3e (diff)
downloadscilab2c-c8fd6991786ccddb44547b619178bb391f3f9b96.tar.gz
scilab2c-c8fd6991786ccddb44547b619178bb391f3f9b96.tar.bz2
scilab2c-c8fd6991786ccddb44547b619178bb391f3f9b96.zip
RPi-PWM and basic imaage processing
Diffstat (limited to 'src/c/imageProcessing/cvcore')
-rw-r--r--src/c/imageProcessing/cvcore/imcvCreateImages.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/c/imageProcessing/cvcore/imcvCreateImages.c b/src/c/imageProcessing/cvcore/imcvCreateImages.c
new file mode 100644
index 00000000..a7eeaec2
--- /dev/null
+++ b/src/c/imageProcessing/cvcore/imcvCreateImages.c
@@ -0,0 +1,39 @@
+/* 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 create openCV image object from given specifications*/
+
+#include "types.h"
+#include "cvcore.h"
+#include <stdio.h>
+
+IplImage* imcvCreateImages(int width, int height, char *bit_depth, uint8 no_of_ch)
+{
+ CvSize imageSize = cvSize (width,height);
+ 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)
+ img = cvCreateImage(imageSize,IPL_DEPTH_8U,no_of_ch);
+ else if (strcmp(bit_depth,"IPL_DEPTH_8S") == 0)
+ img = cvCreateImage(imageSize,IPL_DEPTH_8S,no_of_ch);
+ else if (strcmp(bit_depth,"IPL_DEPTH_16U") == 0)
+ img = cvCreateImage(imageSize,IPL_DEPTH_8U,no_of_ch);
+ else if (strcmp(bit_depth,"IPL_DEPTH_16S") == 0)
+ img = cvCreateImage(imageSize,IPL_DEPTH_8S,no_of_ch);
+ else if (strcmp(bit_depth,"IPL_DEPTH_32U") == 0)
+ img = cvCreateImage(imageSize,IPL_DEPTH_8U,no_of_ch);
+ else if (strcmp(bit_depth,"IPL_DEPTH_32S") == 0)
+ img = cvCreateImage(imageSize,IPL_DEPTH_8S,no_of_ch);
+
+ return img;
+} \ No newline at end of file