summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsiddhu89902016-09-22 10:35:52 +0530
committersiddhu89902016-09-22 10:35:52 +0530
commit9a30882032e80661fe6c69d7c50da0154e4e431f (patch)
treeee2dab98e220547f050f7b891d8cc0aaaf78dfd4
parent2790257d385a9d7d9e0dab9205baf4b3df0dd8c8 (diff)
downloadScilab2C_fossee_old-9a30882032e80661fe6c69d7c50da0154e4e431f.tar.gz
Scilab2C_fossee_old-9a30882032e80661fe6c69d7c50da0154e4e431f.tar.bz2
Scilab2C_fossee_old-9a30882032e80661fe6c69d7c50da0154e4e431f.zip
Image processing functions for blurring, thresholding and edge detection added
-rw-r--r--macros/CCodeGeneration/C_GenerateMakefile.binbin37204 -> 37240 bytes
-rw-r--r--macros/ImageProcessing/imgproc/CV_AdaptiveThreshold.binbin0 -> 5504 bytes
-rw-r--r--macros/ImageProcessing/imgproc/CV_AdaptiveThreshold.sci49
-rw-r--r--macros/ImageProcessing/imgproc/CV_Blur.binbin0 -> 5044 bytes
-rw-r--r--macros/ImageProcessing/imgproc/CV_Blur.sci48
-rw-r--r--macros/ImageProcessing/imgproc/CV_Canny.binbin0 -> 5220 bytes
-rw-r--r--macros/ImageProcessing/imgproc/CV_Canny.sci48
-rw-r--r--macros/ImageProcessing/imgproc/CV_CornerHarris.binbin0 -> 6200 bytes
-rw-r--r--macros/ImageProcessing/imgproc/CV_CornerHarris.sci54
-rw-r--r--macros/ImageProcessing/imgproc/CV_Dilate.binbin0 -> 6936 bytes
-rw-r--r--macros/ImageProcessing/imgproc/CV_Dilate.sci53
-rw-r--r--macros/ImageProcessing/imgproc/CV_DistanceTransform.binbin0 -> 4012 bytes
-rw-r--r--macros/ImageProcessing/imgproc/CV_DistanceTransform.sci41
-rw-r--r--macros/ImageProcessing/imgproc/CV_Erode.binbin0 -> 6880 bytes
-rw-r--r--macros/ImageProcessing/imgproc/CV_Erode.sci52
-rw-r--r--macros/ImageProcessing/imgproc/CV_GaussianBlur.binbin0 -> 6004 bytes
-rw-r--r--macros/ImageProcessing/imgproc/CV_GaussianBlur.sci52
-rw-r--r--macros/ImageProcessing/imgproc/CV_MedianBlur.binbin0 -> 3936 bytes
-rw-r--r--macros/ImageProcessing/imgproc/CV_MedianBlur.sci42
-rw-r--r--macros/ImageProcessing/imgproc/libbin712 -> 928 bytes
-rw-r--r--macros/ImageProcessing/imgproc/names9
-rw-r--r--macros/ToolInitialization/INIT_FillSCI2LibCDirs.binbin1247248 -> 1283828 bytes
-rw-r--r--macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci198
-rw-r--r--macros/findDeps/getAllSources.binbin194112 -> 196164 bytes
-rw-r--r--macros/findDeps/getAllSources.sci11
-rw-r--r--src/c/hardware/rasberrypi/includes/RPIPeripheralThreading.h2
-rw-r--r--src/c/hardware/rasberrypi/threading/u16RPIThreadCreates.c2
-rw-r--r--src/c/imageProcessing/cvimgproc/imcvAdaptThresholds.cpp47
-rw-r--r--src/c/imageProcessing/cvimgproc/imcvBlurs.cpp55
-rw-r--r--src/c/imageProcessing/cvimgproc/imcvCanny.cpp31
-rw-r--r--src/c/imageProcessing/cvimgproc/imcvCornerHarris.cpp55
-rw-r--r--src/c/imageProcessing/cvimgproc/imcvCvtColors.cpp123
-rw-r--r--src/c/imageProcessing/cvimgproc/imcvDilate.cpp71
-rw-r--r--src/c/imageProcessing/cvimgproc/imcvDistanceTransforms.cpp41
-rw-r--r--src/c/imageProcessing/cvimgproc/imcvErode.cpp71
-rw-r--r--src/c/imageProcessing/cvimgproc/imcvGaussianBlurs.cpp54
-rw-r--r--src/c/imageProcessing/cvimgproc/imcvMedianBlurs.cpp31
-rw-r--r--src/c/imageProcessing/cvimgproc/imcvThresholds.cpp9
-rw-r--r--src/c/imageProcessing/includes/cvimgproc.hpp27
-rw-r--r--src/c/imageProcessing/interfaces/int_cvhighgui.hpp4
-rw-r--r--src/c/imageProcessing/interfaces/int_cvimgproc.hpp51
41 files changed, 1322 insertions, 9 deletions
diff --git a/macros/CCodeGeneration/C_GenerateMakefile.bin b/macros/CCodeGeneration/C_GenerateMakefile.bin
index 216107b..b4a4750 100644
--- a/macros/CCodeGeneration/C_GenerateMakefile.bin
+++ b/macros/CCodeGeneration/C_GenerateMakefile.bin
Binary files differ
diff --git a/macros/ImageProcessing/imgproc/CV_AdaptiveThreshold.bin b/macros/ImageProcessing/imgproc/CV_AdaptiveThreshold.bin
new file mode 100644
index 0000000..26a58c0
--- /dev/null
+++ b/macros/ImageProcessing/imgproc/CV_AdaptiveThreshold.bin
Binary files differ
diff --git a/macros/ImageProcessing/imgproc/CV_AdaptiveThreshold.sci b/macros/ImageProcessing/imgproc/CV_AdaptiveThreshold.sci
new file mode 100644
index 0000000..193e726
--- /dev/null
+++ b/macros/ImageProcessing/imgproc/CV_AdaptiveThreshold.sci
@@ -0,0 +1,49 @@
+// 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 cvtimg = CV_AdaptiveThreshold(srcimg,max_value,adaptive_method, ...
+ thresh_type, block_size, C)
+// function to adaptively threshold input image
+//
+// Calling Sequence
+// dst = CV_AdaptiveThreshold(srcimg,max_value,adaptive_method, ...
+// thresh_type,blk_size,c)
+//
+// Parameters
+// src -> Source 8-bit single-channel image.
+// max_value -> Non-zero value assigned to the pixels for which the
+// condition is satisfied. See the details below.
+// adaptive_method -> Adaptive thresholding algorithm to use,
+// ADAPTIVE_THRESH_MEAN_C or ADAPTIVE_THRESH_GAUSSIAN_C .
+// thresh_type -> Thresholding type that must be either THRESH_BINARY
+// or THRESH_BINARY_INV .
+// blockSize -> Size of a pixel neighborhood that is used to calculate
+// a threshold value for the pixel: 3, 5, 7, and so on.
+// C -> Constant subtracted from the mean or weighted mean.Normally,
+// it is positive but may be zero or negative as well.
+// Description
+// This function can be used for adaptively threshold given image
+// Examples
+// img = CV_LoadImage('~/test.jpg',0)
+// dst = CV_AdaptiveThreshold(img,255,"ADAPTIVE_THRESH_MEAN_C", ...
+// "THRESH_BINARY",5,0)
+//
+// See also
+// CV_LoadImage CV_CreateImage
+//
+// Authors
+// Siddhesh Wani
+//
+cvtimg = 0
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for OpenCV
+
+endfunction
diff --git a/macros/ImageProcessing/imgproc/CV_Blur.bin b/macros/ImageProcessing/imgproc/CV_Blur.bin
new file mode 100644
index 0000000..9fc1af4
--- /dev/null
+++ b/macros/ImageProcessing/imgproc/CV_Blur.bin
Binary files differ
diff --git a/macros/ImageProcessing/imgproc/CV_Blur.sci b/macros/ImageProcessing/imgproc/CV_Blur.sci
new file mode 100644
index 0000000..0486bef
--- /dev/null
+++ b/macros/ImageProcessing/imgproc/CV_Blur.sci
@@ -0,0 +1,48 @@
+// 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 cvtimg = CV_Blur(srcimg,ksize_width,ksize_height,anchor_x,anchor_y, ...
+ border_type)
+// function to blur image using normalised box filter
+//
+// Calling Sequence
+// dst = CV_Blur(srcimg,ksize_width,ksize_height,anchor_x,anchor_y, ...
+// border_type)
+//
+// Parameters
+// srcimg -> Source image.
+// ksize_width, ksize_height -> blurring kernel size.
+// anchor_x, anchor_y -> x,y coordinates of anchor point
+// borderType -> border mode used to extrapolate pixels outside of the
+// image. Can be :
+// BORDER_REPLICATE: aaaaaa|abcdefgh|hhhhhhh
+// BORDER_REFLECT: fedcba|abcdefgh|hgfedcb
+// BORDER_REFLECT_101: gfedcb|abcdefgh|gfedcba
+// BORDER_WRAP: cdefgh|abcdefgh|abcdefg
+// BORDER_CONSTANT: iiiiii|abcdefgh|iiiiiii
+// Description
+// This function can be used for blurring image using normalised box
+// filter. Image can be of any depth and have any no of channels.
+// Examples
+// img = CV_LoadImage('~/test.jpg',0)
+// dst = CV_Blur(img,3,3,-1,-1,"BORDER_CONSTANT")
+//
+// See also
+// CV_LoadImage CV_Threshold, CV_CvtColor
+//
+// Authors
+// Siddhesh Wani
+//
+cvtimg = 0
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for OpenCV
+
+endfunction
diff --git a/macros/ImageProcessing/imgproc/CV_Canny.bin b/macros/ImageProcessing/imgproc/CV_Canny.bin
new file mode 100644
index 0000000..df82478
--- /dev/null
+++ b/macros/ImageProcessing/imgproc/CV_Canny.bin
Binary files differ
diff --git a/macros/ImageProcessing/imgproc/CV_Canny.sci b/macros/ImageProcessing/imgproc/CV_Canny.sci
new file mode 100644
index 0000000..dca5e03
--- /dev/null
+++ b/macros/ImageProcessing/imgproc/CV_Canny.sci
@@ -0,0 +1,48 @@
+// 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 edges = CV_Canny(srcimg,threhold1,threshold2,aperture_size,L2gradient)
+//Finds edges in image using Canny algorithm
+//
+// Calling Sequence
+// edges = CV_Canny(srcimg,threhold1,threshold2,aperture_size,L2gradient)
+//
+// Parameters
+// srcimg -> single-channel 8-bit input image.
+// threshold1 -> first threshold for the hysteresis procedure.
+// threshold2 -> second threshold for the hysteresis procedure.
+// aperture_size -> aperture size for the Sobel() operator.
+// L2gradient -> a flag, indicating whether a more accurate
+// L_2 norm =sqrt{(dI/dx)^2 + (dI/dy)^2} should be used to
+// calculate the image gradient magnitude ( L2gradient=1 ),
+// or whether the default L_1 norm =|dI/dx|+|dI/dy| is enough
+// ( L2gradient=0).
+// Description
+// This function can be used for finding edes in single channel 8 bit
+// image. 'aperture_size' and 'L2gradient' are optionals. By default,
+// aperture_size is 3 and L2gradient is false.
+//
+// Examples
+// img = CV_LoadImage('~/test.jpg',0)
+// dst = CV_CvtColor(img,"CV_RGB2GRAY");
+// edge = CV_Canny(dst,50,100,3,0);
+//
+// See also
+// CV_LoadImage CV_CvtColor
+//
+// Authors
+// Siddhesh Wani
+//
+edges = 0
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for OpenCV
+
+endfunction
diff --git a/macros/ImageProcessing/imgproc/CV_CornerHarris.bin b/macros/ImageProcessing/imgproc/CV_CornerHarris.bin
new file mode 100644
index 0000000..291d3e4
--- /dev/null
+++ b/macros/ImageProcessing/imgproc/CV_CornerHarris.bin
Binary files differ
diff --git a/macros/ImageProcessing/imgproc/CV_CornerHarris.sci b/macros/ImageProcessing/imgproc/CV_CornerHarris.sci
new file mode 100644
index 0000000..1b7aabc
--- /dev/null
+++ b/macros/ImageProcessing/imgproc/CV_CornerHarris.sci
@@ -0,0 +1,54 @@
+// 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 edges = CV_CornerHarris(srcimg,blocksize,ksize,k,border_type)
+//Finds edges in image using Harris algorithm
+//
+// Calling Sequence
+// edges = CV_CornerHarris(srcimg,blocksize,ksize,k,border_type)
+//
+// Parameters
+// srcimg -> Input single-channel 8-bit or floating-point image.
+// blockSize -> Neighborhood size
+// ksize -> Aperture parameter for the Sobel() operator.
+// k -> Harris detector free parameter.
+// borderType -> border mode used to extrapolate pixels outside of the
+// image. It can be :
+// BORDER_REPLICATE: aaaaaa|abcdefgh|hhhhhhh
+// BORDER_REFLECT: fedcba|abcdefgh|hgfedcb
+// BORDER_REFLECT_101: gfedcb|abcdefgh|gfedcba
+// BORDER_WRAP: cdefgh|abcdefgh|abcdefg
+// BORDER_CONSTANT: iiiiii|abcdefgh|iiiiiii
+// Description
+// The function runs the Harris edge detector on the image. For each
+// pixel (x, y) it calculates a 2 * 2 gradient covariance matrix M(x,y)
+// over a blockSize * blockSize neighborhood. Then, it computes the
+// following characteristic:
+// dst(x,y) = det(M(x,y)) - k .tr(M(x,y))^2
+// Corners in the image can be found as the local maxima of this
+// response map
+//
+// Examples
+// img = CV_LoadImage('~/test.jpg',0)
+// dst = CV_CvtColor(img,"CV_RGB2GRAY");
+// edge = CV_CornerHarris(dst,5,3,1,"BORDER_REPLICATE");
+//
+// See also
+// CV_LoadImage CV_CvtColor
+//
+// Authors
+// Siddhesh Wani
+//
+edges = 0
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for OpenCV
+
+endfunction
diff --git a/macros/ImageProcessing/imgproc/CV_Dilate.bin b/macros/ImageProcessing/imgproc/CV_Dilate.bin
new file mode 100644
index 0000000..3f2d2d9
--- /dev/null
+++ b/macros/ImageProcessing/imgproc/CV_Dilate.bin
Binary files differ
diff --git a/macros/ImageProcessing/imgproc/CV_Dilate.sci b/macros/ImageProcessing/imgproc/CV_Dilate.sci
new file mode 100644
index 0000000..d3e3dac
--- /dev/null
+++ b/macros/ImageProcessing/imgproc/CV_Dilate.sci
@@ -0,0 +1,53 @@
+// 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 cvtimg = CV_Dilate(srcimg,dilation_type,dilation_size,iterations, ...
+ border_type,border_value)
+// dilates an image by using a specific structuring element.
+//
+// Calling Sequence
+// cvtimg = CV_Dilate(srcimg,dilation_type,dilation_size,[iterations, ...
+// border_type,border_value])
+// Parameters
+// src -> input image; the number of channels can be arbitrary, but the
+// depth should be one of CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
+// dilation_type -> can be one of : MORPH_RECT, MORPH_CROSS,
+// MORPH_ELLIPSE
+// dilation_size -> size of kernel to be used for erosion. Must be odd
+// iterations -> number of times erosion is applied.
+// border_type -> pixel extrapolation method. It can be:
+// BORDER_REPLICATE: aaaaaa|abcdefgh|hhhhhhh
+// BORDER_REFLECT: fedcba|abcdefgh|hgfedcb
+// BORDER_REFLECT_101: gfedcb|abcdefgh|gfedcba
+// BORDER_WRAP: cdefgh|abcdefgh|abcdefg
+// BORDER_CONSTANT: iiiiii|abcdefgh|iiiiiii
+// border_value -> border value in case of a constant border
+// Description
+// This function can be used for eroding an image. Kernel used for erosion
+// is decided by type and size. Size must always be odd. Anchor pint of
+// kernel is always center of kernel. Input arguements 'iterations(1),
+// border_type(BORDER_CONSTANT) and border_value' are optionals. Whwn not
+// specified, default values as as mentioned in brackets.
+// Examples
+// img = CV_LoadImage('~/test.jpg',0)
+// dst = CV_Erode(img,"MORPH_RECT",3,1,"BORDER_CONSTANT",0);
+//
+// See also
+// CV_LoadImage CV_Erode
+//
+// Authors
+// Siddhesh Wani
+//
+cvtimg = 0
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for OpenCV
+
+endfunction
diff --git a/macros/ImageProcessing/imgproc/CV_DistanceTransform.bin b/macros/ImageProcessing/imgproc/CV_DistanceTransform.bin
new file mode 100644
index 0000000..0955b5f
--- /dev/null
+++ b/macros/ImageProcessing/imgproc/CV_DistanceTransform.bin
Binary files differ
diff --git a/macros/ImageProcessing/imgproc/CV_DistanceTransform.sci b/macros/ImageProcessing/imgproc/CV_DistanceTransform.sci
new file mode 100644
index 0000000..8277dda
--- /dev/null
+++ b/macros/ImageProcessing/imgproc/CV_DistanceTransform.sci
@@ -0,0 +1,41 @@
+// 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 dstimg = CV_DistanceTransform(srcimg,distance_type,mask_size)
+// function to calculate distance to closest zero pixels for each pixel
+//
+// Calling Sequence
+// dst = CV_DistanceTransform(srcimg,distance_type,mask_size)
+//
+// Parameters
+// srcimg -> Source 8-bit single-channel image.
+// distance_type -> Type of distance. It can be
+// CV_DIST_L1, CV_DIST_L2 , or CV_DIST_C
+// mask_size -> Size of the distance transform mask
+// Description
+// This function can be used to calculate distance to closest zero
+// pixel for each pixel of the source image. Output is 32 bit floating
+// point, single channel image of the same size as that of source image.
+// Examples
+// img = CV_LoadImage('~/test.jpg',0)
+// dst = CV_DistanceTransform(img,"CV_DIST_L1",3)
+//
+// See also
+// CV_LoadImage CV_CreateImage CV_CvtColor
+//
+// Authors
+// Siddhesh Wani
+//
+dstimg = 0
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for OpenCV
+
+endfunction
diff --git a/macros/ImageProcessing/imgproc/CV_Erode.bin b/macros/ImageProcessing/imgproc/CV_Erode.bin
new file mode 100644
index 0000000..33d4231
--- /dev/null
+++ b/macros/ImageProcessing/imgproc/CV_Erode.bin
Binary files differ
diff --git a/macros/ImageProcessing/imgproc/CV_Erode.sci b/macros/ImageProcessing/imgproc/CV_Erode.sci
new file mode 100644
index 0000000..b2e4b26
--- /dev/null
+++ b/macros/ImageProcessing/imgproc/CV_Erode.sci
@@ -0,0 +1,52 @@
+// 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 cvtimg = CV_Erode(srcimg,erosion_type,erosion_size,iterations, ...
+ border_type,border_value)
+// Erodes an image by using a specific structuring element.
+//
+// Calling Sequence
+// cvtimg = CV_Erode(srcimg,erosion_type,erosion_size,[iterations, ...
+// border_type,border_value])
+// Parameters
+// src -> input image; the number of channels can be arbitrary, but the
+// depth should be one of CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
+// erosion_type -> can be one of : MORPH_RECT, MORPH_CROSS, MORPH_ELLIPSE
+// erosion_size -> size of kernel to be used for erosion. Must be odd
+// iterations -> number of times erosion is applied.
+// border_type -> pixel extrapolation method. It can be:
+// BORDER_REPLICATE: aaaaaa|abcdefgh|hhhhhhh
+// BORDER_REFLECT: fedcba|abcdefgh|hgfedcb
+// BORDER_REFLECT_101: gfedcb|abcdefgh|gfedcba
+// BORDER_WRAP: cdefgh|abcdefgh|abcdefg
+// BORDER_CONSTANT: iiiiii|abcdefgh|iiiiiii
+// border_value -> border value in case of a constant border
+// Description
+// This function can be used for eroding an image. Kernel used for erosion
+// is decided by type and size. Size must always be odd. Anchor pint of
+// kernel is always center of kernel. Input arguements 'iterations(1),
+// border_type(BORDER_CONSTANT) and border_value' are optionals. Whwn not
+// specified, default values as as mentioned in brackets.
+// Examples
+// img = CV_LoadImage('~/test.jpg',0)
+// dst = CV_Erode(img,"MORPH_RECT",3,1,"BORDER_CONSTANT",0);
+//
+// See also
+// CV_LoadImage CV_Dilate
+//
+// Authors
+// Siddhesh Wani
+//
+cvtimg = 0
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for OpenCV
+
+endfunction
diff --git a/macros/ImageProcessing/imgproc/CV_GaussianBlur.bin b/macros/ImageProcessing/imgproc/CV_GaussianBlur.bin
new file mode 100644
index 0000000..b176662
--- /dev/null
+++ b/macros/ImageProcessing/imgproc/CV_GaussianBlur.bin
Binary files differ
diff --git a/macros/ImageProcessing/imgproc/CV_GaussianBlur.sci b/macros/ImageProcessing/imgproc/CV_GaussianBlur.sci
new file mode 100644
index 0000000..0f3c003
--- /dev/null
+++ b/macros/ImageProcessing/imgproc/CV_GaussianBlur.sci
@@ -0,0 +1,52 @@
+// 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 cvtimg = CV_GaussianBlur(srcimg,ksize_width,ksize_height,sigma_x,sigma_y, ...
+ border_type)
+// function to blur image using gaussian filter
+//
+// Calling Sequence
+// dst = CV_Blur(srcimg,ksize_width,ksize_height,anchor_x,anchor_y, ...
+// border_type)
+//
+// Parameters
+// srcimg -> Source image.
+// ksize_width, ksize_height -> blurring kernel size. must be odd.
+// sigmaX -> Gaussian kernel standard deviation in X direction.
+// sigmaY -> Gaussian kernel standard deviation in Y direction;
+// if sigmaY is zero, it is set to be equal to sigmaX,
+// if both sigmas are zeros, they are computed from
+// ksize.width and ksize.height , respectively
+// borderType -> border mode used to extrapolate pixels outside of the
+// image. Can be :
+// BORDER_REPLICATE: aaaaaa|abcdefgh|hhhhhhh
+// BORDER_REFLECT: fedcba|abcdefgh|hgfedcb
+// BORDER_REFLECT_101: gfedcb|abcdefgh|gfedcba
+// BORDER_WRAP: cdefgh|abcdefgh|abcdefg
+// BORDER_CONSTANT: iiiiii|abcdefgh|iiiiiii
+// Description
+// This function can be used for blurring image using gaussian
+// filter. Image can be of any depth and have any no of channels.
+// Examples
+// img = CV_LoadImage('~/test.jpg',0)
+// dst = CV_GaussianBlur(img,3,3,0,0,"BORDER_CONSTANT")
+//
+// See also
+// CV_LoadImage CV_Blur, CV_CvtColor
+//
+// Authors
+// Siddhesh Wani
+//
+cvtimg = 0
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for OpenCV
+
+endfunction
diff --git a/macros/ImageProcessing/imgproc/CV_MedianBlur.bin b/macros/ImageProcessing/imgproc/CV_MedianBlur.bin
new file mode 100644
index 0000000..fdcd23e
--- /dev/null
+++ b/macros/ImageProcessing/imgproc/CV_MedianBlur.bin
Binary files differ
diff --git a/macros/ImageProcessing/imgproc/CV_MedianBlur.sci b/macros/ImageProcessing/imgproc/CV_MedianBlur.sci
new file mode 100644
index 0000000..755ad45
--- /dev/null
+++ b/macros/ImageProcessing/imgproc/CV_MedianBlur.sci
@@ -0,0 +1,42 @@
+// 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 cvtimg = CV_MedianBlur(srcimg,ksize)
+// function to blur image using median filter
+//
+// Calling Sequence
+// dst = CV_Blur(srcimg,ksize_width,ksize_height,anchor_x,anchor_y, ...
+// border_type)
+//
+// Parameters
+// srcimg -> input 1-, 3-, or 4-channel image; when ksize is 3 or 5,
+// the image depth should be CV_8U, CV_16U, or CV_32F, for
+// larger aperture sizes, it can only be CV_8U.
+// ksize_width -> aperture linear size; it must be odd and greater than 1,
+// for example: 3, 5, 7 ...
+// Description
+// This function can be used for blurring image using median
+// filter. Image can be of any depth and have any no of channels.
+// Examples
+// img = CV_LoadImage('~/test.jpg',0)
+// dst = CV_MedianBlur(img,3)
+//
+// See also
+// CV_GaussianBlur CV_Blur, CV_CvtColor
+//
+// Authors
+// Siddhesh Wani
+//
+cvtimg = 0
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for OpenCV
+
+endfunction
diff --git a/macros/ImageProcessing/imgproc/lib b/macros/ImageProcessing/imgproc/lib
index 173bc66..656e3bb 100644
--- a/macros/ImageProcessing/imgproc/lib
+++ b/macros/ImageProcessing/imgproc/lib
Binary files differ
diff --git a/macros/ImageProcessing/imgproc/names b/macros/ImageProcessing/imgproc/names
index 31074fe..16240f5 100644
--- a/macros/ImageProcessing/imgproc/names
+++ b/macros/ImageProcessing/imgproc/names
@@ -1,2 +1,11 @@
+CV_AdaptiveThreshold
+CV_Blur
+CV_Canny
+CV_CornerHarris
CV_CvtColor
+CV_Dilate
+CV_DistanceTransform
+CV_Erode
+CV_GaussianBlur
+CV_MedianBlur
CV_Threshold
diff --git a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin
index 8ac49ac..16791ae 100644
--- a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin
+++ b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin
Binary files differ
diff --git a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
index 164a7c7..14b7d41 100644
--- a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
+++ b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
@@ -5712,6 +5712,204 @@ PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file',
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+//------------------------------------
+//---- Class CV_AdaptiveThreshold -----------
+//------------------------------------
+ClassName = 'CV_AdaptiveThreshold';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 6',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''mt''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('mt0d0g2g2d0d0'+ArgSeparator+'mt0',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'CV_AdaptiveThreshold';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class CV_DistanceTransform ----
+//------------------------------------
+ClassName = 'CV_DistanceTransform';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 3',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''mt''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('mt0g2d0'+ArgSeparator+'mt0',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'CV_DistanceTransform';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class CV_Blur -----------------
+//------------------------------------
+ClassName = 'CV_Blur';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 6',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''mt''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('mt0d0d0d0d0g2'+ArgSeparator+'mt0',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'CV_Blur';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+FunctionName = 'CV_GaussianBlur';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class CV_MedianBlur -----------------
+//------------------------------------
+ClassName = 'CV_MedianBlur';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''mt''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('mt0d0'+ArgSeparator+'mt0',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'CV_MedianBlur';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class CV_Dilate ---------------
+//------------------------------------
+ClassName = 'CV_Dilate';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 3',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''mt''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 6',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''mt''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('mt0g2d0'+ArgSeparator+'mt0',ClassFileName,'file','y');
+PrintStringInfo('mt0g2d0d0g2d0'+ArgSeparator+'mt0',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'CV_Dilate';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+FunctionName = 'CV_Erode';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class CV_Canny ----------------
+//------------------------------------
+ClassName = 'CV_Canny';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 5',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''mt''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 3',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''mt''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('mt0d0d0d0d0'+ArgSeparator+'mt0',ClassFileName,'file','y');
+PrintStringInfo('mt0d0d0'+ArgSeparator+'mt0',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'CV_Canny';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class CV_CornerHarris ----------------
+//------------------------------------
+ClassName = 'CV_CornerHarris';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+PrintStringInfo('NIN= 5',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''mt''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+PrintStringInfo('NIN= 4',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''mt''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('mt0d0d0d0g2'+ArgSeparator+'mt0',ClassFileName,'file','y');
+PrintStringInfo('mt0d0d0d0'+ArgSeparator+'mt0',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'CV_CornerHarris';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
// ////////////////////////////////////////////
// /////PARTE INTRODOTTA DA ALBERTO MOREA
// /////////////////////////////////////////////
diff --git a/macros/findDeps/getAllSources.bin b/macros/findDeps/getAllSources.bin
index 9d7f5ba..0a2a3ce 100644
--- a/macros/findDeps/getAllSources.bin
+++ b/macros/findDeps/getAllSources.bin
Binary files differ
diff --git a/macros/findDeps/getAllSources.sci b/macros/findDeps/getAllSources.sci
index aaaf4be..7173991 100644
--- a/macros/findDeps/getAllSources.sci
+++ b/macros/findDeps/getAllSources.sci
@@ -1044,7 +1044,16 @@ function allSources = getAllSources(SharedInfo)
"src/c/imageProcessing/cvhighgui/imcvLoadImages.cpp"
"src/c/imageProcessing/cvhighgui/imcvShowImages.cpp"
"src/c/imageProcessing/cvimgproc/imcvCvtColors.cpp"
- "src/c/imageProcessing/cvimgproc/imcvThresholds.cpp"];
+ "src/c/imageProcessing/cvimgproc/imcvThresholds.cpp"
+ "src/c/imageProcessing/cvimgproc/imcvAdaptThresholds.cpp"
+ "src/c/imageProcessing/cvimgproc/imcvDistanceTransforms.cpp"
+ "src/c/imageProcessing/cvimgproc/imcvBlurs.cpp"
+ "src/c/imageProcessing/cvimgproc/imcvGaussianBlurs.cpp"
+ "src/c/imageProcessing/cvimgproc/imcvMedianBlurs.cpp"
+ "src/c/imageProcessing/cvimgproc/imcvErode.cpp"
+ "src/c/imageProcessing/cvimgproc/imcvDilate.cpp"
+ "src/c/imageProcessing/cvimgproc/imcvCanny.cpp"
+ "src/c/imageProcessing/cvimgproc/imcvCornerHarris.cpp"];
if Target == "StandAlone"
allSources = Standalone_files;
diff --git a/src/c/hardware/rasberrypi/includes/RPIPeripheralThreading.h b/src/c/hardware/rasberrypi/includes/RPIPeripheralThreading.h
index 2304567..a7b2adb 100644
--- a/src/c/hardware/rasberrypi/includes/RPIPeripheralThreading.h
+++ b/src/c/hardware/rasberrypi/includes/RPIPeripheralThreading.h
@@ -19,7 +19,7 @@
extern "C" {
#endif
-uint16 RPIThreadCreate(void *(*threadFunction)(void));
+uint16 RPIThreadCreate(void *(*threadFunction)(void*));
#ifdef __cplusplus
} /* extern "C" */
diff --git a/src/c/hardware/rasberrypi/threading/u16RPIThreadCreates.c b/src/c/hardware/rasberrypi/threading/u16RPIThreadCreates.c
index d0a063a..c05c959 100644
--- a/src/c/hardware/rasberrypi/threading/u16RPIThreadCreates.c
+++ b/src/c/hardware/rasberrypi/threading/u16RPIThreadCreates.c
@@ -15,7 +15,7 @@
#include "types.h"
#include "RPIPeripheralThreading.h"
-uint16 RPIThreadCreate(void *(*threadFunction)(void))
+uint16 RPIThreadCreate(void *(*threadFunction)(void*))
{
int status;
status = piThreadCreate (threadFunction);
diff --git a/src/c/imageProcessing/cvimgproc/imcvAdaptThresholds.cpp b/src/c/imageProcessing/cvimgproc/imcvAdaptThresholds.cpp
new file mode 100644
index 0000000..927cfb3
--- /dev/null
+++ b/src/c/imageProcessing/cvimgproc/imcvAdaptThresholds.cpp
@@ -0,0 +1,47 @@
+/* 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 adaptive threshold a gray scale image*/
+
+#include "types.h"
+#include "cvcore.hpp"
+#include "cvimgproc.hpp"
+
+
+using namespace cv;
+
+Mat imcvAdaptThresholds(Mat src, double t_value, double maxvalue, char* AdaptiveMethod, \
+ char* ThreholdType, double blocksize, double cont)
+{
+
+ Mat dst(src.rows, src.cols, src.type());
+
+ if(strcmp(AdaptiveMethod,"ADAPTIVE_THRESH_MEAN_C") == 0)
+ {
+ if(strcmp(ThreholdType, "THRESH_BINARY") == 0)
+ adaptiveThreshold(src,dst,maxvalue,ADAPTIVE_THRESH_MEAN_C, \
+ THRESH_BINARY,blocksize,cont);
+ else if(strcmp(ThreholdType, "THRESH_BINARY_INV") == 0)
+ adaptiveThreshold(src,dst,maxvalue,ADAPTIVE_THRESH_MEAN_C, \
+ THRESH_BINARY_INV,blocksize,cont);
+ }
+ else if(strcmp(AdaptiveMethod,"ADAPTIVE_THRESH_GAUSSIAN_C") == 0)
+ {
+ if(strcmp(ThreholdType, "THRESH_BINARY") == 0)
+ adaptiveThreshold(src,dst,maxvalue,ADAPTIVE_THRESH_GAUSSIAN_C, \
+ THRESH_BINARY,blocksize,cont);
+ else if(strcmp(ThreholdType, "THRESH_BINARY_INV") == 0)
+ adaptiveThreshold(src,dst,maxvalue,ADAPTIVE_THRESH_GAUSSIAN_C, \
+ THRESH_BINARY_INV,blocksize,cont);
+ }
+ return dst;
+} \ No newline at end of file
diff --git a/src/c/imageProcessing/cvimgproc/imcvBlurs.cpp b/src/c/imageProcessing/cvimgproc/imcvBlurs.cpp
new file mode 100644
index 0000000..d5c06de
--- /dev/null
+++ b/src/c/imageProcessing/cvimgproc/imcvBlurs.cpp
@@ -0,0 +1,55 @@
+/* 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 adaptive threshold a gray scale image*/
+
+#include "types.h"
+#include "cvcore.hpp"
+#include "cvimgproc.hpp"
+
+
+using namespace cv;
+
+Mat imcvBlurs(Mat src, double ksize_width, double ksize_height, double anchor_x, \
+ double anchor_y, char* border_type)
+{
+
+ /*Mat dst(src.rows, src.cols, src.type());*/
+ Mat dst = src.clone();
+
+ Point anchor = Point(anchor_x,anchor_y);
+ Size2f ksize = Size2f(ksize_width, ksize_height);
+
+ if(strcmp(border_type,"BORDER_REPLICATE") == 0)
+ {
+ blur(src,dst,ksize,anchor,BORDER_REPLICATE);
+ }
+ else if(strcmp(border_type,"BORDER_REFLECT"))
+ {
+ blur(src,dst,ksize,anchor,BORDER_REFLECT);
+ }
+ else if(strcmp(border_type,"BORDER_REFLECT_101"))
+ {
+ blur(src,dst,ksize,anchor,BORDER_REFLECT_101);
+ }
+ else if(strcmp(border_type,"BORDER_WRAP"))
+ {
+ blur(src,dst,ksize,anchor,BORDER_WRAP);
+ }
+ else if(strcmp(border_type,"BORDER_CONSTANT"))
+ {
+ blur(src,dst,ksize,anchor,BORDER_CONSTANT);
+ }
+
+
+ return dst;
+} \ No newline at end of file
diff --git a/src/c/imageProcessing/cvimgproc/imcvCanny.cpp b/src/c/imageProcessing/cvimgproc/imcvCanny.cpp
new file mode 100644
index 0000000..a81450b
--- /dev/null
+++ b/src/c/imageProcessing/cvimgproc/imcvCanny.cpp
@@ -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
+*/
+
+/* Function to find edges in image */
+
+#include "types.h"
+#include "cvcore.hpp"
+#include "cvimgproc.hpp"
+
+
+using namespace cv;
+
+Mat imcvCanny(Mat src, double threshold1, double threshold2, double \
+ aperture_size, double L2gradient)
+{
+
+ Mat dst = src.clone();
+
+ Canny(src, dst, threshold1, threshold2, aperture_size, L2gradient);
+
+ return dst;
+}
diff --git a/src/c/imageProcessing/cvimgproc/imcvCornerHarris.cpp b/src/c/imageProcessing/cvimgproc/imcvCornerHarris.cpp
new file mode 100644
index 0000000..d6df1cc
--- /dev/null
+++ b/src/c/imageProcessing/cvimgproc/imcvCornerHarris.cpp
@@ -0,0 +1,55 @@
+/* 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 find edges using Harris algorithm*/
+
+#include "types.h"
+#include "cvcore.hpp"
+#include "cvimgproc.hpp"
+
+
+using namespace cv;
+
+Mat imcvCornerHarris(Mat src, double blocksize, double ksize, double k, \
+ char* border_type)
+{
+
+ Mat dst(src.rows, src.cols, CV_32FC1);
+
+ if(strcmp(border_type,"BORDER_REPLICATE") == 0)
+ {
+ cornerHarris(src,dst,blocksize,ksize,k,BORDER_REPLICATE);
+ }
+ else if(strcmp(border_type,"BORDER_REFLECT"))
+ {
+ cornerHarris(src,dst,blocksize,ksize,k,BORDER_REFLECT);
+ }
+ else if(strcmp(border_type,"BORDER_REFLECT_101"))
+ {
+ cornerHarris(src,dst,blocksize,ksize,k,BORDER_REFLECT_101);
+ }
+ else if(strcmp(border_type,"BORDER_WRAP"))
+ {
+ cornerHarris(src,dst,blocksize,ksize,k,BORDER_WRAP);
+ }
+ else if(strcmp(border_type,"BORDER_CONSTANT"))
+ {
+ cornerHarris(src,dst,blocksize,ksize,k,BORDER_CONSTANT);
+ }
+ else if(strcmp(border_type,"BORDER_DEFAULT"))
+ {
+ cornerHarris(src,dst,blocksize,ksize,k,BORDER_DEFAULT);
+ }
+
+
+ return dst;
+} \ No newline at end of file
diff --git a/src/c/imageProcessing/cvimgproc/imcvCvtColors.cpp b/src/c/imageProcessing/cvimgproc/imcvCvtColors.cpp
index 1523afe..eaad278 100644
--- a/src/c/imageProcessing/cvimgproc/imcvCvtColors.cpp
+++ b/src/c/imageProcessing/cvimgproc/imcvCvtColors.cpp
@@ -22,8 +22,127 @@ using namespace cv;
Mat imcvCvtColors(Mat src, char* code)
{
Mat dst(src.rows, src.cols, src.type());
+
+ /*RGB <--> Gray*/
if(strcmp(code,"CV_RGB2GRAY") == 0)
- cvtColor(src,dst,CV_RGB2GRAY);
+ {cvtColor(src,dst,CV_RGB2GRAY);}
+ else if(strcmp(code,"CV_BGR2GRAY") == 0)
+ {cvtColor(src,dst,CV_BGR2GRAY);}
+ else if(strcmp(code,"CV_GRAY2RGB") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_GRAY2RGB);}
+ else if(strcmp(code,"CV_GRAY2BGR") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_GRAY2BGR);}
+
+ /*RGB <--> CIE XYZ.Rec 709 with D65 white point*/
+ else if(strcmp(code,"CV_RGB2XYZ") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_RGB2XYZ);}
+ else if(strcmp(code,"CV_BGR2XYZ") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_BGR2XYZ);}
+ else if(strcmp(code,"CV_XYZ2RGB") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_XYZ2RGB);}
+ else if(strcmp(code,"CV_XYZ2BGR") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_XYZ2BGR);}
+
+ /*RGB <--> YCrCb JPEG (or YCC) */
+ else if(strcmp(code,"CV_BGR2YCrCb") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_BGR2YCrCb);}
+ else if(strcmp(code,"CV_RGB2YCrCb") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_RGB2YCrCb);}
+ else if(strcmp(code,"CV_YCrCb2BGR") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_YCrCb2BGR);}
+ else if(strcmp(code,"CV_YCrCb2RGB") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_YCrCb2RGB);}
+
+ /*RGB <--> HSV */
+ else if(strcmp(code,"CV_BGR2HSV") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_BGR2HSV);}
+ else if(strcmp(code,"CV_RGB2HSV") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_RGB2HSV);}
+ else if(strcmp(code,"CV_HSV2BGR") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_HSV2BGR);}
+ else if(strcmp(code,"CV_HSV2RGB") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_HSV2RGB);}
+
+ /*RGB <--> HLS */
+ else if(strcmp(code,"CV_BGR2HLS") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_BGR2HLS);}
+ else if(strcmp(code,"CV_RGB2HLS") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_RGB2HLS);}
+ else if(strcmp(code,"CV_HLS2BGR") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_HLS2BGR);}
+ else if(strcmp(code,"CV_HLS2RGB") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_HLS2RGB);}
+ /*RGB <--> CIE L*a*b* */
+ else if(strcmp(code,"CV_BGR2Lab") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_BGR2Lab);}
+ else if(strcmp(code,"CV_RGB2Lab") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_RGB2Lab);}
+ else if(strcmp(code,"CV_Lab2BGR") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_Lab2BGR);}
+ else if(strcmp(code,"CV_Lab2RGB") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_Lab2RGB);}
+
+ /*RGB <--> CIE L*u*v* */
+ else if(strcmp(code,"CV_BGR2Luv") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_BGR2Luv);}
+ else if(strcmp(code,"CV_RGB2Luv") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_RGB2Luv);}
+ else if(strcmp(code,"CV_Luv2BGR") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_Luv2BGR);}
+ else if(strcmp(code,"CV_Luv2RGB") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_Luv2RGB);}
+
+ /*Bayer <--> RGB */
+ else if(strcmp(code,"CV_BayerBG2BGR") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_BayerBG2BGR);}
+ else if(strcmp(code,"CV_BayerGB2BGR") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_BayerGB2BGR);}
+ else if(strcmp(code,"CV_BayerRG2BGR") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_BayerRG2BGR);}
+ else if(strcmp(code,"CV_BayerGR2BGR") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_BayerGR2BGR);}
+ else if(strcmp(code,"CV_BayerBG2RGB") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_BayerBG2RGB);}
+ else if(strcmp(code,"CV_BayerGB2RGB") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_BayerGB2RGB);}
+ else if(strcmp(code,"CV_BayerRG2RGB") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_BayerRG2RGB);}
+ else if(strcmp(code,"CV_BayerBG2RGB") == 0)
+ {dst.reshape(3);
+ cvtColor(src,dst,CV_BayerGR2RGB);}
return dst;
-} \ No newline at end of file
+}
diff --git a/src/c/imageProcessing/cvimgproc/imcvDilate.cpp b/src/c/imageProcessing/cvimgproc/imcvDilate.cpp
new file mode 100644
index 0000000..1659cf5
--- /dev/null
+++ b/src/c/imageProcessing/cvimgproc/imcvDilate.cpp
@@ -0,0 +1,71 @@
+/* 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 adaptive threshold a gray scale image*/
+
+#include "types.h"
+#include "cvcore.hpp"
+#include "cvimgproc.hpp"
+
+
+using namespace cv;
+
+Mat imcvDilate(Mat src, char* dilation_type, double size, double iterations, \
+ char* border_type, double border_value)
+{
+
+ /*Mat dst(src.rows, src.cols, src.type());*/
+ Mat dst = src.clone();
+ int dilate_type =0;
+
+ if(strcmp(dilation_type,"MORPH_RECT") == 0)
+ {
+ dilate_type = MORPH_RECT;
+ }
+ else if(strcmp(dilation_type,"MORPH_CROSS") == 0)
+ {
+ dilate_type = MORPH_CROSS;
+ }
+ else if(strcmp(dilation_type,"MORPH_ELLIPSE") == 0)
+ {
+ dilate_type = MORPH_ELLIPSE;
+ }
+
+
+ Mat element = getStructuringElement(dilate_type, Size(size,size), \
+ Point((size-1)/2,(size-1)/2));
+
+ if(strcmp(border_type,"BORDER_REPLICATE") == 0)
+ {
+ dilate(src, dst, element, Point(-1,-1), iterations, BORDER_REPLICATE);
+ }
+ else if(strcmp(border_type,"BORDER_REFLECT"))
+ {
+ dilate(src, dst, element, Point(-1,-1), iterations, BORDER_REFLECT);
+ }
+ else if(strcmp(border_type,"BORDER_REFLECT_101"))
+ {
+ dilate(src, dst, element, Point(-1,-1), iterations,BORDER_REFLECT_101);
+ }
+ else if(strcmp(border_type,"BORDER_WRAP"))
+ {
+ dilate(src, dst, element, Point(-1,-1), iterations, BORDER_WRAP);
+ }
+ else if(strcmp(border_type,"BORDER_CONSTANT"))
+ {
+ dilate(src, dst, element, Point(-1,-1), iterations, BORDER_CONSTANT, \
+ Scalar(border_value));
+ }
+
+
+ return dst;
+} \ No newline at end of file
diff --git a/src/c/imageProcessing/cvimgproc/imcvDistanceTransforms.cpp b/src/c/imageProcessing/cvimgproc/imcvDistanceTransforms.cpp
new file mode 100644
index 0000000..e53292a
--- /dev/null
+++ b/src/c/imageProcessing/cvimgproc/imcvDistanceTransforms.cpp
@@ -0,0 +1,41 @@
+/* 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 adaptive threshold a gray scale image*/
+
+#include "types.h"
+#include "cvcore.hpp"
+#include "cvimgproc.hpp"
+
+
+using namespace cv;
+
+Mat imcvDistanceTransforms(Mat src, char* distance_type, int mask_size )
+{
+
+ Mat dst(src.rows, src.cols, CV_32F);
+
+ if(strcmp(distance_type,"CV_DIST_L1") == 0)
+ {
+ distanceTransform(src,dst,CV_DIST_L1,mask_size);
+ }
+ else if(strcmp(distance_type,"CV_DIST_L2") == 0)
+ {
+ distanceTransform(src,dst,CV_DIST_L2,mask_size);
+ }
+ else if(strcmp(distance_type,"CV_DIST_C") == 0)
+ {
+ distanceTransform(src,dst,CV_DIST_C,mask_size);
+ }
+
+ return dst;
+} \ No newline at end of file
diff --git a/src/c/imageProcessing/cvimgproc/imcvErode.cpp b/src/c/imageProcessing/cvimgproc/imcvErode.cpp
new file mode 100644
index 0000000..64bae01
--- /dev/null
+++ b/src/c/imageProcessing/cvimgproc/imcvErode.cpp
@@ -0,0 +1,71 @@
+/* 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 adaptive threshold a gray scale image*/
+
+#include "types.h"
+#include "cvcore.hpp"
+#include "cvimgproc.hpp"
+
+
+using namespace cv;
+
+Mat imcvErode(Mat src, char* erosion_type, double size, double iterations, \
+ char* border_type, double border_value)
+{
+
+ /*Mat dst(src.rows, src.cols, src.type());*/
+ Mat dst = src.clone();
+ int erode_type =0;
+
+ if(strcmp(erosion_type,"MORPH_RECT") == 0)
+ {
+ erode_type = MORPH_RECT;
+ }
+ else if(strcmp(erosion_type,"MORPH_CROSS") == 0)
+ {
+ erode_type = MORPH_CROSS;
+ }
+ else if(strcmp(erosion_type,"MORPH_ELLIPSE") == 0)
+ {
+ erode_type = MORPH_ELLIPSE;
+ }
+
+
+ Mat element = getStructuringElement(erode_type, Size(size,size), \
+ Point((size-1)/2,(size-1)/2));
+
+ if(strcmp(border_type,"BORDER_REPLICATE") == 0)
+ {
+ erode(src, dst, element, Point(-1,-1), iterations, BORDER_REPLICATE);
+ }
+ else if(strcmp(border_type,"BORDER_REFLECT"))
+ {
+ erode(src, dst, element, Point(-1,-1), iterations, BORDER_REFLECT);
+ }
+ else if(strcmp(border_type,"BORDER_REFLECT_101"))
+ {
+ erode(src, dst, element, Point(-1,-1), iterations, BORDER_REFLECT_101);
+ }
+ else if(strcmp(border_type,"BORDER_WRAP"))
+ {
+ erode(src, dst, element, Point(-1,-1), iterations, BORDER_WRAP);
+ }
+ else if(strcmp(border_type,"BORDER_CONSTANT"))
+ {
+ erode(src, dst, element, Point(-1,-1), iterations, BORDER_CONSTANT, \
+ Scalar(border_value));
+ }
+
+
+ return dst;
+} \ No newline at end of file
diff --git a/src/c/imageProcessing/cvimgproc/imcvGaussianBlurs.cpp b/src/c/imageProcessing/cvimgproc/imcvGaussianBlurs.cpp
new file mode 100644
index 0000000..3c8c481
--- /dev/null
+++ b/src/c/imageProcessing/cvimgproc/imcvGaussianBlurs.cpp
@@ -0,0 +1,54 @@
+/* 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 adaptive threshold a gray scale image*/
+
+#include "types.h"
+#include "cvcore.hpp"
+#include "cvimgproc.hpp"
+
+
+using namespace cv;
+
+Mat imcvGaussianBlurs(Mat src, double ksize_width, double ksize_height,
+ double sigma_x, double sigma_y, char* border_type)
+{
+
+ /*Mat dst(src.rows, src.cols, src.type());*/
+ Mat dst = src.clone();
+
+ Size2f ksize = Size2f(ksize_width, ksize_height);
+
+ if(strcmp(border_type,"BORDER_REPLICATE") == 0)
+ {
+ GaussianBlur(src,dst,ksize,sigma_x,sigma_y,BORDER_REPLICATE);
+ }
+ else if(strcmp(border_type,"BORDER_REFLECT"))
+ {
+ GaussianBlur(src,dst,ksize,sigma_x,sigma_y,BORDER_REFLECT);
+ }
+ else if(strcmp(border_type,"BORDER_REFLECT_101"))
+ {
+ GaussianBlur(src,dst,ksize,sigma_x,sigma_y,BORDER_REFLECT_101);
+ }
+ else if(strcmp(border_type,"BORDER_WRAP"))
+ {
+ GaussianBlur(src,dst,ksize,sigma_x,sigma_y,BORDER_WRAP);
+ }
+ else if(strcmp(border_type,"BORDER_CONSTANT"))
+ {
+ GaussianBlur(src,dst,ksize,sigma_x,sigma_y,BORDER_CONSTANT);
+ }
+
+
+ return dst;
+} \ No newline at end of file
diff --git a/src/c/imageProcessing/cvimgproc/imcvMedianBlurs.cpp b/src/c/imageProcessing/cvimgproc/imcvMedianBlurs.cpp
new file mode 100644
index 0000000..d8e90ff
--- /dev/null
+++ b/src/c/imageProcessing/cvimgproc/imcvMedianBlurs.cpp
@@ -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
+*/
+
+/* Function to adaptive threshold a gray scale image*/
+
+#include "types.h"
+#include "cvcore.hpp"
+#include "cvimgproc.hpp"
+
+
+using namespace cv;
+
+Mat imcvMedianBlurs(Mat src, double ksize)
+{
+
+ /*Mat dst(src.rows, src.cols, src.type());*/
+ Mat dst = src.clone();
+
+ medianBlur(src,dst,(int)ksize);
+
+ return dst;
+} \ No newline at end of file
diff --git a/src/c/imageProcessing/cvimgproc/imcvThresholds.cpp b/src/c/imageProcessing/cvimgproc/imcvThresholds.cpp
index 2e40de9..9664a44 100644
--- a/src/c/imageProcessing/cvimgproc/imcvThresholds.cpp
+++ b/src/c/imageProcessing/cvimgproc/imcvThresholds.cpp
@@ -22,8 +22,17 @@ using namespace cv;
Mat imcvThresholds(Mat src, double t_value, double maxvalue, char* type)
{
Mat dst(src.rows, src.cols, src.type());
+
if(strcmp(type,"THRESH_BINARY") == 0)
threshold(src,dst,t_value,maxvalue,THRESH_BINARY);
+ if(strcmp(type,"THRESH_BINARY_INV") == 0)
+ threshold(src,dst,t_value,maxvalue,THRESH_BINARY_INV);
+ if(strcmp(type,"THRESH_TRUNC") == 0)
+ threshold(src,dst,t_value,maxvalue,THRESH_TRUNC);
+ if(strcmp(type,"THRESH_TOZERO") == 0)
+ threshold(src,dst,t_value,maxvalue,THRESH_TOZERO);
+ if(strcmp(type,"THRESH_TOZERO_INV") == 0)
+ threshold(src,dst,t_value,maxvalue,THRESH_TOZERO_INV);
return dst;
} \ No newline at end of file
diff --git a/src/c/imageProcessing/includes/cvimgproc.hpp b/src/c/imageProcessing/includes/cvimgproc.hpp
index b7d2faa..8fdf3e3 100644
--- a/src/c/imageProcessing/includes/cvimgproc.hpp
+++ b/src/c/imageProcessing/includes/cvimgproc.hpp
@@ -20,6 +20,33 @@
using namespace cv;
Mat imcvCvtColors(Mat src, char* code);
+
Mat imcvThresholds(Mat src, double threshold, double maxvalue, char* type);
+Mat imcvAdaptThresholds(Mat src, double t_value, double maxvalue, char* AdaptiveMethod, \
+ char* ThreholdType, double blocksize, double C);
+
+Mat imcvDistanceTransforms(Mat src, char* distance_type, int mask_size);
+
+
+Mat imcvBlurs(Mat src, double ksize_width, double ksize_height, double anchor_x, \
+ double anchor_y, char* border_type);
+
+Mat imcvGaussianBlurs(Mat src, double ksize_width, double ksize_height, double sigma_x, \
+ double sigma_y, char* border_type);
+
+Mat imcvMedianBlurs(Mat src, double ksize);
+
+Mat imcvErode(Mat src, char* erosion_type, double size, double iterations, \
+ char* border_type, double border_value);
+
+Mat imcvDilate(Mat src, char* dilation_type, double size, double iterations, \
+ char* border_type, double border_value);
+
+Mat imcvCanny(Mat src, double threshold1, double threshold2, double \
+ aperture_size, double L2gradient);
+
+Mat imcvCornerHarris(Mat src, double blocksize, double ksize, double k, \
+ char* border_type);
+
#endif /*__CVIMGPROC_H__*/
diff --git a/src/c/imageProcessing/interfaces/int_cvhighgui.hpp b/src/c/imageProcessing/interfaces/int_cvhighgui.hpp
index 05f260f..8e1a989 100644
--- a/src/c/imageProcessing/interfaces/int_cvhighgui.hpp
+++ b/src/c/imageProcessing/interfaces/int_cvhighgui.hpp
@@ -20,8 +20,8 @@
//#define g2d0CV_LoadImageim0(filename,name_size,loadtype) imcvLoadImages(filename,loadtype)
#define g2d0CV_LoadImagemt0(filename,name_size,loadtype) imread(filename,loadtype)
-#define g2mt0CV_ShowImageu80(winname,win_size,img) imshow(winname,img)
-#define mt0CV_ShowImageu80(img) imshow("",img)
+#define g2mt0CV_ShowImageu80(winname,win_size,img) imcvShowImages(winname,img)
+#define mt0CV_ShowImageu80(img) imcvShowImages("",img)
#define d0CV_WaitKeyu80(delay) cvWaitKey(delay)
#define g2mt0CV_SaveImageu80(filename,name_size,img) imwrite(filename,img)
diff --git a/src/c/imageProcessing/interfaces/int_cvimgproc.hpp b/src/c/imageProcessing/interfaces/int_cvimgproc.hpp
index 65fa77e..9b1a85c 100644
--- a/src/c/imageProcessing/interfaces/int_cvimgproc.hpp
+++ b/src/c/imageProcessing/interfaces/int_cvimgproc.hpp
@@ -18,7 +18,54 @@
#include "opencv2/imgproc/imgproc.hpp"
#define mt0g2CV_CvtColormt0(src,code,code_size) imcvCvtColors(src,code)
-#define mt0d0d0g2CV_Thresholdmt0(src,threshold,maxvalue,thresh_type,type_size) \
- imcvThresholds(src,threshold,maxvalue,thresh_type)
+
+#define mt0d0d0g2CV_Thresholdmt0(src,threshold,maxvalue,thresh_type, \
+ type_size) imcvThresholds(src,threshold,maxvalue,thresh_type)
+
+#define mt0d0g2g2d0d0CV_AdaptiveThresholdmt0(src,maxvalue,adaptmethod, \
+ adapt_size,thresh_type,blocksize,C) imcvAdaaptThresholds(src, \
+ maxvalue,adaptmethod,thresh_type,blocksize,C)
+
+#define mt0g2d0CV_DistanceTransform(src,distance_type,type_size,mask_size) \
+ imcvDistanceTransform(src,distance_type,mask_size)
+
+#define mt0d0d0d0d0g2CV_Blurmt0(src,ksize_width,ksize_height,anchor_x, \
+ anchor_y,border_type,type_size) imcvBlurs(src,ksize_width, \
+ ksize_height,anchor_x,anchor_y,border_type)
+
+#define mt0d0d0d0d0g2CV_GaussianBlurmt0(src,ksize_width,ksize_height,sigma_x, \
+ sigma_y,border_type,type_size) imcvGaussianBlurs(src,ksize_width, \
+ ksize_height,sigma_x,sigma_y,border_type)
+
+#define mt0d0CV_MedianBlurmt0(src,ksize) imcvMedianBlurs(src,ksize)
+
+#define mt0g2d0CV_Erodemt0(src,erosion_type,type_size,erosion_size) \
+ imcvErode(src,erosion_type,erosion_size,1,"BORDER_CONSTANT",0)
+
+#define mt0g2d0d0g2d0CV_Erodemt0(src,erosion_type,type_size,erosion_size, \
+ iterations,border_type,bor_size,border_value) \
+ imcvErode(src,erosion_type,erosion_size,iterations,border_type, \
+ border_value)
+
+#define mt0g2d0CV_Dilatemt0(src,dilation_type,type_size,dilation_size) \
+ imcvDilate(src,dilation_type,dilation_size,1,"BORDER_CONSTANT",0)
+
+#define mt0g2d0d0g2d0CV_Dilatemt0(src,dilation_type,type_size,dilation_size, \
+ iterations,border_type,bor_size,border_value) \
+ imcvDilate(src,dilation_type,dilation_size,iterations,border_type, \
+ border_value)
+
+#define mt0d0d0d0d0CV_Cannymt0(src,threshold1,threshold2,aperture_size, \
+ L2gradient) imcvCanny(src,threshold1,threshold2,aperture_size, \
+ L2gradient)
+
+#define mt0d0d0CV_Cannymt0(src,threshold1,threshold2) imcvCanny(src, \
+ threshold1,threshold2,3,0)
+
+#define mt0d0d0d0g2CV_CornerHarrismt0(src,blocksize,ksize,k,border_type, \
+ type_size) imcvCornerHarris(src,blocksize,ksize,k,border_type)
+
+#define mt0d0d0d0CV_CornerHarrismt0(src,blocksize,ksize,k) \
+ imcvCornerHarris(src,blocksize,ksize,k,"BORDER_DEFAULT")
#endif /*__INT_CVIMGPROC_H__*/