Description
-Integral kernel creates box filter which can be used with integral images.
+Converts rotation vector to rotation matrix.
@@ -53,9 +51,8 @@ Integral kernel creates box filter which can be used with integral images.
Examples
diff --git a/help/en_US/rotestimate.xml b/help/en_US/rotestimate.xml
new file mode 100644
index 0000000..5b6e0e4
--- /dev/null
+++ b/help/en_US/rotestimate.xml
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+ rotestimate
+ Estimates camera intrinsic parameters matrix(K).
+
+
+
+
+ Calling Sequence
+
+ img1=imread('path of the image file')
+ img2=imread('path of the image file')
+ res = rotestimate(cam_index,img1,img2)
+ img3=imread('path of the image file')
+ res = rotestimate(cam_index,img1,img2,img3)
+ img4=imread('path of the image file')
+ res = rotestimate(cam_index,img1,img2,img3,img4)
+ img5=imread('path of the image file')
+ res = rotestimate(cam_index,img1,img2,img3,img4,img5)
+ img6=imread('path of the image file')
+ res = rotestimate(cam_index,img1,img2,img3,img4,img5,img6)
+
+
+
+
+
+ Parameters
+
+ cam_index :
+ cam_index of the camera for which K is returned.
+ img1 :
+ an image
+ img2 :
+ an image
+ img3 :
+ an image
+ img4 :
+ an image
+ img5 :
+ an image
+ img6 :
+ an image
+
+
+
+
+ Description
+
+The images pass through a stiching pipeline.
+Features are extracted from each image and matching is done on two consecutive images to ensure the continuity in images.
+After this camera parameters are estimated.
+
+
+
+
+
+
+ Examples
+
+
+
+
+ Authors
+
+ Manoj Sree Harsha
+
+
+
diff --git a/help/en_US/scilab_en_US_help/CascadeObjectDetector.html b/help/en_US/scilab_en_US_help/CascadeObjectDetector.html
deleted file mode 100755
index 4c6335f..0000000
--- a/help/en_US/scilab_en_US_help/CascadeObjectDetector.html
+++ /dev/null
@@ -1,119 +0,0 @@
-
-
- CascadeObjectDetector
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > CascadeObjectDetector
-
-
- CascadeObjectDetector
-
This function is used to detect objects in an image.
-
-
-Calling Sequence
-
detect=CascadeObjectDetector(inputImage,classifierList);
-detect=CascadeObjectDetector(inputImage,classifierList,scale);
-detect=CascadeObjectDetector(inputImage,classifierList,scale,minNeighbors);
-detect=CascadeObjectDetector(inputImage,classifierList,scale,minNeighbors,flags);
-detect=CascadeObjectDetector(inputImage,classifierList,scale,minNeighbors,flags,minSize);
-detect=CascadeObjectDetector(inputImage,classifierList,scale,minNeighbors,flags,minSize,maxSize);
-
-Parameters
-
- out:
-
the output image with all specified detections.
- - inputImage:
-
input image on which the objects should be detected.
- - classifierList:
-
a matrix of strings containing the location of the xml files which are to be used in the detection.
- - scale:
-
Parameter specifying how much the image size is reduced at each image scale.
- - minNeighbors:
-
Parameter specifying how many neighbors each candidate rectangle should have to retain it.
- - flags:
-
the method used in detection.it should be either 1 or 4 or 2 or 8.
- - min size:
-
Minimum possible object size. Objects smaller than that are ignored.
- - max size:
-
Maximum possible object size. Objects larger than that are ignored.
-
-Description
-
-
This function is used to detect objects in an image.
-
-
-Examples
-
-
-z=imread("oscarSelfie.jpg");
-
-stacksize('max')
-declare string martrix with the xml locations.Here the general opencv's .xml files are used.
-s=["/home/nihar/Desktop/opencv/data/haarcascades/haarcascade_eye_tree_eyeglasses.xml" "/home/nihar/Desktop/opencv/data/haarcascades/haarcascade_frontalface_alt.xml"];
-
-
-p=CascadeObjectDetector(z,s,1.05);
-
-imshow(p);
-
-Detect only faces.
-
-
-z=imread("oscarSelfie.jpg");
-
-stacksize('max')
-declare string martrix with the xml locations.Here the general opencv's .xml files are used.
-s=["/home/nihar/Desktop/opencv/data/haarcascades/haarcascade_frontalface_alt.xml"];
-
-
-p=CascadeObjectDetector(z,s,1.05);
-
-imshow(p); | | | |
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/DCT.html b/help/en_US/scilab_en_US_help/DCT.html
new file mode 100644
index 0000000..f608112
--- /dev/null
+++ b/help/en_US/scilab_en_US_help/DCT.html
@@ -0,0 +1,82 @@
+
+
+ DCT
+
+
+
+
+
+
+
+ FOSSEE Image Processing Toolbox >> FOSSEE Image Processing Toolbox > DCT
+
+
+ DCT
+
Performs forward Discrete Cosine Transform of the 1D or 2D array.
+
+
+
+
+Parameters
+
- srcMat :
+
1D or 2D floating type array
+ - dstMat :
+
The output matrix
+
+Description
+
dstMat = DCT(srcMat)
+Returns the DCT of the input matrix.
+
+
+Examples
+
srcMat = [230.3 23.1 432.5; 321 543.1 89.5]
+dstMAt = DCT(srcMat)
+disp(dstMAt) | | | |
+
+
+
+
+
+
+
diff --git a/help/en_US/scilab_en_US_help/FFT.html b/help/en_US/scilab_en_US_help/FFT.html
new file mode 100644
index 0000000..3d48797
--- /dev/null
+++ b/help/en_US/scilab_en_US_help/FFT.html
@@ -0,0 +1,80 @@
+
+
+ FFT
+
+
+
+
+
+
+
+ FOSSEE Image Processing Toolbox >> FOSSEE Image Processing Toolbox > FFT
+
+
+ FFT
+
This function returns discrete Fourier Transform of 2D input matrix
+
+
+Calling Sequence
+
fourierTransform=FFT(inputMatrix)
+
+Parameters
+
- inputMatrix:
+
Input matrix must be 2-D.
+
+Description
+
It returns the 2D discrete Fourier transform of two dimensional input matrix.
+
+
+Examples
+
I=imread('images/lena.jpeg',0);
+I=double(I);
+fourier=FFT(I)
+imshow(fourier) | | | |
+
+
+
+
+
+
+
diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS
old mode 100755
new mode 100644
index ef46423..dc8b5d4
Binary files a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS and b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS differ
diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB
old mode 100755
new mode 100644
index e3c71bf..b936101
Binary files a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB and b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB differ
diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS b/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS
old mode 100755
new mode 100644
index 1324712..9161a48
--- a/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS
+++ b/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS
@@ -1 +1,6 @@
-
\ No newline at end of file
+<<<<<<< HEAD
+Ka/)'ڤh)H4-vHF(l
+@=ͫMYzيc8V"욠LW>l5aZX#
+=======
+
+>>>>>>> 404a7f2a4f72456d4df64dde1e76243bd43b9e42
diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS b/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS
old mode 100755
new mode 100644
index 60477b1..f66bf63
Binary files a/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS and b/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS differ
diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA b/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA
old mode 100755
new mode 100644
index a646b00..84d23e8
--- a/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA
+++ b/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA
@@ -1,2 +1,6 @@
JavaSearch 1.0
+<<<<<<< HEAD
+TMAP bs=2048 rt=1 fl=-1 id1=484 id2=1
+=======
TMAP bs=2048 rt=0 fl=-1 id1=10 id2=1
+>>>>>>> 404a7f2a4f72456d4df64dde1e76243bd43b9e42
diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP b/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP
old mode 100755
new mode 100644
index fced7c7..75ddfb4
Binary files a/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP and b/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP differ
diff --git a/help/en_US/scilab_en_US_help/ScilabCaution.png b/help/en_US/scilab_en_US_help/ScilabCaution.png
old mode 100755
new mode 100644
diff --git a/help/en_US/scilab_en_US_help/ScilabEdit.png b/help/en_US/scilab_en_US_help/ScilabEdit.png
old mode 100755
new mode 100644
diff --git a/help/en_US/scilab_en_US_help/ScilabExecute.png b/help/en_US/scilab_en_US_help/ScilabExecute.png
old mode 100755
new mode 100644
diff --git a/help/en_US/scilab_en_US_help/ScilabImportant.png b/help/en_US/scilab_en_US_help/ScilabImportant.png
old mode 100755
new mode 100644
diff --git a/help/en_US/scilab_en_US_help/ScilabNote.png b/help/en_US/scilab_en_US_help/ScilabNote.png
old mode 100755
new mode 100644
diff --git a/help/en_US/scilab_en_US_help/ScilabTip.png b/help/en_US/scilab_en_US_help/ScilabTip.png
old mode 100755
new mode 100644
diff --git a/help/en_US/scilab_en_US_help/ScilabWarning.png b/help/en_US/scilab_en_US_help/ScilabWarning.png
old mode 100755
new mode 100644
diff --git a/help/en_US/scilab_en_US_help/affine2d.html b/help/en_US/scilab_en_US_help/affine2d.html
new file mode 100644
index 0000000..aef9b07
--- /dev/null
+++ b/help/en_US/scilab_en_US_help/affine2d.html
@@ -0,0 +1,82 @@
+
+
+ affine2d
+
+
+
+
+
+
+
+ FOSSEE Image Processing Toolbox >> FOSSEE Image Processing Toolbox > affine2d
+
+
+ affine2d
+
Creates an affine2d object for input 3x3 matrix.
+
+
+
+
+Parameters
+
- mat :
+
It is a 3x3 matrix which specifies forward affine2d transformation.
+ - y :
+
an affine2d object with similar properties as the input.
+
+Description
+
y = affine2d(mat) returns the affine2d object where a 3x3 numeric matrix is given as input
+It encapsulates 2d affine geometri transformation.
+
+
+Examples
+
a=[1 2 0;3 4 0;5 1 1];
+y=affine2d(a);
+disp(y); | | | |
+
+
+
+
+
+
+
diff --git a/help/en_US/scilab_en_US_help/arrowedline.html b/help/en_US/scilab_en_US_help/arrowedline.html
deleted file mode 100755
index 46c4d00..0000000
--- a/help/en_US/scilab_en_US_help/arrowedline.html
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
- arrowedline
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > arrowedline
-
-
-
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/bboxOverlapRatio.html b/help/en_US/scilab_en_US_help/bboxOverlapRatio.html
new file mode 100644
index 0000000..ca00fea
--- /dev/null
+++ b/help/en_US/scilab_en_US_help/bboxOverlapRatio.html
@@ -0,0 +1,92 @@
+
+
+ bboxOverlapRatio
+
+
+
+
+
+
+
+ FOSSEE Image Processing Toolbox >> FOSSEE Image Processing Toolbox > bboxOverlapRatio
+
+
+ bboxOverlapRatio
+
Compute the overlap ratio between the bounding boxes A and B.
+
+
+Calling Sequence
+
[ overlapRatio ] = bboxOverlapRatio(bboxA, bboxB);
+[ overlapRatio ] = bboxOverlapRatio(bboxA, bboxB, ratioType);
+
+Parameters
+
- bboxA:
+
Bounding box A of the form [x, y, width, height];
+ - bboxB:
+
Boundng box B of the form [x, y, width, height];
+ - ratioType (Optional Argument):
+
Method to be used to compute the ratio. Set this to either 'Union' or 'Min'. Default computation method is set to 'Union'.
+ - overlapRatio:
+
Overlap ratio between the bounding boxes A and B.
+
+Description
+
Compute the overlap ratio between the bounding boxes A and B.
+
+
+Examples
+
bboxA = [1 2 3 4];
+bboxB = bboxA + 100;
+overlapRatioMin = bboxOverlapRatio(bboxA, bboxB, 'Min');
+overlapRatioUnion = bboxOverlapRatio(bboxA, bboxB);
+
+bboxA = [0 0 50 50];
+bboxB = [0 0 200 200];
+overlapRatioMin = bboxOverlapRatio(bboxA, bboxB, 'Min');
+overlapRatioUnion = bboxOverlapRatio(bboxA, bboxB); | | | |
+
+
+
+
+
+
+
diff --git a/help/en_US/scilab_en_US_help/blur.html b/help/en_US/scilab_en_US_help/blur.html
deleted file mode 100755
index 5cefd26..0000000
--- a/help/en_US/scilab_en_US_help/blur.html
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
- blur
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > blur
-
-
- blur
-
This function is used to blur an image using the normalized box filter.
-
-
-Calling Sequence
-
B = blur(input_image ,ksize_width,ksize_height,anchorX,anchorY);
-
-Parameters
-
- A:
-
image matrix of the source image.
- - ksize_width :
-
Defines the width of the kernel to be used in pixels.
- - ksize_width :
-
Defines the height of the kernel to be used in pixels.
- - anchorX :
-
Indicates where the x coordinate of the anchor point (the pixel evaluated) is located with respect to the neighborhood. If there is a negative value, then the center of the kernel is considered the anchor point.
- - anchorY :
-
Indicates where the y coordinate of the anchor point (the pixel evaluated) is located with respect to the neighborhood. If there is a negative value, then the center of the kernel is considered the anchor point.
- - B :
-
output image with the applied blur fucntion.
-
-Description
-
The function smoothes an image using the kernel specified with its dimesnsions.
-
-
-Examples
-
i = imread('right1.jpg',0);
-i2 =blur(i,5,5,1,1)
-imshow(i2); | | | |
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/boundingRect.html b/help/en_US/scilab_en_US_help/boundingRect.html
deleted file mode 100755
index 090d97e..0000000
--- a/help/en_US/scilab_en_US_help/boundingRect.html
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
- boundingRect
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > boundingRect
-
-
- boundingRect
-
this function Calculates the up-right bounding rectangle of a point set.
-
-
-Calling Sequence
-
z=imread("lena.jpeg",0);
-rect=boundingRect(points);
-
-Parameters
-
- rect:
-
the rectangle coordinates
- - points:
-
the set of 2D points. It must be N*2.
-
-Description
-
-
Calculates the up-right bounding rectangle of a point set.
-
-
-Examples
-
z=imread("lena.jpeg",0);
-kaze=detectKAZEFeatures(z)x
-rect=boundingRect(kaze.KeyPoints); | | | |
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/c_code.css b/help/en_US/scilab_en_US_help/c_code.css
old mode 100755
new mode 100644
diff --git a/help/en_US/scilab_en_US_help/calfocal.html b/help/en_US/scilab_en_US_help/calfocal.html
new file mode 100644
index 0000000..c191384
--- /dev/null
+++ b/help/en_US/scilab_en_US_help/calfocal.html
@@ -0,0 +1,95 @@
+
+
+ calfocal
+
+
+
+
+
+
+
+ FOSSEE Image Processing Toolbox >> FOSSEE Image Processing Toolbox > calfocal
+
+
+ calfocal
+
Estimates focal lengths for each given camera.
+
+
+Calling Sequence
+
res = calfocal(image1,image2)
+res = calfocal(image1,image2,image3)
+res = calfocal(image1,image2,image3,image4)
+res = calfocal(image1,image2,image3,image4,image5)
+res = calfocal(image1,image2,image3,image4,image5,image6)
+
+Parameters
+
- image1 :
+
an image
+ - image2 :
+
an image
+ - image3 :
+
an image
+ - image4 :
+
an image
+ - image5 :
+
an image
+ - image6 :
+
an image
+
+Description
+
res = calfocal(image1,image2) return a 1x2 matrix.
+Features are extracted from each image and matching is done on two consecutive images to ensure the continuity in images.
+After this camera parameters are estimated along with their focal lengths are estimated.
+
+
+Examples
+
a=imread('images/campus_000.jpg');
+b=imread('images/campus_001.jpg');
+res=calfocal(a,b); | | | |
+
+
+
+
+
+
+
diff --git a/help/en_US/scilab_en_US_help/cameraMatrix.html b/help/en_US/scilab_en_US_help/cameraMatrix.html
new file mode 100644
index 0000000..eea48da
--- /dev/null
+++ b/help/en_US/scilab_en_US_help/cameraMatrix.html
@@ -0,0 +1,86 @@
+
+
+ cameraMatrix
+
+
+
+
+
+
+
+ FOSSEE Image Processing Toolbox >> FOSSEE Image Processing Toolbox > cameraMatrix
+
+
+ cameraMatrix
+
Returns camera projection matrix.
+
+
+Calling Sequence
+
camMatrix = cameraMatrix(instrinsicMatrix,rotationMatrix,translationVector);
+
+Parameters
+
- camMatrix:
+
A 4x3 camera projection matrix, which can be used to project 3-D world points in homogenous co-ordinates into an image.
+ - instrinsicMatrix:
+
Projection matrix of size 3x3.
+ - rotationMatrix:
+
A 3x3 matrix which specifies the rotation of a camera.
+ - translationVector:
+
A 1x3 vector which specifies the translation of a camera.
+
+Description
+
Return a matrix of size 4-by-3, which can be used to project 3-D world points in homogenous co-ordinates into an image.
+
+
+Examples
+
instrinsicMatrix = [1 0 0; 1 2 0; 3 4 0];
+rotationMatrix = [ 0.1417 -0.7409 0.6565; 0.9661 -0.0410 -0.2548; 0.2157 0.6703 0.7100];
+translationVector = [ -29.2584 35.7824 725.5824];
+camMatrix = cameraMatrix(instrinsicMatrix,rotationMatrix,translationVector) | | | |
+
+
+
+
+
+
+
diff --git a/help/en_US/scilab_en_US_help/circle.html b/help/en_US/scilab_en_US_help/circle.html
deleted file mode 100755
index 9ef9447..0000000
--- a/help/en_US/scilab_en_US_help/circle.html
+++ /dev/null
@@ -1,101 +0,0 @@
-
-
- circle
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > circle
-
-
- circle
-
This function circle draws a simple or filled circle on an image with a given center and radius.
-
-
-Calling Sequence
-
cir=circle(inputImage,xcor,ycor,radius,r,g,b);
-cir=circle(inputImage,xcor,ycor,radius,r,g,b,thickness);
-cir=circle(inputImage,xcor,ycor,radius,r,g,b,thickness,linetype);
-cir=circle(inputImage,xcor,ycor,radius,r,g,b,thickness,linetype,shift);
-
-Parameters
-
- cir:
-
The output image with the circle drawn in it.
- - inputImage:
-
The input image on which the circle should be drawn.
- - xcor:
-
X-coordinate of the center
- - ycor:
-
Y-coordinate of the center
- - r:
-
red color value of the circle.It should be in the range 0-255.
- - b:
-
blue color value of the circle.It should be in the range 0-255.
- - g:
-
green color value of the circle.It should be in the range 0-255.
- - thickness:
-
Line thickness.
- - linetype:
-
Type of the circle boundary.It can be 0 or 4 or 8.
- - shift:
-
Number of fractional bits in the point coordinates.
-
-Description
-
This function circle draws a simple or filled circle on an image with a given center and radius.
-
-
-
-Examples
-
-z=imread("lena.jpeg");
-
-cir=circle(z,100,100,15,255,0,0,1,8,0);
-finally show the circle drawn
-imshow(cir) | | | |
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/convolver.html b/help/en_US/scilab_en_US_help/convolver.html
new file mode 100644
index 0000000..8d44ef1
--- /dev/null
+++ b/help/en_US/scilab_en_US_help/convolver.html
@@ -0,0 +1,90 @@
+
+
+ convolver
+
+
+
+
+
+
+
+ FOSSEE Image Processing Toolbox >> FOSSEE Image Processing Toolbox > convolver
+
+
+ convolver
+
Convolves an image with the kernel.
+
+
+Calling Sequence
+
out_image = convolver(in_image,ksize,kvalues,scalar)
+
+Parameters
+
- in_image :
+
an image
+ - out_image :
+
the output image
+ - ksize :
+
kernel size (belongs to {3,4,5})
+ - kvalues :
+
kernel matrix values
+ - scalar :
+
any floating value
+
+Description
+
out_image = convolver(in_image,ksize,kvalues,scalar)
+Returns the convoluted image of the input image. It uses filter2d function to perform convolution.
+The convolution is with the given kernel.
+
+
+Examples
+
a = imread('images/lena.jpeg')
+b=[1 1 1;1 1 1;1 1 1]
+y=convolver(a,3,b,9)
+imshow(y) | | | |
+
+Authors
+
- Kevin George , Manoj Sree Harsha
+
+
+
+
+
diff --git a/help/en_US/scilab_en_US_help/cornerEigenValsAndVecs.html b/help/en_US/scilab_en_US_help/cornerEigenValsAndVecs.html
new file mode 100644
index 0000000..8ecd277
--- /dev/null
+++ b/help/en_US/scilab_en_US_help/cornerEigenValsAndVecs.html
@@ -0,0 +1,92 @@
+
+
+ cornerEigenValsAndVecs
+
+
+
+
+
+
+
+ FOSSEE Image Processing Toolbox >> FOSSEE Image Processing Toolbox > cornerEigenValsAndVecs
+
+
+ cornerEigenValsAndVecs
+
Calculates eigenvalues and eigenvectors of image blocks for corner detection.
+
+
+Calling Sequence
+
inputImage=imread('path of the image file')
+outputImg = cornerEigenValsAndVecs(inputImage, blockSize, kSize, borderType)
+imshow(outputImg)
+
+Parameters
+
- inputImage :
+
an image.
+ - blockSize :
+
Neighborhood size
+ - kSize :
+
Aperture parameter for the Sobel() operator.
+ - borderType :
+
Pixel extrapolation method
+
+Description
+
outputImg = cornerEigenValsAndVecs(inputImage, blockSize, kSize, borderType)
+For every pixel p , the function cornerEigenValsAndVecs considers a blockSize x blockSize neighborhood S(p) . It calculates the covariation matrix of derivatives over the neighbourhood
+After that, it finds eigenvectors and eigenvalues and stores them in the destination image(outputImg).
+
+
+Examples
+
inputImage=imread('images/lena.jpeg');
+blockSize = 7;
+kSize=3;
+borderType="BORDER_DEFAULT"
+outputImg=cornerEigenValsAndVecs(inputImage, blockSize, kSize, borderType);
+imshow(outputImg) | | | |
+
+
+
+
+
+
+
diff --git a/help/en_US/scilab_en_US_help/cornerHarris.html b/help/en_US/scilab_en_US_help/cornerHarris.html
new file mode 100644
index 0000000..321bad0
--- /dev/null
+++ b/help/en_US/scilab_en_US_help/cornerHarris.html
@@ -0,0 +1,95 @@
+
+
+ cornerHarris
+
+
+
+
+
+
+
+ FOSSEE Image Processing Toolbox >> FOSSEE Image Processing Toolbox > cornerHarris
+
+
+ cornerHarris
+
Harris edge detector.
+
+
+Calling Sequence
+
inputImage=imread('path of the image file')
+outputImg = cornerHarris(inputImage, blockSize, kSize, k, borderType)
+imshow(outputImg)
+
+Parameters
+
- inputImage :
+
an image.
+ - blockSize :
+
Neighborhood size
+ - kSize :
+
Aperture parameter for the Sobel() operator.
+ - k :
+
Harris detector free parameter.
+ - borderType :
+
Pixel extrapolation method
+
+Description
+
outputImg = cornerHarris(inputImage, blockSize, kSize, k, borderType)
+This function runs the Harris edge detector on the image.
+outputImg is used to store the Harris detector responses
+
+
+Examples
+
inputImage=imread('images/lena.jpeg');
+blockSize = 7;
+kSize=3;
+k=0.04;
+borderType="BORDER_DEFAULT"
+outputImg=cornerHarris(inputImage, blockSize, kSize, k, borderType);
+imshow(outputImg) | | | |
+
+
+
+
+
+
+
diff --git a/help/en_US/scilab_en_US_help/cornerMinEigenVal.html b/help/en_US/scilab_en_US_help/cornerMinEigenVal.html
new file mode 100644
index 0000000..878bc39
--- /dev/null
+++ b/help/en_US/scilab_en_US_help/cornerMinEigenVal.html
@@ -0,0 +1,93 @@
+
+
+ cornerMinEigenVal
+
+
+
+
+
+
+
+ FOSSEE Image Processing Toolbox >> FOSSEE Image Processing Toolbox > cornerMinEigenVal
+
+
+ cornerMinEigenVal
+
Calculates the minimal eigenvalue of gradient matrices for corner detection.
+
+
+Calling Sequence
+
inputImage=imread('path of the image file')
+outputImg = cornerMinEigenVal(inputImage, blockSize, kSize, borderType)
+imshow(outputImg)
+
+Parameters
+
- inputImage :
+
an image.
+ - blockSize :
+
Neighborhood size
+ - kSize :
+
Aperture parameter for the Sobel() operator.
+ - borderType :
+
Pixel extrapolation method
+
+Description
+
outputImg = cornerMinEigenVal(inputImage, blockSize, kSize, borderType)
+The function is similar to cornerEigenValsAndVecs() but it calculates only the minimal eigenvalue of the covariance matrix of derivatives.
+After that, it stores them in the destination image(outputImg).
+
+
+Examples
+
inputImage=imread('images/lena.jpeg');
+blockSize = 7;
+kSize=3;
+k=0.04;
+borderType="BORDER_DEFAULT"
+outputImg=cornerMinEigenVal(inputImage, blockSize, kSize, borderType);
+imshow(outputImg) | | | |
+
+
+
+
+
+
+
diff --git a/help/en_US/scilab_en_US_help/correctMatches.html b/help/en_US/scilab_en_US_help/correctMatches.html
deleted file mode 100755
index b6ce5b0..0000000
--- a/help/en_US/scilab_en_US_help/correctMatches.html
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
- correctMatches
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > correctMatches
-
-
- correctMatches
-
This function Refines coordinates of corresponding points using openCV's functions.
-
-
-Calling Sequence
-
[newPoints1, newPoints2] = correctMatches(F, points1, points2)
-
-
-
-Description
-
The function implements the Optimal Triangulation Method (see Multiple View Geometry for details). For each given point correspondence points1[i] <-> points2[i], and a fundamental matrix F, it computes the corrected correspondences newPoints1[i] <-> newPoints2[i] that minimize the geometric error d(points1[i], newPoints1[i])^2 + d(points2[i],newPoints2[i])^2 (where d(a,b) is the geometric distance between points a and b ) subject to the epipolar constraint newPoints2^T * F * newPoints1 = 0 .
-
-
-Examples
-
-I=imread("oscarSelfie.jpg",0);
-
-stacksize('max')
-
-cornerPoints1=detectMSERFeatures(I);
-
-I2=imread("oscarSelfie.jpg",0);
-
-cornerPoints2=detectMSERFeatures(I2);
-fundamentalMat=estimateFundamentalMat(cornerPoints1.Location,cornerPoints2.Location);
-[new1 new2]=correctMatches(fundamentalMat,cornerPoints2.Location,cornerPoints1.Location); | | | |
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/cvtColor.html b/help/en_US/scilab_en_US_help/cvtColor.html
deleted file mode 100755
index f14a99f..0000000
--- a/help/en_US/scilab_en_US_help/cvtColor.html
+++ /dev/null
@@ -1,137 +0,0 @@
-
-
- cvtColor
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > cvtColor
-
-
- cvtColor
-
This function is used to transform a image from one space to other like rgb to gray and vice versa.
-
-
-Calling Sequence
-
inputImage=imread("lena.jpeg");
-outputImage=cvtColor(inputImage,codeString);
-outputImage=cvtColor(inputImage,codeString,dstCn);
-
-Parameters
-
- dstCn:
-
number of channels in the destination image; if the parameter is 0, the number of the channels is derived automatically from src and code
- - codeString:
-
A string which specifies the type of conversion.The different types are listed below.
- - "CV_BGR2GRAY":
-
Conversion is from BGR(blue-green-red) space to GRAY.
- - "CV_RGB2GRAY":
-
Conversion is from RGB(red-green-blue) space to GRAY.
- - "CV_GRAY2BGR":
-
Conversion is from BGR(blue-green-red) space.
- - "CV_GRAY2RGB":
-
Conversion is from to GRAY to RGB(blue-green-red) space.
- - "CV_BGR2XYZ" :
-
Conversion is from BGR(blue-green-red) space to CIE XYZ.
- - "CV_RGB2XYZ" :
-
Conversion is from RGB(red-green-blue) space to CIE XYZ.
- - "CV_XYZ2BGR" :
-
Conversion is from to CIE XYZ to BGR space.
- - "CV_XYZ2RGB" :
-
Conversion is from to CIE XYZ to RGB(red-green-blue) space.
- - "CV_BGR2YCrCb":
-
Conversion is from BGR(blue-green-red) space to luma-chroma.
- - "CV_RGB2YCrCb" :
-
Conversion is from RGB(red-green-blue) space to luma chroma.
- - "CV_YCrCb2BGR" :
-
Conversion is from luma-chroma to BGR(blue-green-red) space.
- - "CV_YCrCb2RGB" :
-
Conversion is from luma-chroma to RGB(red-green-blue) space.
- - "CV_BGR2HSV":
-
Conversion is from BGR(blue-green-red) space to HSV.
- - "CV_RGB2HSV":
-
Conversion is from RGB space to HSV.
- - "CV_HSV2BGR":
-
Conversion is from to HSV to BGR(blue-green-red) space.
- - "CV_HSV2RGB":
-
Conversion is from to HSV to RGB(red-green-blue) space.
- - "CV_BGR2HLS":
-
Conversion is from BGR(blue-green-red) space to HLS.
- - "CV_RGB2HLS":
-
Conversion is from RGB space to HSV.
- - "CV_HLS2BGR":
-
Conversion is from HLS to BGR(blue-green-red) space.
- - "CV_HLS2RGB":
-
Conversion is from HLS to RGB(red-green-blue) space.
- - "CV_BGR2Lab":
-
Conversion is from BGR(blue-green-red) space to CIE Lab.
- - "CV_RGB2Lab":
-
Conversion is from RGB space to CIE Lab.
- - "CV_Lab2BGR":
-
Conversion is from CIE Lab to BGR(blue-green-red) space.
- - "CV_Lab2RGB":
-
Conversion is from CIE Lab to RGB space.
- - "CV_BGR2Luv":
-
Conversion is from BGR(blue-green-red) space to CIE Luv.
- - "CV_RGB2Luv":
-
Conversion is from RGB space to CIE Luv.
- - "CV_Luv2BGR":
-
Conversion is from CIE Luv to BGR(blue-green-red) space.
- - "CV_Luv2RGB":
-
Conversion is from CIE Luv to RGB space.
-
-Description
-
-
This function is used to transform a image from one space to other like rgb to gray and vice versa.
-
-
-Examples
-
z=imread("lena.jpeg",0);
-ss=cvtColor(z,"CV_GRAY2BGR");
-imshow(ss) | | | |
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/daddy.tar.gz b/help/en_US/scilab_en_US_help/daddy.tar.gz
deleted file mode 100755
index 6bb8e04..0000000
Binary files a/help/en_US/scilab_en_US_help/daddy.tar.gz and /dev/null differ
diff --git a/help/en_US/scilab_en_US_help/deconvlucy.html b/help/en_US/scilab_en_US_help/deconvlucy.html
deleted file mode 100755
index 1eda998..0000000
--- a/help/en_US/scilab_en_US_help/deconvlucy.html
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
- deconvlucy
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > deconvlucy
-
-
- deconvlucy
-
This function is used to Deblur image using Lucy-Richardson method
-
-
-Calling Sequence
-
J = deconvlucy(I1, I2);
-J = deconvlucy(I1, I2, NUMIT)
-
-Parameters
-
- I1:
-
image matrix of the source image .
- - I2:
-
image matrix of the source image from last iteraion.
- - NUMIT:
-
The number if iterations specified to achieve the desired result.
- - B :
-
output image in the deconvoluted form.
-
-Description
-
J = deconvlucy(I, PSF, NUMIT) specifies the number of iterations the deconvlucy function performs. If this value is not specified, the default is 10.
-
-
-Examples
-
i = imread("lena.jpeg",0);
-i1 = imread("lena.jpeg",0);
-rs = deconvlucy(i,i1); | | | |
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/demosaic.html b/help/en_US/scilab_en_US_help/demosaic.html
deleted file mode 100755
index a8265a4..0000000
--- a/help/en_US/scilab_en_US_help/demosaic.html
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
- demosaic
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > demosaic
-
-
- demosaic
-
This function converts the Bayer pattern encoded image to the truecolor image, RGB.
-
-
-Calling Sequence
-
image=imread("lena.jpeg",0)
-dem=demosaic(image,"gbrg");
-dem=demosaic(image,"bggr");
-dem=demosaic(image,"rggb");
-dem=demosaic(image,"grbg");
-
-Parameters
-
- dem:
-
the output image
- - image:
-
the image which should be converted.
-
-Description
-
-
This function converts the Bayer pattern encoded image to the truecolor image, RGB.
-
-
-Examples
-
z=imread("lena.jpeg");
-dem=demosaic(z,"rggb");
-imshow(dem); | | | |
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/detectGFTTFeatures.html b/help/en_US/scilab_en_US_help/detectGFTTFeatures.html
deleted file mode 100755
index 29ae319..0000000
--- a/help/en_US/scilab_en_US_help/detectGFTTFeatures.html
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
- detectGFTTFeatures
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > detectGFTTFeatures
-
-
- detectGFTTFeatures
-
This function is used to detect GFTT Features in a grayscale Image.
-
-
-Calling Sequence
-
result = detectGFTTFeatures(Image);
-result = detectGFTTFeatures(Image,Name,Value,....)
-
-Parameters
-
- result:
-
a struct containing features and keypoints
- - Image:
-
a grayscale image whose GFTT features is to be found
- - blocksize:
-
the blocksize to be used for detecting the keypoints
- - minDistance:
-
the minimum distance between the points for feature computation
- - useHarrisDetector:
-
an option to use the HarrisDetector.default value is false.
- - maxCorners:
-
the maximum number of corners that should be used for feature computation.
- - ROI or Mask :
-
(Optional) Region Of Interest. This is taken as a vector [u v width height]. When specified, the function detects the key points within region of area width*height with u and v being the top left corner coordinates.
-
-Description
-
This function is used to detect GFTT Features in a grayscale Image.
-
-Examples
-
-z=imread("people.jpg",0);
-image=imread("pls.jpg",0);
-stacksize('max')
-
-pls=detectGFTTFeatures(z,"minDistance",4);
-
-pls1=detectGFTTFeatures(image);
-
-[op ir]=matchFeatures(pls.Features,pls1.Features);
-
-final=drawMatch(z,image,pls.KeyPoints,pls1.KeyPoints,op,ir);
-imshow(final) | | | |
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/detectKAZEFeatures.html b/help/en_US/scilab_en_US_help/detectKAZEFeatures.html
deleted file mode 100755
index d4a1f4f..0000000
--- a/help/en_US/scilab_en_US_help/detectKAZEFeatures.html
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
- detectKAZEFeatures
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > detectKAZEFeatures
-
-
- detectKAZEFeatures
-
This function is used to detect KAZE Features in a grayscale Image.
-
-
-Calling Sequence
-
result = detectKAZEFeatures(Image);
-result = detectKAZEFeatures(Image,Name,Value,....)
-
-Parameters
-
- NumOctaves :
-
(Optional)The number of Octaves that the detector uses. (Default - 4) The value must be an integer scalar in between 1 and 4.
- - diffusivity:
-
-KAZE's diffusivity'
- - ROI or Mask :
-
(Optional) Region Of Interest. This is taken as a vector [u v width height]. When specified, the function detects the key points within region of area width*height with u and v being the top left corner coordinates.
-
-Description
-
This function is used to detect KAZE Features in a grayscale Image.
-
-
-Examples
-
-z=imread("people.jpg",0);
-image=imread("pls.jpg",0);
-stacksize('max')
-
-pls=detectKAZEFeatures(z,"diffusivity",2.1);
-
-pls1=detectKAZEFeatures(image);
-
-[op ir]=matchFeatures(pls.Features,pls1.Features);
-
-final=drawMatch(z,image,pls.KeyPoints,pls1.KeyPoints,op,ir);
-imshow(final) | | | |
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/detectMinEigenFeatures.html b/help/en_US/scilab_en_US_help/detectMinEigenFeatures.html
deleted file mode 100755
index 85b8387..0000000
--- a/help/en_US/scilab_en_US_help/detectMinEigenFeatures.html
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
- detectMinEigenFeatures
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > detectMinEigenFeatures
-
-
- detectMinEigenFeatures
-
This function is used to find corner points in an image using Minimum Eigen Value algorithm.
-
-
-Calling Sequence
-
points = detectMinEigenFeatures(I);
-points = detectMinEigenFeatures(I, Name, Value, ...);
-
-Parameters
-
- points:
-
Structure of corner points
- - I:
-
Input image to detectHarrisFeatures()
- - MinQuality:
-
(Optional) Minimum accepted quality of corners (Default- 0.01)
- - FilterSize:
-
(Optional) Dimension of Gaussian Filter (Default: 5)
- - ROI:
-
(Optional) Rectangular region for corner detection
-
-Description
-
This function detects corners in an image I. These corner points are used to extract features and hence recognize the contents of an image.
-
-
-Examples
-
I = imread('sample.jpg');
-points = detectMinEigenFeatures(I); | | | |
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/ellipse.html b/help/en_US/scilab_en_US_help/ellipse.html
deleted file mode 100755
index 4ec5ea9..0000000
--- a/help/en_US/scilab_en_US_help/ellipse.html
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
- ellipse
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > ellipse
-
-
- ellipse
-
This function draws a simple or thick elliptic arc or fills an ellipse sector.
-
-
-Calling Sequence
-
elli=ellipse(inputImage,xcor,ycor,firstAxis,secondAxis,angle,startAngle,endAngle,r,g,b);
-elli=ellipse(inputImage,xcor,ycor,firstAxis,secondAxis,angle,startAngle,endAngle,r,g,b,thickness);
-elli=ellipse(inputImage,xcor,ycor,firstAxis,secondAxis,angle,startAngle,endAngle,r,g,b,thickness,linetype);
-elli=ellipse(inputImage,xcor,ycor,firstAxis,secondAxis,angle,startAngle,endAngle,r,g,b,thickness,linetype,shift);
-
-Parameters
-
- elli:
-
The output image with the ellipse drawn in it.
- - inputImage:
-
The input image on which the ellipse should be drawn.
- - xcor:
-
X-coordinate of the center
- - ycor:
-
Y-coordinate of the center
- - firstAxis:
-
the first axis of the ellipse.
- - secondAxis:
-
the second axis of the ellipse.
- - angle:
-
Ellipse rotation angle in degrees.
- - startAngle:
-
Starting angle of the elliptic arc in degrees.
- - endAngle:
-
Ending angle of the elliptic arc in degrees.
- - r:
-
red color value of the ellipse.It should be in the range 0-255.
- - b:
-
blue color value of the ellipse.It should be in the range 0-255.
- - g:
-
green color value of the ellipse.It should be in the range 0-255.
- - thickness:
-
Line thickness.
- - linetype:
-
Type of the ellipse boundary.It can be 0 or 4 or 8.
- - shift:
-
Number of fractional bits in the point coordinates.
-
-Description
-
-
This function draws a simple or thick elliptic arc or fills an ellipse sector.
-
-
-Examples
-
-z=imread("lena.jpeg",0);
-call the function
-elli=ellipse(z,0,0,45,45,45,0,45,255,0,0,1,0);
-
-imshow(elli) | | | |
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/erode.html b/help/en_US/scilab_en_US_help/erode.html
deleted file mode 100755
index c6061fc..0000000
--- a/help/en_US/scilab_en_US_help/erode.html
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
- erode
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > erode
-
-
- erode
-
This function Erodes an image by using a specific structuring element.
-
-
-Calling Sequence
-
z=imread("lena.jpeg");
-ero=erode(inputImage,kernel,anchorX,anchorY,iterations);
-
-Parameters
-
- z:
-
input image which should be eroded.
- - ero:
-
the output eroded image
- - kernel:
-
structuring element used for erosion
- - anchorX:
-
x coordinate of Anchor.
- - anchorY:
-
y coordinate of Anchor.
- - Anchor:
-
position of the anchor within the element.
- - Iterations:
-
number of times erosion is applied.
-
-Description
-
-
This function Erodes an image by using a specific structuring element.
-
-
-Examples
-
z=imread("lena.jpeg");
-ero=erode(z,[6 4],1,1,4); | | | |
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/estimateFundamentalMat.html b/help/en_US/scilab_en_US_help/estimateFundamentalMat.html
deleted file mode 100755
index fb69a0c..0000000
--- a/help/en_US/scilab_en_US_help/estimateFundamentalMat.html
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
- estimateFundamentalMat
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > estimateFundamentalMat
-
-
- estimateFundamentalMat
-
It returns the 3-by-3 fundamental matrix corresponding to the input points
-
-
-Calling Sequence
-
fundamentalMat=estimateFundamentalMatrix(matchedPoints1,matchedPoints2);
-fundamentalMat=estimateFundamentalMatrix(matchedPoints1,matchedPoints2,'method','RANSAC','param1',2,'param2',0.99);
-
-Parameters
-
- matchedPoints1:
-
M-by-2 array of first image points. These points can be SURFPoints, MSERRegions, cornerPoints.
- - matchedPoints2:
-
M-by-2 array of the second image points of the same size and format as matchedPoints1.
- - method:
-
method for computing fundamental matrix. Possible methods are 7POINT,8POINT,RANSAC,LMEDS and RANSAC is the default one.
- - param1:
-
It indiacates maximum distance from a point to an epipolar line in pixels
- - param2:
-
It specifies a desirable level of confidence
-
-Description
-
estimateFundamentalMatrix function calculates a fundamental matrix from the corresponding points in two images.
-
-
-Examples
-
I=imread("lena_left.jpeg");
-cornerPoints1=detectMinEigenFeatures(I);
-I2=imread("lena_right.jpeg");
-cornerPoints2=detectMinEigenFeatures(I2);
-fundamentalMat=(cornerPoints1.Location,cornerPoints2.Location); | | | |
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/exposure.html b/help/en_US/scilab_en_US_help/exposure.html
new file mode 100644
index 0000000..48210ce
--- /dev/null
+++ b/help/en_US/scilab_en_US_help/exposure.html
@@ -0,0 +1,110 @@
+
+
+ exposure
+
+
+
+
+
+
+
+ FOSSEE Image Processing Toolbox >> FOSSEE Image Processing Toolbox > exposure
+
+
+ exposure
+
Compensate exposure in the specified image.
+
+
+Calling Sequence
+
stacksize('max')
+image1=imread('path of the image file')
+image2=imread('path of the image file')
+y = exposure(algo_type,img_index,image1,image2)
+image3=imread('path of the image file')
+y = exposure(algo_type,img_index,image1,image2,image3)
+image4=imread('path of the image file')
+y = exposure(algo_type,img_index,image1,image2,image3,image4)
+image5=imread('path of the image file')
+y = exposure(algo_type,img_index,image1,image2,image3,image4,image5)
+image6=imread('path of the image file')
+y = exposure(algo_type,img_index,image1,image2,image3,image4,image6)
+
+Parameters
+
- algo_type :
+
an integer between 1 and 3 (both inclusive) specifying the algorithm to be used for exposure compensation.
+ - img_index :
+
index of the image on which exposure compensator will be applied
+ - image1 :
+
an image
+ - image2 :
+
an image
+ - image3 :
+
an image
+ - image4 :
+
an image
+ - image5 :
+
an image
+ - image6 :
+
an image
+
+Description
+
y = exposure(algo_type,img_index,image1,image2) returns an image whose exposure is compensated.
+Features are extracted from each image and matching is done on two consecutive images to ensure the continuity in images.
+After this camera parameters are estimated which is required to do particular type of warping.
+After warping is done exposure is compensated in an image whose index is mentioned.
+
+
+Examples
+
a=imread('images/lenahi.jpg');
+b=imread('images/lenalow.jpg');
+algo_type=1;
+img_index=1;
+y=exposure(algo_type,img_index,a,b);
+imshow(y) | | | |
+
+
+
+
+
+
+
diff --git a/help/en_US/scilab_en_US_help/findHomography.html b/help/en_US/scilab_en_US_help/findHomography.html
deleted file mode 100755
index 38dee6f..0000000
--- a/help/en_US/scilab_en_US_help/findHomography.html
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
- findHomography
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > findHomography
-
-
- findHomography
-
This Function Finds a perspective transformation between two planes.
-
-
-Calling Sequence
-
homographyMatrix=findHomography(points1,points2);
-homographyMatrix=findHomography(points1,points2,method);
-homographyMatrix=findHomography(points1,points2,method,threshold);
-
-Parameters
-
- homographyMatrix:
-
perspective transformation H between the source and the destination planes
- - points1:
-
Coordinates of the points in the original plane
- - points2:
-
Coordinates of the points in the target plane
- - method:
-
Method used to computed a homography matrix.
- - threshold:
-
Maximum allowed reprojection error to treat a point pair as an inlier.
- - Note:
-
the number of points should be same in the points1 and points2
-
-Description
-
The function finds and returns the perspective transformation H between the source and the destination planes
-
-
-Examples
-
read first image
-z=imread("lena.jpeg",0);
-get points from first image
-yo=detectGFTTFeatures(z);
-read second image
-image=imread("lena2.jpg",0);
-yo1=detectGFTTFeatures(image);
-
-lou=findHomography(yo.KeyPoints,yo1.KeyPoints(1:594,:)); | | | |
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/fitellipse.html b/help/en_US/scilab_en_US_help/fitellipse.html
deleted file mode 100755
index 11ebb1e..0000000
--- a/help/en_US/scilab_en_US_help/fitellipse.html
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
- fitellipse
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > fitellipse
-
-
- fitellipse
-
The function calculates the ellipse that fits (in a least-squares sense) a set of 2D points best of all.
-
-
-Calling Sequence
-
felli=fitellipse(points);
-
-Parameters
-
- felli:
-
a struct containing all the details about the ellipse Params.
- - points:
-
Input 2D point set
-
-Description
-
-
The function calculates the ellipse that fits (in a least-squares sense) a set of 2D points best of all.
-
-
-Examples
-
-z=imread("lena.jpeg",0);
-
-pio=detectKAZEFeatures(z);
-
-sss=fitellipse(pio.KeyPoints) | | | |
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/graycoprops.html b/help/en_US/scilab_en_US_help/graycoprops.html
deleted file mode 100755
index 3c247ce..0000000
--- a/help/en_US/scilab_en_US_help/graycoprops.html
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
- graycoprops
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > graycoprops
-
-
-
-
-
-Calling Sequence
-
z=imread("lena.jpeg");
-
-gray=graycoprops(z)
-gray=graycoprops(z,"contrast")
-gray=graycoprops(z,["contrast" "energy"])
-gray=graycoprops(z,["contrast" "correlation" "energy"])
-gray=graycoprops(z,["contrast" "correlation" "energy" "homogeneity"])
-
-Parameters
-
- gray:
-
A struct containing all the parameters
- - z:
-
A image or a matrix
- - contrast:
-
a measure of the intensity contrast between a pixel and its neighbor over the whole image.
- - energy:
-
the sum of squared elements
- - homogeneity:
-
a value that measures the closeness of the distribution of elements.
- - correlation:
-
a measure of how correlated a pixel is to its neighbor over the whole image
-
-Description
-
This function computes the Properties of gray-level co-occurrence matrix.The properties being "correlation","contrast","energy" and "homogeneity".
-
-
-
-Examples
-
-z=imread("lena.jpeg",0);
-sss=graycoprops(z,["contrast"])
-
-
-glcm = [0 1 2 3;1 1 2 3;1 0 2 0;0 0 0 3]
-sss=graycoprops(glcm,["contrast" "energy" "correlation"]) | | | |
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/imattributes.html b/help/en_US/scilab_en_US_help/imattributes.html
new file mode 100644
index 0000000..f4f3487
--- /dev/null
+++ b/help/en_US/scilab_en_US_help/imattributes.html
@@ -0,0 +1,83 @@
+
+
+ imattributes
+
+
+
+
+
+
+
+ FOSSEE Image Processing Toolbox >> FOSSEE Image Processing Toolbox > imattributes
+
+
+ imattributes
+
Provides information about image attributes.
+
+
+Calling Sequence
+
inputImage=imread('path of the image file')
+imattributes(inputImage)
+
+Parameters
+
- inputImage :
+
an image.
+
+Description
+
imattributes gives image attribute information in the form of a 4-by-2 or 6-by-2 cell array, depending on the image type.
+The first column of the cell array contains the name of the attribute.
+The second column contains the value of the attribute. Both attribute names and values are character vectors
+'Minimum intensity': Regarding intensity images, this value represents the lowest intensity value of any pixel. In case ofindexed images, this value represents the lowest index value into a color map.
+'Maximum intensity':Regarding intensity images, this value represents the highest intensity value of any pixel. In case of indexed images, this value represents the highest index value into a color map.
+
+
+Examples
+
inputImage=imread('images/lena.jpeg');
+imattributes(inputImage) | | | |
+
+Authors
+
- Dhruti Shah , Manoj Sree Harsha
+
+
+
+
+
diff --git a/help/en_US/scilab_en_US_help/imread.html b/help/en_US/scilab_en_US_help/imread.html
deleted file mode 100755
index 12094f4..0000000
--- a/help/en_US/scilab_en_US_help/imread.html
+++ /dev/null
@@ -1,108 +0,0 @@
-
-
- imread
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > imread
-
-
-
-
-
-Calling Sequence
-
image=imread("image_path");
-image=imread("image_path",options)
-
-Parameters
-
- image_path:
-
a String which contains the path of the image that is to be read.
- - options:
-
an Integer, containing the option for user to specify. See below for details.
- - 0 :
-
convert image to the single channel grayscale image.
- - 1 :
-
convert image to the 3 channel BGR color image.
- - 2 :
-
load 16-bit/32-bit image when the input image has the corresponding depth, otherwise convert it to 8-bit.
- - 4 :
-
the image is read in any possible color format.
- - 8 :
-
use the gdal driver for loading the image.
- - 16 :
-
convert image to the single channel grayscale image and the image size reduced 1/2.
- - 17 :
-
convert image to the 3 channel BGR color image and the image size reduced 1/2.
- - 32 :
-
convert image to the single channel grayscale image and the image size reduced 1/4.
- - 33 :
-
convert image to the 3 channel BGR color image and the image size reduced 1/4.
- - 64 :
-
convert image to the single channel grayscale image and the image size reduced 1/8.
- - 65 :
-
convert image to the 3 channel BGR color image and the image size reduced 1/8.
- - 128 :
-
do not rotate the image according to EXIF's orientation flag.
-
-Description
-
This function is used to Read/Load an image from the disk
-
-
-
-Examples
-
Read a image as it is(Unchanged).
-
-image=imread("test.jpg");
-
-Read image as grayscale
-
-image=imread("test.jpg",0); | | | |
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/imresize.html b/help/en_US/scilab_en_US_help/imresize.html
deleted file mode 100755
index b3aec70..0000000
--- a/help/en_US/scilab_en_US_help/imresize.html
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
- imresize
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > imresize
-
-
- imresize
-
This function is used to resize the image
-
-
-Calling Sequence
-
newImage=imresize(inputImage,alpha,beta);
-
-Parameters
-
- newImage:
-
the new resized image
- - inputImage:
-
the image which should be resized.
- - alpha:
-
new number of rows.
- - beta:
-
new number of columns.
-
-Description
-
-
This function is used to resize the image
-
-
-Examples
-
z=imread("lena.jpeg",0);
-zz=imresize(z,35,12);
-imshow(zz) | | | |
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/index.html b/help/en_US/scilab_en_US_help/index.html
deleted file mode 100755
index 651ec0d..0000000
--- a/help/en_US/scilab_en_US_help/index.html
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- FOSSEE Image Processing Toolbox
-
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/indexImages.html b/help/en_US/scilab_en_US_help/indexImages.html
deleted file mode 100755
index ad4089d..0000000
--- a/help/en_US/scilab_en_US_help/indexImages.html
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
- indexImages
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > indexImages
-
-
- indexImages
-
This function creates image search index
-
-
-Calling Sequence
-
imageIndex = indexImages(imgSet, bagOfFeatures, Name, Value... );
-
-Parameters
-
- imgSet:
-
Collection of images with their location and labels
- - bagOfFeatures:
-
Bag of Visual Words
- - Verbose [Optional Input Argument]:
-
Enable Progress display to Screen
- - SaveFeatureLocations [Optional Input Argument]:
-
A boolean value indicating whether feature locations has to be saved or not. Values: [True(default)|False]
- - imageIndex:
-
Search Index Object containing the mapping of visual vocabulary to each image in the image set
-
-Description
-
Creates a search Index Object that has been mapped to visual words that can be used for retrieve Images
-
-
-Examples
-
imgSet = imageSet(directory,'recursive');
-[trainingSet testSet] = partition(imgSet,[0.8]);
-bag = bagOfFeatures(trainingSet);
-imageindex = indexImages(trainingSet, bag);
-
-With Optional Arguments:
-imageindex = indexImages(trainingSet, bag, "Verbose", 1); | | | |
-
-Authors
-
- Umang Agrawal
- - Rohit Suri
- - Sridhar Reddy
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/integralKernel.html b/help/en_US/scilab_en_US_help/integralKernel.html
deleted file mode 100755
index 4a57ef6..0000000
--- a/help/en_US/scilab_en_US_help/integralKernel.html
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
- integralKernel
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > integralKernel
-
-
- integralKernel
-
This function creates a filter to be used with integral images.
-
-
-Calling Sequence
-
results = intergralKernel(bbox, weight);
-
-Parameters
-
- results:
-
A structure kernel which contains bounding boxes, weights, filter coefficients, center of filter, size of filter, orientation of filter
- - bboxes:
-
bounding boxes that define the filter
- - weights:
-
weights corresponding to each of the bbox
-
-Description
-
Integral kernel creates box filter which can be used with integral images.
-
-
-Examples
-
bbox = [1 2 3 4; 5 6 7 8];
-weights = [10 11];
-results = integralKernel(bbox, weights); | | | |
-
-
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/jhelpidx.xml b/help/en_US/scilab_en_US_help/jhelpidx.xml
old mode 100755
new mode 100644
diff --git a/help/en_US/scilab_en_US_help/jhelpmap.jhm b/help/en_US/scilab_en_US_help/jhelpmap.jhm
old mode 100755
new mode 100644
index cdbcb20..050a670
--- a/help/en_US/scilab_en_US_help/jhelpmap.jhm
+++ b/help/en_US/scilab_en_US_help/jhelpmap.jhm
@@ -2,4 +2,29 @@
\ No newline at end of file
diff --git a/help/en_US/scilab_en_US_help/jhelpset.hs b/help/en_US/scilab_en_US_help/jhelpset.hs
old mode 100755
new mode 100644
diff --git a/help/en_US/scilab_en_US_help/jhelptoc.xml b/help/en_US/scilab_en_US_help/jhelptoc.xml
old mode 100755
new mode 100644
index 5ef8b88..2da9911
--- a/help/en_US/scilab_en_US_help/jhelptoc.xml
+++ b/help/en_US/scilab_en_US_help/jhelptoc.xml
@@ -2,5 +2,31 @@
+<<<<<<< HEAD
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+=======
+>>>>>>> 404a7f2a4f72456d4df64dde1e76243bd43b9e42
\ No newline at end of file
diff --git a/help/en_US/scilab_en_US_help/matMulDeriv.html b/help/en_US/scilab_en_US_help/matMulDeriv.html
deleted file mode 100755
index e9beb04..0000000
--- a/help/en_US/scilab_en_US_help/matMulDeriv.html
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
- matMulDeriv
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > matMulDeriv
-
-
- matMulDeriv
-
this function Computes partial derivatives of the matrix product for each multiplied matrix
-
-
-Calling Sequence
-
[da db]=matMulDeriv(A,B);
-
-
-
-Description
-
this function Computes partial derivatives of the matrix product for each multiplied matrix
-
-Examples
-
Declare mattrices
-a=[1 2 ;3 4];
-b=[1 2 ;3 4];
-
-[da db]=matMulDeriv(a,b);
-
-da
-db | | | |
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/match.html b/help/en_US/scilab_en_US_help/match.html
new file mode 100644
index 0000000..b3d4bc5
--- /dev/null
+++ b/help/en_US/scilab_en_US_help/match.html
@@ -0,0 +1,84 @@
+
+
+ match
+
+
+
+
+
+
+
+ FOSSEE Image Processing Toolbox >> FOSSEE Image Processing Toolbox > match
+
+
+ match
+
Performs matching features between two images.
+
+
+Calling Sequence
+
img1=imread('path of the image file')
+img2=imread('path of the image file')
+x=match(img1,img2)
+
+Parameters
+
- img1 :
+
an image
+ - img2 :
+
an image
+
+Description
+
The images pass through a stiching pipeline.
+Features are extracted from each image and matching is done on two images.
+
+
+Examples
+
img1=imread('images/campus_000.jpg');
+img2=imread('images/campus_001.jpg');
+x=match(img1,img2); | | | |
+
+
+
+
+
+
+
diff --git a/help/en_US/scilab_en_US_help/opticalflow.html b/help/en_US/scilab_en_US_help/opticalflow.html
new file mode 100644
index 0000000..fd444c3
--- /dev/null
+++ b/help/en_US/scilab_en_US_help/opticalflow.html
@@ -0,0 +1,78 @@
+
+
+ opticalflow
+
+
+
+
+
+
+
+ FOSSEE Image Processing Toolbox >> FOSSEE Image Processing Toolbox > opticalflow
+
+
+ opticalflow
+
Calculates optical flow.
+
+
+
+
+Parameters
+
- vid :
+
a video
+
+Description
+
opticalflow(vid) returns an opticalflow video and it will be written to 'out.avi' file (In the current working directory).
+
+
+Examples
+
opticalflow('ball.mp4');
+opticalflow('vtest.avi'); | | | |
+
+Authors
+
- Manoj Sree Harsha , M Avinash Reddy
+
+
+
+
+
diff --git a/help/en_US/scilab_en_US_help/pana.html b/help/en_US/scilab_en_US_help/pana.html
new file mode 100644
index 0000000..d7d6952
--- /dev/null
+++ b/help/en_US/scilab_en_US_help/pana.html
@@ -0,0 +1,117 @@
+
+
+ pana
+
+
+
+
+
+
+
+ FOSSEE Image Processing Toolbox >> FOSSEE Image Processing Toolbox > pana
+
+
+ pana
+
Creates the output panorama image using two or more images
+
+
+Calling Sequence
+
stacksize('max')
+img1=imread('path of the image file')
+img2=imread('path of the image file')
+out = pana(img1,img2)
+img3=imread('path of the image file')
+out = pana(img1,img2,img3)
+img4=imread('path of the image file')
+out = pana(img1,img2,img3,img4)
+img5=imread('path of the image file')
+out = pana(img1,img2,img3,img4,img5)
+img6=imread('path of the image file')
+out = pana(img1,img2,img3,img4,img5,img6)
+
+Parameters
+
- img1 :
+
an image
+ - img2 :
+
an image
+ - img3 :
+
an image
+ - img4 :
+
an image
+ - img5 :
+
an image
+ - img6 :
+
an image
+
+Description
+
The images pass through a stiching pipeline before the final panorama is formed.
+Features are extracted from each image and matching is done on two consecutive images to ensure the continuity in images.
+After this camera parameters are estimated which is required to do particular type of warping.
+After warping is done exposure is compensated in all images so as to get a uniform exposure throughout the panaroma.
+Seam estimation is done next to get the exact portions of images to be blended.
+Finally, the images are blended to form the panorama.
+
+
+Examples
+
stacksize('max');
+img1=imread('images/campus_017.jpg');
+img2=imread('images/campus_016.jpg');
+img3=imread('images/campus_015.jpg');
+img4=imread('images/campus_014.jpg');
+img5=imread('images/campus_013.jpg');
+img6=imread('images/campus_012.jpg');
+out=pana(img1,img2,img3,img4,img5,img6); | | | |
+
+Examples
+
stacksize('max');
+a=imread('images/s1.jpg');
+b=imread('images/s2.jpg');
+c=imread('images/s3.jpg');
+y=pana(a,b,c); | | | |
+
+Authors
+
- M Avinash Reddy , Manoj Sree Harsha , Ebey Abraham
+
+
+
+
+
diff --git a/help/en_US/scilab_en_US_help/pclradius.html b/help/en_US/scilab_en_US_help/pclradius.html
new file mode 100644
index 0000000..c1dc7d0
--- /dev/null
+++ b/help/en_US/scilab_en_US_help/pclradius.html
@@ -0,0 +1,93 @@
+
+
+ pclradius
+
+
+
+
+
+
+
+ FOSSEE Image Processing Toolbox >> FOSSEE Image Processing Toolbox > pclradius
+
+
+ pclradius
+
Finds all the points within the circle of radius r with centre as query point q, in the pointcloud pcloud
+
+
+Calling Sequence
+
y = pclradius(pcloud,q,r)
+
+Parameters
+
- pcloud :
+
pointCloud object.
+ - q :
+
a row vector containing the query point
+ - r :
+
a positive integer specifying the radius.
+ - out :
+
a matrix.
+
+Description
+
out = pclradius(pcloud,q,r) return a 2x(Number of points) matrix .
+The first row of out contains the indices of all the points in the pointCloud within the circle of radius r.
+The second row contains the corresponding squared distances(squared euclidean distance).
+
+
+Examples
+
a=pcread('data/cube.ply');
+q=[1 1 -1];
+r=10;
+out=pclradius(a,q,r);
+
+a=pcread('data/bun0.pcd');
+q=[0.5 0.5 0.5];
+r=2;
+out=pclradius(a,q,r); | | | |
+
+
+
+
+
+
+
diff --git a/help/en_US/scilab_en_US_help/radius.html b/help/en_US/scilab_en_US_help/radius.html
new file mode 100644
index 0000000..c1f731c
--- /dev/null
+++ b/help/en_US/scilab_en_US_help/radius.html
@@ -0,0 +1,89 @@
+
+
+ radius
+
+
+
+
+
+
+
+ FOSSEE Image Processing Toolbox >> FOSSEE Image Processing Toolbox > radius
+
+
+ radius
+
Finds all the points within the circle of radius r with centre as query point q, in the dataset f
+
+
+Calling Sequence
+
y = radius(q,f,r)
+y = radius(q,f,r,algo_type)
+
+Parameters
+
- q :
+
a row vector containing the query point
+ - f :
+
f is the set of data points and the number of columns in f should be same as that of q to match point dimensionality
+ - r :
+
a positive integer specifying the radius.
+ - algo_type :
+
a integer between 1 and 4 (both inclusive) specifying the algorithm to be used for the radius search.
+
+Description
+
y = radius(q,f,r) return a 2x(Number of points) matrix .
+The first row of y contains the indices of all the points in the dataset(f) within the circle of radius r.
+The second row contains the corresponding distances(squared euclidean distance).
+
+
+Examples
+
q=[1 2 3];
+f=[1 2 3;4 5 6;7 8 9];
+r=30;
+y=radius(q,f,r); | | | |
+
+
+
+
+
+
+
diff --git a/help/en_US/scilab_en_US_help/rgb2xyz.html b/help/en_US/scilab_en_US_help/rgb2xyz.html
deleted file mode 100755
index c5524c2..0000000
--- a/help/en_US/scilab_en_US_help/rgb2xyz.html
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
- rgb2xyz
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > rgb2xyz
-
-
- rgb2xyz
-
This function is used to convert rgb values of an image to their CIE 1931 xyz.
-
-
-Calling Sequence
-
image=imread("lena.jpeg");
-xyz=imread(image);
-
-Parameters
-
- xyz:
-
the converted image
- - image:
-
Input Image.
-
-Description
-
-
This function is used to convert rgb values of an image to their CIE 1931 xyz.
-
-
-Examples
-
z=imread("lena.jpeg");
-xyz=rgb2xyz(z);
-imshow(xyz); | | | |
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/rotationVectorToMatrix.html b/help/en_US/scilab_en_US_help/rotationVectorToMatrix.html
new file mode 100644
index 0000000..af5b24c
--- /dev/null
+++ b/help/en_US/scilab_en_US_help/rotationVectorToMatrix.html
@@ -0,0 +1,80 @@
+
+
+ rotationVectorToMatrix
+
+
+
+
+
+
+
+ FOSSEE Image Processing Toolbox >> FOSSEE Image Processing Toolbox > rotationVectorToMatrix
+
+
+ rotationVectorToMatrix
+
Returns rotation matrix.
+
+
+Calling Sequence
+
matrix = rotationVectorToMatrix(vector);
+
+Parameters
+
- matrix:
+
rotation matrix
+ - vector:
+
3-D rotation vector
+
+Description
+
Converts rotation vector to rotation matrix.
+
+
+Examples
+
vector = pi/4 * [1, 2, 3];
+matrix = rotationVectorToMatrix(vector); | | | |
+
+
+
+
+
+
+
diff --git a/help/en_US/scilab_en_US_help/rotestimate.html b/help/en_US/scilab_en_US_help/rotestimate.html
new file mode 100644
index 0000000..9bcffdd
--- /dev/null
+++ b/help/en_US/scilab_en_US_help/rotestimate.html
@@ -0,0 +1,104 @@
+
+
+ rotestimate
+
+
+
+
+
+
+
+ FOSSEE Image Processing Toolbox >> FOSSEE Image Processing Toolbox > rotestimate
+
+
+ rotestimate
+
Estimates camera intrinsic parameters matrix(K).
+
+
+Calling Sequence
+
img1=imread('path of the image file')
+img2=imread('path of the image file')
+res = rotestimate(cam_index,img1,img2)
+img3=imread('path of the image file')
+res = rotestimate(cam_index,img1,img2,img3)
+img4=imread('path of the image file')
+res = rotestimate(cam_index,img1,img2,img3,img4)
+img5=imread('path of the image file')
+res = rotestimate(cam_index,img1,img2,img3,img4,img5)
+img6=imread('path of the image file')
+res = rotestimate(cam_index,img1,img2,img3,img4,img5,img6)
+
+Parameters
+
- cam_index :
+
cam_index of the camera for which K is returned.
+ - img1 :
+
an image
+ - img2 :
+
an image
+ - img3 :
+
an image
+ - img4 :
+
an image
+ - img5 :
+
an image
+ - img6 :
+
an image
+
+Description
+
The images pass through a stiching pipeline.
+Features are extracted from each image and matching is done on two consecutive images to ensure the continuity in images.
+After this camera parameters are estimated.
+
+
+Examples
+
img1=imread('images/campus_000.jpg');
+img2=imread('images/campus_001.jpg');
+cam_index=1
+res=rotestimate(1,img1,img2); | | | |
+
+
+
+
+
+
+
diff --git a/help/en_US/scilab_en_US_help/scilab_code.css b/help/en_US/scilab_en_US_help/scilab_code.css
old mode 100755
new mode 100644
diff --git a/help/en_US/scilab_en_US_help/section_df69b7946d692d1fc3c4781d13d82733.html b/help/en_US/scilab_en_US_help/section_df69b7946d692d1fc3c4781d13d82733.html
new file mode 100644
index 0000000..853e895
--- /dev/null
+++ b/help/en_US/scilab_en_US_help/section_df69b7946d692d1fc3c4781d13d82733.html
@@ -0,0 +1,175 @@
+
+
+
+
+
+
+
+
+
+
+ FOSSEE Image Processing Toolbox >> FOSSEE Image Processing Toolbox
+
+
+ FOSSEE Image Processing Toolbox
+- DCT — Performs forward Discrete Cosine Transform of the 1D or 2D array.
+
+
+
+
+
+- FFT — This function returns discrete Fourier Transform of 2D input matrix
+
+
+
+
+
+- affine2d — Creates an affine2d object for input 3x3 matrix.
+
+
+
+
+
+- bboxOverlapRatio — Compute the overlap ratio between the bounding boxes A and B.
+
+
+
+
+
+- calfocal — Estimates focal lengths for each given camera.
+
+
+
+
+
+- cameraMatrix — Returns camera projection matrix.
+
+
+
+
+
+- convolver — Convolves an image with the kernel.
+
+
+
+
+
+- cornerEigenValsAndVecs — Calculates eigenvalues and eigenvectors of image blocks for corner detection.
+
+
+
+
+
+- cornerHarris — Harris edge detector.
+
+
+
+
+
+- cornerMinEigenVal — Calculates the minimal eigenvalue of gradient matrices for corner detection.
+
+
+
+
+
+- exposure — Compensate exposure in the specified image.
+
+
+
+
+
+- imattributes — Provides information about image attributes.
+
+
+
+
+
+- knn — Finds the k nearest neighbours of the query point q, in the dataset f
+
+
+
+
+
+- match — Performs matching features between two images.
+
+
+
+
+
+- opticalflow — Calculates optical flow.
+
+
+
+
+
+- pana — Creates the output panorama image using two or more images
+
+
+
+
+
+- pclradius — Finds all the points within the circle of radius r with centre as query point q, in the pointcloud pcloud
+
+
+
+
+
+- radius — Finds all the points within the circle of radius r with centre as query point q, in the dataset f
+
+
+
+
+
+- rotationVectorToMatrix — Returns rotation matrix.
+
+
+
+
+
+- rotestimate — Estimates camera intrinsic parameters matrix(K).
+
+
+
+
+
+- sfind — Estimates Seams
+
+
+
+
+
diff --git a/help/en_US/scilab_en_US_help/stereoCalibrate.html b/help/en_US/scilab_en_US_help/stereoCalibrate.html
deleted file mode 100755
index 2df02e9..0000000
--- a/help/en_US/scilab_en_US_help/stereoCalibrate.html
+++ /dev/null
@@ -1,132 +0,0 @@
-
-
- stereoCalibrate
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > stereoCalibrate
-
-
- stereoCalibrate
-
this function Performs stereo calibration for the fisheye model.
-
-
-Calling Sequence
-
stereo=stereoCalibrate(objectpoints,imagepoints1,imagepoints2);
-stereo=stereoCalibrate(objectpoints,imagepoints1,imagepoints2,cameraMatrix1,distCoeffs1,cameraMatrix2,distCoeffs2);
-
-Parameters
-
- stereo:
-
a Struct containing all the camera Params
- - objectpoints:
-
a 2d set of actual object points.
- - imagepoints1:
-
a list of imagepoints of image1.
- - imagepoints2:
-
a list of imagepoints of image2.
- - cameraMatrix1:
-
camera matrix of first camera.
- - distCoeffs1:
-
distortion coefficients of first camera.it should be 4*1 or 1*4.
- - cameraMatrix2:
-
camera matrix of second camera.
- - distCoeffs2:
-
distortion coefficients of second camera.it should be 4*1 or 1*4.
-
-Description
-
-
this function Performs stereo calibration for the fisheye model.
-
-
-Examples
-
-
-
-yo=genCheckerboardPoints([7 10],8);
-
-z=imread("left1.jpg",0);
-
-image=imread("right1.jpg",0);
-
-ii=detectCheckerboardCorner(z,[7 10]);
-
-ii2=detectCheckerboardCorner(image,[7 10]);
-
-ii=list(ii);
-ii2=list(ii2);
-
-final=stereoCalibrate(yo,ii,ii2);
-
-final
-
-uu = undistortImage(image,final.cameraMatrix2);
-imshow(uu);
-
-
-yo=genCheckerboardPoints([7 10],8);
-
-z=imread("left1.jpg",0);
-
-image=imread("right1.jpg",0);
-
-ii=detectCheckerboardCorner(z,[7 10]);
-
-ii2=detectCheckerboardCorner(image,[7 10]);
-
-ii=list(ii);
-ii2=list(ii2);
-
-final=stereoCalibrate(yo,ii,ii2);
-
-final
-
-uu = undistortImage(image,final.cameraMatrix2,'distCoeffs',final.distortionCoefficients2);
-imshow(uu); | | | |
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/style.css b/help/en_US/scilab_en_US_help/style.css
old mode 100755
new mode 100644
diff --git a/help/en_US/scilab_en_US_help/trainSVMClassifier.html b/help/en_US/scilab_en_US_help/trainSVMClassifier.html
deleted file mode 100755
index c84a288..0000000
--- a/help/en_US/scilab_en_US_help/trainSVMClassifier.html
+++ /dev/null
@@ -1,136 +0,0 @@
-
-
- trainSVMClassifier
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > trainSVMClassifier
-
-
- trainSVMClassifier
-
This function is used to train an image classifier using the SVM(Support Vector Machines) Model.
-
-
-Calling Sequence
-
imgSet = imageSet(directory,'recursive');
-'or'
-imgSet = imageSet(image);
-bag = bagOfFeatures(imgSet);
-classifier = trainSVMClassifier(imgSets, bag);
-classifier = trainSVMClassifier(imgSets, bag,'nameclass')
-classifier = trainSVMClassifier(imgSets, bag,'nameclass')
-classifier = trainSVMClassifier(imgSets, bag,'nameclass',C)
-classifier = trainSVMClassifier(imgSets, bag,'nameclass',C,coeff)
-classifier = trainSVMClassifier(imgSets, bag,'nameclass',C,coeff,degree)
-classifier = trainSVMClassifier(imgSets, bag,'nameclass',C,coeff,degree,gamma)
-classifier = trainSVMClassifier(imgSets, bag,'nameclass',C,coeff,degree,gamma,kernelType,Nu)
-classifier = trainSVMClassifier(imgSets, bag,'nameclass',C,coeff,degree,gamma,kernelType,Nu,P)
-classifier = trainSVMClassifier(imgSets, bag,'nameclass',C,coeff,degree,gamma,kernelType,Nu,P,setType)
-
-Parameters
-
- classifier:
-
Image category classifier location
- - BagofFeaturesLocation :
-
location of the xml or yml file.
- - Description :
-
features obtained after training.
- - imgSets:
-
Input imageSet to train the classifier on
- - bag:
-
The bagOfFeatures of the imageSet provided
- - image:
-
The set of images used for creating the imageset used for training
- - nameclass:
-
Name of the classifier one wants for their trained model .xml or .yml file
- - C:
-
Parameter C of a SVM optimization problem that should be used to train the model
- - coef:
-
Parameter coef0 of a kernel function that should be used to train the model
- - degree:
-
Parameter degree of a kernel function that should be used to train the model
- - gamma:
-
Parameter γ of a kernel function that should be used to train the model.
- - kernelType:
-
Type of a SVM kernel that should be used to train the model.it should be [-1,5].
- - Nu:
-
Parameter ν of a SVM optimization problem that should be used to train the model.
- - P:
-
Parameter ϵ of a SVM optimization problem that should be used to train the model.
- - type:
-
Type of a SVM formulation that should be used to train the model.it should be [100,104].
-
-Description
-
this function is used to train an image classifier using the SVM(Support Vector Machines) Model.
-
-
-
-Examples
-
-image=imageSet('images2','recursive');
-
-x=bagOfFeatures(image);
-
-d=trainSVMClassifier(image,x,"SVM");
-
-z=imread("fish.jpg");
-
-resp=predict(d,z,"SVM");
-
-
-image=imageSet('images2','recursive');
-
-x=bagOfFeatures(image);
-
-d=trainSVMClassifier(image,x,"SVM",1.1,0.2);
-
-z=imread("fish.jpg");
-
-resp=predict(d,z,"SVM"); | | | |
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/trainSVMSGDClassifier.html b/help/en_US/scilab_en_US_help/trainSVMSGDClassifier.html
deleted file mode 100755
index 0315f73..0000000
--- a/help/en_US/scilab_en_US_help/trainSVMSGDClassifier.html
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
- trainSVMSGDClassifier
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > trainSVMSGDClassifier
-
-
- trainSVMSGDClassifier
-
This function is used to train an image classifier using the SVMSGD(Stochastic Gradient Descent SVM) Model.
-
-
-Calling Sequence
-
imgSet = imageSet(directory,'recursive');
-'or'
-imgSet = imageSet(image);
-bag = bagOfFeatures(imgSet);
-classifier = trainSVMSGDClassifier(imgSets, bag);`
-classifier = trainSVMSGDClassifier(imgSets, bag,'nameclass')
-classifier = trainSVMSGDClassifier(imgSets, bag,'nameclass')
-classifier = trainSVMSGDClassifier(imgSets, bag,'nameclass',initialStepSize)
-classifier = trainSVMSGDClassifier(imgSets, bag,'nameclass',initialStepSize,marginReg)
-classifier = trainSVMSGDClassifier(imgSets, bag,'nameclass',initialStepSize,marginReg,marginType)
-classifier = trainSVMSGDClassifier(imgSets, bag,'nameclass',initialStepSize,marginReg,marginType,optimalParams)
-classifier = trainSVMSGDClassifier(imgSets, bag,'nameclass',initialStepSize,marginReg,marginType,optimalParams,stepDecreasingPower)
-classifier = trainSVMSGDClassifier(imgSets, bag,'nameclass',initialStepSize,marginReg,marginType,optimalParams,stepDecreasingPower,svmsgdType)
-
-Parameters
-
- classifier:
-
Image category classifier location
- - BagofFeaturesLocation :
-
location of the xml or yml file.
- - Description :
-
features obtained after training.
- - imgSets:
-
Input imageSet to train the classifier on
- - bag:
-
The bagOfFeatures of the imageSet provided
- - image:
-
The set of images used for creating the imageset used for training
- - nameclass:
-
Name of the classifier one wants for their trained model .xml or .yml file
- - initialStepSize:
-
Parameter initialStepSize of a SVMSGD optimization problem that should be used to train the model.
- - marginReg:
-
Parameter marginRegularization of a SVMSGD optimization problem that should be used to train the model
- - marginType:
-
Parameter marginType of a SVMSGD optimization problem that should be used to train the model.it should be either 0 or 1.
- - optimalParams:
-
sets optimal parameters values for chosen SVM SGD model.
- - stepDecreasingPower:
-
Parameter stepDecreasingPower of a SVMSGD optimization problem that should be used to train the model.
- - svmsgdType:
-
Algorithm type of SVMSGD that should be used to train the model.it should be either 0 or 1.
-
-Description
-
This function is used to train an image classifier using the SVMSGD(Stochastic Gradient Descent SVM) Model.
-
-
-Examples
-
-image=imageSet('images2','recursive');
-
-x=bagOfFeatures(image);
-
-r=trainSVMSGDClassifier(image,x,"pbrr",0,0,0,1,0,1);
-
-z=imread("fish.jpg");
-
-resp=predict(r,z,"SVMSGD");
-
-
-image=imageSet('images2','recursive');
-
-x=bagOfFeatures(image);
-
-r=trainSVMSGDClassifier(image,x,"pbrr");
-
-z=imread("fish.jpg");
-
-resp=predict(r,z,"SVMSGD"); | | | |
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/undistortPoints.html b/help/en_US/scilab_en_US_help/undistortPoints.html
deleted file mode 100755
index 097ad48..0000000
--- a/help/en_US/scilab_en_US_help/undistortPoints.html
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
- undistortPoints
-
-
-
-
-
-
-
- FOSSEE_Image_Processing_Toolbox >> FOSSEE_Image_Processing_Toolbox > undistortPoints
-
-
- undistortPoints
-
Returns the ideal point coordinates from the observed point coordinates
-
-
-Calling Sequence
-
[idealPoints] = undistortPoints(observedPoints, camMat, disCoefMat, rectMat, newCamMat)
-
-Parameters
-
- observedPoints:
-
1xN or Nx1 2-channel (CV_32FC2 or CV_64FC2).
- - camMat:
-
\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}
- - disCoefMat:
-
Input vector of distortion coefficients (k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, or 8 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.
- - rectMat:
-
Rectification transformation in the object space (3x3 matrix). If the matrix is empty, the identity transformation is used.
- - newCamMat:
-
New camera matrix (3x3) or new projection matrix (3x4. If the matrix is empty, the identity new camera matrix is used.
- - idealPoints:
-
ideal point coordinates matrix. If matrix newCamMat is identity or omitted, idealPoints will contain normalized point coordinates.
-
-Description
-
Returns the ideal points coordinates from the observed point coordinates after undistortion and reverse perpective transformation.
-
-
-Examples
-
[observedPoints] = [1 2 3 4; 4 3 2 1]
-[camMat] = [450 0 231; 0 876.3 87.1; 0 0 1]
-[disCoefMat] = [3 2 0 9]
-[rectMat] = [1 0 0; 0 1 0; 0 0 1]
-[newCamMat] = []
-[idealPoints] = undistortPoints(observedPoints, camMat, disCoefMat, rectMat, newCamMat) | | | |
-
-
-
-
-
diff --git a/help/en_US/scilab_en_US_help/xml_code.css b/help/en_US/scilab_en_US_help/xml_code.css
old mode 100755
new mode 100644
diff --git a/help/en_US/stereoCalibrate.xml b/help/en_US/stereoCalibrate.xml
deleted file mode 100755
index dc83117..0000000
--- a/help/en_US/stereoCalibrate.xml
+++ /dev/null
@@ -1,116 +0,0 @@
-
-
-
-
-
-
-
- stereoCalibrate
- this function Performs stereo calibration for the fisheye model.
-
-
-
-
- Calling Sequence
-
-
- stereo=stereoCalibrate(objectpoints,imagepoints1,imagepoints2);
- stereo=stereoCalibrate(objectpoints,imagepoints1,imagepoints2,cameraMatrix1,distCoeffs1,cameraMatrix2,distCoeffs2);
-
-
-
-
-
- Parameters
-
- stereo:
- a Struct containing all the camera Params
- objectpoints:
- a 2d set of actual object points.
- imagepoints1:
- a list of imagepoints of image1.
- imagepoints2:
- a list of imagepoints of image2.
- cameraMatrix1:
- camera matrix of first camera.
- distCoeffs1:
- distortion coefficients of first camera.it should be 4*1 or 1*4.
- cameraMatrix2:
- camera matrix of second camera.
- distCoeffs2:
- distortion coefficients of second camera.it should be 4*1 or 1*4.
-
-
-
-
- Description
-
-
-
-this function Performs stereo calibration for the fisheye model.
-
-
-
-
-
-
- Examples
-
-
-
diff --git a/help/en_US/trainSVMClassifier.xml b/help/en_US/trainSVMClassifier.xml
deleted file mode 100755
index fb20ded..0000000
--- a/help/en_US/trainSVMClassifier.xml
+++ /dev/null
@@ -1,118 +0,0 @@
-
-
-
-
-
-
-
- trainSVMClassifier
- This function is used to train an image classifier using the SVM(Support Vector Machines) Model.
-
-
-
-
- Calling Sequence
-
- imgSet = imageSet(directory,'recursive');
- 'or'
- imgSet = imageSet(image);
- bag = bagOfFeatures(imgSet);
- classifier = trainSVMClassifier(imgSets, bag);
- classifier = trainSVMClassifier(imgSets, bag,'nameclass')
- classifier = trainSVMClassifier(imgSets, bag,'nameclass')
- classifier = trainSVMClassifier(imgSets, bag,'nameclass',C)
- classifier = trainSVMClassifier(imgSets, bag,'nameclass',C,coeff)
- classifier = trainSVMClassifier(imgSets, bag,'nameclass',C,coeff,degree)
- classifier = trainSVMClassifier(imgSets, bag,'nameclass',C,coeff,degree,gamma)
- classifier = trainSVMClassifier(imgSets, bag,'nameclass',C,coeff,degree,gamma,kernelType,Nu)
- classifier = trainSVMClassifier(imgSets, bag,'nameclass',C,coeff,degree,gamma,kernelType,Nu,P)
- classifier = trainSVMClassifier(imgSets, bag,'nameclass',C,coeff,degree,gamma,kernelType,Nu,P,setType)
-
-
-
-
-
- Parameters
-
- classifier:
- Image category classifier location
- BagofFeaturesLocation :
- location of the xml or yml file.
- Description :
- features obtained after training.
- imgSets:
- Input imageSet to train the classifier on
- bag:
- The bagOfFeatures of the imageSet provided
- image:
- The set of images used for creating the imageset used for training
- nameclass:
- Name of the classifier one wants for their trained model .xml or .yml file
- C:
- Parameter C of a SVM optimization problem that should be used to train the model
- coef:
- Parameter coef0 of a kernel function that should be used to train the model
- degree:
- Parameter degree of a kernel function that should be used to train the model
- gamma:
- Parameter γ of a kernel function that should be used to train the model.
- kernelType:
- Type of a SVM kernel that should be used to train the model.it should be [-1,5].
- Nu:
- Parameter ν of a SVM optimization problem that should be used to train the model.
- P:
- Parameter ϵ of a SVM optimization problem that should be used to train the model.
- type:
- Type of a SVM formulation that should be used to train the model.it should be [100,104].
-
-
-
-
- Description
-
-this function is used to train an image classifier using the SVM(Support Vector Machines) Model.
-
-
-
-
-
-
-
-
- Examples
-
-
-
diff --git a/help/en_US/trainSVMSGDClassifier.xml b/help/en_US/trainSVMSGDClassifier.xml
deleted file mode 100755
index f30584c..0000000
--- a/help/en_US/trainSVMSGDClassifier.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
-
-
-
-
- trainSVMSGDClassifier
- This function is used to train an image classifier using the SVMSGD(Stochastic Gradient Descent SVM) Model.
-
-
-
-
- Calling Sequence
-
- imgSet = imageSet(directory,'recursive');
- 'or'
- imgSet = imageSet(image);
- bag = bagOfFeatures(imgSet);
- classifier = trainSVMSGDClassifier(imgSets, bag);`
- classifier = trainSVMSGDClassifier(imgSets, bag,'nameclass')
- classifier = trainSVMSGDClassifier(imgSets, bag,'nameclass')
- classifier = trainSVMSGDClassifier(imgSets, bag,'nameclass',initialStepSize)
- classifier = trainSVMSGDClassifier(imgSets, bag,'nameclass',initialStepSize,marginReg)
- classifier = trainSVMSGDClassifier(imgSets, bag,'nameclass',initialStepSize,marginReg,marginType)
- classifier = trainSVMSGDClassifier(imgSets, bag,'nameclass',initialStepSize,marginReg,marginType,optimalParams)
- classifier = trainSVMSGDClassifier(imgSets, bag,'nameclass',initialStepSize,marginReg,marginType,optimalParams,stepDecreasingPower)
- classifier = trainSVMSGDClassifier(imgSets, bag,'nameclass',initialStepSize,marginReg,marginType,optimalParams,stepDecreasingPower,svmsgdType)
-
-
-
-
-
- Parameters
-
- classifier:
- Image category classifier location
- BagofFeaturesLocation :
- location of the xml or yml file.
- Description :
- features obtained after training.
- imgSets:
- Input imageSet to train the classifier on
- bag:
- The bagOfFeatures of the imageSet provided
- image:
- The set of images used for creating the imageset used for training
- nameclass:
- Name of the classifier one wants for their trained model .xml or .yml file
- initialStepSize:
- Parameter initialStepSize of a SVMSGD optimization problem that should be used to train the model.
- marginReg:
- Parameter marginRegularization of a SVMSGD optimization problem that should be used to train the model
- marginType:
- Parameter marginType of a SVMSGD optimization problem that should be used to train the model.it should be either 0 or 1.
- optimalParams:
- sets optimal parameters values for chosen SVM SGD model.
- stepDecreasingPower:
- Parameter stepDecreasingPower of a SVMSGD optimization problem that should be used to train the model.
- svmsgdType:
- Algorithm type of SVMSGD that should be used to train the model.it should be either 0 or 1.
-
-
-
-
- Description
-
-This function is used to train an image classifier using the SVMSGD(Stochastic Gradient Descent SVM) Model.
-
-
-
-
-
-
- Examples
-
-
-
diff --git a/help/en_US/undistortPoints.xml b/help/en_US/undistortPoints.xml
deleted file mode 100755
index 4f9c08d..0000000
--- a/help/en_US/undistortPoints.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
- undistortPoints
- Returns the ideal point coordinates from the observed point coordinates
-
-
-
-
- Calling Sequence
-
- [idealPoints] = undistortPoints(observedPoints, camMat, disCoefMat, rectMat, newCamMat)
-
-
-
-
-
- Parameters
-
- observedPoints:
- 1xN or Nx1 2-channel (CV_32FC2 or CV_64FC2).
- camMat:
- \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}
- disCoefMat:
- Input vector of distortion coefficients (k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, or 8 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.
- rectMat:
- Rectification transformation in the object space (3x3 matrix). If the matrix is empty, the identity transformation is used.
- newCamMat:
- New camera matrix (3x3) or new projection matrix (3x4. If the matrix is empty, the identity new camera matrix is used.
- idealPoints:
- ideal point coordinates matrix. If matrix newCamMat is identity or omitted, idealPoints will contain normalized point coordinates.
-
-
-
-
- Description
-
-Returns the ideal points coordinates from the observed point coordinates after undistortion and reverse perpective transformation.
-
-
-
-
-
-
- Examples
-
-
-
diff --git a/images/1.jpg b/images/1.jpg
new file mode 100644
index 0000000..e9f5bee
Binary files /dev/null and b/images/1.jpg differ
diff --git a/images/1.png b/images/1.png
new file mode 100644
index 0000000..a1d4b3c
Binary files /dev/null and b/images/1.png differ
diff --git a/images/1low.png b/images/1low.png
new file mode 100644
index 0000000..6b138e2
Binary files /dev/null and b/images/1low.png differ
diff --git a/images/2.png b/images/2.png
new file mode 100644
index 0000000..68c7a75
Binary files /dev/null and b/images/2.png differ
diff --git a/images/3.png b/images/3.png
new file mode 100644
index 0000000..e800ee7
Binary files /dev/null and b/images/3.png differ
diff --git a/images/3hi.png b/images/3hi.png
new file mode 100644
index 0000000..51362b0
Binary files /dev/null and b/images/3hi.png differ
diff --git a/images/4.png b/images/4.png
new file mode 100644
index 0000000..931cfa1
Binary files /dev/null and b/images/4.png differ
diff --git a/images/CCITT_1.TIF b/images/CCITT_1.TIF
new file mode 100644
index 0000000..fe51399
Binary files /dev/null and b/images/CCITT_1.TIF differ
diff --git a/images/G4S.TIF b/images/G4S.TIF
new file mode 100644
index 0000000..31ff418
Binary files /dev/null and b/images/G4S.TIF differ
diff --git a/images/b b/images/b
new file mode 100644
index 0000000..b8755b3
Binary files /dev/null and b/images/b differ
diff --git a/images/b1.jpg b/images/b1.jpg
new file mode 100644
index 0000000..ffc44cf
Binary files /dev/null and b/images/b1.jpg differ
diff --git a/images/b1hi.jpg b/images/b1hi.jpg
new file mode 100644
index 0000000..50dc68a
Binary files /dev/null and b/images/b1hi.jpg differ
diff --git a/images/b2.jpg b/images/b2.jpg
new file mode 100644
index 0000000..8b94952
Binary files /dev/null and b/images/b2.jpg differ
diff --git a/images/b3.jpg b/images/b3.jpg
new file mode 100644
index 0000000..180e47b
Binary files /dev/null and b/images/b3.jpg differ
diff --git a/images/b4.jpg b/images/b4.jpg
new file mode 100644
index 0000000..a4e9d22
Binary files /dev/null and b/images/b4.jpg differ
diff --git a/images/campus_000.jpg b/images/campus_000.jpg
new file mode 100644
index 0000000..2bfba8d
Binary files /dev/null and b/images/campus_000.jpg differ
diff --git a/images/campus_001.jpg b/images/campus_001.jpg
new file mode 100644
index 0000000..8993474
Binary files /dev/null and b/images/campus_001.jpg differ
diff --git a/images/campus_002.jpg b/images/campus_002.jpg
new file mode 100644
index 0000000..90b8749
Binary files /dev/null and b/images/campus_002.jpg differ
diff --git a/images/campus_003.jpg b/images/campus_003.jpg
new file mode 100644
index 0000000..f78e7b1
Binary files /dev/null and b/images/campus_003.jpg differ
diff --git a/images/campus_004.jpg b/images/campus_004.jpg
new file mode 100644
index 0000000..c6ba5b1
Binary files /dev/null and b/images/campus_004.jpg differ
diff --git a/images/campus_005.jpg b/images/campus_005.jpg
new file mode 100644
index 0000000..66e4d87
Binary files /dev/null and b/images/campus_005.jpg differ
diff --git a/images/campus_006.jpg b/images/campus_006.jpg
new file mode 100644
index 0000000..0f44c50
Binary files /dev/null and b/images/campus_006.jpg differ
diff --git a/images/campus_007.jpg b/images/campus_007.jpg
new file mode 100644
index 0000000..d5ad621
Binary files /dev/null and b/images/campus_007.jpg differ
diff --git a/images/campus_008.jpg b/images/campus_008.jpg
new file mode 100644
index 0000000..3c5aa77
Binary files /dev/null and b/images/campus_008.jpg differ
diff --git a/images/campus_009.jpg b/images/campus_009.jpg
new file mode 100644
index 0000000..7717381
Binary files /dev/null and b/images/campus_009.jpg differ
diff --git a/images/campus_010.jpg b/images/campus_010.jpg
new file mode 100644
index 0000000..ad63293
Binary files /dev/null and b/images/campus_010.jpg differ
diff --git a/images/campus_011.jpg b/images/campus_011.jpg
new file mode 100644
index 0000000..1dfa809
Binary files /dev/null and b/images/campus_011.jpg differ
diff --git a/images/campus_012.jpg b/images/campus_012.jpg
new file mode 100644
index 0000000..909109b
Binary files /dev/null and b/images/campus_012.jpg differ
diff --git a/images/campus_013.jpg b/images/campus_013.jpg
new file mode 100644
index 0000000..5568c6a
Binary files /dev/null and b/images/campus_013.jpg differ
diff --git a/images/campus_014.jpg b/images/campus_014.jpg
new file mode 100644
index 0000000..8a17067
Binary files /dev/null and b/images/campus_014.jpg differ
diff --git a/images/campus_015.jpg b/images/campus_015.jpg
new file mode 100644
index 0000000..d04e729
Binary files /dev/null and b/images/campus_015.jpg differ
diff --git a/images/campus_016.jpg b/images/campus_016.jpg
new file mode 100644
index 0000000..91cc629
Binary files /dev/null and b/images/campus_016.jpg differ
diff --git a/images/campus_017.jpg b/images/campus_017.jpg
new file mode 100644
index 0000000..3a5ae8d
Binary files /dev/null and b/images/campus_017.jpg differ
diff --git a/images/card.png b/images/card.png
new file mode 100644
index 0000000..6f01082
Binary files /dev/null and b/images/card.png differ
diff --git a/images/cardhi.png b/images/cardhi.png
new file mode 100644
index 0000000..e820eaa
Binary files /dev/null and b/images/cardhi.png differ
diff --git a/images/child(1).jpg b/images/child(1).jpg
new file mode 100644
index 0000000..b9e45e7
Binary files /dev/null and b/images/child(1).jpg differ
diff --git a/images/child.jpg b/images/child.jpg
new file mode 100644
index 0000000..b9e45e7
Binary files /dev/null and b/images/child.jpg differ
diff --git a/images/disparity.jpg b/images/disparity.jpg
new file mode 100644
index 0000000..0fb11f5
Binary files /dev/null and b/images/disparity.jpg differ
diff --git a/images/disparity2.jpg b/images/disparity2.jpg
new file mode 100644
index 0000000..2f9f4f1
Binary files /dev/null and b/images/disparity2.jpg differ
diff --git a/images/disparitylow.jpg b/images/disparitylow.jpg
new file mode 100644
index 0000000..176873f
Binary files /dev/null and b/images/disparitylow.jpg differ
diff --git a/images/dog.png b/images/dog.png
new file mode 100644
index 0000000..fb5d2da
Binary files /dev/null and b/images/dog.png differ
diff --git a/images/eggs.jpg b/images/eggs.jpg
new file mode 100644
index 0000000..f3036dd
Binary files /dev/null and b/images/eggs.jpg differ
diff --git a/images/ex1.jpg b/images/ex1.jpg
new file mode 100644
index 0000000..0d56e2d
Binary files /dev/null and b/images/ex1.jpg differ
diff --git a/images/first.jpg b/images/first.jpg
new file mode 100644
index 0000000..2686c70
Binary files /dev/null and b/images/first.jpg differ
diff --git a/images/flower.png b/images/flower.png
new file mode 100644
index 0000000..212cea1
Binary files /dev/null and b/images/flower.png differ
diff --git a/images/hill1.jpg b/images/hill1.jpg
new file mode 100644
index 0000000..5ed9f8e
Binary files /dev/null and b/images/hill1.jpg differ
diff --git a/images/hill2.jpg b/images/hill2.jpg
new file mode 100644
index 0000000..602e582
Binary files /dev/null and b/images/hill2.jpg differ
diff --git a/images/hill3.jpg b/images/hill3.jpg
new file mode 100644
index 0000000..5f46070
Binary files /dev/null and b/images/hill3.jpg differ
diff --git a/images/ledge1.jpg b/images/ledge1.jpg
new file mode 100644
index 0000000..4501015
Binary files /dev/null and b/images/ledge1.jpg differ
diff --git a/images/ledge2.jpg b/images/ledge2.jpg
new file mode 100644
index 0000000..6caed87
Binary files /dev/null and b/images/ledge2.jpg differ
diff --git a/images/ledge3.jpg b/images/ledge3.jpg
new file mode 100644
index 0000000..02f97b6
Binary files /dev/null and b/images/ledge3.jpg differ
diff --git a/images/lena1.jpg b/images/lena1.jpg
new file mode 100644
index 0000000..83d5324
Binary files /dev/null and b/images/lena1.jpg differ
diff --git a/images/lenahi.jpg b/images/lenahi.jpg
new file mode 100644
index 0000000..994a672
Binary files /dev/null and b/images/lenahi.jpg differ
diff --git a/images/lenalow.jpg b/images/lenalow.jpg
new file mode 100644
index 0000000..c2a5a91
Binary files /dev/null and b/images/lenalow.jpg differ
diff --git a/images/monkey.jpeg b/images/monkey.jpeg
new file mode 100644
index 0000000..c8f6cf7
Binary files /dev/null and b/images/monkey.jpeg differ
diff --git a/images/monkeyhi.jpg b/images/monkeyhi.jpg
new file mode 100644
index 0000000..f71c969
Binary files /dev/null and b/images/monkeyhi.jpg differ
diff --git a/images/pana.png b/images/pana.png
new file mode 100644
index 0000000..355f1b9
Binary files /dev/null and b/images/pana.png differ
diff --git a/images/pier1.jpg b/images/pier1.jpg
new file mode 100644
index 0000000..f49c666
Binary files /dev/null and b/images/pier1.jpg differ
diff --git a/images/pier2.jpg b/images/pier2.jpg
new file mode 100644
index 0000000..f3e2090
Binary files /dev/null and b/images/pier2.jpg differ
diff --git a/images/pier3.jpg b/images/pier3.jpg
new file mode 100644
index 0000000..30e1aed
Binary files /dev/null and b/images/pier3.jpg differ
diff --git a/images/polar.jpg b/images/polar.jpg
new file mode 100644
index 0000000..baed443
Binary files /dev/null and b/images/polar.jpg differ
diff --git a/images/polarhi.jpg b/images/polarhi.jpg
new file mode 100644
index 0000000..6f650d7
Binary files /dev/null and b/images/polarhi.jpg differ
diff --git a/images/polarlow.jpg b/images/polarlow.jpg
new file mode 100644
index 0000000..ba8e0b2
Binary files /dev/null and b/images/polarlow.jpg differ
diff --git a/images/s.jpg b/images/s.jpg
new file mode 100644
index 0000000..4472ce4
Binary files /dev/null and b/images/s.jpg differ
diff --git a/images/s1.jpg b/images/s1.jpg
new file mode 100644
index 0000000..f4474a0
Binary files /dev/null and b/images/s1.jpg differ
diff --git a/images/s2.jpg b/images/s2.jpg
new file mode 100644
index 0000000..b59b7c5
Binary files /dev/null and b/images/s2.jpg differ
diff --git a/images/s3.jpg b/images/s3.jpg
new file mode 100644
index 0000000..ca9a13a
Binary files /dev/null and b/images/s3.jpg differ
diff --git a/images/sample.tif b/images/sample.tif
new file mode 100644
index 0000000..a7cc229
Binary files /dev/null and b/images/sample.tif differ
diff --git a/images/seam.jpg b/images/seam.jpg
new file mode 100644
index 0000000..540125f
Binary files /dev/null and b/images/seam.jpg differ
diff --git a/images/second.jpg b/images/second.jpg
new file mode 100644
index 0000000..729d876
Binary files /dev/null and b/images/second.jpg differ
diff --git a/images/station1.jpg b/images/station1.jpg
new file mode 100644
index 0000000..6b55deb
Binary files /dev/null and b/images/station1.jpg differ
diff --git a/images/station2.jpg b/images/station2.jpg
new file mode 100644
index 0000000..99b65d1
Binary files /dev/null and b/images/station2.jpg differ
diff --git a/images/third.jpg b/images/third.jpg
new file mode 100644
index 0000000..e79edef
Binary files /dev/null and b/images/third.jpg differ
diff --git a/images/utleft.jpg b/images/utleft.jpg
new file mode 100644
index 0000000..5cc9549
Binary files /dev/null and b/images/utleft.jpg differ
diff --git a/images/utright.jpg b/images/utright.jpg
new file mode 100644
index 0000000..a861f33
Binary files /dev/null and b/images/utright.jpg differ
diff --git a/macros/CascadeObjectDetector.bin b/macros/CascadeObjectDetector.bin
deleted file mode 100644
index cfda964..0000000
Binary files a/macros/CascadeObjectDetector.bin and /dev/null differ
diff --git a/macros/CascadeObjectDetector.sci b/macros/CascadeObjectDetector.sci
deleted file mode 100644
index 6f6335c..0000000
--- a/macros/CascadeObjectDetector.sci
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright (C) 2015 - 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: Nihar Rao
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-
-function [out,bbox]=CascadeObjectDetector(input_image,classifierList,varargin)
-// This function is used to detect objects in an image.
-//
-// Calling Sequence
-//
-// detect=CascadeObjectDetector(inputImage,classifierList);
-// detect=CascadeObjectDetector(inputImage,classifierList,scale);
-// detect=CascadeObjectDetector(inputImage,classifierList,scale,minNeighbors);
-// detect=CascadeObjectDetector(inputImage,classifierList,scale,minNeighbors,flags);
-// detect=CascadeObjectDetector(inputImage,classifierList,scale,minNeighbors,flags,minSize);
-// detect=CascadeObjectDetector(inputImage,classifierList,scale,minNeighbors,flags,minSize,maxSize);
-//
-// Parameters
-// out: the output image with all specified detections.
-// inputImage: input image on which the objects should be detected.
-// classifierList: a matrix of strings containing the location of the xml files which are to be used in the detection.
-// scale: Parameter specifying how much the image size is reduced at each image scale.
-// minNeighbors: Parameter specifying how many neighbors each candidate rectangle should have to retain it.
-// flags: the method used in detection.it should be either 1 or 4 or 2 or 8.
-// min size: Minimum possible object size. Objects smaller than that are ignored.
-// max size: Maximum possible object size. Objects larger than that are ignored.
-//
-// Description
-//
-// This function is used to detect objects in an image.
-//
-// Examples
-// // A example detecting all faces,eyes in an image.
-// //read the input image.
-// z=imread("oscarSelfie.jpg");
-// //increase stacksize of scilab
-// stacksize('max')
-// declare string martrix with the xml locations.Here the general opencv's .xml files are used.
-// s=["/home/nihar/Desktop/opencv/data/haarcascades/haarcascade_eye_tree_eyeglasses.xml" "/home/nihar/Desktop/opencv/data/haarcascades/haarcascade_frontalface_alt.xml"];
-// //call function
-// //Note:-the value of scale and other optional inputs must be adjusted to get proper/desired detection.
-// p=CascadeObjectDetector(z,s,1.05);
-// //show the detection
-//imshow(p);
-//
-// Detect only faces.
-//
-// //read the input image.
-// z=imread("oscarSelfie.jpg");
-// //increase stacksize of scilab
-// stacksize('max')
-// declare string martrix with the xml locations.Here the general opencv's .xml files are used.
-// s=["/home/nihar/Desktop/opencv/data/haarcascades/haarcascade_frontalface_alt.xml"];
-// //call function
-// //Note:-the value of scale and other optional inputs must be adjusted to get proper/desired detection.
-// p=CascadeObjectDetector(z,s,1.05);
-// //show the detection
-// imshow(p);
-
-
-
- input_image1=mattolist(input_image);
- [lhs rhs]=argn(0);
- if lhs>1
- error(msprintf(" Too many output arguments"));
- elseif rhs>7
- error(msprintf(" Too many input arguments"));
- elseif rhs<2
- error(msprintf("Too less arguments provided!,minimum is 2!"));
- end
- select rhs
- case 2 then
- [a,bbox]=raw_CascadeObjectDetector(input_image1,classifierList);
- case 3 then
- [a,bbox]=raw_CascadeObjectDetector(input_image1,classifierList,varargin(1));
- case 4 then
- [a,bbox]=raw_CascadeObjectDetector(input_image1,classifierList,varargin(1),varargin(2));
- case 5 then
- [a,bbox]=raw_CascadeObjectDetector(input_image1,classifierList,varargin(1),varargin(2),varargin(3));
- case 6 then
- [a,bbox]=raw_CascadeObjectDetector(input_image1,classifierList,varargin(1),varargin(2),varargin(3),varargin(4));
- case 7 then
- [a,bbox]=raw_CascadeObjectDetector(input_image1,classifierList,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5));
- end
- dimension=size(a)
- for i = 1:dimension
- out(:,:,i)=a(i);
- end
-
-endfunction;
diff --git a/macros/DCT.bin b/macros/DCT.bin
new file mode 100644
index 0000000..5ee5e5c
Binary files /dev/null and b/macros/DCT.bin differ
diff --git a/macros/DCT.sci b/macros/DCT.sci
new file mode 100644
index 0000000..5370a65
--- /dev/null
+++ b/macros/DCT.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2015 - 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: Deepshikha
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function [dstImg] = DCT(srcImg)
+ //Performs forward Discrete Cosine Transform of the 1D or 2D array.
+ //
+ //Calling Sequence
+ //dstMat = DCT(srcMat)
+ //
+ //Parameters
+ //srcMat : 1D or 2D floating type array
+ //dstMat : The output matrix
+ //
+ //Description
+ //dstMat = DCT(srcMat)
+ //Returns the DCT of the input matrix.
+ //
+ //Examples
+ //srcMat = [230.3 23.1 432.5; 321 543.1 89.5]
+ //dstMAt = DCT(srcMat)
+ //disp(dstMAt)
+ //Authors
+ // Deepshikha
+
+ srcMat = mattolist(srcImg)
+ output = raw_DCT(srcMat)
+
+ channels = size(output)
+
+ for i = 1:channels // for i channel image
+ dstImg(:,:,i) = output(i)
+ end
+endfunction
\ No newline at end of file
diff --git a/macros/FFT.bin b/macros/FFT.bin
new file mode 100644
index 0000000..1284f9a
Binary files /dev/null and b/macros/FFT.bin differ
diff --git a/macros/FFT.sci b/macros/FFT.sci
new file mode 100644
index 0000000..4017225
--- /dev/null
+++ b/macros/FFT.sci
@@ -0,0 +1,37 @@
+// Copyright (C) 2015 - 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: Sridhar Reddy
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function fourierTransform=FFT(inputMatrix)
+ // This function returns discrete Fourier Transform of 2D input matrix
+ //
+ // Calling Sequence
+ // fourierTransform=FFT(inputMatrix)
+ //
+ // Parameters
+ // inputMatrix: Input matrix must be 2-D.
+ //
+ // Description
+ // It returns the 2D discrete Fourier transform of two dimensional input matrix.
+ //
+ // Examples
+ // I=imread('images/lena.jpeg',0);
+ // I=double(I);
+ // fourier=FFT(I)
+ // imshow(fourier)
+ //Authors
+ // Sridhar Reddy
+
+ [rows cols channels]=size(inputMatrix);
+ if channels <> 1 then
+ error(msprintf("Wrong input, input must be 2-D matrix"));
+ end
+ fourierTransform=raw_FFT(inputMatrix);
+endfunction
diff --git a/macros/affine2d.bin b/macros/affine2d.bin
new file mode 100644
index 0000000..f403c1c
Binary files /dev/null and b/macros/affine2d.bin differ
diff --git a/macros/affine2d.sci b/macros/affine2d.sci
new file mode 100644
index 0000000..f42b6cb
--- /dev/null
+++ b/macros/affine2d.sci
@@ -0,0 +1,43 @@
+// Copyright (C) 2015 - 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: Yash S. Bhalgat
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function tform = affine2d(image)
+ //Creates an affine2d object for input 3x3 matrix.
+ //
+ //Calling Sequence
+ //y = affine2d(mat)
+ //
+ //Parameters
+ //mat : It is a 3x3 matrix which specifies forward affine2d transformation.
+ //y : an affine2d object with similar properties as the input.
+ //
+ //Description
+ //y = affine2d(mat) returns the affine2d object where a 3x3 numeric matrix is given as input
+ //It encapsulates 2d affine geometri transformation.
+ //
+ //Examples
+ //a=[1 2 0;3 4 0;5 1 1];
+ //y=affine2d(a);
+ //disp(y);
+ //Authors
+ // Yash S. Bhalgat
+
+
+ image_list = mattolist(image)
+
+ out = raw_affine2d(image)
+
+ sz = size(out)
+ for i=1:sz
+ tform(:, :, i) = out(i)
+ end
+
+endfunction
diff --git a/macros/arrowedline.bin b/macros/arrowedline.bin
deleted file mode 100644
index 3a7b2a0..0000000
Binary files a/macros/arrowedline.bin and /dev/null differ
diff --git a/macros/arrowedline.sci b/macros/arrowedline.sci
deleted file mode 100644
index 7ba5e46..0000000
--- a/macros/arrowedline.sci
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright (C) 2015 - 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: Nihar Rao
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function[dstImg] = arrowedline(srcImg, x1, y1, x2, y2, R, G, B, varargin)
-// This Function Draws a arrow segment pointing from the first point to the second one.
-//
-// Calling Sequence
-//
-// z=imread("lena.jpeg");
-// arrow=arrowedline(z,x1,y1,x2,y2,R,G,B);
-// arrow=arrowedline(z,x1,y1,x2,y2,R,G,B,thickness);
-// arrow=arrowedline(z,x1,y1,x2,y2,R,G,B,thickness,linetype);
-// arrow=arrowedline(z,x1,y1,x2,y2,R,G,B,thickness,linetype,shift);
-//
-// Parameters
-//
-// z: input image on which the arrowd line should be drawn.
-// arrow: the output image with the arrowed line drawn on it.
-// x1: x coordinate of first point
-// y1: y coordinate of first point
-// x2: x coordinate of second point
-// R: red color value of the circle.It should be in the range 0-255.
-// G: blue color value of the circle.It should be in the range 0-255.
-// B: green color value of the circle.It should be in the range 0-255.
-// thickness: Line thickness.
-// linetype: Type of the circle boundary.It can be 0 or 4 or 8.
-// shift: Number of fractional bits in the point coordinates.
-//
-// Description
-// This Function Draws a arrow segment pointing from the first point to the second one.
-//
-// Examples
-//
-// z=imread("lena.jpeg");
-// arrow=arrowedline(z,200,200,150,10,255,255,0,13);
-// imshow(arrow)
-
-
-
-
- [lhs, rhs] = argn(0)
-
- srcMat = mattolist(srcImg)
-
- select rhs
- case 8 then
- out = raw_arrowedline(srcMat, x1, y1, x2, y2, R, G, B)
- case 9 then
- out = raw_arrowedline(srcMat, x1, y1, x2, y2, R, G, B,varargin(1))
- case 10 then
- out = raw_arrowedline(srcMat, x1, y1, x2, y2, R, G, B, varargin(1),varargin(2))
- case 11 then
- out = raw_arrowedline(srcMat, x1, y1, x2, y2, R, G, B, varargin(1),varargin(2), varargin(3))
- case 12 then
- out = raw_arrowedline(srcMat, x1, y1, x2, y2, R, G, B, varargin(1),varargin(2), varargin(3), varargin(4))
- end
-
- channels = size(out)
-
- for i = 1:channels
- dstImg(:,:,i) = out(i)
- end
-endfunction
diff --git a/macros/bboxOverlapRatio.bin b/macros/bboxOverlapRatio.bin
new file mode 100644
index 0000000..e38f5ea
Binary files /dev/null and b/macros/bboxOverlapRatio.bin differ
diff --git a/macros/bboxOverlapRatio.sci b/macros/bboxOverlapRatio.sci
new file mode 100644
index 0000000..2d6e1f6
--- /dev/null
+++ b/macros/bboxOverlapRatio.sci
@@ -0,0 +1,53 @@
+// Copyright (C) 2015 - 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: Tanmay Chaudhari
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+ function [ out ] = bboxOverlapRatio(bboxA, bboxB, varargin)
+ // Compute the overlap ratio between the bounding boxes A and B.
+ //
+ // Calling Sequence
+ // [ overlapRatio ] = bboxOverlapRatio(bboxA, bboxB);
+ // [ overlapRatio ] = bboxOverlapRatio(bboxA, bboxB, ratioType);
+ //
+ // Parameters
+ // bboxA: Bounding box A of the form [x, y, width, height];
+ // bboxB: Boundng box B of the form [x, y, width, height];
+ // ratioType (Optional Argument): Method to be used to compute the ratio. Set this to either 'Union' or 'Min'. Default computation method is set to 'Union'.
+ // overlapRatio: Overlap ratio between the bounding boxes A and B.
+ //
+ // Description
+ // Compute the overlap ratio between the bounding boxes A and B.
+ //
+ // Examples
+ // bboxA = [1 2 3 4];
+ // bboxB = bboxA + 100;
+ // overlapRatioMin = bboxOverlapRatio(bboxA, bboxB, 'Min');
+ // overlapRatioUnion = bboxOverlapRatio(bboxA, bboxB);
+ //
+ // bboxA = [0 0 50 50];
+ // bboxB = [0 0 200 200];
+ // overlapRatioMin = bboxOverlapRatio(bboxA, bboxB, 'Min');
+ // overlapRatioUnion = bboxOverlapRatio(bboxA, bboxB);
+ //
+ // Authors
+ // Tanmay Chaudhari
+
+ [lhs rhs] = argn(0)
+ if rhs>3 then
+ error(msprintf("Too many input arguments"))
+ elseif rhs==3 then
+ a=raw_bboxOverlapRatio(bboxA,bboxB,varargin(1))
+ out=a
+ elseif rhs==2 then
+ a=raw_bboxOverlapRatio(bboxA,bboxB)
+ out=a
+ end
+
+endfunction
diff --git a/macros/blur.bin b/macros/blur.bin
deleted file mode 100644
index 17a7178..0000000
Binary files a/macros/blur.bin and /dev/null differ
diff --git a/macros/blur.sci b/macros/blur.sci
deleted file mode 100644
index b52c278..0000000
--- a/macros/blur.sci
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (C) 2015 - 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: Nihar Rao
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function [out]=blur(input_image ,ksize_width,ksize_height,anchorX,anchorY)
-// This function is used to blur an image using the normalized box filter.
-//
-// Calling Sequence
-// B = blur(input_image ,ksize_width,ksize_height,anchorX,anchorY);
-//
-// Parameters
-// A: image matrix of the source image.
-// ksize_width : Defines the width of the kernel to be used in pixels.
-// ksize_width : Defines the height of the kernel to be used in pixels.
-// anchorX : Indicates where the x coordinate of the anchor point (the pixel evaluated) is located with respect to the neighborhood. If there is a negative value, then the center of the kernel is considered the anchor point.
-// anchorY : Indicates where the y coordinate of the anchor point (the pixel evaluated) is located with respect to the neighborhood. If there is a negative value, then the center of the kernel is considered the anchor point.
-// B : output image with the applied blur fucntion.
-//
-// Description
-// The function smoothes an image using the kernel specified with its dimesnsions.
-//
-// Examples
-// i = imread('right1.jpg',0);
-// i2 =blur(i,5,5,1,1)
-// imshow(i2);
-//
-
- input_image1=mattolist(input_image);
- a=raw_blur(input_image1, ksize_width,ksize_height,anchorX,anchorY);
- dimension=size(a)
- for i = 1:dimension
- out(:,:,i)=a(i);
- end
-
-endfunction;
diff --git a/macros/boundingRect.bin b/macros/boundingRect.bin
deleted file mode 100644
index 2dffd9b..0000000
Binary files a/macros/boundingRect.bin and /dev/null differ
diff --git a/macros/boundingRect.sci b/macros/boundingRect.sci
deleted file mode 100644
index 400828e..0000000
--- a/macros/boundingRect.sci
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (C) 2015 - 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: Sukul Bagai
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-function [rectMat]=boundingRect(points)
-//this function Calculates the up-right bounding rectangle of a point set.
-//
-// Calling Sequence
-//
-// z=imread("lena.jpeg",0);
-// rect=boundingRect(points);
-//
-// Parameters
-//
-// rect: the rectangle coordinates
-// points: the set of 2D points. It must be N*2.
-//
-// Description
-//
-// Calculates the up-right bounding rectangle of a point set.
-//
-// Examples
-//
-// z=imread("lena.jpeg",0);
-// kaze=detectKAZEFeatures(z)x
-// rect=boundingRect(kaze.KeyPoints);
- rectMat=raw_boundingRect(points);
-endfunction
diff --git a/macros/calfocal.bin b/macros/calfocal.bin
new file mode 100644
index 0000000..25252ad
Binary files /dev/null and b/macros/calfocal.bin differ
diff --git a/macros/calfocal.sci b/macros/calfocal.sci
new file mode 100644
index 0000000..163c87b
--- /dev/null
+++ b/macros/calfocal.sci
@@ -0,0 +1,68 @@
+// Copyright (C) 2015 - 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: Manoj Sree Harsha
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function [res]=calfocal(image,varargin)
+ //Estimates focal lengths for each given camera.
+ //
+ //Calling Sequence
+ //res = calfocal(image1,image2)
+ //res = calfocal(image1,image2,image3)
+ //res = calfocal(image1,image2,image3,image4)
+ //res = calfocal(image1,image2,image3,image4,image5)
+ //res = calfocal(image1,image2,image3,image4,image5,image6)
+ //
+ //Parameters
+ //image1 : an image
+ //image2 : an image
+ //image3 : an image
+ //image4 : an image
+ //image5 : an image
+ //image6 : an image
+ //
+ //Description
+ //res = calfocal(image1,image2) return a 1x2 matrix.
+ //Features are extracted from each image and matching is done on two consecutive images to ensure the continuity in images.
+ //After this camera parameters are estimated along with their focal lengths are estimated.
+ //
+ //Examples
+ //a=imread('images/campus_000.jpg');
+ //b=imread('images/campus_001.jpg');
+ //res=calfocal(a,b);
+ //Authors
+ // Manoj Sree Harsha
+
+[lhs rhs]=argn(0)
+
+ if lhs>1
+ error(msprintf(" Too many output arguments"))
+ elseif rhs>6
+ error(msprintf(" Too many input arguments,maximum number of arguments is 6"))
+ elseif rhs<2
+ error(msprintf("the function needs atleast 2 arguments"))
+ end
+ image=mattolist(image)
+ for i=1:rhs-1
+ varargin(i)=mattolist(varargin(i))
+ end
+ if rhs==2
+ res=raw_focals(image,varargin(1))
+ elseif rhs==3
+ res=raw_focals(image,varargin(1),varargin(2))
+ elseif rhs==4
+ res=raw_focals(image,varargin(1),varargin(2),varargin(3))
+ elseif rhs==5
+ res=raw_focals(image,varargin(1),varargin(2),varargin(3),varargin(4))
+ elseif rhs==6
+ res=raw_focals(image,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5))
+ end
+
+ res=double(res)
+endfunction
diff --git a/macros/cameraMatrix.bin b/macros/cameraMatrix.bin
new file mode 100644
index 0000000..3d0ed1f
Binary files /dev/null and b/macros/cameraMatrix.bin differ
diff --git a/macros/cameraMatrix.sci b/macros/cameraMatrix.sci
new file mode 100644
index 0000000..7c7099c
--- /dev/null
+++ b/macros/cameraMatrix.sci
@@ -0,0 +1,39 @@
+// Copyright (C) 2015 - 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: Tanmay Chaudhari
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function [ camMatrix ] = cameraMatrix(instrinsicMatrix,rotationMatrix,translationVector)
+ // Returns camera projection matrix.
+ //
+ // Calling Sequence
+ // camMatrix = cameraMatrix(instrinsicMatrix,rotationMatrix,translationVector);
+ //
+ // Parameters
+ // camMatrix: A 4x3 camera projection matrix, which can be used to project 3-D world points in homogenous co-ordinates into an image.
+ // instrinsicMatrix: Projection matrix of size 3x3.
+ // rotationMatrix: A 3x3 matrix which specifies the rotation of a camera.
+ // translationVector: A 1x3 vector which specifies the translation of a camera.
+ //
+ // Description
+ // Return a matrix of size 4-by-3, which can be used to project 3-D world points in homogenous co-ordinates into an image.
+ //
+ // Examples
+ // instrinsicMatrix = [1 0 0; 1 2 0; 3 4 0];
+ // rotationMatrix = [ 0.1417 -0.7409 0.6565; 0.9661 -0.0410 -0.2548; 0.2157 0.6703 0.7100];
+ // translationVector = [ -29.2584 35.7824 725.5824];
+ // camMatrix = cameraMatrix(instrinsicMatrix,rotationMatrix,translationVector)
+ //
+ // Authors
+ // Tanmay Chaudhari
+
+ a=raw_cameraMatrix(instrinsicMatrix,rotationMatrix,translationVector);
+ camMatrix(:,:,1)=a(1);
+
+endfunction
diff --git a/macros/circle.bin b/macros/circle.bin
deleted file mode 100644
index 090afe5..0000000
Binary files a/macros/circle.bin and /dev/null differ
diff --git a/macros/circle.sci b/macros/circle.sci
deleted file mode 100644
index 918ea76..0000000
--- a/macros/circle.sci
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright (C) 2015 - 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: Abhilasha Sancheti & Nihar Rao
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-function [out]=circle(input_image , x_coordinate_of_centre , y_coordinate_centre , radius, r_value,g_value,b_value,varargin)
-// This function circle draws a simple or filled circle on an image with a given center and radius.
-//
-// Calling Sequence
-// cir=circle(inputImage,xcor,ycor,radius,r,g,b);
-// cir=circle(inputImage,xcor,ycor,radius,r,g,b,thickness);
-// cir=circle(inputImage,xcor,ycor,radius,r,g,b,thickness,linetype);
-// cir=circle(inputImage,xcor,ycor,radius,r,g,b,thickness,linetype,shift);
-//
-// Parameters
-// cir: The output image with the circle drawn in it.
-// inputImage: The input image on which the circle should be drawn.
-// xcor: X-coordinate of the center
-// ycor: Y-coordinate of the center
-// r: red color value of the circle.It should be in the range 0-255.
-// b: blue color value of the circle.It should be in the range 0-255.
-// g: green color value of the circle.It should be in the range 0-255.
-// thickness: Line thickness.
-// linetype: Type of the circle boundary.It can be 0 or 4 or 8.
-// shift: Number of fractional bits in the point coordinates.
-//
-// Description
-// This function circle draws a simple or filled circle on an image with a given center and radius.
-//
-//
-// Examples
-//
-// //read the input image
-// z=imread("lena.jpeg");
-// //call the function
-// cir=circle(z,100,100,15,255,0,0,1,8,0);
-// finally show the circle drawn
-// imshow(cir)
-
-
- input_image1=mattolist(input_image);
- [lhs,rhs]=argn(0);
- if lhs>1
- error(msprintf(" Too many output arguments"));
- elseif rhs>10
- error(msprintf(" Too many input arguments,maximum number of arguments is 10\n"));
- elseif rhs<7
- error(msprintf("the function needs atleast 11 arguments"));
- end
- if rhs==7
- a=raw_circle(input_image1 , x_coordinate_of_centre , y_coordinate_centre , radius, r_value,g_value,b_value);
- elseif rhs==8
- a=raw_circle(input_image1 , x_coordinate_of_centre , y_coordinate_centre , radius, r_value,g_value,b_value,varargin(1));
- elseif rhs==9
- a=raw_circle(input_image1 , x_coordinate_of_centre , y_coordinate_centre , radius, r_value,g_value,b_value,varargin(1),varargin(2));
- elseif rhs==10
- a=raw_circle(input_image1 , x_coordinate_of_centre , y_coordinate_centre , radius, r_value,g_value,b_value,varargin(1),varargin(2),varargin(3));
- end
- dimension=size(a);
- for i = 1:dimension
- out(:,:,i)=a(i);
- end
-
-endfunction;
diff --git a/macros/convolver.bin b/macros/convolver.bin
new file mode 100644
index 0000000..f975025
Binary files /dev/null and b/macros/convolver.bin differ
diff --git a/macros/convolver.sci b/macros/convolver.sci
new file mode 100644
index 0000000..b73283c
--- /dev/null
+++ b/macros/convolver.sci
@@ -0,0 +1,44 @@
+// Copyright (C) 2015 - 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: Kevin George , Manoj Sree Harsha
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function [output] = convolver(image1,ksize,values1,scalar)
+ //Convolves an image with the kernel.
+ //
+ //Calling Sequence
+ //out_image = convolver(in_image,ksize,kvalues,scalar)
+ //
+ //Parameters
+ //in_image : an image
+ //out_image : the output image
+ //ksize : kernel size (belongs to {3,4,5})
+ //kvalues : kernel matrix values
+ //scalar : any floating value
+ //
+ //Description
+ //out_image = convolver(in_image,ksize,kvalues,scalar)
+ //Returns the convoluted image of the input image. It uses filter2d function to perform convolution.
+ //The convolution is with the given kernel.
+ //
+ //Examples
+ //a = imread('images/lena.jpeg')
+ //b=[1 1 1;1 1 1;1 1 1]
+ //y=convolver(a,3,b,9)
+ //imshow(y)
+ //Authors
+ // Kevin George , Manoj Sree Harsha
+
+ image = mattolist(image1)
+ a = raw_convolver(image,ksize,values1,scalar);
+ d = size(a);
+ for i = 1:d
+ output(:,:,i) = a(i);
+ end
+endfunction
diff --git a/macros/cornerEigenValsAndVecs.bin b/macros/cornerEigenValsAndVecs.bin
new file mode 100644
index 0000000..69f8ff4
Binary files /dev/null and b/macros/cornerEigenValsAndVecs.bin differ
diff --git a/macros/cornerEigenValsAndVecs.sci b/macros/cornerEigenValsAndVecs.sci
new file mode 100644
index 0000000..c596896
--- /dev/null
+++ b/macros/cornerEigenValsAndVecs.sci
@@ -0,0 +1,46 @@
+// Copyright (C) 2015 - 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: Shubheksha Jalan
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function [outputImg]= cornerEigenValsAndVecs(inputImage, blockSize, kSize, borderType)
+ //Calculates eigenvalues and eigenvectors of image blocks for corner detection.
+ //
+ //Calling Sequence
+ //inputImage=imread('path of the image file')
+ //outputImg = cornerEigenValsAndVecs(inputImage, blockSize, kSize, borderType)
+ //imshow(outputImg)
+ //
+ //Parameters
+ //inputImage : an image.
+ //blockSize : Neighborhood size
+ //kSize : Aperture parameter for the Sobel() operator.
+ //borderType : Pixel extrapolation method
+ //
+ //Description
+ //outputImg = cornerEigenValsAndVecs(inputImage, blockSize, kSize, borderType)
+ //For every pixel p , the function cornerEigenValsAndVecs considers a blockSize x blockSize neighborhood S(p) . It calculates the covariation matrix of derivatives over the neighbourhood
+ //After that, it finds eigenvectors and eigenvalues and stores them in the destination image(outputImg).
+ //
+ //Examples
+ //inputImage=imread('images/lena.jpeg');
+ //blockSize = 7;
+ //kSize=3;
+ //borderType="BORDER_DEFAULT"
+ //outputImg=cornerEigenValsAndVecs(inputImage, blockSize, kSize, borderType);
+ //imshow(outputImg)
+ //Authors
+ // Shubheksha Jalan
+
+ inputList=mattolist(inputImage);
+ outputList=raw_cornerEigenValsAndVecs(inputList, blockSize, kSize, borderType);
+ for i=1:size(outputList)
+ outputImg(:,:,i)=outputList(i)
+ end
+endfunction
diff --git a/macros/cornerHarris.bin b/macros/cornerHarris.bin
new file mode 100644
index 0000000..b7d6c4a
Binary files /dev/null and b/macros/cornerHarris.bin differ
diff --git a/macros/cornerHarris.sci b/macros/cornerHarris.sci
new file mode 100644
index 0000000..5c03ef1
--- /dev/null
+++ b/macros/cornerHarris.sci
@@ -0,0 +1,48 @@
+// Copyright (C) 2015 - 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: Shubheksha Jalan
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function [outputImg]= cornerHarris(inputImage, blockSize, kSize, k, borderType)
+ //Harris edge detector.
+ //
+ //Calling Sequence
+ //inputImage=imread('path of the image file')
+ //outputImg = cornerHarris(inputImage, blockSize, kSize, k, borderType)
+ //imshow(outputImg)
+ //
+ //Parameters
+ //inputImage : an image.
+ //blockSize : Neighborhood size
+ //kSize : Aperture parameter for the Sobel() operator.
+ //k : Harris detector free parameter.
+ //borderType : Pixel extrapolation method
+ //
+ //Description
+ //outputImg = cornerHarris(inputImage, blockSize, kSize, k, borderType)
+ //This function runs the Harris edge detector on the image.
+ //outputImg is used to store the Harris detector responses
+ //
+ //Examples
+ //inputImage=imread('images/lena.jpeg');
+ //blockSize = 7;
+ //kSize=3;
+ //k=0.04;
+ //borderType="BORDER_DEFAULT"
+ //outputImg=cornerHarris(inputImage, blockSize, kSize, k, borderType);
+ //imshow(outputImg)
+ //Authors
+ // Shubheksha Jalan
+
+ inputList=mattolist(inputImage);
+ outputList=raw_cornerHarris(inputList, blockSize, kSize, k, borderType);
+ for i=1:size(outputList)
+ outputImg(:,:,i)=outputList(i)
+ end
+endfunction
diff --git a/macros/cornerMinEigenVal.bin b/macros/cornerMinEigenVal.bin
new file mode 100644
index 0000000..3556873
Binary files /dev/null and b/macros/cornerMinEigenVal.bin differ
diff --git a/macros/cornerMinEigenVal.sci b/macros/cornerMinEigenVal.sci
new file mode 100644
index 0000000..8f3904e
--- /dev/null
+++ b/macros/cornerMinEigenVal.sci
@@ -0,0 +1,47 @@
+// Copyright (C) 2015 - 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: Shubheksha Jalan
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function [outputImg]= cornerMinEigenVal(inputImage, blockSize, kSize, borderType)
+ //Calculates the minimal eigenvalue of gradient matrices for corner detection.
+ //
+ //Calling Sequence
+ //inputImage=imread('path of the image file')
+ //outputImg = cornerMinEigenVal(inputImage, blockSize, kSize, borderType)
+ //imshow(outputImg)
+ //
+ //Parameters
+ //inputImage : an image.
+ //blockSize : Neighborhood size
+ //kSize : Aperture parameter for the Sobel() operator.
+ //borderType : Pixel extrapolation method
+ //
+ //Description
+ //outputImg = cornerMinEigenVal(inputImage, blockSize, kSize, borderType)
+ //The function is similar to cornerEigenValsAndVecs() but it calculates only the minimal eigenvalue of the covariance matrix of derivatives.
+ //After that, it stores them in the destination image(outputImg).
+ //
+ //Examples
+ //inputImage=imread('images/lena.jpeg');
+ //blockSize = 7;
+ //kSize=3;
+ //k=0.04;
+ //borderType="BORDER_DEFAULT"
+ //outputImg=cornerMinEigenVal(inputImage, blockSize, kSize, borderType);
+ //imshow(outputImg)
+ //Authors
+ // Shubheksha Jalan
+
+ inputList=mattolist(inputImage);
+ outputList=raw_cornerMinEigenVal(inputList, blockSize, kSize, borderType);
+ for i=1:size(outputList)
+ outputImg(:,:,i)=outputList(i)
+ end
+endfunction
diff --git a/macros/correctMatches.bin b/macros/correctMatches.bin
deleted file mode 100644
index 34d6e5c..0000000
Binary files a/macros/correctMatches.bin and /dev/null differ
diff --git a/macros/correctMatches.sci b/macros/correctMatches.sci
deleted file mode 100644
index 7dfc2da..0000000
--- a/macros/correctMatches.sci
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright (C) 2015 - 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: Nihar Rao
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function [newPoints1, newPoints2] = correctMatches(F, points1, points2)
-// This function Refines coordinates of corresponding points
-//
-// Calling Sequence
-// [newPoints1, newPoints2] = correctMatches(F, points1, points2)
-//
-// Parameters
-// F – 3x3 fundamental matrix.
-// points1 – 2xN array containing the first set of points.
-// points2 – 2xN array containing the second set of points.
-// newPoints1 – The optimized points1.
-// newPoints2 – The optimized points2.
-//
-// Description
-// The function implements the Optimal Triangulation Method (see Multiple View Geometry for details). For each given point correspondence points1[i] <-> points2[i], and a fundamental matrix F, it computes the corrected correspondences newPoints1[i] <-> newPoints2[i] that minimize the geometric error d(points1[i], newPoints1[i])^2 + d(points2[i],newPoints2[i])^2 (where d(a,b) is the geometric distance between points a and b ) subject to the epipolar constraint newPoints2^T * F * newPoints1 = 0 .
-//
-// Examples
-// //read first image
-// I=imread("oscarSelfie.jpg",0);
-// //increase stack size of scilab
-// stacksize('max')
-// // get points from first image
-// cornerPoints1=detectMSERFeatures(I);
-// //read second image
-// I2=imread("oscarSelfie.jpg",0);
-// //get points for 2nd image
-// cornerPoints2=detectMSERFeatures(I2);
-// fundamentalMat=estimateFundamentalMat(cornerPoints1.Location,cornerPoints2.Location);
-// [new1 new2]=correctMatches(fundamentalMat,cornerPoints2.Location,cornerPoints1.Location);
- [lhs rhs]=argn(0);
-
- if lhs>2
- error(msprintf(" Too many output arguments,maximum number of output arguments is 2"));
- elseif rhs>3
- error(msprintf(" Too many input arguments,maximum number of arguments is 3`"));
- elseif rhs<3
- error(msprintf("the function needs atleast 3 arguments"));
- end
-
- [newPoints1, newPoints2]=raw_correctMatches(F, points1, points2);
-
-
-
-endfunction
diff --git a/macros/cvtColor.bin b/macros/cvtColor.bin
deleted file mode 100644
index be515eb..0000000
Binary files a/macros/cvtColor.bin and /dev/null differ
diff --git a/macros/cvtColor.sci b/macros/cvtColor.sci
deleted file mode 100644
index 6f235e2..0000000
--- a/macros/cvtColor.sci
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (C) 2015 - 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: Shubheksha Jalan & Nihar Rao
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function new_image = cvtColor(image, code, varargin)
-// This function is used to transform a image from one space to other like rgb to gray and vice versa.
-//
-// Calling Sequence
-//
-// inputImage=imread("lena.jpeg");
-// outputImage=cvtColor(inputImage,codeString);
-// outputImage=cvtColor(inputImage,codeString,dstCn);
-//
-//
-// Parameters
-// dstCn: number of channels in the destination image; if the parameter is 0, the number of the channels is derived automatically from src and code
-// codeString: A string which specifies the type of conversion.The different types are listed below.
-// "CV_BGR2GRAY": Conversion is from BGR(blue-green-red) space to GRAY.
-// "CV_RGB2GRAY": Conversion is from RGB(red-green-blue) space to GRAY.
-// "CV_GRAY2BGR": Conversion is from BGR(blue-green-red) space.
-// "CV_GRAY2RGB": Conversion is from to GRAY to RGB(blue-green-red) space.
-// "CV_BGR2XYZ" : Conversion is from BGR(blue-green-red) space to CIE XYZ.
-// "CV_RGB2XYZ" : Conversion is from RGB(red-green-blue) space to CIE XYZ.
-// "CV_XYZ2BGR" : Conversion is from to CIE XYZ to BGR space.
-// "CV_XYZ2RGB" : Conversion is from to CIE XYZ to RGB(red-green-blue) space.
-// "CV_BGR2YCrCb": Conversion is from BGR(blue-green-red) space to luma-chroma.
-// "CV_RGB2YCrCb" :Conversion is from RGB(red-green-blue) space to luma chroma.
-// "CV_YCrCb2BGR" :Conversion is from luma-chroma to BGR(blue-green-red) space.
-// "CV_YCrCb2RGB" :Conversion is from luma-chroma to RGB(red-green-blue) space.
-// "CV_BGR2HSV": Conversion is from BGR(blue-green-red) space to HSV.
-// "CV_RGB2HSV": Conversion is from RGB space to HSV.
-// "CV_HSV2BGR": Conversion is from to HSV to BGR(blue-green-red) space.
-// "CV_HSV2RGB": Conversion is from to HSV to RGB(red-green-blue) space.
-// "CV_BGR2HLS": Conversion is from BGR(blue-green-red) space to HLS.
-// "CV_RGB2HLS": Conversion is from RGB space to HSV.
-// "CV_HLS2BGR": Conversion is from HLS to BGR(blue-green-red) space.
-// "CV_HLS2RGB": Conversion is from HLS to RGB(red-green-blue) space.
-// "CV_BGR2Lab": Conversion is from BGR(blue-green-red) space to CIE Lab.
-// "CV_RGB2Lab": Conversion is from RGB space to CIE Lab.
-// "CV_Lab2BGR": Conversion is from CIE Lab to BGR(blue-green-red) space.
-// "CV_Lab2RGB": Conversion is from CIE Lab to RGB space.
-// "CV_BGR2Luv": Conversion is from BGR(blue-green-red) space to CIE Luv.
-// "CV_RGB2Luv": Conversion is from RGB space to CIE Luv.
-// "CV_Luv2BGR": Conversion is from CIE Luv to BGR(blue-green-red) space.
-// "CV_Luv2RGB": Conversion is from CIE Luv to RGB space.
-//
-// Description
-//
-// This function is used to transform a image from one space to other like rgb to gray and vice versa.
-//
-// Examples
-//
-// z=imread("lena.jpeg",0);
-// ss=cvtColor(z,"CV_GRAY2BGR");
-// imshow(ss)
-
-
-
- [ lhs, rhs ] = argn(0)
-
- image_list = mattolist(image)
-
- select rhs
- case 2 then
-
- out = raw_cvtColor(image_list, code)
-
- case 3 then
- out = raw_cvtColor(image_list, code, varargin(1))
- end
-
- sz=size(out);
- for i=1:sz
- new_image(:, :, i) = out(i)
- end
-
-endfunction
diff --git a/macros/deconvlucy.bin b/macros/deconvlucy.bin
deleted file mode 100644
index 2886042..0000000
Binary files a/macros/deconvlucy.bin and /dev/null differ
diff --git a/macros/deconvlucy.sci b/macros/deconvlucy.sci
deleted file mode 100644
index 547a27c..0000000
--- a/macros/deconvlucy.sci
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (C) 2015 - 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: Nihar Rao
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function [out]=deconvlucy(image1,image2,varargin)
-// This function is used to Deblur image using Lucy-Richardson method
-//
-// Calling Sequence
-// J = deconvlucy(I1, I2);
-// J = deconvlucy(I1, I2, NUMIT)
-//
-// Parameters
-// I1: image matrix of the source image .
-// I2: image matrix of the source image from last iteraion.
-// NUMIT: The number if iterations specified to achieve the desired result.
-// B : output image in the deconvoluted form.
-//
-// Description
-// J = deconvlucy(I, PSF, NUMIT) specifies the number of iterations the deconvlucy function performs. If this value is not specified, the default is 10.
-//
-// Examples
-// i = imread("lena.jpeg",0);
-// i1 = imread("lena.jpeg",0);
-// rs = deconvlucy(i,i1);
-//
-
-
-
- input_image1=mattolist(image1);
- input_image2=mattolist(image2);
- [lhs,rhs]=argn(0);
- if lhs>1
- error(msprintf(" Too many output arguments"));
- elseif rhs>3
- error(msprintf(" Too many input arguments,maximum number of arguments is 3\n"));
- elseif rhs<2
- error(msprintf("the function needs atleast 2 arguments"));
- end
- if rhs==2
- a=raw_deconvlucy(input_image1,input_image2);
- elseif rhs==3
- a=raw_deconvlucy(input_image1,input_image2,varargin(1));
- end
-
- dimension=size(a)
- for i = 1:dimension
- out(:,:,i)=a(i);
- end
-
-
-endfunction
diff --git a/macros/demosaic.bin b/macros/demosaic.bin
deleted file mode 100644
index 6ae4b9f..0000000
Binary files a/macros/demosaic.bin and /dev/null differ
diff --git a/macros/demosaic.sci b/macros/demosaic.sci
deleted file mode 100644
index c006a19..0000000
--- a/macros/demosaic.sci
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright (C) 2015 - 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: V Srininivas
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function [out]=demosaic(src,code,dstCn)
-// This function converts the Bayer pattern encoded image to the truecolor image, RGB.
-//
-// Calling Sequence
-// image=imread("lena.jpeg",0)
-// dem=demosaic(image,"gbrg");
-// dem=demosaic(image,"bggr");
-// dem=demosaic(image,"rggb");
-// dem=demosaic(image,"grbg");
-//
-// Parameters
-//
-// dem: the output image
-// image: the image which should be converted.
-//
-// Description
-//
-// This function converts the Bayer pattern encoded image to the truecolor image, RGB.
-//
-// Examples
-//
-// z=imread("lena.jpeg");
-// dem=demosaic(z,"rggb");
-// imshow(dem);
-
-
- input_image1=mattolist(src);
- a=raw_demosaic( input_image1,code);
- dimension=size(a)
- for i = 1:dimension
- out(:,:,i)=a(i);
- end
-endfunction;
diff --git a/macros/detectGFTTFeatures.bin b/macros/detectGFTTFeatures.bin
deleted file mode 100644
index 3a9b4ff..0000000
Binary files a/macros/detectGFTTFeatures.bin and /dev/null differ
diff --git a/macros/detectGFTTFeatures.sci b/macros/detectGFTTFeatures.sci
deleted file mode 100644
index 63676bb..0000000
--- a/macros/detectGFTTFeatures.sci
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright (C) 2015 - 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: Nihar Rao
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-function [varargout] = detectGFTTFeatures(image, varargin)
-// This function is used to detect GFTT Features in a grayscale Image.
-//
-// Calling Sequence
-// result = detectGFTTFeatures(Image);
-// result = detectGFTTFeatures(Image,Name,Value,....)
-//
-// Parameters
-// result: a struct containing features and keypoints
-// Image: a grayscale image whose GFTT features is to be found
-// blocksize: the blocksize to be used for detecting the keypoints
-// minDistance: the minimum distance between the points for feature computation
-// useHarrisDetector: an option to use the HarrisDetector.default value is false.
-// maxCorners: the maximum number of corners that should be used for feature computation.
-// ROI or Mask : (Optional) Region Of Interest. This is taken as a vector [u v width height]. When specified, the function detects the key points within region of area width*height with u and v being the top left corner coordinates.
-// Description
-// This function is used to detect GFTT Features in a grayscale Image.
-// Examples
-//
-// //read image in grayscale
-// z=imread("people.jpg",0);
-// image=imread("pls.jpg",0);
-// stacksize('max')
-// //call the function to detect features for image- z
-// pls=detectGFTTFeatures(z,"minDistance",4);
-// // call the function to detect features for image- image
-// pls1=detectGFTTFeatures(image);
-// //match features using the features detected using the above function
-// [op ir]=matchFeatures(pls.Features,pls1.Features);
-// //finally draw those matches
-// final=drawMatch(z,image,pls.KeyPoints,pls1.KeyPoints,op,ir);
-// imshow(final)
-
-
-
- image_list = mattolist(image);
- [ lhs, rhs ] = argn(0)
- if rhs > 15 then
- error(msprintf("Too many input arguments"))
- end
- if lhs > 1 then
- error(msprintf("Too many output arguments"))
- end
-
- select rhs
- case 1 then
- [a b c d e]= raw_detectGFTTFeatures(image_list)
- case 3 then
- [a b c d e]= raw_detectGFTTFeatures(image_list, varargin(1), varargin(2))
- case 5 then
- [a b c d e]= raw_detectGFTTFeatures(image_list, varargin(1), varargin(2), varargin(3), varargin(4))
- case 7 then
- [a b c d e]= raw_detectGFTTFeatures(image_list, varargin(1), varargin(2), varargin(3), varargin(4), varargin(5), varargin(6))
- case 9 then
- [a b c d e]= raw_detectGFTTFeatures(image_list, varargin(1), varargin(2), varargin(3), varargin(4), varargin(5), varargin(6), varargin(7), varargin(8))
- case 11 then
- [a b c d e]= raw_detectGFTTFeatures(image_list, varargin(1), varargin(2), varargin(3), varargin(4), varargin(5), varargin(6), varargin(7), varargin(8),varargin(9),varargin(10))
- case 13 then
- [a b c d e]= raw_detectGFTTFeatures(image_list, varargin(1), varargin(2), varargin(3), varargin(4), varargin(5), varargin(6), varargin(7), varargin(8),varargin(9),varargin(10),varargin(11),varargin(12));
- case 15 then
- [a b c d e]= raw_detectGFTTFeatures(image_list, varargin(1), varargin(2), varargin(3), varargin(4), varargin(5), varargin(6), varargin(7), varargin(8),varargin(9),varargin(10),varargin(11),varargin(12),varargin(13),varargin(14));
-
- end
-varargout(1) = struct("Type","binaryFeatures",'Features',a,'NumBits',b,'NumFeatures',c,'KeyPoints',d,'keypointsCount',e);
-endfunction
diff --git a/macros/detectKAZEFeatures.bin b/macros/detectKAZEFeatures.bin
deleted file mode 100644
index a837f08..0000000
Binary files a/macros/detectKAZEFeatures.bin and /dev/null differ
diff --git a/macros/detectKAZEFeatures.sci b/macros/detectKAZEFeatures.sci
deleted file mode 100644
index 37f6170..0000000
--- a/macros/detectKAZEFeatures.sci
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright (C) 2015 - 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: Nihar Rao
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-function [varargout] = detectKAZEFeatures(image, varargin)
-// This function is used to detect KAZE Features in a grayscale Image.
-//
-// Calling Sequence
-// result = detectKAZEFeatures(Image);
-// result = detectKAZEFeatures(Image,Name,Value,....)
-// Parameters
-// result=a struct containing features and keypoints
-// Image=a grayscale image whose KAZE features is to be found
-// extended-Set to enable extraction of extended (128-byte) descriptor.
-// upright-Set to enable use of upright descriptors (non rotation-invariant)
-// Threshold-response threshold to accept point
-// NumLayers-Default number of sublevels per scale level
-// NumOctaves : (Optional)The number of Octaves that the detector uses. (Default - 4) The value must be an integer scalar in between 1 and 4.
-// diffusivity:-KAZE's diffusivity'
-// ROI or Mask : (Optional) Region Of Interest. This is taken as a vector [u v width height]. When specified, the function detects the key points within region of area width*height with u and v being the top left corner coordinates.
-//
-//
-// Description
-// This function is used to detect KAZE Features in a grayscale Image.
-//
-// Examples
-//
-// //read image in grayscale
-// z=imread("people.jpg",0);
-// image=imread("pls.jpg",0);
-// stacksize('max')
-// //call the function to detect features for image- z
-// pls=detectKAZEFeatures(z,"diffusivity",2.1);
-// // call the function to detect features for image- image
-// pls1=detectKAZEFeatures(image);
-// //match features using the features detected using the above function
-// [op ir]=matchFeatures(pls.Features,pls1.Features);
-// //finally draw those matches
-// final=drawMatch(z,image,pls.KeyPoints,pls1.KeyPoints,op,ir);
-// imshow(final)
-
-
-
- image_list = mattolist(image);
- [ lhs, rhs ] = argn(0)
- if rhs > 15 then
- error(msprintf("Too many input arguments"))
- end
- if lhs > 1 then
- error(msprintf("Too many output arguments"))
- end
-
- select rhs
- case 1 then
- [a b c d e]= raw_detectKAZEFeatures(image_list)
- case 3 then
- [a b c d e]= raw_detectKAZEFeatures(image_list, varargin(1), varargin(2))
- case 5 then
- [a b c d e]= raw_detectKAZEFeatures(image_list, varargin(1), varargin(2), varargin(3), varargin(4))
- case 7 then
- [a b c d e]= raw_detectKAZEFeatures(image_list, varargin(1), varargin(2), varargin(3), varargin(4), varargin(5), varargin(6))
- case 9 then
- [a b c d e]= raw_detectKAZEFeatures(image_list, varargin(1), varargin(2), varargin(3), varargin(4), varargin(5), varargin(6), varargin(7), varargin(8))
- case 11 then
- [a b c d e]= raw_detectKAZEFeatures(image_list, varargin(1), varargin(2), varargin(3), varargin(4), varargin(5), varargin(6), varargin(7), varargin(8),varargin(9),varargin(10))
- case 13 then
- [a b c d e]= raw_detectKAZEFeatures(image_list, varargin(1), varargin(2), varargin(3), varargin(4), varargin(5), varargin(6), varargin(7), varargin(8),varargin(9),varargin(10),varargin(11),varargin(12));
- case 15 then
- [a b c d e]= raw_detectKAZEFeatures(image_list, varargin(1), varargin(2), varargin(3), varargin(4), varargin(5), varargin(6), varargin(7), varargin(8),varargin(9),varargin(10),varargin(11),varargin(12),varargin(13),varargin(14));
-
- end
-varargout(1) = struct("Type","binaryFeatures",'Features',a,'NumBits',b,'NumFeatures',c,'KeyPoints',d,'keypointsCount',e);
-endfunction
diff --git a/macros/detectMSERFeatures.bin b/macros/detectMSERFeatures.bin
deleted file mode 100644
index a569805..0000000
Binary files a/macros/detectMSERFeatures.bin and /dev/null differ
diff --git a/macros/detectMSERFeatures.sci b/macros/detectMSERFeatures.sci
deleted file mode 100644
index 358c1ce..0000000
--- a/macros/detectMSERFeatures.sci
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (C) 2015 - 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: Umang Agarwal & Sridhar Reddy
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-function [regions]=detectMSERFeatures(image,varargin)
-// This function is used to detect MSER features
-//
-// Calling Sequence
-// list_pixels = detectMSERFeatures(image, Name, Value... )
-// [list_pixels Count Location Axes Orientation] = detectMSERFeatures(image, Name, Value... )
-//
-// Parameters
-// Image: Input Image, should be a 2-D grayscale. The Input Image should be real
-// ThresholdDelta [Optional Input Argument]: Step Size between intensity to be checked for measurement of stability. Values: Percentage numeric value. Default: 2.0
-// RegionAreaRange [Optional Input Argument]: Size of the region in Pixels specified as [minArea maxArea]. Default Value: [30 14000]
-// ROI [Optional Input Argument]: Specify a rectangular region of operation. Format [ x y width height ]. Default: [1 1 size(Image,2) size(Image,1)]
-// MaxAreaVariation [Optional Input Argument]: Maximum Area Variation between external regions at varying thresholds for determination of stability. Values in range of (0,1]. Default 0.25
-// list_pixels: Array of point coordinates for detected regions
-// Location: A M-by-2 Matrix of [x y] coordinates of centroid of the ellipsoidal fit to the region
-// Count: Count of the number of stable regions detected
-// Axes: A M-by-2 Matrix of [majorAxis minorAxis] values for each ellipsoidal fit to the detected regions
-// Orientation: A M-by-1 Vector containing the angle of orientation of the ellipsoidal fit in the range of [-pi/2 +pi/2] radians
-//
-// Description
-// This function is used to detect the MSER regions, and also the corresponding ellipsoidal fit to the detected regions.
-//
-// Examples
-// image = imread('sample.jpg');
-// [regions] = detectMSERFeatures(image);
-//
-// With Optional Arguments:
-// [regions location axes] = detectMSERFeatures(image, "ThresholdDelta", 10.0)
-//
-
-
- [lhs rhs]=argn(0);
- if rhs>9
- error(msprintf(" Too many input arguments"));
- elseif modulo(rhs-1,2)<>0
- error(msprintf("Either Argument Name or its Value missing"));
- end
- imageList=mattolist(image);
- select rhs-1
- case 0 then
- [pixelIdxList count location axes orientation]=raw_detectMSERFeatures(imageList);
- case 2 then
- [pixelIdxList count location axes orientation]=raw_detectMSERFeatures(imageList,varargin(1),varargin(2));
- case 4 then
- [pixelIdxList count location axes orientation]=raw_detectMSERFeatures(imageList,varargin(1),varargin(2),varargin(3),varargin(4));
- case 6 then
- [pixelIdxList count location axes orientation]=raw_detectMSERFeatures(imageList,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6));
- case 8 then
- [pixelIdxList count location axes orientation]=raw_detectMSERFeatures(imageList,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6),varargin(7),varargin(8));
- end
- //for i=1:size(pixelIdxList)
- // regions(i)=struct('Count',1,'Location',location(i,:),'Axes',axes(i,:),'Orientation',orientation(i,:),'PixelIdxList',pixelIdxList(i));
- //end
- regions=struct('Type','MSERObject','Count',count,'Location',location,'Axes',axes,'Orientation',orientation,'PixelIdxList',pixelIdxList),
-endfunction
diff --git a/macros/detectMinEigenFeatures.bin b/macros/detectMinEigenFeatures.bin
deleted file mode 100644
index 9bc5a3a..0000000
Binary files a/macros/detectMinEigenFeatures.bin and /dev/null differ
diff --git a/macros/detectMinEigenFeatures.sci b/macros/detectMinEigenFeatures.sci
deleted file mode 100644
index 5a6ad2a..0000000
--- a/macros/detectMinEigenFeatures.sci
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright (C) 2015 - 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: Rohit Suri & Sridhar Reddy
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function [cornerPoints]=detectMinEigenFeatures(image,varargin)
-// This function is used to find corner points in an image using Minimum Eigen Value algorithm.
-//
-// Calling Sequence
-// points = detectMinEigenFeatures(I);
-// points = detectMinEigenFeatures(I, Name, Value, ...);
-//
-// Parameters
-// points: Structure of corner points
-// I: Input image to detectHarrisFeatures()
-// MinQuality: (Optional) Minimum accepted quality of corners (Default- 0.01)
-// FilterSize: (Optional) Dimension of Gaussian Filter (Default: 5)
-// ROI: (Optional) Rectangular region for corner detection
-//
-// Description
-// This function detects corners in an image I. These corner points are used to extract features and hence recognize the contents of an image.
-//
-// Examples
-// I = imread('sample.jpg');
-// points = detectMinEigenFeatures(I);
-//
-
-
- [lhs rhs]=argn(0);
- if lhs>1
- error(msprintf(" Too many output arguments"));
- elseif rhs>7
- error(msprintf(" Too many input arguments"));
- elseif modulo(rhs,2)==0
- error(msprintf("Either Argument Name or its Value missing"));
- end
- imageList=mattolist(image);
- select rhs-1
- case 0 then
- [location metric count]=raw_detectMinEigenFeaturess(imageList);
- case 2 then
- [location metric count]=raw_detectMinEigenFeatures(imageList,varargin(1),varargin(2));
- case 4 then
- [location metric count]=raw_detectMinEigenFeatures(imageList,varargin(1),varargin(2),varargin(3),varargin(4));
- case 6 then
- [location metric count]=raw_detectMinEigenFeatures(imageList,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6));
- end
- //disp(count(1,1));
- cornerPoints=struct('Type','cornerPoints','Location',location,'Metric',metric,'Count',count);
- //for i=1:count(1,1)
- // cornerPoints(i)=struct('Type','cornerPoints','Location',location(i,:),'Metric',metric(i,:),'Count',1);
- //end
-endfunction
diff --git a/macros/ellipse.bin b/macros/ellipse.bin
deleted file mode 100644
index bdf3b7c..0000000
Binary files a/macros/ellipse.bin and /dev/null differ
diff --git a/macros/ellipse.sci b/macros/ellipse.sci
deleted file mode 100644
index 3dece5c..0000000
--- a/macros/ellipse.sci
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright (C) 2015 - 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: Sukul Bagai
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-function [out]=ellipse(input_image , x_coordinate_of_centre , y_coordinate_centre , first_axis, second_axis, angle, startAngle, endAngle, r_value,g_value,b_value,varargin)
-// This function draws a simple or thick elliptic arc or fills an ellipse sector.
-//
-//
-// Calling Sequence
-// elli=ellipse(inputImage,xcor,ycor,firstAxis,secondAxis,angle,startAngle,endAngle,r,g,b);
-// elli=ellipse(inputImage,xcor,ycor,firstAxis,secondAxis,angle,startAngle,endAngle,r,g,b,thickness);
-// elli=ellipse(inputImage,xcor,ycor,firstAxis,secondAxis,angle,startAngle,endAngle,r,g,b,thickness,linetype);
-// elli=ellipse(inputImage,xcor,ycor,firstAxis,secondAxis,angle,startAngle,endAngle,r,g,b,thickness,linetype,shift);
-//
-// Parameters
-// elli: The output image with the ellipse drawn in it.
-// inputImage: The input image on which the ellipse should be drawn.
-// xcor: X-coordinate of the center
-// ycor: Y-coordinate of the center
-// firstAxis: the first axis of the ellipse.
-// secondAxis: the second axis of the ellipse.
-// angle: Ellipse rotation angle in degrees.
-// startAngle: Starting angle of the elliptic arc in degrees.
-// endAngle: Ending angle of the elliptic arc in degrees.
-// r: red color value of the ellipse.It should be in the range 0-255.
-// b: blue color value of the ellipse.It should be in the range 0-255.
-// g: green color value of the ellipse.It should be in the range 0-255.
-// thickness: Line thickness.
-// linetype: Type of the ellipse boundary.It can be 0 or 4 or 8.
-// shift: Number of fractional bits in the point coordinates.
-//
-// Description
-//
-// This function draws a simple or thick elliptic arc or fills an ellipse sector.
-//
-// Examples
-// // read the input image on which the ellipse shpuld be drawn.
-// z=imread("lena.jpeg",0);
-// call the function
-// elli=ellipse(z,0,0,45,45,45,0,45,255,0,0,1,0);
-// // show the image drawn on it.
-// imshow(elli)
-
-
- input_image1=mattolist(input_image);
- [lhs,rhs]=argn(0);
- if lhs>1
- error(msprintf(" Too many output arguments"));
- elseif rhs>14
- error(msprintf(" Too many input arguments,maximum number of arguments is 14\n"));
- elseif rhs<11
- error(msprintf("the function needs atleast 11 arguments"));
- end
- if rhs==11
- a=raw_ellipse(input_image1 , x_coordinate_of_centre , y_coordinate_centre , first_axis, second_axis, angle, startAngle, endAngle, r_value,g_value,b_value);
- elseif rhs==12
- a=raw_ellipse(input_image1 , x_coordinate_of_centre , y_coordinate_centre , first_axis, second_axis, angle, startAngle, endAngle, r_value,g_value,b_value,varargin(1));
- elseif rhs==13
- a=raw_ellipse(input_image1 , x_coordinate_of_centre , y_coordinate_centre , first_axis, second_axis, angle, startAngle, endAngle, r_value,g_value,b_value,varargin(1),varargin(2));
- elseif rhs==14
- a=raw_ellipse(input_image1 , x_coordinate_of_centre , y_coordinate_centre , first_axis, second_axis, angle, startAngle, endAngle, r_value,g_value,b_value,varargin(1),varargin(2),varargin(3));
- end
-
-
- dimension=size(a)
- for i = 1:dimension
- out(:,:,i)=a(i);
- end
-
-endfunction;
diff --git a/macros/erode.bin b/macros/erode.bin
deleted file mode 100644
index 39385e7..0000000
Binary files a/macros/erode.bin and /dev/null differ
diff --git a/macros/erode.sci b/macros/erode.sci
deleted file mode 100644
index d65cb3e..0000000
--- a/macros/erode.sci
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (C) 2015 - 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: Sukul Bagai
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function [out]=erode(input_image ,kernel,anchorX,anchorY,iterations)
-// This function Erodes an image by using a specific structuring element.
-//
-// Calling Sequence
-//
-// z=imread("lena.jpeg");
-// ero=erode(inputImage,kernel,anchorX,anchorY,iterations);
-//
-// Parameters
-//
-// z: input image which should be eroded.
-// ero: the output eroded image
-// kernel: structuring element used for erosion
-// anchorX: x coordinate of Anchor.
-// anchorY: y coordinate of Anchor.
-// Anchor: position of the anchor within the element.
-// Iterations: number of times erosion is applied.
-//
-// Description
-//
-// This function Erodes an image by using a specific structuring element.
-//
-// Examples
-//
-// z=imread("lena.jpeg");
-// ero=erode(z,[6 4],1,1,4);
-
-
-input_image1=mattolist(input_image);
- a=raw_erode(input_image1 ,kernel,anchorX,anchorY,iterations);
- dimension=size(a)
- for i = 1:dimension
- out(:,:,i)=a(i);
- end
-
-endfunction;
diff --git a/macros/estimateFundamentalMat.bin b/macros/estimateFundamentalMat.bin
deleted file mode 100644
index 3f318a1..0000000
Binary files a/macros/estimateFundamentalMat.bin and /dev/null differ
diff --git a/macros/estimateFundamentalMat.sci b/macros/estimateFundamentalMat.sci
deleted file mode 100644
index 5318011..0000000
--- a/macros/estimateFundamentalMat.sci
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (C) 2015 - 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: Nihar Rao
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function [fundamentalMatrix]=estimateFundamentalMat(matchedPoints1,matchedPoints2,varargin)
-// It returns the 3-by-3 fundamental matrix corresponding to the input points
-//
-// Calling Sequence
-// fundamentalMat=estimateFundamentalMatrix(matchedPoints1,matchedPoints2);
-// fundamentalMat=estimateFundamentalMatrix(matchedPoints1,matchedPoints2,'method','RANSAC','param1',2,'param2',0.99);
-//
-// Parameters
-// matchedPoints1: M-by-2 array of first image points. These points can be SURFPoints, MSERRegions, cornerPoints.
-// matchedPoints2: M-by-2 array of the second image points of the same size and format as matchedPoints1.
-// method: method for computing fundamental matrix. Possible methods are 7POINT,8POINT,RANSAC,LMEDS and RANSAC is the default one.
-// param1: It indiacates maximum distance from a point to an epipolar line in pixels
-// param2: It specifies a desirable level of confidence
-//
-// Description
-// estimateFundamentalMatrix function calculates a fundamental matrix from the corresponding points in two images.
-//
-// Examples
-// I=imread("lena_left.jpeg");
-// cornerPoints1=detectMinEigenFeatures(I);
-// I2=imread("lena_right.jpeg");
-// cornerPoints2=detectMinEigenFeatures(I2);
-// fundamentalMat=(cornerPoints1.Location,cornerPoints2.Location);
-
- [lhs rhs]=argn(0);
- if rhs>10
- error(msprintf(" Too many input arguments"));
-
- end
- select rhs
- case 2 then
- [fundamentalMatrix]=raw_estimateFundamentalMat(matchedPoints1,matchedPoints2);
- case 3 then
- [fundamentalMatrix]=raw_estimateFundamentalMat(matchedPoints1,matchedPoints2,varargin(1));
- case 4 then
- [fundamentalMatrix]=raw_estimateFundamentalMat(matchedPoints1,matchedPoints2,varargin(1),varargin(2));
- case 5 then
- [fundamentalMatrix]=opencv_estimateFundametanlMatrix(matchedPoints1,matchedPoints2,varargin(1),varargin(2),varargin(3));
-
-
- end
-endfunction
diff --git a/macros/exposure.bin b/macros/exposure.bin
new file mode 100644
index 0000000..5c91fe9
Binary files /dev/null and b/macros/exposure.bin differ
diff --git a/macros/exposure.sci b/macros/exposure.sci
new file mode 100644
index 0000000..b73f344
--- /dev/null
+++ b/macros/exposure.sci
@@ -0,0 +1,81 @@
+// Copyright (C) 2015 - 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: Manoj Sree Harsha
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function x = exposure(algo_type,img_index,varargin)
+ //Compensate exposure in the specified image.
+ //
+ //Calling Sequence
+ //stacksize('max')
+ //image1=imread('path of the image file')
+ //image2=imread('path of the image file')
+ //y = exposure(algo_type,img_index,image1,image2)
+ //image3=imread('path of the image file')
+ //y = exposure(algo_type,img_index,image1,image2,image3)
+ //image4=imread('path of the image file')
+ //y = exposure(algo_type,img_index,image1,image2,image3,image4)
+ //image5=imread('path of the image file')
+ //y = exposure(algo_type,img_index,image1,image2,image3,image4,image5)
+ //image6=imread('path of the image file')
+ //y = exposure(algo_type,img_index,image1,image2,image3,image4,image6)
+ //
+ //Parameters
+ //algo_type : an integer between 1 and 3 (both inclusive) specifying the algorithm to be used for exposure compensation.
+ //img_index : index of the image on which exposure compensator will be applied
+ //image1 : an image
+ //image2 : an image
+ //image3 : an image
+ //image4 : an image
+ //image5 : an image
+ //image6 : an image
+ //
+ //Description
+ //y = exposure(algo_type,img_index,image1,image2) returns an image whose exposure is compensated.
+ //Features are extracted from each image and matching is done on two consecutive images to ensure the continuity in images.
+ //After this camera parameters are estimated which is required to do particular type of warping.
+ //After warping is done exposure is compensated in an image whose index is mentioned.
+ //
+ //Examples
+ //a=imread('images/lenahi.jpg');
+ //b=imread('images/lenalow.jpg');
+ //algo_type=1;
+ //img_index=1;
+ //y=exposure(algo_type,img_index,a,b);
+ //imshow(y)
+ //Authors
+ // Manoj Sree Harsha
+
+[lhs rhs]=argn(0)
+if rhs<4
+ error(msprintf("Function need atleast 4 arguments"))
+elseif rhs>8
+ error(msprintf("Too many input arguments,max. no of arguments is 8"))
+end
+for i=1:(rhs-2)
+ varargin(i)=mattolist(varargin(i))
+end
+
+if rhs==4
+ y=raw_exposure(algo_type,img_index,varargin(1),varargin(2));
+elseif rhs==5
+ y=raw_exposure(algo_type,img_index,varargin(1),varargin(2),varargin(3));
+elseif rhs==6
+ y=raw_exposure(algo_type,img_index,varargin(1),varargin(2),varargin(3),varargin(4));
+elseif rhs==7
+ y=raw_exposure(algo_type,img_index,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5));
+elseif rhs==8
+ y=raw_exposure(algo_type,img_index,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6));
+end
+channels = size(y)
+ for i = 1:channels
+ x(:, :, i) = (y(i))
+ end
+ x=double(x);
+endfunction
diff --git a/macros/extractFeatures.bin b/macros/extractFeatures.bin
deleted file mode 100644
index 3884232..0000000
Binary files a/macros/extractFeatures.bin and /dev/null differ
diff --git a/macros/extractFeatures.sci b/macros/extractFeatures.sci
deleted file mode 100644
index 02691ee..0000000
--- a/macros/extractFeatures.sci
+++ /dev/null
@@ -1,193 +0,0 @@
-// Copyright (C) 2015 - 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: Umang Agarwal & Sridhar Reddy
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function [featureVector, ValidPoints]=extractFeatures(image,points,class,varargin)
-// This function is used to extract interest point descriptors
-//
-// Calling Sequence
-// [features, validPoints] = raw_extractFeatures(Image, points, Class, Name, Value... )
-//
-// Parameters
-// Image: Input Image, should be a 2-D grayscale. The Input Image should be real
-// points: M-by-2 vector containing the list of Interest Points
-// Class: The Name of the feature detecting algorithm used for interest point detection
-// Method: The desired algorithm to be used for feature vector calculation
-// Metric: M-by-1 vector containing the strength of eack interest Point
-// BlockSize: An odd integer scalar for defining a square neighbourhood centered at each interest point for Block Detection Method
-// Upright: Rotation Invariance Flag specified as a boolean 'True' or 'False'. Default Value: False(0)
-// SURFSize: Length of SURF Feature Vector. Values: [64(default)|128]
-// Orientation: M-by-1 vector containing the orientation of the detected feature in radians
-// Axes: M-by-2 vector containing the axes length values detected for MSER Object
-// Scale: M-by-1 vector containing the scale of detection of each Interest Point
-// SignOfLaplacian: M-by-1 vector containing the values of Sign of Laplacian of a SURF Object
-// features: M-by-N Feature Matrix containing M feature vectors each of length N
-// validPoints: M-by-2 Matrix containing the set of valid points whose features have been extracted
-//
-// Description
-// The function derives the descriptors from pixels surrounding an interest point, where each interest point specifies the location of the detected region center.
-//
-// Examples
-// image = imread('sample.jpg');
-// [corners count metric] = detectHarrisFeatures(image);
-// [features, valid_corners] = raw_extractFeatures(image, corners, "Class", "cornerPoints", "Metric", metric);
-//
-
-
- [lhs rhs]=argn(0);
- if lhs>2
- error(msprintf(" Too many output arguments"));
- elseif rhs>13
- error(msprintf(" Too many input arguments"));
- end
- imageList=mattolist(image);
-
- //default values
- blockSize=0;
- upright=1;
- surfSize=64;
- if (class=="cornerPoints" | class=="BRISKPoints")
- method="FREAK";
- elseif (class=="MSERRegions" | class=="SURFPoints")
- method="SURF";
- elseif (class=="Matrix")
- method="Block";
- else
- error(msprintf(" Invalid class type, check documentation for the list of valid types"));
- end
-
- //Count to ensure argument called only once
- count_metric=0,count_orientation=0,count_scale=0,count_axes=0,count_signOfLaplacian=0;
- count_method=0, count_block=0, count_surf=0, count_upright=0;
- blockSize=1;
- metric=1;
- //Parsing input arguments
- for i=1:2:rhs-3
- if (varargin(i)=="Metric")
- if(count_metric==0)
- i=i+1;
- metric=varargin(i);
- count_metric=1;
- else
- error(msprintf(" Metric argument has been called twice"));
- end
- elseif (varargin(i)=="Orientation")
- if(count_orientation==0)
-
- i=i+1;
- orientation=varargin(i);
- count_orientation=1;
-
- else
- error(msprintf(" Orientation argument has been called twice"));
- end
- elseif (varargin(i)=="Scale")
- if(count_scale==0)
- i=i+1;
- scale=varargin(i);
- count_scale=1;
- else
- error(msprintf(" Scale argument has been called twice"));
- end
- elseif (varargin(i)=="Axes")
- if(count_axes==0)
- i=i+1;
- axes=varargin(i);
- count_axes=1;
- else
- error(msprintf(" Axes argument has been called twice"));
- end
- elseif (varargin(i)=="SignOfLaplacian")
- if(count_signOfLaplacian==0)
- i=i+1;
- signOfLaplacian=varargin(i);
- count_signOfLaplacian=1;
- else
- error(msprintf("SignOfLaplacian argument has been called twice"));
- end
- elseif (varargin(i)=="Method")
- if(count_method==0)
- i=i+1;
- method=varargin(i);
- count_method=1;
- else
- error(msprintf("Method argument has been called twice"));
- end
- elseif (varargin(i)=="BlockSize")
- if(count_block==0)
- i=i+1;
- blockSize=varargin(i);
- count_block=1;
- else
- error(msprintf("BlockSize argument has been called twice"));
- end
- elseif (varargin(i)=="SurfSize")
- if(count_surf==0)
- i=i+1;
- surfSize=varargin(i);
- count_surf=1;
- else
- error(msprintf("SurfSize argument has been called twice"));
- end
- elseif (varargin(i)=="Upright")
- if(count_upright==0)
- i=i+1;
- upright=varargin(i);
- count_upright=1;
- else
- error(msprintf("Upright argument has been called twice"));
- end
- else
- error(msprintf("Wrong argument, check documentation for the list of valid arguments"));
- end
- end
-
-
- select class
- case "cornerPoints" then
- if(count_metric==0)
- error(msprintf("For cornerPoints Class Metric argument is necessary"));
- end
- [featureVectors ValidPoints numBits numFeatures count metric]= raw_extractFeatures(imageList, points, "Class", class, "Method", method, "surfSize", surfSize, "blockSize", blockSize, "upright", upright, "Metric",metric);
-
- case "BRISKPoints" then
- if(count_metric==0 | count_scale==0 | count_orientation==0)
- error(msprintf("For BRISKPoints Class Metric, Orientation and Scale arguments are necessary"));
- end
- [featureVectors ValidPoints numBits numFeatures scale metrix orientation count]= raw_extractFeatures(imageList, points, "Class", class, "Method", method, "surfSize", surfSize, "blockSize", blockSize, "upright", upright, "Metric",metric,"Orientation",orientation,"Scale",scale);
-
- case "MSERRegions" then
-
- if( count_orientation==0 | count_axes==0)
- error(msprintf("For MSERRegions Class Orientation Matrix and Axes Matrix arguments are necessary."));
- end
-
- [featureVectors, ValidPoints, numBits, numFeatures, count, axes, orientation]=raw_extractFeatures(imageList, points, "Class", class, "Method", method, "surfSize", surfSize, "blockSize", blockSize, "upright", upright, "Orientation",orientation,"Axes",axes);
-
-
- case "SURFPoints" then
- if(count_scale==0 | count_metric==0 | count_signOfLaplacian==0 | count_orientation==0)
- error(msprintf("For SURFPoints Class Metric, Orientation, Scale and SignOfLaplacian arguments are necessary"));
- end
- [featureVectors ValidPoints numBits numFeatures count scale metrix signOfLaplacian orientation]= raw_extractFeatures(imageList, points, "Class", class, "Method", method, "surfSize", surfSize, "blockSize", blockSize, "upright", upright, "Metric",metric,"Orientation",orientation,"Scale",scale,"SignOfLaplacian",signOfLaplacian);
-
-
- case "Matrix" then
- if(count_block==0)
- error(msprintf("For Matrix Class BlockSize argument is necessary"));
- end
- [featureVectors ValidPoints numBits numFeatures]= raw_extractFeatures(imageList, points, "Class", class, "Method", method, "surfSize", surfSize, "blockSize", blockSize, "upright", upright,"BlockSize",blockSize);
- end
-
-
-
- featureVector=struct("Type","binaryFeatures",'Features',featureVectors,'NumBits',numBits,'NumFeatures',numFeatures);
-
-endfunction
diff --git a/macros/findHomography.bin b/macros/findHomography.bin
deleted file mode 100644
index f00ebaf..0000000
Binary files a/macros/findHomography.bin and /dev/null differ
diff --git a/macros/findHomography.sci b/macros/findHomography.sci
deleted file mode 100644
index 2cfe4a0..0000000
--- a/macros/findHomography.sci
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright (C) 2015 - 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: Nihar Rao
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-function [homography_matrix]= findHomography(points1,points2,varargin)
-// This Function Finds a perspective transformation between two planes.
-//
-// Calling Sequence
-// homographyMatrix=findHomography(points1,points2);
-// homographyMatrix=findHomography(points1,points2,method);
-// homographyMatrix=findHomography(points1,points2,method,threshold);
-//
-// Parameters
-// homographyMatrix: perspective transformation H between the source and the destination planes
-// points1: Coordinates of the points in the original plane
-// points2: Coordinates of the points in the target plane
-// method: Method used to computed a homography matrix.
-// Here are the different options for method
-// 0 - a regular method using all the points
-// 4 - RANSAC-based robust method
-// 8 - Least-Median robust method
-// 16 - PROSAC-based robust method
-// threshold: Maximum allowed reprojection error to treat a point pair as an inlier.
-// Note: the number of points should be same in the points1 and points2
-// Description
-// The function finds and returns the perspective transformation H between the source and the destination planes
-//
-//Examples
-//
-// read first image
-// z=imread("lena.jpeg",0);
-// get points from first image
-// yo=detectGFTTFeatures(z);
-// read second image
-// image=imread("lena2.jpg",0);
-// yo1=detectGFTTFeatures(image);
-// // call function with same number of points in both(first arg has 594 so passig 594 points from second arg)
-// lou=findHomography(yo.KeyPoints,yo1.KeyPoints(1:594,:));
-
-
-
-
-
- [lhs rhs]=argn(0);
- if lhs>1
- error(msprintf(" Too many output arguments"));
- elseif rhs>4
- error(msprintf(" Too many input arguments,maximum number of arguments is 4"));
- elseif rhs<2
- error(msprintf("the function needs atleast 2 arguments"));
- end
-
- if rhs==2 then
- homography_matrix=raw_findHomography(points1,points2);
- elseif rhs==3
- homography_matrix=raw_findHomography(points1,points2,varargin(1));
- elseif rhs==4
- homography_matrix=raw_findHomography(points1,points2,varargin(1),varargin(2));
- end
-
-
-
-endfunction
diff --git a/macros/fitellipse.bin b/macros/fitellipse.bin
deleted file mode 100644
index b314a18..0000000
Binary files a/macros/fitellipse.bin and /dev/null differ
diff --git a/macros/fitellipse.sci b/macros/fitellipse.sci
deleted file mode 100644
index 3eabc50..0000000
--- a/macros/fitellipse.sci
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (C) 2015 - 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: Nihar Rao & Priyanka Gandhi
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-function [out]=fitellipse(InputArraypoints)
-// The function calculates the ellipse that fits (in a least-squares sense) a set of 2D points best of all.
-//
-// Calling Sequence
-//
-// felli=fitellipse(points);
-//
-// Parameters
-// felli: a struct containing all the details about the ellipse Params.
-// points: Input 2D point set
-//
-// Description
-//
-// The function calculates the ellipse that fits (in a least-squares sense) a set of 2D points best of all.
-//
-// Examples
-//
-// // read image
-// z=imread("lena.jpeg",0);
-// //get points using KAZE detector or the points can also be hardcoded.
-// pio=detectKAZEFeatures(z);
-// // call function
-// sss=fitellipse(pio.KeyPoints)
-
- [t1 t2 t3 t4 t5]= raw_fitellipse(InputArraypoints);
- out=struct("size1",t1,"size2",t2,"center1",t3,"center2",t4,"angle",t3);
-endfunction;
diff --git a/macros/graycoprops.bin b/macros/graycoprops.bin
deleted file mode 100644
index 2ff4084..0000000
Binary files a/macros/graycoprops.bin and /dev/null differ
diff --git a/macros/graycoprops.sci b/macros/graycoprops.sci
deleted file mode 100644
index ae4b002..0000000
--- a/macros/graycoprops.sci
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright (C) 2015 - 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: Nihar Rao
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-function[stats] = graycoprops(srcImg, varargin)
-// This function computes the Properties of gray-level co-occurrence matrix.
-//
-// Calling Sequence
-// z=imread("lena.jpeg"); //in grayscale or color
-// //Note: z can be a image or simply a Matrix.
-// gray=graycoprops(z) //get all 4 properties
-// gray=graycoprops(z,"contrast") //compute only contrast
-// gray=graycoprops(z,["contrast" "energy"]) //compute contrast and energy.the properties can be passed in any order
-// gray=graycoprops(z,["contrast" "correlation" "energy"])
-// gray=graycoprops(z,["contrast" "correlation" "energy" "homogeneity"])
-//
-// Parameters
-//
-// gray: A struct containing all the parameters
-// z: A image or a matrix
-// contrast: a measure of the intensity contrast between a pixel and its neighbor over the whole image.
-// energy: the sum of squared elements
-// homogeneity: a value that measures the closeness of the distribution of elements.
-// correlation:a measure of how correlated a pixel is to its neighbor over the whole image
-//
-// Description
-// This function computes the Properties of gray-level co-occurrence matrix.The properties being "correlation","contrast","energy" and "homogeneity".
-//
-//
-// Examples
-// //compute for a image
-// z=imread("lena.jpeg",0);
-// sss=graycoprops(z,["contrast"])
-//
-// //compute for a matrix
-// glcm = [0 1 2 3;1 1 2 3;1 0 2 0;0 0 0 3]
-// sss=graycoprops(glcm,["contrast" "energy" "correlation"])
-
-
- [lhs, rhs] = argn(0)
-
- srcMat = mattolist(srcImg)
-
- select rhs
- case 1 then
- [contrast correlation energy homo] = raw_graycoprops(srcMat);
- stats=struct('Contrast',contrast,'Correlation',correlation,'Energy',energy,'Homogeniety',homo);
- case 2 then
- [rows cols]=size(varargin(1));
- n=rows*cols;
- if n>4
- error(msprintf("the string matrix must have maximimum of 4 entries"));
- end
- inputString=varargin(1);
- if n==1
- [out]=raw_graycoprops(srcMat,varargin(1));
- stats=struct(inputString(1),out);
- elseif n==2
- [out out1]=raw_graycoprops(srcMat,varargin(1));
- stats=struct(inputString(1),out,inputString(2),out1);
-
- elseif n==3
- [out out1 out2]=raw_graycoprops(srcMat,varargin(1));
- stats=struct(inputString(1),out,inputString(2),out1,inputString(3),out2);
-
- elseif n==4
- [out out1 out2 out3]=raw_graycoprops(srcMat,varargin(1));
- stats=struct(inputString(1),out,inputString(2),out1,inputString(3),out2,inputString(4),out3);
-
- end
-
-
- end
-
-
-
-endfunction
diff --git a/macros/imattributes.bin b/macros/imattributes.bin
new file mode 100644
index 0000000..a923f14
Binary files /dev/null and b/macros/imattributes.bin differ
diff --git a/macros/imattributes.sci b/macros/imattributes.sci
new file mode 100644
index 0000000..af859f2
--- /dev/null
+++ b/macros/imattributes.sci
@@ -0,0 +1,37 @@
+// Copyright (C) 2015 - 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: Dhruti Shah , Manoj Sree Harsha
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function [] = imattributes(image)
+ //Provides information about image attributes.
+ //
+ //Calling Sequence
+ //inputImage=imread('path of the image file')
+ //imattributes(inputImage)
+ //
+ //Parameters
+ //inputImage : an image.
+ //
+ //Description
+ //imattributes gives image attribute information in the form of a 4-by-2 or 6-by-2 cell array, depending on the image type.
+ //The first column of the cell array contains the name of the attribute.
+ // The second column contains the value of the attribute. Both attribute names and values are character vectors
+ //'Minimum intensity': Regarding intensity images, this value represents the lowest intensity value of any pixel. In case ofindexed images, this value represents the lowest index value into a color map.
+ //'Maximum intensity':Regarding intensity images, this value represents the highest intensity value of any pixel. In case of indexed images, this value represents the highest index value into a color map.
+ //
+ //Examples
+ //inputImage=imread('images/lena.jpeg');
+ //imattributes(inputImage)
+ //Authors
+ // Dhruti Shah , Manoj Sree Harsha
+
+img=mattolist(image);
+raw_imattributes(img);
+endfunction
diff --git a/macros/imread.bin b/macros/imread.bin
deleted file mode 100644
index d344d4d..0000000
Binary files a/macros/imread.bin and /dev/null differ
diff --git a/macros/imread.sci b/macros/imread.sci
deleted file mode 100644
index 3aaf9b0..0000000
--- a/macros/imread.sci
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (C) 2015 - 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: Sukul Bagai & Nihar Rao
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function[dstMat] = imread(matA,varargin)
-// This function is used to Read/Load an image from the disk
-//
-//
-//
-// Calling Sequence
-// image=imread("image_path");
-// image=imread("image_path",options)
-//
-// Parameters
-// image_path: a String which contains the path of the image that is to be read.
-// options: an Integer, containing the option for user to specify. See below for details.
-// 0 : convert image to the single channel grayscale image.
-// 1 : convert image to the 3 channel BGR color image.
-// 2 : load 16-bit/32-bit image when the input image has the corresponding depth, otherwise convert it to 8-bit.
-// 4 : the image is read in any possible color format.
-// 8 : use the gdal driver for loading the image.
-// 16 : convert image to the single channel grayscale image and the image size reduced 1/2.
-// 17 : convert image to the 3 channel BGR color image and the image size reduced 1/2.
-// 32 : convert image to the single channel grayscale image and the image size reduced 1/4.
-// 33 : convert image to the 3 channel BGR color image and the image size reduced 1/4.
-// 64 : convert image to the single channel grayscale image and the image size reduced 1/8.
-// 65 : convert image to the 3 channel BGR color image and the image size reduced 1/8.
-// 128 : do not rotate the image according to EXIF's orientation flag.
-//
-// Description
-// This function is used to Read/Load an image from the disk
-//
-//
-// Examples
-// Read a image as it is(Unchanged).
-// //Calling imread
-// image=imread("test.jpg");
-//
-// Read image as grayscale
-// //Calling imread
-// image=imread("test.jpg",0);
-
- [lhs rhs]=argn(0);
-
- if lhs>1
- error(msprintf(" Too many output arguments"));
- elseif rhs>2
- error(msprintf(" Too many input arguments,maximum number of arguments is 2\n"));
- elseif rhs<1
- error(msprintf("the function needs atleast 1 arguments"));
- end
- if rhs==1
- out = raw_imread(matA);
- else
- out=raw_imread(matA,varargin(1));
- end
-
-
- channel = size(out)
-
- for i = 1: channel
- dstMat(:,:,i) = (out(i))
- end
-
-endfunction
diff --git a/macros/imresize.bin b/macros/imresize.bin
deleted file mode 100644
index 3506f9b..0000000
Binary files a/macros/imresize.bin and /dev/null differ
diff --git a/macros/imresize.sci b/macros/imresize.sci
deleted file mode 100644
index 0ae3438..0000000
--- a/macros/imresize.sci
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright (C) 2015 - 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: Nihar Rao
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function [out]=imresize(image,alpha,beta)
-// This function is used to resize the image
-//
-// Calling Sequence
-//
-// newImage=imresize(inputImage,alpha,beta);
-//
-// Parameters
-//
-// newImage: the new resized image
-// inputImage: the image which should be resized.
-// alpha: new number of rows.
-// beta: new number of columns.
-//
-// Description
-//
-// This function is used to resize the image
-//
-// Examples
-//
-// z=imread("lena.jpeg",0);
-// zz=imresize(z,35,12);
-// imshow(zz)
- image1=mattolist(image);
- a=raw_imresize(image1,alpha,beta);
- dimension=size(a)
- for i = 1:dimension
- out(:,:,i)=a(i);
- end
-endfunction;
diff --git a/macros/indexImages.bin b/macros/indexImages.bin
deleted file mode 100644
index a129b23..0000000
Binary files a/macros/indexImages.bin and /dev/null differ
diff --git a/macros/indexImages.sci b/macros/indexImages.sci
deleted file mode 100644
index 928ad28..0000000
--- a/macros/indexImages.sci
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright (C) 2015 - 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: Rohit Suri ,Umang Agarwal & Sridhar Reddy
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-
-function [imageIndex]=indexImages(imgSet,varargin)
-// This function creates image search index
-//
-// Calling Sequence
-// imageIndex = indexImages(imgSet, bagOfFeatures, Name, Value... );
-//
-// Parameters
-// imgSet: Collection of images with their location and labels
-// bagOfFeatures: Bag of Visual Words
-// Verbose [Optional Input Argument]: Enable Progress display to Screen
-// SaveFeatureLocations [Optional Input Argument]: A boolean value indicating whether feature locations has to be saved or not. Values: [True(default)|False]
-// imageIndex: Search Index Object containing the mapping of visual vocabulary to each image in the image set
-//
-// Description
-// Creates a search Index Object that has been mapped to visual words that can be used for retrieve Images
-//
-// Examples
-// imgSet = imageSet(directory,'recursive');
-// [trainingSet testSet] = partition(imgSet,[0.8]);
-// bag = bagOfFeatures(trainingSet);
-// imageindex = indexImages(trainingSet, bag);
-//
-// With Optional Arguments:
-// imageindex = indexImages(trainingSet, bag, "Verbose", 1);
-//
-// Authors
-// Umang Agrawal
-// Rohit Suri
-// Sridhar Reddy
-
- [lhs rhs]=argn(0);
- if rhs>6
- error(msprintf(" Too many input arguments"));
- end
- imgSetList=imageSetToList(imgSet);
- if modulo(lhs,2)==0
- bagList=bagStructToList(varargin(1));
- select rhs
- case 1 then
- [imageIndexList]=raw_indexImages(imgSetList);
- case 2 then
- [imageIndexList]=raw_indexImages(imgSetList,bagList);
- case 3 then
- [imageIndexList]=raw_indexImages(imgSetList,varargin(1),varargin(2));
- case 4 then
- [imageIndexList]=raw_indexImages(imgSetList,bagList,varargin(2),varargin(3));
- case 5 then
- [imageIndexList]=raw_indexImages(imgSetList,varargin(1),varargin(2),varargin(3),varargin(4));
- case 6 then
- [imageIndexList]=raw_indexImages(imgSetList,bagList,varargin(2),varargin(3),varargin(4),varargin(5));
- end
- end
-
-endfunction
diff --git a/macros/integralImage.bin b/macros/integralImage.bin
deleted file mode 100644
index 38b5e6c..0000000
Binary files a/macros/integralImage.bin and /dev/null differ
diff --git a/macros/integralImage.sci b/macros/integralImage.sci
deleted file mode 100644
index 00801cb..0000000
--- a/macros/integralImage.sci
+++ /dev/null
@@ -1,20 +0,0 @@
-function[dstMat] = integralImage(srcImg, varargin)
-
- [lhs, rhs] = argn(0)
-
- srcMat = mattolist(srcImg)
-
- select rhs
- case 1 then
- out = opencv_integralImage(srcMat)
- case 3 then
- out = opencv_integralImage(srcMat, varargin(1))
- end
-
- channel = size(out)
-
- for i = 1: channel
- dstMat(:,:,i) = out(i)
- end
-
-endfunction
diff --git a/macros/lab2double.bin b/macros/lab2double.bin
deleted file mode 100644
index d47da03..0000000
Binary files a/macros/lab2double.bin and /dev/null differ
diff --git a/macros/lab2double.sci b/macros/lab2double.sci
deleted file mode 100644
index 34e0438..0000000
--- a/macros/lab2double.sci
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (C) 2015 - 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: Tess Zacharias
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function [output] = lab2double(pstData)
-// This function used to convert a matrix of L*a*b to double.
-//
-// Calling Sequence
-//
-// doub=lab2double(matrix);
-//
-// Parameters
-//
-// doub: The output matrix with double values.
-// matrix: the input matrix with Lab values.
-//
-// Description
-//
-// This function used to convert a matrix of L*a*b to double.
-//
-// Examples
-// a=[1 0 1];
-// doub=lab2double(a);
-//
-// z=imread("lena.jpeg");
-// cvt=cvtColor(z,"CV_RGB2Lab");
-// doub=lab2double(cvt);
-
- pstData=mattolist(pstData);
- a = raw_lab2double(pstData);
- d = size(a);
- for i=1:d
- output(:,:,i) = a(i);
- end
-endfunction
diff --git a/macros/matMulDeriv.bin b/macros/matMulDeriv.bin
deleted file mode 100644
index a672b32..0000000
Binary files a/macros/matMulDeriv.bin and /dev/null differ
diff --git a/macros/matMulDeriv.sci b/macros/matMulDeriv.sci
deleted file mode 100644
index 02793e5..0000000
--- a/macros/matMulDeriv.sci
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright (C) 2015 - 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: Nihar Rao
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-function [DA,DB]= matMulDeriv(A,B)
-// this function Computes partial derivatives of the matrix product for each multiplied matrix
-//
-// Calling Sequence
-// [da db]=matMulDeriv(A,B);
-//
-// Parameters
-// A First multiplied matrix.
-// B Second multiplied matrix.
-// da First output derivative matrix d(A*B)/dA of size (A.rows * B.cols)x(A.rows * A.cols) and same type as A.
-// db Second output derivative matrix d(A*B)/dB of size (A.rows * B.cols)x(B.rows * B.cols) and same type as A.
-//
-// Description
-// this function Computes partial derivatives of the matrix product for each multiplied matrix
-// Examples
-//
-// Declare mattrices
-//a=[1 2 ;3 4];
-//b=[1 2 ;3 4];
-// //call function
-//[da db]=matMulDeriv(a,b);
-// //view output
-//da
-//db
- [lhs rhs]=argn(0);
-
- if lhs>2
- error(msprintf(" Too many output arguments,maximum number of output arguments is 2"));
- elseif rhs>2
- error(msprintf(" Too many input arguments,maximum number of arguments is 2`"));
- elseif rhs<2
- error(msprintf("the function needs atleast 2 arguments"));
- end
-
- [DA,DB]=raw_matMulDeriv(A,B);
-
-
-endfunction
diff --git a/macros/match.bin b/macros/match.bin
new file mode 100644
index 0000000..cc52f12
Binary files /dev/null and b/macros/match.bin differ
diff --git a/macros/match.sci b/macros/match.sci
new file mode 100644
index 0000000..93fc64c
--- /dev/null
+++ b/macros/match.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2015 - 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: M Avinash Reddy & Manoj Sree Harsha
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function [x] = match(a,b)
+ //Performs matching features between two images.
+ //
+ //Calling Sequence
+ //img1=imread('path of the image file')
+ //img2=imread('path of the image file')
+ //x=match(img1,img2)
+ //
+ //Parameters
+ //img1 : an image
+ //img2 : an image
+ //
+ //Description
+ //The images pass through a stiching pipeline.
+ //Features are extracted from each image and matching is done on two images.
+ //
+ //Examples
+ //img1=imread('images/campus_000.jpg');
+ //img2=imread('images/campus_001.jpg');
+ //x=match(img1,img2);
+ //Authors
+ // Manoj Sree Harsha
+
+c=mattolist(a);
+d=mattolist(b);
+[y]=raw_match(c,d);
+channels = size(y)
+ for i = 1:channels
+ x(:, :, i) = ((y(i)))
+ end
+endfunction
diff --git a/macros/opticalflow.bin b/macros/opticalflow.bin
new file mode 100644
index 0000000..40bf5d2
Binary files /dev/null and b/macros/opticalflow.bin differ
diff --git a/macros/opticalflow.sci b/macros/opticalflow.sci
new file mode 100644
index 0000000..d9b55a8
--- /dev/null
+++ b/macros/opticalflow.sci
@@ -0,0 +1,32 @@
+// Copyright (C) 2015 - 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: Manoj Sree Harsha & M Avinash Reddy
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+//
+function [] = opticalflow(a)
+ //Calculates optical flow.
+ //
+ //Calling Sequence
+ //opticalflow(vid)
+ //
+ //Parameters
+ //vid : a video
+ //
+ //Description
+ //opticalflow(vid) returns an opticalflow video and it will be written to 'out.avi' file (In the current working directory).
+ //
+ //Examples
+ //opticalflow('ball.mp4');
+ //opticalflow('vtest.avi');
+ //Authors
+ // Manoj Sree Harsha , M Avinash Reddy
+
+ raw_opticalflow(a);
+
+endfunction
diff --git a/macros/pana.bin b/macros/pana.bin
new file mode 100644
index 0000000..362fa76
Binary files /dev/null and b/macros/pana.bin differ
diff --git a/macros/pana.sci b/macros/pana.sci
new file mode 100644
index 0000000..0dad110
--- /dev/null
+++ b/macros/pana.sci
@@ -0,0 +1,94 @@
+// Copyright (C) 2015 - 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: M Avinash Reddy & Manoj Sree Harsha & Ebey Abraham
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function [out]=pana(img1,varargin)
+ //Creates the output panorama image using two or more images
+ //
+ //Calling Sequence
+ //stacksize('max')
+ //img1=imread('path of the image file')
+ //img2=imread('path of the image file')
+ //out = pana(img1,img2)
+ //img3=imread('path of the image file')
+ //out = pana(img1,img2,img3)
+ //img4=imread('path of the image file')
+ //out = pana(img1,img2,img3,img4)
+ //img5=imread('path of the image file')
+ //out = pana(img1,img2,img3,img4,img5)
+ //img6=imread('path of the image file')
+ //out = pana(img1,img2,img3,img4,img5,img6)
+ //
+ //Parameters
+ //img1 : an image
+ //img2 : an image
+ //img3 : an image
+ //img4 : an image
+ //img5 : an image
+ //img6 : an image
+ //
+ //Description
+ //The images pass through a stiching pipeline before the final panorama is formed.
+ //Features are extracted from each image and matching is done on two consecutive images to ensure the continuity in images.
+ //After this camera parameters are estimated which is required to do particular type of warping.
+ //After warping is done exposure is compensated in all images so as to get a uniform exposure throughout the panaroma.
+ //Seam estimation is done next to get the exact portions of images to be blended.
+ //Finally, the images are blended to form the panorama.
+ //
+ //Examples
+ //stacksize('max');
+ //img1=imread('images/campus_017.jpg');
+ //img2=imread('images/campus_016.jpg');
+ //img3=imread('images/campus_015.jpg');
+ //img4=imread('images/campus_014.jpg');
+ //img5=imread('images/campus_013.jpg');
+ //img6=imread('images/campus_012.jpg');
+ //out=pana(img1,img2,img3,img4,img5,img6);
+ //
+ //Examples
+ //stacksize('max');
+ //a=imread('images/s1.jpg');
+ //b=imread('images/s2.jpg');
+ //c=imread('images/s3.jpg');
+ //y=pana(a,b,c);
+ //Authors
+ // M Avinash Reddy , Manoj Sree Harsha , Ebey Abraham
+ [lhs rhs]=argn(0)
+ if lhs>1
+ error(msprintf(" Too many output arguments"))
+ end
+ if rhs>6
+ error(msprintf(" Too many input arguments,maximum number of arguments is 6"))
+ end
+ if rhs<2
+ error(msprintf("the function needs atleast 2 arguments"))
+ end
+ image=mattolist(img1)
+ for i=1:rhs-1
+ varargin(i)=mattolist(varargin(i))
+ end
+ if rhs==2
+ res=raw_panorama(image,varargin(1))
+ elseif rhs==3
+ res=raw_panorama(image,varargin(1),varargin(2))
+ elseif rhs==4
+ res=raw_panorama(image,varargin(1),varargin(2),varargin(3))
+ elseif rhs==5
+ res=raw_panorama(image,varargin(1),varargin(2),varargin(3),varargin(4))
+ elseif rhs==6
+ res=raw_panorama(image,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5))
+ end
+
+ channel=size(res)
+ for i = 1: channel
+ out(:,:,i) = (res(i))
+ end
+ out=double(out)
+endfunction
diff --git a/macros/pclradius.bin b/macros/pclradius.bin
new file mode 100644
index 0000000..8e700be
Binary files /dev/null and b/macros/pclradius.bin differ
diff --git a/macros/pclradius.sci b/macros/pclradius.sci
new file mode 100644
index 0000000..6796136
--- /dev/null
+++ b/macros/pclradius.sci
@@ -0,0 +1,45 @@
+// Copyright (C) 2015 - 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: Manoj Sree Harsha
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function [out] = pclradius(pcloud,q,r)
+ //Finds all the points within the circle of radius r with centre as query point q, in the pointcloud pcloud
+ //
+ //Calling Sequence
+ //y = pclradius(pcloud,q,r)
+ //
+ //Parameters
+ //pcloud : pointCloud object.
+ //q : a row vector containing the query point
+ //r : a positive integer specifying the radius.
+ //out : a matrix.
+ //
+ //Description
+ //out = pclradius(pcloud,q,r) return a 2x(Number of points) matrix .
+ //The first row of out contains the indices of all the points in the pointCloud within the circle of radius r.
+ //The second row contains the corresponding squared distances(squared euclidean distance).
+ //
+ //Examples
+ //a=pcread('data/cube.ply');
+ //q=[1 1 -1];
+ //r=10;
+ //out=pclradius(a,q,r);
+ //
+ //a=pcread('data/bun0.pcd');
+ //q=[0.5 0.5 0.5];
+ //r=2;
+ //out=pclradius(a,q,r);
+ //Authors
+ // Manoj Sree Harsha
+
+ data=pcloud.Location;
+ out = raw_radsearch(data,q,r);
+
+endfunction
diff --git a/macros/pcread.bin b/macros/pcread.bin
deleted file mode 100644
index e62e48f..0000000
Binary files a/macros/pcread.bin and /dev/null differ
diff --git a/macros/pcread.sci b/macros/pcread.sci
deleted file mode 100644
index e45727f..0000000
--- a/macros/pcread.sci
+++ /dev/null
@@ -1,26 +0,0 @@
-//Author-Nihar Rao
-function[point] = pcread(inputPath)
-
- [lhs rhs]=argn(0);
-
- if lhs>1
- error(msprintf(" Too many output arguments"));
- elseif rhs>1
- error(msprintf(" Too many input arguments,maximum number of arguments is 1\n"));
- elseif rhs<1
- error(msprintf("the function needs atleast 1 arguments"));
- end
-
- [location count width height rgb xlimit ylimit zlimit dense intensity Normal]=raw_pcread(inputPath);
-
-
-
-point=struct('dataType','PointCloud','Width',width,'Height',height,'is_dense',dense,'Location',location,'Count',count,'Color',rgb,'XLimits',xlimit,'YLimits',ylimit,'ZLimits',zlimit,'Intensity',intensity,'Normal',Normal);
-
-
-
-
-
-
-
-endfunction
diff --git a/macros/radius.bin b/macros/radius.bin
new file mode 100644
index 0000000..ed661f3
Binary files /dev/null and b/macros/radius.bin differ
diff --git a/macros/radius.sci b/macros/radius.sci
new file mode 100644
index 0000000..9c9611c
--- /dev/null
+++ b/macros/radius.sci
@@ -0,0 +1,55 @@
+// Copyright (C) 2015 - 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: Manoj Sree Harsha
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function [y]=radius(q,f,r,varargin)
+ //Finds all the points within the circle of radius r with centre as query point q, in the dataset f
+ //
+ //Calling Sequence
+ //y = radius(q,f,r)
+ //y = radius(q,f,r,algo_type)
+ //
+ //Parameters
+ //q : a row vector containing the query point
+ //f : f is the set of data points and the number of columns in f should be same as that of q to match point dimensionality
+ //r : a positive integer specifying the radius.
+ //algo_type : a integer between 1 and 4 (both inclusive) specifying the algorithm to be used for the radius search.
+ //
+ //Description
+ //y = radius(q,f,r) return a 2x(Number of points) matrix .
+ //The first row of y contains the indices of all the points in the dataset(f) within the circle of radius r.
+ //The second row contains the corresponding distances(squared euclidean distance).
+ //
+ //Examples
+ //q=[1 2 3];
+ //f=[1 2 3;4 5 6;7 8 9];
+ //r=30;
+ //y=radius(q,f,r);
+ //Authors
+ // Manoj Sree Harsha
+
+[lhs rhs]=argn(0)
+
+ if lhs>1
+ error(msprintf(" Too many output arguments"))
+ elseif rhs>4
+ error(msprintf(" Too many input arguments,maximum number of arguments is 4"))
+ elseif rhs<3
+ error(msprintf("the function needs atleast 3 arguments"))
+ end
+ f1=mattolist(f);
+
+ if rhs==3
+ y=raw_radius(q,f1,r)
+ elseif rhs==4
+ y=raw_radius(q,f1,r,varargin(1))
+ end
+
+endfunction
diff --git a/macros/rotationVectorToMatrix.bin b/macros/rotationVectorToMatrix.bin
new file mode 100644
index 0000000..c4abfdc
Binary files /dev/null and b/macros/rotationVectorToMatrix.bin differ
diff --git a/macros/rotationVectorToMatrix.sci b/macros/rotationVectorToMatrix.sci
new file mode 100644
index 0000000..ad5cc41
--- /dev/null
+++ b/macros/rotationVectorToMatrix.sci
@@ -0,0 +1,34 @@
+// Copyright (C) 2015 - 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: Tanmay Chaudhari
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function [ out ] = rotationVectorToMatrix(vector)
+ // Returns rotation matrix.
+ //
+ // Calling Sequence
+ // matrix = rotationVectorToMatrix(vector);
+ //
+ // Parameters
+ // matrix: rotation matrix
+ // vector: 3-D rotation vector
+ //
+ // Description
+ // Converts rotation vector to rotation matrix.
+ //
+ // Examples
+ // vector = pi/4 * [1, 2, 3];
+ // matrix = rotationVectorToMatrix(vector);
+ //
+ // Authors
+ // Tanmay Chaudhari
+
+ out=raw_rotationVectorToMatrix(vector);
+
+endfunction
diff --git a/macros/rotestimate.bin b/macros/rotestimate.bin
new file mode 100644
index 0000000..1964ba2
Binary files /dev/null and b/macros/rotestimate.bin differ
diff --git a/macros/rotestimate.sci b/macros/rotestimate.sci
new file mode 100644
index 0000000..79fdc2d
--- /dev/null
+++ b/macros/rotestimate.sci
@@ -0,0 +1,72 @@
+// Copyright (C) 2015 - 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: Manoj Sree Harsha
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function res = rotestimate(cam_index,varargin)
+ //Estimates camera intrinsic parameters matrix(K).
+ //
+ //Calling Sequence
+ //img1=imread('path of the image file')
+ //img2=imread('path of the image file')
+ //res = rotestimate(cam_index,img1,img2)
+ //img3=imread('path of the image file')
+ //res = rotestimate(cam_index,img1,img2,img3)
+ //img4=imread('path of the image file')
+ //res = rotestimate(cam_index,img1,img2,img3,img4)
+ //img5=imread('path of the image file')
+ //res = rotestimate(cam_index,img1,img2,img3,img4,img5)
+ //img6=imread('path of the image file')
+ //res = rotestimate(cam_index,img1,img2,img3,img4,img5,img6)
+ //
+ //Parameters
+ //cam_index : cam_index of the camera for which K is returned.
+ //img1 : an image
+ //img2 : an image
+ //img3 : an image
+ //img4 : an image
+ //img5 : an image
+ //img6 : an image
+ //
+ //Description
+ //The images pass through a stiching pipeline.
+ //Features are extracted from each image and matching is done on two consecutive images to ensure the continuity in images.
+ //After this camera parameters are estimated.
+ //
+ //Examples
+ //img1=imread('images/campus_000.jpg');
+ //img2=imread('images/campus_001.jpg');
+ //cam_index=1
+ //res=rotestimate(1,img1,img2);
+ //Authors
+ // Manoj Sree Harsha
+
+[lhs rhs]=argn(0)
+ if lhs>1
+ error(msprintf(" Too many output arguments"))
+ elseif rhs>7
+ error(msprintf(" Too many input arguments,maximum number of arguments is 7"))
+ elseif rhs<3
+ error(msprintf("the function needs atleast 3 arguments"))
+ end
+ for i=1:(rhs-1)
+ varargin(i)=mattolist(varargin(i))
+ end
+ if rhs==3
+ res=raw_rotestimate(cam_index,varargin(1),varargin(2));
+ elseif rhs==4
+ res=raw_rotestimate(cam_index,varargin(1),varargin(2),varargin(3));
+ elseif rhs==5
+ res=raw_rotestimate(cam_index,varargin(1),varargin(2),varargin(3),varargin(4));
+ elseif rhs==6
+ res=raw_rotestimate(cam_index,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5));
+ elseif rhs==7
+ res=raw_rotestimate(cam_index,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6));
+ end
+endfunction
diff --git a/macros/stereoCalibrate.bin b/macros/stereoCalibrate.bin
deleted file mode 100644
index 11db6eb..0000000
Binary files a/macros/stereoCalibrate.bin and /dev/null differ
diff --git a/macros/stereoCalibrate.sci b/macros/stereoCalibrate.sci
deleted file mode 100644
index 502cc10..0000000
--- a/macros/stereoCalibrate.sci
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright (C) 2015 - 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: Nihar Rao
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function [params]=stereoCalibrate(objectpoints,imagepoints1,imagepoints2,varargin)
-// this function Performs stereo calibration for the fisheye model.
-//
-// Calling Sequence
-//
-// stereo=stereoCalibrate(objectpoints,imagepoints1,imagepoints2);
-// stereo=stereoCalibrate(objectpoints,imagepoints1,imagepoints2,cameraMatrix1,distCoeffs1,cameraMatrix2,distCoeffs2);
-//
-// Parameters
-// stereo: a Struct containing all the camera Params
-// objectpoints: a 2d set of actual object points.
-// imagepoints1: a list of imagepoints of image1.
-// imagepoints2: a list of imagepoints of image2.
-// cameraMatrix1: camera matrix of first camera.
-// distCoeffs1: distortion coefficients of first camera.it should be 4*1 or 1*4.
-// cameraMatrix2: camera matrix of second camera.
-// distCoeffs2: distortion coefficients of second camera.it should be 4*1 or 1*4.
-//
-// Description
-//
-// this function Performs stereo calibration for the fisheye model.
-//
-// Examples
-// // A example to show calibration, using the traditional chessboard/checkerboard example.
-//
-// //generate checkerboardpoints for calibration
-// yo=genCheckerboardPoints([7 10],8);
-// //read first image
-// z=imread("left1.jpg",0);
-// //read second image
-// image=imread("right1.jpg",0);
-// //detect checkerboardpoints for image 1
-// ii=detectCheckerboardCorner(z,[7 10]);
-// //detect checkerboardpoints for image 2
-// ii2=detectCheckerboardCorner(image,[7 10]);
-// //convert imagepoints to list
-// ii=list(ii);
-// ii2=list(ii2);
-// // call function
-// final=stereoCalibrate(yo,ii,ii2);
-// // show the struct
-// final
-// // use the above calibration further
-// uu = undistortImage(image,final.cameraMatrix2);
-// imshow(uu);
-//
-//
-// //generate checkerboardpoints for calibration
-// yo=genCheckerboardPoints([7 10],8);
-// //read first image
-// z=imread("left1.jpg",0);
-// //read second image
-// image=imread("right1.jpg",0);
-// //detect checkerboardpoints for image 1
-// ii=detectCheckerboardCorner(z,[7 10]);
-// //detect checkerboardpoints for image 2
-// ii2=detectCheckerboardCorner(image,[7 10]);
-// //convert imagepoints to list
-// ii=list(ii);
-// ii2=list(ii2);
-// // call function
-// final=stereoCalibrate(yo,ii,ii2);
-// // show the struct
-// final
-// // use the above calibration further
-// uu = undistortImage(image,final.cameraMatrix2,'distCoeffs',final.distortionCoefficients2);
-// imshow(uu);
-
-
-
- [lhs rhs]=argn(0);
-
- if lhs>1
- error(msprintf(" Too many [a b c d e f]put arguments\n"));
- elseif rhs>7
- error(msprintf(" Too many input arguments,maximum number of arguments is 7\n"));
- elseif rhs<3
- error(msprintf("the function needs atleast 3 arguments\n"));
- end
-
- if rhs==3
- [a b c d e f] =raw_stereoCalibrate(objectpoints,imagepoints1,imagepoints2);
- elseif rhs==4
- [a b c d e f]=raw_stereoCalibrate(objectpoints,imagepoints1,imagepoints2,varargin(1));
- elseif rhs==5
- [a b c d e f]=raw_stereoCalibrate(objectpoints,imagepoints1,imagepoints2,varargin(1),varargin(2));
- elseif rhs==6
- [a b c d e f]=raw_stereoCalibrate(objectpoints,imagepoints1,imagepoints2,varargin(1),varargin(2),varargin(3));
- elseif rhs==7
- [a b c d e f]=raw_stereoCalibrate(objectpoints,imagepoints1,imagepoints2,varargin(1),varargin(2),varargin(3),varargin(4));
- end
-
-
-
- params=struct('cameraMarix1',a,'distortionCoefficients1',b,'cameraMatrix2',c,'distortionCoefficients2',d,'rotationMatrix',e,'TranslationVector',f);
-endfunction
diff --git a/macros/trainSVMClassifier.bin b/macros/trainSVMClassifier.bin
deleted file mode 100644
index 5f15907..0000000
Binary files a/macros/trainSVMClassifier.bin and /dev/null differ
diff --git a/macros/trainSVMClassifier.sci b/macros/trainSVMClassifier.sci
deleted file mode 100644
index a288163..0000000
--- a/macros/trainSVMClassifier.sci
+++ /dev/null
@@ -1,111 +0,0 @@
-// Copyright (C) 2015 - 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: Nihar Rao
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-function [classifier]=trainSVMClassifier(imgSet,bag,classifierName,varargin)
-// This function is used to train an image classifier using the SVM(Support Vector Machines) Model.
-//
-// Calling Sequence
-// imgSet = imageSet(directory,'recursive');
-// 'or'
-// imgSet = imageSet(image);
-// bag = bagOfFeatures(imgSet);
-// classifier = trainSVMClassifier(imgSets, bag);
-// classifier = trainSVMClassifier(imgSets, bag,'nameclass')
-// classifier = trainSVMClassifier(imgSets, bag,'nameclass')
-// classifier = trainSVMClassifier(imgSets, bag,'nameclass',C)
-// classifier = trainSVMClassifier(imgSets, bag,'nameclass',C,coeff)
-// classifier = trainSVMClassifier(imgSets, bag,'nameclass',C,coeff,degree)
-// classifier = trainSVMClassifier(imgSets, bag,'nameclass',C,coeff,degree,gamma)
-// classifier = trainSVMClassifier(imgSets, bag,'nameclass',C,coeff,degree,gamma,kernelType,Nu)
-// classifier = trainSVMClassifier(imgSets, bag,'nameclass',C,coeff,degree,gamma,kernelType,Nu,P)
-// classifier = trainSVMClassifier(imgSets, bag,'nameclass',C,coeff,degree,gamma,kernelType,Nu,P,setType)
-//
-// Parameters
-// classifier: Image category classifier location
-// BagofFeaturesLocation : location of the xml or yml file.
-// Description : features obtained after training.
-// imgSets: Input imageSet to train the classifier on
-// bag: The bagOfFeatures of the imageSet provided
-// image: The set of images used for creating the imageset used for training
-// nameclass: Name of the classifier one wants for their trained model .xml or .yml file
-// C: Parameter C of a SVM optimization problem that should be used to train the model
-// coef: Parameter coef0 of a kernel function that should be used to train the model
-// degree: Parameter degree of a kernel function that should be used to train the model
-// gamma:Parameter γ of a kernel function that should be used to train the model.
-// kernelType:Type of a SVM kernel that should be used to train the model.it should be [-1,5].
-// Nu:Parameter ν of a SVM optimization problem that should be used to train the model.
-// P: Parameter ϵ of a SVM optimization problem that should be used to train the model.
-// type: Type of a SVM formulation that should be used to train the model.it should be [100,104].
-//
-// Description
-// this function is used to train an image classifier using the SVM(Support Vector Machines) Model.
-//
-//
-// Examples
-// //get imageset from 'images2' folder
-// image=imageSet('images2','recursive');
-// //get bag of features
-// x=bagOfFeatures(image);
-// //train thew model and name the saved .yml file as "SVM"
-// d=trainSVMClassifier(image,x,"SVM");
-// //read image to get prediction from mthe above trained data
-// z=imread("fish.jpg");
-// //finally predict the class using SVM's prediction function for the input image
-// resp=predict(d,z,"SVM");
-//
-// //get imageset from 'images2' folder
-// image=imageSet('images2','recursive');
-// //get bag of features
-// x=bagOfFeatures(image);
-// //train the model with the given parameters and name the saved .yml file as "SVM"
-// d=trainSVMClassifier(image,x,"SVM",1.1,0.2);
-// //read image to get prediction from mthe above trained data
-// z=imread("fish.jpg");
-// //finally predict the class for the input image
-// resp=predict(d,z,"SVM");
-
-
-
-
-
- //convert to list
- bag_list = bagStructToList(bag);
- imgSets_list = imageSetToList(imgSet);
- [lhs rhs]=argn(0);
-
- if lhs>1
- error(msprintf(" Too many output arguments"));
- elseif rhs>11
- error(msprintf(" Too many input arguments,maximum number of arguments is 11"));
- elseif rhs<3
- error(msprintf("the function needs atleast 3 arguments"));
- end
- if rhs==3
- temp=raw_trainSVMClassifier(imgSets_list, bag_list,classifierName);
- elseif rhs==4
- temp=raw_trainSVMClassifier(imgSets_list,bag_list,classifierName,varargin(1));
- elseif rhs==5
- temp=raw_trainSVMClassifier(imgSets_list,bag_list,classifierName,varargin(1),varargin(2));
- elseif rhs==6
- temp=raw_trainSVMClassifier(imgSets_list,bag_list,classifierName,varargin(1),varargin(2),varargin(3));
- elseif rhs==7
- temp=raw_trainSVMClassifier(imgSets_list,bag_list,classifierName,varargin(1),varargin(2),varargin(3),varargin(4));
- elseif rhs==8
- temp=raw_trainSVMClassifier(imgSets_list,bag_list,classifierName,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5));
- elseif rhs==9
- temp=raw_trainSVMClassifier(imgSets_list,bag_list,classifierName,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6));
- elseif rhs==10
- temp=raw_trainSVMClassifier(imgSets_list,bag_list,classifierName,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6),varargin(7));
- elseif rhs==11
- temp=raw_trainSVMClassifier(imgSets_list,bag_list,classifierName,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6),varargin(7),varargin(8));
- end
- classifier = struct("ClassifierLocation", temp(2), "BagofFeaturesLocation", temp(3), "Description", temp(4));
-
-endfunction
diff --git a/macros/trainSVMSGDClassifier.bin b/macros/trainSVMSGDClassifier.bin
deleted file mode 100644
index 1a5a9ab..0000000
Binary files a/macros/trainSVMSGDClassifier.bin and /dev/null differ
diff --git a/macros/trainSVMSGDClassifier.sci b/macros/trainSVMSGDClassifier.sci
deleted file mode 100644
index bb01b27..0000000
--- a/macros/trainSVMSGDClassifier.sci
+++ /dev/null
@@ -1,101 +0,0 @@
-// Copyright (C) 2015 - 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: Nihar Rao
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function [classifier]=trainSVMSGDSGDClassifier(imgSet,bag,classifierName,varargin)
-// This function is used to train an image classifier using the SVMSGD(Stochastic Gradient Descent SVM) Model.
-//
-// Calling Sequence
-// imgSet = imageSet(directory,'recursive');
-// 'or'
-// imgSet = imageSet(image);
-// bag = bagOfFeatures(imgSet);
-// classifier = trainSVMSGDClassifier(imgSets, bag);`
-// classifier = trainSVMSGDClassifier(imgSets, bag,'nameclass')
-// classifier = trainSVMSGDClassifier(imgSets, bag,'nameclass')
-// classifier = trainSVMSGDClassifier(imgSets, bag,'nameclass',initialStepSize)
-// classifier = trainSVMSGDClassifier(imgSets, bag,'nameclass',initialStepSize,marginReg)
-// classifier = trainSVMSGDClassifier(imgSets, bag,'nameclass',initialStepSize,marginReg,marginType)
-// classifier = trainSVMSGDClassifier(imgSets, bag,'nameclass',initialStepSize,marginReg,marginType,optimalParams)
-// classifier = trainSVMSGDClassifier(imgSets, bag,'nameclass',initialStepSize,marginReg,marginType,optimalParams,stepDecreasingPower)
-//classifier = trainSVMSGDClassifier(imgSets, bag,'nameclass',initialStepSize,marginReg,marginType,optimalParams,stepDecreasingPower,svmsgdType)
-//
-// Parameters
-// classifier: Image category classifier location
-// BagofFeaturesLocation : location of the xml or yml file.
-// Description : features obtained after training.
-// imgSets: Input imageSet to train the classifier on
-// bag: The bagOfFeatures of the imageSet provided
-// image: The set of images used for creating the imageset used for training
-// nameclass: Name of the classifier one wants for their trained model .xml or .yml file
-// initialStepSize:Parameter initialStepSize of a SVMSGD optimization problem that should be used to train the model.
-// marginReg: Parameter marginRegularization of a SVMSGD optimization problem that should be used to train the model
-// marginType: Parameter marginType of a SVMSGD optimization problem that should be used to train the model.it should be either 0 or 1.
-// optimalParams: sets optimal parameters values for chosen SVM SGD model.
-// stepDecreasingPower: Parameter stepDecreasingPower of a SVMSGD optimization problem that should be used to train the model.
-// svmsgdType: Algorithm type of SVMSGD that should be used to train the model.it should be either 0 or 1.
-//
-//
-// Description
-// This function is used to train an image classifier using the SVMSGD(Stochastic Gradient Descent SVM) Model.
-//
-// Examples
-// //get imageset from 'images2' folder
-// image=imageSet('images2','recursive');
-// //get bag of features
-// x=bagOfFeatures(image);
-// //train thew model and name the saved .yml file as "pbrr" using the given parameters
-// r=trainSVMSGDClassifier(image,x,"pbrr",0,0,0,1,0,1);
-// //read image to get prediction from the above trained data
-// z=imread("fish.jpg");
-// //finally predict the class using SVMSGD's prediction function for the input image
-// resp=predict(r,z,"SVMSGD");
-//
-// //get imageset from 'images2' folder
-// image=imageSet('images2','recursive');
-// //get bag of features
-// x=bagOfFeatures(image);
-// //train the model and name the saved .yml file as "pbrr"
-// r=trainSVMSGDClassifier(image,x,"pbrr");
-// //read image to get prediction from the above trained data
-// z=imread("fish.jpg");
-// //finally predict the class using SVMSGD's prediction function for the input image
-// resp=predict(r,z,"SVMSGD");
-
- //convert to list
- bag_list = bagStructToList(bag);
- imgSets_list = imageSetToList(imgSet);
- [lhs rhs]=argn(0);
-
- if lhs>1
- error(msprintf(" Too many output arguments"));
- elseif rhs>9
- error(msprintf(" Too many input arguments,maximum number of arguments is 9"));
- elseif rhs<3
- error(msprintf("the function needs atleast 3 arguments"));
- end
- if rhs==3
- temp=raw_trainSVMSGDSGDClassifier(imgSets_list, bag_list,classifierName);
- elseif rhs==4
- temp=raw_trainSVMSGDSGDClassifier(imgSets_list,bag_list,classifierName,varargin(1));
- elseif rhs==5
- temp=raw_trainSVMSGDSGDClassifier(imgSets_list,bag_list,classifierName,varargin(1),varargin(2));
- elseif rhs==6
- temp=raw_trainSVMSGDSGDClassifier(imgSets_list,bag_list,classifierName,varargin(1),varargin(2),varargin(3));
- elseif rhs==7
- temp=raw_trainSVMSGDSGDClassifier(imgSets_list,bag_list,classifierName,varargin(1),varargin(2),varargin(3),varargin(4));
- elseif rhs==8
- temp=raw_trainSVMSGDSGDClassifier(imgSets_list,bag_list,classifierName,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5));
- elseif rhs==9
- temp=raw_trainSVMSGDSGDClassifier(imgSets_list,bag_list,classifierName,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6));
- end
- classifier = struct("ClassifierLocation", temp(2), "BagofFeaturesLocation", temp(3), "Description", temp(4));
-
-endfunction
diff --git a/macros/undistortPoints.bin b/macros/undistortPoints.bin
deleted file mode 100644
index 1cf81d4..0000000
Binary files a/macros/undistortPoints.bin and /dev/null differ
diff --git a/macros/undistortPoints.sci b/macros/undistortPoints.sci
deleted file mode 100644
index e690f58..0000000
--- a/macros/undistortPoints.sci
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (C) 2015 - 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: Deepshika & Nihar Rao
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function [idealPoints] = undistortPoints(observedPoints, camMat, disCoefMat, rectMat, newCamMat)
-// Returns the ideal point coordinates from the observed point coordinates
-//
-// Calling Sequence
-// [idealPoints] = undistortPoints(observedPoints, camMat, disCoefMat, rectMat, newCamMat)
-//
-// Parameters
-// observedPoints: 1xN or Nx1 2-channel (CV_32FC2 or CV_64FC2).
-// camMat: \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}
-// disCoefMat: Input vector of distortion coefficients (k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, or 8 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.
-// rectMat: Rectification transformation in the object space (3x3 matrix). If the matrix is empty, the identity transformation is used.
-//newCamMat: New camera matrix (3x3) or new projection matrix (3x4. If the matrix is empty, the identity new camera matrix is used.
-// idealPoints: ideal point coordinates matrix. If matrix newCamMat is identity or omitted, idealPoints will contain normalized point coordinates.
-//
-// Description
-// Returns the ideal points coordinates from the observed point coordinates after undistortion and reverse perpective transformation.
-//
-// Examples
-// [observedPoints] = [1 2 3 4; 4 3 2 1]
-// [camMat] = [450 0 231; 0 876.3 87.1; 0 0 1]
-// [disCoefMat] = [3 2 0 9]
-// [rectMat] = [1 0 0; 0 1 0; 0 0 1]
-// [newCamMat] = []
-// [idealPoints] = undistortPoints(observedPoints, camMat, disCoefMat, rectMat, newCamMat)
-
-
-
- output = raw_undistortPoints(observedPoints, camMat, disCoefMat, rectMat, newCamMat)
-
- idealPoints=output;
-
-
-
-endfunction
diff --git a/macros/xyz2rgb.bin b/macros/xyz2rgb.bin
deleted file mode 100644
index 980d866..0000000
Binary files a/macros/xyz2rgb.bin and /dev/null differ
diff --git a/macros/xyz2rgb.sci b/macros/xyz2rgb.sci
deleted file mode 100644
index d557939..0000000
--- a/macros/xyz2rgb.sci
+++ /dev/null
@@ -1,8 +0,0 @@
-function [output] = xyz2rgb(img)
- image = mattolist(img);
- a = opencv_xyz2rgb(image);
- d = size(a);
- for i=1:d
- output(:,:,i) = a(i);
- end
-endfunction
diff --git a/sci_gateway/cpp/cleaner.sce b/sci_gateway/cleaner.sce
similarity index 100%
rename from sci_gateway/cpp/cleaner.sce
rename to sci_gateway/cleaner.sce
diff --git a/sci_gateway/cpp/PCL_pcread.cpp b/sci_gateway/cpp/PCL_pcread.cpp
deleted file mode 100644
index 6c7d5e7..0000000
--- a/sci_gateway/cpp/PCL_pcread.cpp
+++ /dev/null
@@ -1,365 +0,0 @@
-/*Authors-Nihar Rao
- Shreyash Sharma
-
-*/
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-
-
-
-using namespace std;
-extern "C"
-{
- #include "api_scilab.h"
- #include "Scierror.h"
- #include "BOOL.h"
- #include
- #include "sciprint.h"
-
-
-
-bool files_exist_check( char *name) {
- struct stat buffer;
- return (stat (name, &buffer) == 0);
- }
-
- int PCL_pcread(char *fname, unsigned long fname_len)
- {
- SciErr sciErr;
- int iLen = 0;
- //variable info
- int iRows = 0;
- int iCols = 0;
- int piRows = 0;
- int piCols = 0;
- int *piAddr = NULL;
- int *piLen = NULL;
- char **pstData = NULL;
- int **pstData1 = NULL;
- int i,j,k=0;
- int intErr;
- double val;
- double *points;
- double *rgbValues,*intensityValues;
- int n;
- int width,height;
- int il,z;
- double num;
- double *xLimit;
- double *yLimit;
- double *zLimit;
- double *normalVectors;
- bool isDense;
- pcl::PointXYZRGB minLimit,maxLimit;
-
-
-
- //Checking number of input and output arguments (enviromnet variable, min arguments, max arguments)
- CheckInputArgument(pvApiCtx, 1, 1);
- CheckOutputArgument(pvApiCtx, 11, 11);
-
-
-
- // get Address of inputs
- sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
-
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
-
- //Now, we will retrieve the string from the input parameter. For this, we will require 3 calls
- //first call to retrieve dimensions
- sciErr = getMatrixOfString(pvApiCtx, piAddr, &iRows, &iCols, NULL, NULL);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- piLen = (int*)malloc(sizeof(int) * iRows * iCols);
- //second call to retrieve length of each string
- sciErr = getMatrixOfString(pvApiCtx, piAddr, &iRows, &iCols, piLen, NULL);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- pstData = (char**)malloc(sizeof(char*) * iRows * iCols);
- for(i = 0 ; i < iRows * iCols ; i++)
- {
- pstData[i] = (char*)malloc(sizeof(char) * (piLen[i] + 1));//+ 1 for null termination
- }
- //third call to retrieve data
- sciErr = getMatrixOfString(pvApiCtx, piAddr, &iRows, &iCols, piLen, pstData);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //check if file exists
- if(!files_exist_check(pstData[0]))
- {
-
- Scierror(999, "Error: the input file not found!.Please enter correct path!\n");
- return 0;
- }
-
- //get string version of file
-
- string inputFile(pstData[0]);
-
- /*Processing*/
-
-
- n=inputFile.length();
-
-
-
- pcl::PointCloud::Ptr cloud (new pcl::PointCloud ());
- //checking ending
- if(inputFile.substr(n-3,n-1)=="pcd")
- {
-
-
-
- if (pcl::io::loadPCDFile (pstData[0], *cloud) == -1) // load the file
- {
- cout<<"\n ERROR: couldn't load file\n"< (pstData[0], *cloud) < 0)
- {
- cout<<"\n ERROR: couldn't load file\n"<height;
- width=cloud->width;
- num=cloud->points.size();
- isDense=cloud->is_dense;
-
- //Allocate memory for cloud processing
- points=(double *)malloc(sizeof(double)*height*width*3);
- normalVectors=(double *)malloc(sizeof(double)*height*width*3);
- rgbValues=(double *)malloc(sizeof(double)*height*width*3);
- intensityValues=(double *)malloc(sizeof(double)*height*width);
- xLimit=(double *)malloc(sizeof(double)*1*2);
- yLimit=(double *)malloc(sizeof(double)*1*2);
- zLimit=(double *)malloc(sizeof(double)*1*2);
-
-
- il=0;
-
- pcl::PointCloud::iterator it;
-
-
-
- //storing values
- for ( it = cloud->points.begin(); it!=cloud->points.end(); ++it) {
- points[il]=(*it).x;
- points[(height * width) + il]=(*it).y;
- points[(2 * height * width) + il]=(*it).z;
-
- //RGB
- rgbValues[il]=(*it).r;
- rgbValues[(height * width) + il]=(*it).g;
- rgbValues[(2 * height * width) + il]=(*it).b;
- //intensity
- intensityValues[il]=0.2989 *(*it).r + 0.5870 * (*it).g + 0.1140 * (*it).b;
-
- il++;
-
-
-
- }
-
-
-
- //////get Limits
- getMinMax3D(*cloud,minLimit,maxLimit);
-
- //Allocate limits for returning to scilab
-
- xLimit[0]=minLimit.x;
- xLimit[1]=maxLimit.x;
-
- yLimit[0]=minLimit.y;
- yLimit[1]=maxLimit.y;
-
- zLimit[0]=minLimit.z;
- zLimit[1]=maxLimit.z;
-
- ///Normal computation
-
-
- pcl::PointCloud::Ptr normals (new pcl::PointCloud);
- pcl::IntegralImageNormalEstimation ne;
- ne.setNormalEstimationMethod (ne.AVERAGE_3D_GRADIENT);
- ne.setMaxDepthChangeFactor(0.02f);
- ne.setNormalSmoothingSize(10.0f);
- ne.setInputCloud(cloud);
- //ne.setRadiusSearch (0.03);
- ne.compute(*normals);
-
-
- //convert cloud to double *
-
-
- pcl::PointCloud::iterator ir;
- il=0;
- for ( ir = normals->points.begin(); ir!=normals->points.end(); ++ir) {
- normalVectors[il]=(*ir).x;
- normalVectors[(height * width) + il]=(*ir).y;
- normalVectors[(2 * height * width) + il]=(*ir).z;
-
- il++;
-
-
- }
-
- }
- catch(exception& e)
- {
- Scierror(999,e.what());
- return 0;
-
-
- }
-
-
-
-
-
-
- //Write Output to Scilab
-
-
-
- sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 1,height*width, 3, points);
- if(sciErr.iErr){
- printError(&sciErr, 0);
- return 0;
- }
- sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 2, 1, 1,&num );
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = createScalarInteger32(pvApiCtx, nbInputArgument(pvApiCtx) + 3,width);
- if(intErr)
- {
- Scierror(999,"Error creating matrix");
- return 0;
- }
- intErr = createScalarInteger32(pvApiCtx, nbInputArgument(pvApiCtx) + 4,height);
- if(intErr)
- {
- Scierror(999,"Error creating matrix");
- return 0;
- }
- sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 5,height*width, 3, rgbValues);
- if(sciErr.iErr){
- printError(&sciErr, 0);
- return 0;
- }
- sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 6,1,2,xLimit);
- if(sciErr.iErr){
- printError(&sciErr, 0);
- return 0;
- }
- sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 7,1,2,yLimit);
- if(sciErr.iErr){
- printError(&sciErr, 0);
- return 0;
- }
- sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 8,1,2,zLimit);
- if(sciErr.iErr){
- printError(&sciErr, 0);
- return 0;
- }
-
- //processing bool for output(is_dense)
- int final;
- if(isDense)
- final=1;
- else
- final=0;
-
- intErr=createScalarBoolean(pvApiCtx, nbInputArgument(pvApiCtx) + 9,final );
- if(intErr)
- {
- Scierror(999,"error creating booleean output ");
- return 0;
-
-
- }
- sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 10,width,height,intensityValues);
- if(sciErr.iErr){
- printError(&sciErr, 0);
- return 0;
- }
- sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 11,height*width, 3, normalVectors);
- if(sciErr.iErr){
- printError(&sciErr, 0);
- return 0;
- }
-
-
- for(int i=1;i<=11;i++)
- AssignOutputVariable(pvApiCtx, i) = nbInputArgument(pvApiCtx) + i;
-
-
- //Returning the Output Variables as arguments to the Scilab environment
- ReturnArguments(pvApiCtx);
-
- return 0;
- }
-
-
-
-
-}
-
-
diff --git a/sci_gateway/cpp/PCL_radsearch.cpp b/sci_gateway/cpp/PCL_radsearch.cpp
new file mode 100644
index 0000000..c9ea3c7
--- /dev/null
+++ b/sci_gateway/cpp/PCL_radsearch.cpp
@@ -0,0 +1,180 @@
+/********************************************************
+Author: Manoj Sree Harsha
+********************************************************/
+#include
+#include
+#include
+#include
+using namespace std;
+extern "C"
+{
+ #include "api_scilab.h"
+ #include "Scierror.h"
+ #include "BOOL.h"
+ #include
+ #include "sciprint.h"
+
+ int PCL_radsearch(char *fname, unsigned long fname_len)
+ {
+
+ // Error management variables
+ SciErr sciErr;
+ int intErr;
+
+ // variables required to read argument #1
+ int *piAddr1 = NULL;
+ int rows1 = 0, cols1 = 0;
+ double* points = NULL; // pointCloud datapoints
+
+ // variables required to read argument #2
+ int *piAddr2 = NULL;
+ int rows2=0,cols2=0;
+ double *qpoint=NULL; // contains the query point
+
+ // variables required to read argument #3
+ int *piAddr3 = NULL;
+ double r=0; // radius
+
+ //Output Matrix containing indices and distances.
+ double *result=NULL;
+
+ //Checking number of input and output arguments (enviromnet variable, min arguments, max arguments)
+ CheckInputArgument(pvApiCtx, 3, 3);
+ CheckOutputArgument(pvApiCtx, 1, 1);
+
+ // to get the argument #1
+ sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr1);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ // Check that the first input argument is a real matrix (and not complex)
+ if( !isDoubleType(pvApiCtx, piAddr1) || isVarComplex(pvApiCtx, piAddr1) )
+ {
+ Scierror(999, "point cloud should consist of real values.");
+ return 0;
+ }
+ sciErr = getMatrixOfDouble(pvApiCtx, piAddr1, &rows1, &cols1, &points);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ // to get the argument #2
+ sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piAddr2);
+
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ // Check that the first input argument is a real vector (and not complex)
+ if ( !isDoubleType(pvApiCtx, piAddr2) || isVarComplex(pvApiCtx, piAddr2) )
+ {
+ Scierror(999, _("%s: Wrong type for input argument #%d: A real vector expected.\n"), fname, 2);
+ return 0;
+ }
+ sciErr = getMatrixOfDouble(pvApiCtx, piAddr2, &rows2, &cols2, &qpoint);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ // to get the argument #3
+ sciErr = getVarAddressFromPosition(pvApiCtx, 3, &piAddr3);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ if ( !isDoubleType(pvApiCtx, piAddr3))
+ {
+ Scierror(999, _("%s: Wrong type for input argument #%d: A scalar expected.\n"), fname, 3);
+ return 0;
+ }
+ intErr = getScalarDouble(pvApiCtx, piAddr3,&r);
+ if (intErr)
+ {
+ return intErr;
+ }
+
+ // Check that the second argument is a vector or not
+ if(rows2!=1)
+ {
+ Scierror(999, _("%s: Invalid input argument #%d: A vector expected.\n"),fname,2);
+ return 0;
+ }
+
+ //Application Code
+ try
+ {
+ //Creates and fills a PointCloud with the data given by user.
+ pcl::PointCloud::Ptr cloud (new pcl::PointCloud);
+ cloud->width = rows1;
+ cloud->height = 1;
+ cloud->points.resize (cloud->width*cloud->height);
+ for(size_t i = 0; i < cloud->points.size (); ++i)
+ {
+ cloud->points[i].x = points[i];
+ cloud->points[i].y = points[i + (int)rows1*1 ];
+ cloud->points[i].z = points[i + 2*(int)rows1*1];
+ }
+
+ //Creates kdtree object and sets our created cloud as the input
+ pcl::KdTreeFLANN kdtree;
+ kdtree.setInputCloud (cloud);
+
+ //Creates a “searchPoint” which is assigned with values of querypoint.
+ pcl::PointXYZ searchPoint;
+ searchPoint.x = qpoint[0];
+ searchPoint.y = qpoint[1];
+ searchPoint.z = qpoint[2];
+
+ //Creates 2 vectors for storing information about our points.
+ std::vector pointIdxRadiusSearch;
+ std::vector pointRadiusSquaredDistance;
+
+ //Calling Function 'radiusSearch'
+ kdtree.radiusSearch (searchPoint, r, pointIdxRadiusSearch, pointRadiusSquaredDistance);
+
+ //Storing indices and distances in output matrix 'result'
+ int count=0;
+ result=(double*)malloc(sizeof(double)*2*pointIdxRadiusSearch.size ());
+ for (int i=0;i<2*pointIdxRadiusSearch.size ();i++)
+ {
+ if(i%2==0)
+ {
+ result[i]=(double)pointIdxRadiusSearch[count];
+ }
+ else
+ {
+ result[i]=(double)pointRadiusSquaredDistance[count];
+ count=count+1;
+ }
+ }
+
+ //creating the output matrix
+ sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 1,2,pointIdxRadiusSearch.size (),result);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return sciErr.iErr;
+ }
+ }
+ catch(cv::Exception& e)
+ {
+ const char* err=e.what();
+ Scierror(999,("%s"),err);
+ }
+
+ //Assigning output variables
+ AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
+
+ //Returning the Output Variables as arguments to the Scilab environment
+ ReturnArguments(pvApiCtx);
+ return 0;
+ }
+}
diff --git a/sci_gateway/cpp/builder_gateway_cpp.sce b/sci_gateway/cpp/builder_gateway_cpp.sce
deleted file mode 100644
index 318bf1a..0000000
--- a/sci_gateway/cpp/builder_gateway_cpp.sce
+++ /dev/null
@@ -1,458 +0,0 @@
-// This file is released under the 3-clause BSD license. See COPYING-BSD.
-
-
-mode(-1)
-lines(0)
-
-toolbox_title = "FOSSEE_Image_Processing_Toolbox";
-
-Build_64Bits = %t;
-
-
-path_builder = get_absolute_file_path('builder_gateway_cpp.sce');
-Names = [
-// "raw_dctmtx", "dctmtx";
-// "raw_multithresh", "multithresh";
-// "raw_applycform", "opencv_applycform";
- "raw_arrowedline", "opencv_arrowedline";
- "raw_blur", "opencv_blur";
- "raw_boundingRect", "opencv_boundingRect";
-//// "raw_bwconvhull", "opencv_bwconvhull";
-//// "raw_bwdistgeodesic", "opencv_bwdistgeodesic";
-//// "raw_bwlookup", "opencv_bwlookup";
-//// "raw_canny", "opencv_canny";
-// "raw_circle", "opencv_circle";
-//// "raw_clipline", "opencv_clipline";
-//// "raw_convexhull", "opencv_convexhull";
-//// "raw_convmtx2", "opencv_convmtx2";
-//// "raw_copymakeborder", "opencv_copymakeborder";
-//// "raw_corner", "opencv_corner";
-//// "raw_cornerEigenValsAndVecs", "opencv_cornerEigenValsAndVecs";
-//// "raw_cornerHarris", "opencv_cornerHarris";
-//// "raw_cornerMinEigenVal", "opencv_cornerMinEigenVal";
-// "raw_cvtColor", "opencv_cvtColor";
-//// "raw_demosaic", "opencv_demosaic";
-// "raw_dilate", "opencv_dilate";
-//// "raw_ellipse", "opencv_ellipse";
-//// "raw_ellipse2poly", "opencv_ellipse2poly";
-//
-//// "raw_fftshift", "opencv_fftshift";
-//// "raw_fillconvexpoly", "opencv_fillconvexpoly";
-//// "raw_filter2D", "opencv_filter2D";
-//// "raw_findContours", "opencv_findContours";
-//// "raw_fsamp2", "opencv_fsamp2";
-
-//// "raw_gabor", "opencv_gabor";
-//// "raw_gaussianblur", "opencv_gaussianblur";
-//// "raw_getStructuringElement", "opencv_getStructuringElement";
-//// "getTextSize", "opencv_getTextSize";
-//// "raw_getgaussiankernel", "opencv_getgaussiankernel";
-//// "raw_getrectsubpix", "opencv_getrectsubpix";
-//// "raw_getrotationmatrix2D", "opencv_getrotationmatrix2D";
-//// "raw_goodfeaturestotrack", "opencv_goodfeaturestotrack";
-
-//// "raw_houghcircles", "opencv_houghcircles";
-//// "raw_houghlines", "opencv_houghlines";
-//// "raw_houghlinesp", "opencv_houghlinesp";
-//// "raw_ifftshift", "opencv_ifftshift";
-//// "raw_im2double", "opencv_im2double";
-//// "raw_imabsdiff", "opencv_imabsdiff";
-//// "raw_imadd", "opencv_imadd";
-//// "raw_imattributes", "opencv_imattributes";
-//// "raw_imboxfilt3", "opencv_imboxfilt3";
-//// "raw_imcomplement", "opencv_imcomplement";
-//// "raw_imcontour", "opencv_imcontour";
-//// "raw_imcontrast", "opencv_imcontrast";
-// "raw_imcrop", "opencv_imcrop";
-//// "raw_imdivide", "opencv_imdivide";
-//// "raw_imextendedmax", "opencv_imextendedmax";
-//// "raw_imextendedmin", "opencv_imextendedmin";
-//// "raw_imfill", "opencv_imfill";
-//// "raw_imfindcircles", "opencv_imfindcircles";
-//// "raw_imfuse", "opencv_imfuse";
-//// "raw_imgaborfilt", "opencv_imgaborfilt";
-//// "raw_imgaussfilt3", "opencv_imgaussfilt3";
-//// "raw_imguidedfilter", "opencv_imguidedfilter";
-//// "raw_imhmax", "opencv_imhmax";
-//// "raw_imhmin", "opencv_imhmin";
-//// "raw_imimposemin", "opencv_imimposemin";
-//// "raw_imlincomb", "opencv_imlincomb";
-//// "raw_immultiply", "opencv_immultiply";
-// "raw_impixel", "opencv_impixel";
-//// "raw_impyramid", "opencv_impyramid";
- "raw_imread", "opencv_imread";
-//// "raw_imrect", "opencv_imrect";
-// "raw_imresize", "opencv_imresize";
-// "raw_imsharpen", "opencv_imsharpen";
-//// "raw_imshowpair", "opencv_imshowpair";
-//// "raw_imsubtract", "opencv_imsubtract";
-//// "raw_imwarp", "opencv_imwarp";
-// "raw_imwrite", "opencv_imwrite";
-//// "raw_ind2gray", "opencv_ind2gray";
-//// "raw_ind2rgb", "opencv_ind2rgb";
-//// "raw_lab2double", "opencv_lab2double";
-//// "raw_lab2rgb", "opencv_lab2rgb";
-//// "raw_lab2uint16", "opencv_lab2uint16";
-//// "raw_lab2uint8", "opencv_lab2uint8";
-//// "raw_lab2xyz", "opencv_lab2xyz";
-//// "raw_laplacian", "opencv_laplacian";
-//// "raw_line", "opencv_line";
-//
-
-// "raw_medianblur", "opencv_medianblur";
-//// "raw_montage", "opencv_montage";
-//// "raw_morphologyEx", "opencv_morphologyEx";
-//// "raw_ntsc2rgb", "opencv_ntsc2rgb";
-//// "raw_puttext", "opencv_puttext";
-//// "raw_pyrDown", "opencv_pyrDown";
-//// "raw_pyrUp", "opencv_pyrUp";
-//// "raw_rectangle", "opencv_rectangle";
-//// "raw_regionfill", "opencv_regionfill";
-//// "raw_rgb2lab", "opencv_rgb2lab";
-//// "raw_rgb2ntsc", "opencv_rgb2ntsc";
- "raw_rgb2xyz", "opencv_rgb2xyz";
-//// "raw_roifill", "opencv_roifill";
-//// "raw_roipoly", "opencv_roipoly";
-//// "raw_scharr", "opencv_scharr";
-//// "raw_sepFilter2D", "opencv_sepFilter2D";
-//// "raw_sobel", "opencv_sobel";
-//// "raw_ssim", "opencv_ssim";
-//// "raw_threshold", "opencv_threshold";
-//// "raw_undistort", "opencv_undistort";
-//// "raw_viscircles", "opencv_viscircles";
-//// "raw_watershed", "opencv_watershed";
-//// "raw_whitepoint", "opencv_whitepoint";
-//// "raw_wiener2", "opencv_wiener2";
-//// "raw_xyz2double", "opencv_xyz2double";
-//// "raw_xyz2lab", "opencv_xyz2lab";
-//// "raw_xyz2rgb", "opencv_xyz2rgb";
-//// "raw_xyz2uint16", "opencv_xyz2uint16";
-// "raw_iminpaint.cpp", "opencv_iminpaint";
-// "raw_roiFreeHand.cpp","opencv_roiFreeHand.cpp"
-
-// "raw_deconvlucy", "opencv_deconvlucy";
-//// "imhistmatch", "opencv_imhistmatch";
-//// "graycoprops", "opencv_graycoprops";
-//// "graydiffweight", "opencv_graydiffweight";
-//// "decorrstretch", "opencv_decorrstretch";
-//// "adaptf", "opencv_adapthisteq";
-//// "affine2d", "opencv_affine2d";
-
-
-//// "approxpolyDP","approxpolyDP";
-//// "arclenght","arclenght";
-//// "bilateralfilter","bilateralfilter";
-//// "borderInterpolate","borderInterpolate";
-//// "boxfilter","boxfilter";
-//// "contourarea","contourarea";
-//// "boxfilter","boxfilter";
-// "raw_fitellipse","opencv_fitellipse";
-//// "getkerneltype","getkerneltype";
-//// "histeq","histeq";
-// "raw_imrotate","opencv_imrotate";
-//// "mean1","mean1";
-//// "minAreaRect","minAreaRect";
-//// "minimumenclosingcirlce","minimumenclosingcirlce";
-//// "pyrMeanShiftFiltering","pyrMeanShiftFiltering";
-// "raw_rgb2gray","opencv_rgb2gray";
-//// "warpaffine","warpaffine";
-// "raw_detectMinEigenFeatures","opencv_detectMinEigenFeatures";
-// "raw_correctMatches","opencv_correctMatches";
-// "raw_findHomography","opencv_findHomography";
-// "raw_matMulDeriv","opencv_matMulDeriv";
-// "raw_imageSet","opencv_imageSet";
-// "raw_bagOfFeatures","opencv_bagOfFeatures";
-// "raw_trainImageCategoryClassifier","opencv_trainImageCategoryClassifier";
-// "raw_trainSVMClassifier","opencv_trainSVMClassifier";
-// "raw_predictSVM","opencv_predictSVM";
-// "raw_trainSVMSGDClassifier","opencv_trainSVMSGDClassifier";
-// "raw_predictSVMSGD","opencv_predictSVMSGD";
-// "raw_getParamsSVM","opencv_getParamsSVM";
-// "raw_getParamsSVMSGD","opencv_getParamsSVMSGD";
-// "raw_trainBoostClassifier","opencv_trainBoostClassifier";
-// "raw_predictBoost","opencv_predictBoost";
-// "raw_trainEMClassifier","opencv_trainEMClassifier";
-// "raw_CascadeObjectDetector","opencv_CascadeObjectDetector";
-// "ocv_detectBRISKFeatures","opencv_detectBRISKFeatures";
-// "raw_detectMSERFeatures","opencv_detectMSERFeatures";
-// "raw_extractFeatures","opencv_extractFeatures";
-// "raw_detectSURFFeatures","opencv_detectSURFFeatures"
-// "raw_drawMatch","opencv_drawMatch";
-// "raw_matchFeatures","opencv_matchFeatures";
-// "ocv_detectFASTFeatures","opencv_detectFASTFeatures";
-// "ocv_detectHarrisFeatures","opencv_detectHarrisFeatures";
-// "raw_peopleDetector","opencv_peopleDetector";
-// "raw_rectangle","opencv_rectangle";
-// "raw_detectKAZEFeatures","opencv_detectKAZEFeatures";
-// "raw_detectGFTTFeatures","opencv_detectGFTTFeatures";
-// "raw_estimateFundamentalMat","opencv_estimateFundamentalMat";
-// "raw_undistortPoints","opencv_undistortPoints";
-// "raw_rectifyStereoImages","opencv_rectifyStereoImages";
-// "raw_estimateNewCameraMatrix", "opencv_estimateNewCameraMatrix";
-// "raw_stereoCalibrate","opencv_stereoCalibrate";
-// "raw_detectCheckerboardCorner","opencv_detectCheckerboardCorner";
-// "raw_genCheckerboardPoints","opencv_genCheckerboardPoints";
-// "raw_undistortImage","opencv_undistortImage";
-// "raw_disparity","opencv_disparity";
-// "raw_indexImages","opencv_indexImages";
-// "raw_lab2double","opencv_lab2double";
-// "raw_fitellipse","opencv_fitellipse";
-// "raw_graycoprops","opencv_graycoprops";
-// "raw_integralKernel","opencv_integralKernel";
-// "raw_pcread","PCL_pcread";
-
-
-
- ];
-
-Files = [
-// "dctmtx.cpp",
-
-// "multithresh.cpp",
-// "opencv_applycform.cpp",
-// "opencv_arrowedline.cpp",
-// "opencv_blur.cpp",
-//// "opencv_boundingRect.cpp",
-//// "opencv_bwconvhull.cpp",
-//// "opencv_bwdistgeodesic.cpp",
-//// "opencv_bwlookup.cpp",
-//// "opencv_canny.cpp",
-// "opencv_circle.cpp",
-//// "opencv_clipline.cpp",
-//// "opencv_convexhull.cpp",
-//// "opencv_convmtx2.cpp",
-//// "opencv_copymakeborder.cpp",
-//// "opencv_corner.cpp",
-//// "opencv_cornerEigenValsAndVecs.cpp",
-//// "opencv_cornerHarris.cpp",
-//// "opencv_cornerMinEigenVal.cpp",
-// "opencv_cvtColor.cpp",
-//// "opencv_demosaic.cpp",
-// "opencv_dilate.cpp",
-// "opencv_ellipse.cpp",
-//// "opencv_ellipse2poly.cpp",
-/// "opencv_erode.cpp",
-//// "opencv_fftshift.cpp",
-//// "opencv_fillconvexpoly.cpp",
-//// "opencv_filter2D.cpp",
-//// "opencv_findContours.cpp",
-//// "opencv_fsamp2.cpp",
-
-//// "opencv_gabor.cpp",
-//// "opencv_gaussianblur.cpp",
-//// "opencv_getStructuringElement.cpp",
-//// "opencv_getTextSize.cpp",
-//// "opencv_getgaussiankernel.cpp",
-//// "opencv_getrectsubpix.cpp",
-//// "opencv_getrotationmatrix2D.cpp",
-//// "opencv_goodfeaturestotrack.cpp",
-
-//// "opencv_houghcircles.cpp",
-//// "opencv_houghlines.cpp",
-//// "opencv_houghlinesp.cpp",
-//// "opencv_ifftshift.cpp",
-//// "opencv_im2double.cpp",
-//// "opencv_imabsdiff.cpp",
-//// "opencv_imadd.cpp",
-//// "opencv_imattributes.cpp",
-//// "opencv_imboxfilt3.cpp",
-//// "opencv_imcomplement.cpp",
-//// "opencv_imcontour.cpp",
-//// "opencv_imcontrast.cpp",
-// "opencv_imcrop.cpp",
-//// "opencv_imdivide.cpp",
-//// "opencv_imextendedmax.cpp",
-//// "opencv_imextendedmin.cpp",
-//// "opencv_imfill.cpp",
-//// "opencv_imfindcircles.cpp",
-//// "opencv_imfuse.cpp",
-//// "opencv_imgaborfilt.cpp",
-//// "opencv_imgaussfilt3.cpp",
-//// "opencv_imguidedfilter.cpp",
-//// "opencv_imhmax.cpp",
-//// "opencv_imhmin.cpp",
-//// "opencv_imimposemin.cpp",
-//// "opencv_imlincomb.cpp",
-//// "opencv_immultiply.cpp",
-// "opencv_impixel.cpp",
-//// "opencv_impyramid.cpp",
- "opencv_imread.cpp",
-//// "opencv_imrect.cpp",
-// "opencv_imresize.cpp",
-// "opencv_imsharpen.cpp",
-//// "opencv_imshowpair.cpp",
-//// "opencv_imsubtract.cpp",
-//// "opencv_imwarp.cpp",
-// "opencv_imwrite.cpp",
-//// "opencv_ind2gray.cpp",
-//// "opencv_ind2rgb.cpp",
-//// "opencv_lab2double.cpp",
-//// "opencv_lab2rgb.cpp",
-//// "opencv_lab2uint16.cpp",
-//// "opencv_lab2uint8.cpp",
-//// "opencv_lab2xyz.cpp",
-//// "opencv_laplacian.cpp",
-//// "opencv_line.cpp",
-// "opencv_roiFreeHand.cpp",
-
-// "opencv_medianblur.cpp",
-//// "opencv_montage.cpp",
-//// "opencv_morphologyEx.cpp",
-//// "opencv_ntsc2rgb.cpp",
-//// "opencv_puttext.cpp",
-//// "opencv_pyrDown.cpp",
-//// "opencv_pyrUp.cpp",
-//// "opencv_rectangle.cpp",
-//// "opencv_regionfill.cpp",
-//// "opencv_rgb2lab.cpp",
-//// "opencv_rgb2ntsc.cpp",
- "opencv_rgb2xyz.cpp",
-//// "opencv_roifill.cpp",
-//// "opencv_roipoly.cpp",
-//// "opencv_scharr.cpp",
-//// "opencv_sepFilter2D.cpp",
-//// "opencv_sobel.cpp",
-//// "opencv_ssim.cpp",
-//// "opencv_threshold.cpp",
-//// "opencv_undistort.cpp",
-//// "opencv_viscircles.cpp",
-//// "opencv_watershed.cpp",
-//// "opencv_whitepoint.cpp",
-//// "opencv_wiener2.cpp",
-//// "opencv_xyz2double.cpp",
-//// "opencv_xyz2lab.cpp",
-//// "opencv_xyz2rgb.cpp",
-//// "opencv_xyz2uint16.cpp",
-
-
-// "opencv_deconvlucy.cpp",
-//// "opencv_integralImage.cpp",
-//// "opencv_imhistmatch.cpp",
-//// "opencv_graycoprops.cpp",
-//// "opencv_graydiffweight.cpp",
-//// "opencv_decorrstretch.cpp",
-//// "opencv_adapthisteq.cpp",
-//// "opencv_affine2d.cpp",
-
-// "rgb2gray.cpp",
-//// "warpaffine.cpp",
-//// "opencv_pyrMeanShiftFiltering.cpp",
-//// "opencv_minimumenclosingcirlce.cpp",
-//// "opencv_minAreaRect.cpp",
-//// "opencv_mean1.cpp",
-// "opencv_imrotate.cpp",
-//// "opencv_getkerneltype.cpp",
-// "opencv_fitellipse.cpp",
-//// "opencv_contourarea.cpp",
-//// "opencv_boxfilter.cpp",
-//// "opencv_borderInterpolate.cpp",
-//// "opencv_bilateralfilter.cpp",
-//// "opencv_arclength.cpp",
-//// "opencv_approxpolyDP.cpp",
-//// "opencv_histeq.cpp",
-// "opencv_detectMinEigenFeatures.cpp",
- "opencv_correctMatches.cpp",
- "opencv_findHomography.cpp",
- "opencv_matMulDeriv.cpp",
- "opencv_imageSet.cpp",
- "opencv_bagOfFeatures.cpp",
- "opencv_trainImageCategoryClassifier.cpp",
- "opencv_trainSVMClassifier.cpp",
- "opencv_predictSVM.cpp",
- "opencv_trainSVMSGDClassifier.cpp",
- "opencv_predictSVMSGD.cpp",
- "opencv_getParamsSVM.cpp",
- "opencv_getParamsSVMSGD.cpp",
- "opencv_trainBoostClassifier.cpp",
- "opencv_predictBoost.cpp",
- "opencv_trainEMClassifier.cpp",
- "opencv_CascadeObjectDetector.cpp",
- "opencv_detectBRISKFeatures.cpp",
- "opencv_detectMSERFeatures.cpp",
- "opencv_extractFeatures.cpp",
- "opencv_detectSURFFeatures.cpp",
- "opencv_drawMatch.cpp",
- "opencv_matchFeatures.cpp",
- "opencv_detectFASTFeatures.cpp",
- "opencv_detectHarrisFeatures.cpp",
- "opencv_peopleDetector.cpp",
- "opencv_rectangle.cpp",
- "opencv_detectKAZEFeatures.cpp",
- "opencv_detectGFTTFeatures.cpp",
- "opencv_estimateFundamentalMatrix.cpp",
- "opencv_undistortPoints.cpp",
- "opencv_rectifyStereoImages.cpp",
-// "opencv_estimateNewCameraMatrix.cpp",
- "opencv_stereoCalibrate.cpp",
- "opencv_detectCheckerboardCorner.cpp",
- "opencv_genCheckerboardPoints.cpp",
- "opencv_undistortImage.cpp",
- "opencv_disparity.cpp",
- "opencv_indexImages.cpp",
- "opencv_lab2double.cpp",
- "opencv_fitellipse.cpp",
- "opencv_graycoprops.cpp",
- "opencv_integralKernel.cpp",
- "PCL_pcread.cpp"
- "opencv_bundleAdjustment.cpp"
- "opencv_iminpaint.cpp"
-
-
-
- ];
-
- //copyfile("/home/fossee/Desktop/FOSSEE_Image_Processing_Toolbox/sci_gateway/cpp/common.h",TMPDIR);
- //copyfile("/home/fossee/Desktop/FOSSEE_Image_Processing_Toolbox/sci_gateway/cpp/common.cpp",TMPDIR);
-
- //[a, opt] = getversion();
- //Version = opt(2);
-
- //if getos()=="Windows" then
-// third_dir = path_builder+filesep()+'..'+filesep()+'..'+filesep()+'thirdparty';
-// lib_base_dir = third_dir + filesep() + 'windows' + filesep() + 'lib' + filesep() + Version + filesep();
-// inc_base_dir = third_dir + filesep() + 'windows' + filesep() + 'include' + filesep() + 'coin';
-// C_Flags=['-D__USE_DEPRECATED_STACK_FUNCTIONS__ -w -I '+path_builder+' '+ '-I '+inc_base_dir+' ']
-// Linker_Flag = [lib_base_dir+"libClp.lib "+lib_base_dir+"libCgl.lib "+lib_base_dir+"libOsi.lib "+lib_base_dir+"libOsiClp.lib "+lib_base_dir+"libCoinUtils.lib "+lib_base_dir+"libSymphony.lib "+lib_base_dir+"IpOptFSS.lib "+lib_base_dir+"IpOpt-vc10.lib "]
-
-//else
- //third_dir = path_builder+'..'+filesep()+'..'+filesep()+'thirdparty';
- //lib_base_dir = third_dir + filesep() + 'linux' + filesep() + 'lib' + filesep() + Version + filesep();
- //inc_base_dir = third_dir + filesep() + 'linux' + filesep() + 'include' + filesep() + 'opencv';
- //incl_base_dir = third_dir + filesep() + 'linux' + filesep() + 'include' + filesep() + 'opencv2';
-
-// C_Flags=["-D__USE_DEPRECATED_STACK_FUNCTIONS__ -w -fpermissive -I"+path_builder+"-I"+inc_base_dir+" "+"-I"+incl_base_dir+" -Wl,-rpath= "+lib_base_dir+" "+"-L"+lib_base_dir+"libopencv_core"+" "+"-L"+lib_base_dir+"libopencv_highgui"+" "+"-L"+lib_base_dir+"libopencv_imgproc" ]
-
-// export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:"+lib_base_dir
-// unix_s("export LD_LIBRARY_PATH="+lib_base_dir);
-
-// C_Flags=["-I"+inc_base_dir+" "+"-I"+incl_base_dir];
-// Linker_Flag = ["-L"+lib_base_dir+"libopencv_core"+" "+"-L"+lib_base_dir+"libopencv_highgui"+" "+"-L"+lib_base_dir+"libopencv_imgproc" ];
-
-// Linker_Flag = ["-L/home/fossee/Desktop/FOSSEE_Image_Processing_Toolbox/thirdparty/linux/lib/x64 -lopencv_core -L/home/fossee/Desktop/FOSSEE_Image_Processing_Toolbox/thirdparty/linux/lib/x64 -lopencv_imgproc -L/home/fossee/Desktop/FOSSEE_Image_Processing_Toolbox/thirdparty/linux/lib/x64 -lopencv_highgui" ]
-
-
-//tools_path = path_builder + "../../thirdparty/linux/";
-//unix_s("export LD_LIBRARY_PATH="+tools_path+"lib/"+Version+filesep()+" ");
-//C_Flags=["-w -fpermissive -I"+tools_path+"include/opencv -I"+tools_path+"include/opencv2 -Wl,-rpath="+tools_path+"lib/"+Version+filesep()+" "]
-
-//Linker_Flag = ["-L"+tools_path+"lib/"+Version+"-lopencv_shape -lopencv_stitching -lopencv_objdetect -lopencv_superres -lopencv_videostab -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_video -lopencv_photo -lopencv_ml -lopencv_imgproc -lopencv_flann -lopencv_core "]
-
-//end
-
-//tbx_build_gateway(toolbox_title,Names,Files,get_absolute_file_path("builder_gateway_cpp.sce"), [], Linker_Flag, C_Flags,"g++");
-
-//clear toolbox_title Names Files Linker_Flag C_Flags;
-
-function builder_gw_cpp()
- WITHOUT_AUTO_PUTLHSVAR = %t;
- copyfile(path_builder+"/common.h",TMPDIR);
- copyfile(path_builder+"/common.cpp",TMPDIR);
- tbx_build_gateway("skeleton_imageprocessing", ..
- Names, ..
- Files, ..
- get_absolute_file_path("builder_gateway_cpp.sce"),[],["-L/usr/local/lib -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_cvv -lopencv_dpm -lopencv_fuzzy -lopencv_hdf -lopencv_line_descriptor -lopencv_optflow -lopencv_reg -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_rgbd -lopencv_viz -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_face -lopencv_plot -lopencv_dnn -lopencv_xfeatures2d -lopencv_shape -lopencv_video -lopencv_ximgproc -lopencv_calib3d -lopencv_features2d -lopencv_flann -lopencv_xobjdetect -lopencv_objdetect -lopencv_ml -lopencv_xphoto -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_photo -lopencv_imgproc -lopencv_core -lpcl_common -lpcl_features -lpcl_filters -lpcl_io -lpcl_kdtree -lpcl_keypoints -lpcl_octree -lpcl_outofcore -lpcl_people -lpcl_recognition -lpcl_registration -lpcl_sample_consensus -lpcl_search -lpcl_segmentation -lpcl_surface -lpcl_tracking"],["-I/usr/include/scilab -I/usr/local/include/opencv -I/usr/local/include/opencv2 -I/usr/local/include/pcl-1.8 -I/usr/include/eigen3 "],"g++");
-endfunction
-
-builder_gw_cpp();
-clear builder_gw_cpp; // remove builder_gw_cpp on stack
-
diff --git a/sci_gateway/cpp/builder_gateway_cpp.sce~ b/sci_gateway/cpp/builder_gateway_cpp.sce~
deleted file mode 100644
index c736288..0000000
--- a/sci_gateway/cpp/builder_gateway_cpp.sce~
+++ /dev/null
@@ -1,364 +0,0 @@
-// This file is released under the 3-clause BSD license. See COPYING-BSD.
-
-
-mode(-1)
-lines(0)
-
-toolbox_title = "FOSSEE_Image_Processing_Toolbox";
-
-Build_64Bits = %t;
-
-
-path_builder = get_absolute_file_path('builder_gateway_cpp.sce');
-Names = [
-// "raw_dctmtx", "dctmtx";
-// "raw_multithresh", "multithresh";
-// "raw_applycform", "opencv_applycform";
- //"raw_arrowedline", "opencv_arrowedline";
- "raw_blur", "opencv_blur";
-// "raw_boundingRect", "opencv_boundingRect";
-// "raw_bwconvhull", "opencv_bwconvhull";
-// "raw_bwdistgeodesic", "opencv_bwdistgeodesic";
-// "raw_bwlookup", "opencv_bwlookup";
-// "raw_canny", "opencv_canny";
- "raw_circle", "opencv_circle";
-// "raw_clipline", "opencv_clipline";
-// "raw_convexhull", "opencv_convexhull";
-// "raw_convmtx2", "opencv_convmtx2";
-// "raw_copymakeborder", "opencv_copymakeborder";
-// "raw_corner", "opencv_corner";
-// "raw_cornerEigenValsAndVecs", "opencv_cornerEigenValsAndVecs";
-// "raw_cornerHarris", "opencv_cornerHarris";
-// "raw_cornerMinEigenVal", "opencv_cornerMinEigenVal";
-// "raw_cvtColor", "opencv_cvtColor";
-// "raw_demosaic", "opencv_demosaic";
- "raw_dilate", "opencv_dilate";
-// "raw_ellipse", "opencv_ellipse";
-// "raw_ellipse2poly", "opencv_ellipse2poly";
- "raw_erode", "opencv_erode";
-// "raw_fftshift", "opencv_fftshift";
-// "raw_fillconvexpoly", "opencv_fillconvexpoly";
-// "raw_filter2D", "opencv_filter2D";
-// "raw_findContours", "opencv_findContours";
-// "raw_fsamp2", "opencv_fsamp2";
-
-// "raw_gabor", "opencv_gabor";
-// "raw_gaussianblur", "opencv_gaussianblur";
-// "raw_getStructuringElement", "opencv_getStructuringElement";
-// "getTextSize", "opencv_getTextSize";
-// "raw_getgaussiankernel", "opencv_getgaussiankernel";
-// "raw_getrectsubpix", "opencv_getrectsubpix";
-// "raw_getrotationmatrix2D", "opencv_getrotationmatrix2D";
-// "raw_goodfeaturestotrack", "opencv_goodfeaturestotrack";
-
-// "raw_houghcircles", "opencv_houghcircles";
-// "raw_houghlines", "opencv_houghlines";
-// "raw_houghlinesp", "opencv_houghlinesp";
-// "raw_ifftshift", "opencv_ifftshift";
-// "raw_im2double", "opencv_im2double";
-// "raw_imabsdiff", "opencv_imabsdiff";
-// "raw_imadd", "opencv_imadd";
-// "raw_imattributes", "opencv_imattributes";
-// "raw_imboxfilt3", "opencv_imboxfilt3";
-// "raw_imcomplement", "opencv_imcomplement";
-// "raw_imcontour", "opencv_imcontour";
-// "raw_imcontrast", "opencv_imcontrast";
- "raw_imcrop", "opencv_imcrop";
-// "raw_imdivide", "opencv_imdivide";
-// "raw_imextendedmax", "opencv_imextendedmax";
-// "raw_imextendedmin", "opencv_imextendedmin";
-// "raw_imfill", "opencv_imfill";
-// "raw_imfindcircles", "opencv_imfindcircles";
-// "raw_imfuse", "opencv_imfuse";
-// "raw_imgaborfilt", "opencv_imgaborfilt";
-// "raw_imgaussfilt3", "opencv_imgaussfilt3";
-// "raw_imguidedfilter", "opencv_imguidedfilter";
-// "raw_imhmax", "opencv_imhmax";
-// "raw_imhmin", "opencv_imhmin";
-// "raw_imimposemin", "opencv_imimposemin";
-// "raw_imlincomb", "opencv_imlincomb";
-// "raw_immultiply", "opencv_immultiply";
- "raw_impixel", "opencv_impixel";
-// "raw_impyramid", "opencv_impyramid";
- "raw_imread", "opencv_imread";
-// "raw_imrect", "opencv_imrect";
- "raw_imresize", "opencv_imresize";
- "raw_imsharpen", "opencv_imsharpen";
-// "raw_imshowpair", "opencv_imshowpair";
-// "raw_imsubtract", "opencv_imsubtract";
-// "raw_imwarp", "opencv_imwarp";
- "raw_imwrite", "opencv_imwrite";
-// "raw_ind2gray", "opencv_ind2gray";
-// "raw_ind2rgb", "opencv_ind2rgb";
-// "raw_lab2double", "opencv_lab2double";
-// "raw_lab2rgb", "opencv_lab2rgb";
-// "raw_lab2uint16", "opencv_lab2uint16";
-// "raw_lab2uint8", "opencv_lab2uint8";
-// "raw_lab2xyz", "opencv_lab2xyz";
-// "raw_laplacian", "opencv_laplacian";
-// "raw_line", "opencv_line";
-
-// "raw_medianblur", "opencv_medianblur";
-// "raw_montage", "opencv_montage";
-// "raw_morphologyEx", "opencv_morphologyEx";
-// "raw_ntsc2rgb", "opencv_ntsc2rgb";
-// "raw_puttext", "opencv_puttext";
-// "raw_pyrDown", "opencv_pyrDown";
-// "raw_pyrUp", "opencv_pyrUp";
-// "raw_rectangle", "opencv_rectangle";
-// "raw_regionfill", "opencv_regionfill";
-// "raw_rgb2lab", "opencv_rgb2lab";
-// "raw_rgb2ntsc", "opencv_rgb2ntsc";
-// "raw_rgb2xyz", "opencv_rgb2xyz";
-// "raw_roifill", "opencv_roifill";
-// "raw_roipoly", "opencv_roipoly";
-// "raw_scharr", "opencv_scharr";
-// "raw_sepFilter2D", "opencv_sepFilter2D";
-// "raw_sobel", "opencv_sobel";
-// "raw_ssim", "opencv_ssim";
-// "raw_threshold", "opencv_threshold";
-// "raw_undistort", "opencv_undistort";
-// "raw_viscircles", "opencv_viscircles";
-// "raw_watershed", "opencv_watershed";
-// "raw_whitepoint", "opencv_whitepoint";
-// "raw_wiener2", "opencv_wiener2";
-// "raw_xyz2double", "opencv_xyz2double";
-// "raw_xyz2lab", "opencv_xyz2lab";
-// "raw_xyz2rgb", "opencv_xyz2rgb";
-// "raw_xyz2uint16", "opencv_xyz2uint16";
-
-// "deconvlucy", "opencv_deconvlucy";
-// "imhistmatch", "opencv_imhistmatch";
-// "graycoprops", "opencv_graycoprops";
-// "graydiffweight", "opencv_graydiffweight";
-// "decorrstretch", "opencv_decorrstretch";
-// "adaptf", "opencv_adapthisteq";
-// "affine2d", "opencv_affine2d";
-
-
-// "approxpolyDP","approxpolyDP";
-// "arclenght","arclenght";
-// "bilateralfilter","bilateralfilter";
-// "borderInterpolate","borderInterpolate";
-// "boxfilter","boxfilter";
-// "contourarea","contourarea";
-// "boxfilter","boxfilter";
-// "fitellipse","fitellipse";
-// "getkerneltype","getkerneltype";
-// "histeq","histeq";
- "raw_imrotate","opencv_imrotate";
-// "mean1","mean1";
-// "minAreaRect","minAreaRect";
-// "minimumenclosingcirlce","minimumenclosingcirlce";
-// "pyrMeanShiftFiltering","pyrMeanShiftFiltering";
- "raw_rgb2gray","opencv_rgb2gray";
-// "warpaffine","warpaffine";
-
-
-
- ];
-
-Files = [
-// "dctmtx.cpp",
-
-// "multithresh.cpp",
-// "opencv_applycform.cpp",
- //"opencv_arrowedline.cpp",
- "opencv_blur.cpp",
-// "opencv_boundingRect.cpp",
-// "opencv_bwconvhull.cpp",
-// "opencv_bwdistgeodesic.cpp",
-// "opencv_bwlookup.cpp",
-// "opencv_canny.cpp",
- "opencv_circle.cpp",
-// "opencv_clipline.cpp",
-// "opencv_convexhull.cpp",
-// "opencv_convmtx2.cpp",
-// "opencv_copymakeborder.cpp",
-// "opencv_corner.cpp",
-// "opencv_cornerEigenValsAndVecs.cpp",
-// "opencv_cornerHarris.cpp",
-// "opencv_cornerMinEigenVal.cpp",
-// "opencv_cvtColor.cpp",
-// "opencv_demosaic.cpp",
- "opencv_dilate.cpp",
- "opencv_ellipse.cpp",
-// "opencv_ellipse2poly.cpp",
- "opencv_erode.cpp",
-// "opencv_fftshift.cpp",
-// "opencv_fillconvexpoly.cpp",
-// "opencv_filter2D.cpp",
-// "opencv_findContours.cpp",
-// "opencv_fsamp2.cpp",
-
-// "opencv_gabor.cpp",
-// "opencv_gaussianblur.cpp",
-// "opencv_getStructuringElement.cpp",
-// "opencv_getTextSize.cpp",
-// "opencv_getgaussiankernel.cpp",
-// "opencv_getrectsubpix.cpp",
-// "opencv_getrotationmatrix2D.cpp",
-// "opencv_goodfeaturestotrack.cpp",
-
-// "opencv_houghcircles.cpp",
-// "opencv_houghlines.cpp",
-// "opencv_houghlinesp.cpp",
-// "opencv_ifftshift.cpp",
-// "opencv_im2double.cpp",
-// "opencv_imabsdiff.cpp",
-// "opencv_imadd.cpp",
-// "opencv_imattributes.cpp",
-// "opencv_imboxfilt3.cpp",
-// "opencv_imcomplement.cpp",
-// "opencv_imcontour.cpp",
-// "opencv_imcontrast.cpp",
- "opencv_imcrop.cpp",
-// "opencv_imdivide.cpp",
-// "opencv_imextendedmax.cpp",
-// "opencv_imextendedmin.cpp",
-// "opencv_imfill.cpp",
-// "opencv_imfindcircles.cpp",
-// "opencv_imfuse.cpp",
-// "opencv_imgaborfilt.cpp",
-// "opencv_imgaussfilt3.cpp",
-// "opencv_imguidedfilter.cpp",
-// "opencv_imhmax.cpp",
-// "opencv_imhmin.cpp",
-// "opencv_imimposemin.cpp",
-// "opencv_imlincomb.cpp",
-// "opencv_immultiply.cpp",
- "opencv_impixel.cpp",
-// "opencv_impyramid.cpp",
- "opencv_imread.cpp",
-// "opencv_imrect.cpp",
- "opencv_imresize.cpp",
- "opencv_imsharpen.cpp",
-// "opencv_imshowpair.cpp",
-// "opencv_imsubtract.cpp",
-// "opencv_imwarp.cpp",
- "opencv_imwrite.cpp",
-// "opencv_ind2gray.cpp",
-// "opencv_ind2rgb.cpp",
-// "opencv_lab2double.cpp",
-// "opencv_lab2rgb.cpp",
-// "opencv_lab2uint16.cpp",
-// "opencv_lab2uint8.cpp",
-// "opencv_lab2xyz.cpp",
-// "opencv_laplacian.cpp",
-// "opencv_line.cpp",
-
-// "opencv_medianblur.cpp",
-// "opencv_montage.cpp",
-// "opencv_morphologyEx.cpp",
-// "opencv_ntsc2rgb.cpp",
-// "opencv_puttext.cpp",
-// "opencv_pyrDown.cpp",
-// "opencv_pyrUp.cpp",
-// "opencv_rectangle.cpp",
-// "opencv_regionfill.cpp",
-// "opencv_rgb2lab.cpp",
-// "opencv_rgb2ntsc.cpp",
-// "opencv_rgb2xyz.cpp",
-// "opencv_roifill.cpp",
-// "opencv_roipoly.cpp",
-// "opencv_scharr.cpp",
-// "opencv_sepFilter2D.cpp",
-// "opencv_sobel.cpp",
-// "opencv_ssim.cpp",
-// "opencv_threshold.cpp",
-// "opencv_undistort.cpp",
-// "opencv_viscircles.cpp",
-// "opencv_watershed.cpp",
-// "opencv_whitepoint.cpp",
-// "opencv_wiener2.cpp",
-// "opencv_xyz2double.cpp",
-// "opencv_xyz2lab.cpp",
-// "opencv_xyz2rgb.cpp",
-// "opencv_xyz2uint16.cpp",
-
-
-// "opencv_deconvlucy.cpp",
-// "opencv_integralImage.cpp",
-// "opencv_imhistmatch.cpp",
-// "opencv_graycoprops.cpp",
-// "opencv_graydiffweight.cpp",
-// "opencv_decorrstretch.cpp",
-// "opencv_adapthisteq.cpp",
-// "opencv_affine2d.cpp",
-
- "rgb2gray.cpp",
-// "warpaffine.cpp",
-// "opencv_pyrMeanShiftFiltering.cpp",
-// "opencv_minimumenclosingcirlce.cpp",
-// "opencv_minAreaRect.cpp",
-// "opencv_mean1.cpp",
- "opencv_imrotate.cpp",
-// "opencv_getkerneltype.cpp",
-// "opencv_fitellipse.cpp",
-// "opencv_contourarea.cpp",
-// "opencv_boxfilter.cpp",
-// "opencv_borderInterpolate.cpp",
-// "opencv_bilateralfilter.cpp",
-// "opencv_arclength.cpp",
-// "opencv_approxpolyDP.cpp",
-// "opencv_histeq.cpp",
-
-
-
- ];
-
- copyfile("/home/fossee/Desktop/FOSSEE_Image_Processing_Toolbox/sci_gateway/cpp/common.h",TMPDIR);
- copyfile("/home/fossee/Desktop/FOSSEE_Image_Processing_Toolbox/sci_gateway/cpp/common.cpp",TMPDIR);
-
- [a, opt] = getversion();
- Version = opt(2);
-
- if getos()=="Windows" then
-// third_dir = path_builder+filesep()+'..'+filesep()+'..'+filesep()+'thirdparty';
-// lib_base_dir = third_dir + filesep() + 'windows' + filesep() + 'lib' + filesep() + Version + filesep();
-// inc_base_dir = third_dir + filesep() + 'windows' + filesep() + 'include' + filesep() + 'coin';
-// C_Flags=['-D__USE_DEPRECATED_STACK_FUNCTIONS__ -w -I '+path_builder+' '+ '-I '+inc_base_dir+' ']
-// Linker_Flag = [lib_base_dir+"libClp.lib "+lib_base_dir+"libCgl.lib "+lib_base_dir+"libOsi.lib "+lib_base_dir+"libOsiClp.lib "+lib_base_dir+"libCoinUtils.lib "+lib_base_dir+"libSymphony.lib "+lib_base_dir+"IpOptFSS.lib "+lib_base_dir+"IpOpt-vc10.lib "]
-
-else
- third_dir = path_builder+'..'+filesep()+'..'+filesep()+'thirdparty';
- lib_base_dir = third_dir + filesep() + 'linux' + filesep() + 'lib' + filesep() + Version + filesep();
- inc_base_dir = third_dir + filesep() + 'linux' + filesep() + 'include' + filesep() + 'opencv';
- incl_base_dir = third_dir + filesep() + 'linux' + filesep() + 'include' + filesep() + 'opencv2';
-
-// C_Flags=["-D__USE_DEPRECATED_STACK_FUNCTIONS__ -w -fpermissive -I"+path_builder+"-I"+inc_base_dir+" "+"-I"+incl_base_dir+" -Wl,-rpath= "+lib_base_dir+" "+"-L"+lib_base_dir+"libopencv_core"+" "+"-L"+lib_base_dir+"libopencv_highgui"+" "+"-L"+lib_base_dir+"libopencv_imgproc" ]
-
-// export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:"+lib_base_dir
-// unix_s("export LD_LIBRARY_PATH="+lib_base_dir);
-
-// C_Flags=["-I"+inc_base_dir+" "+"-I"+incl_base_dir];
-// Linker_Flag = ["-L"+lib_base_dir+"libopencv_core"+" "+"-L"+lib_base_dir+"libopencv_highgui"+" "+"-L"+lib_base_dir+"libopencv_imgproc" ];
-
-// Linker_Flag = ["-L/home/fossee/Desktop/FOSSEE_Image_Processing_Toolbox/thirdparty/linux/lib/x64 -lopencv_core -L/home/fossee/Desktop/FOSSEE_Image_Processing_Toolbox/thirdparty/linux/lib/x64 -lopencv_imgproc -L/home/fossee/Desktop/FOSSEE_Image_Processing_Toolbox/thirdparty/linux/lib/x64 -lopencv_highgui" ]
-
-unix_s("export LD_LIBRARY_PATH="+tools_path+"lib/"+Version+filesep()+" ");
-tools_path = path_builder + "../../thirdparty/linux/";
-
-C_Flags=["-w -fpermissive -I"+tools_path+"include/opencv -I"+tools_path+"include/opencv2 -Wl,-rpath="+tools_path+"lib/"+Version+filesep()+" "]
-
-Linker_Flag = ["-L"+tools_path+"lib/"+Version+"-lopencv_shape -lopencv_stitching -lopencv_objdetect -lopencv_superres -lopencv_videostab -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_video -lopencv_photo -lopencv_ml -lopencv_imgproc -lopencv_flann -lopencv_core "]
-
-end
-
-tbx_build_gateway(toolbox_title,Names,Files,get_absolute_file_path("builder_gateway_cpp.sce"), [], Linker_Flag, C_Flags,"g++");
-
-clear toolbox_title Names Files Linker_Flag C_Flags;
-
-//function builder_gw_cpp()
-// WITHOUT_AUTO_PUTLHSVAR = %t;
-// copyfile("/home/fossee/Desktop/FOSSEE_Image_Processing_Toolbox/sci_gateway/cpp/common.h",TMPDIR);
-// copyfile("/home/fossee/Desktop/FOSSEE_Image_Processing_Toolbox/sci_gateway/cpp/common.cpp",TMPDIR);
-//tbx_build_gateway("skeleton_imageprocessing", ..
-// names, ..
-// files, ..
-// get_absolute_file_path("builder_gateway_cpp.sce"),[],["-L/usr/local/lib -lopencv_core -L/usr/local/lib -lopencv_highgui -L/usr/lib -lopencv_imgproc -L/usr/lib -lopencv_calib3d -L/usr/lib -lopencv_video -L/usr/lib -lopencv_nonfree -L/usr/lib -lopencv_ml -L/usr/lib -lopencv_objdetect"],["-I/usr/include/scilab -I/usr/include/opencv -I/usr/include/opencv2 "],"g++ ");
-//endfunction
-
-//builder_gw_cpp();
-//clear builder_gw_cpp; // remove builder_gw_cpp on stack
-
diff --git a/sci_gateway/cpp/common.cpp~ b/sci_gateway/cpp/common.cpp~
deleted file mode 100644
index c19f58a..0000000
--- a/sci_gateway/cpp/common.cpp~
+++ /dev/null
@@ -1,890 +0,0 @@
-/***************************************************
-Author : Sukul Bagai
-***************************************************/
-
-//takes the matrix type as parameter and returns a string of the type
-string type2str(int type)
-{
- string r;
- uchar depth = type & CV_MAT_DEPTH_MASK;
- switch ( depth )
- {
- case CV_8U: r = "8U"; break;
- case CV_8S: r = "8S"; break;
- case CV_16U: r = "16U"; break;
- case CV_16S: r = "16S"; break;
- case CV_32S: r = "32S"; break;
- case CV_32F: r = "32F"; break;
- case CV_64F: r = "64F"; break;
- default: r = "User"; break;
- }
- return r;
-}
-
-//takes matrix type as parameter and returns no. of channels of the image matrix
-int no_of_channels(int type)
-{
- uchar chans = 1 + (type >> CV_CN_SHIFT);
- return chans;
-}
-
-//function used to retrieve image matrix from Scilab environment
-/*
- We need to retrieve image from the Scilab environment
- We do this by getting a List of 2-D matrices. The size of the list, in our case is known(either 3 or 1,
- 3 for a coloured image and 1 for a grayscale image), hence we do not require the dynamic capability of a list.
- Incase of a 3-channel image, the first matrix will be a matrix with dimensions img.rows X img.cols, and will denote the R(red)
- values of the image. Similarly, the second will have the G(green) values, and the third will have B(blue) values.
- For a single-channeled image, we will have only a single matrix
-*/
-int retrieveImage(Mat &image,int pos)
-{
-
- SciErr sciErr;
- int iRows=0,iCols=0,i,j,k=0;
- int *piAddr = NULL;
- int *piAddrChild = NULL;
- int iPrec = 0,iItem = 0;
-
- //retrieving number of items in the list and type of data(integer/float)
- sciErr = getVarAddressFromPosition(pvApiCtx,pos,&piAddr);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- sciErr = getListItemAddress(pvApiCtx,piAddr,1,&piAddrChild);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- sciErr = getListItemNumber(pvApiCtx,piAddr,&iItem);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- if(isIntegerType(pvApiCtx, piAddrChild))
- {
- //getting precision
- sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrChild, &iPrec);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- switch(iPrec)
- {
- case SCI_UINT8: //for unsigned integer 8
- {
- if(iItem==3)
- {
- unsigned char *pstDataR = NULL;
- unsigned char *pstDataG = NULL;
- unsigned char *pstDataB = NULL;
- sciErr = getVarAddressFromPosition(pvApiCtx,pos,&piAddr);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //retrive the matrix of the R values
- sciErr = getMatrixOfUnsignedInteger8InList(pvApiCtx, piAddr, 1, &iRows, &iCols, &pstDataR);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //retrive address of the list
- sciErr = getVarAddressFromPosition(pvApiCtx,pos,&piAddr);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //retrive the matrix of the G values
- sciErr = getMatrixOfUnsignedInteger8InList(pvApiCtx, piAddr, 2, &iRows, &iCols, &pstDataG);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //retrive address of the list
- sciErr = getVarAddressFromPosition(pvApiCtx,pos,&piAddr);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //retrive the matrix of the B values
- sciErr = getMatrixOfUnsignedInteger8InList(pvApiCtx, piAddr, 3, &iRows, &iCols, &pstDataB);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- //creating an image matrix with the no. of rows and columns we retrieved, and assigning it to be of the form 8-bit unsinged integers
- image = Mat(iRows,iCols,CV_8UC3);
-
- /*Now that we have the 3 matrices(R,G,B), we need to assign those values to the pixels. The following code does this*/
- k=0;
- for(i=0;i(i,j)[2]=pstDataR[i+iRows*j];
- image.at(i,j)[1]=pstDataG[i+iRows*j];
- image.at(i,j)[0]=pstDataB[i+iRows*j];
- }
- }
- }
- else
- {
- unsigned char *pstDataR = NULL;
- sciErr = getVarAddressFromPosition(pvApiCtx,pos,&piAddr);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //retrive the matrix of the R values
- sciErr = getMatrixOfUnsignedInteger8InList(pvApiCtx, piAddr, 1, &iRows, &iCols, &pstDataR);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- //creating an image matrix with the no. of rows and columns we retrieved, and assigning it to be of the form 8-bit unsinged integers
- image = Mat(iRows,iCols,CV_8UC1);
-
- //Assigning matrix value to pixel
- k=0;
- for(i=0;i(i,j)=pstDataR[i+iRows*j];
- }
- break;
- }
- case SCI_UINT16: //for unsigned integer 16
- {
- if(iItem==3)
- {
- short unsigned int *pstDataR = NULL;
- short unsigned int *pstDataG = NULL;
- short unsigned int *pstDataB = NULL;
- sciErr = getVarAddressFromPosition(pvApiCtx,pos,&piAddr);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //retrive the matrix of the R values
- sciErr = getMatrixOfUnsignedInteger16InList(pvApiCtx, piAddr, 1, &iRows, &iCols, &pstDataR);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //retrive address of the list
- sciErr = getVarAddressFromPosition(pvApiCtx,pos,&piAddr);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //retrive the matrix of the G values
- sciErr = getMatrixOfUnsignedInteger16InList(pvApiCtx, piAddr, 2, &iRows, &iCols, &pstDataG);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //retrive address of the list
- sciErr = getVarAddressFromPosition(pvApiCtx,pos,&piAddr);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //retrive the matrix of the B values
- sciErr = getMatrixOfUnsignedInteger16InList(pvApiCtx, piAddr, 3, &iRows, &iCols, &pstDataB);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- //creating an image matrix with the no. of rows and columns we retrieved, and assigning it to be of the form 8-bit unsinged integers
- image = Mat(iRows,iCols,CV_16UC3);
-
- //Now that we have the 3 matrices(R,G,B), we need to assign those values to the pixels. The following code does this
- k=0;
- for(i=0;i(i,j)[2]=pstDataR[i+iRows*j];
- image.at(i,j)[1]=pstDataG[i+iRows*j];
- image.at(i,j)[0]=pstDataB[i+iRows*j];
- //i+iRows*j
- }
- }
- }
- else
- {
- short unsigned int *pstDataR = NULL;
- sciErr = getVarAddressFromPosition(pvApiCtx,pos,&piAddr);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //retrive the matrix of the R values
- sciErr = getMatrixOfUnsignedInteger16InList(pvApiCtx, piAddr, 1, &iRows, &iCols, &pstDataR);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- //creating an image matrix with the no. of rows and columns we retrieved, and assigning it to be of the form 8-bit unsinged integers
- image = Mat(iRows,iCols,CV_16UC1);
-
- //Assigning matrix values to pixels
- k=0;
- for(i=0;i(i,j)=pstDataR[i+iRows*j];
- }
- break;
- }
- case SCI_INT16: //for signed integer 16
- {
- if(iItem==3)
- {
- short int *pstDataR = NULL;
- short int *pstDataG = NULL;
- short int *pstDataB = NULL;
- sciErr = getVarAddressFromPosition(pvApiCtx,pos,&piAddr);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //retrive the matrix of the R values
- sciErr = getMatrixOfInteger16InList(pvApiCtx, piAddr, 1, &iRows, &iCols, &pstDataR);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //retrive address of the list
- sciErr = getVarAddressFromPosition(pvApiCtx,pos,&piAddr);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //retrive the matrix of the G values
- sciErr = getMatrixOfInteger16InList(pvApiCtx, piAddr, 2, &iRows, &iCols, &pstDataG);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //retrive address of the list
- sciErr = getVarAddressFromPosition(pvApiCtx,pos,&piAddr);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //retrive the matrix of the B values
- sciErr = getMatrixOfInteger16InList(pvApiCtx, piAddr, 3, &iRows, &iCols, &pstDataB);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- //creating an image matrix with the no. of rows and columns we retrieved, and assigning it to be of the form 8-bit unsinged integers
- image = Mat(iRows,iCols,CV_16SC3);
-
- //Now that we have the 3 matrices(R,G,B), we need to assign those values to the pixels. The following code does this
- k=0;
- for(i=0;i(i,j)[2]=pstDataR[i+iRows*j];
- image.at(i,j)[1]=pstDataG[i+iRows*j];
- image.at(i,j)[0]=pstDataB[i+iRows*j];
- }
- }
- }
- else
- {
- short int *pstDataR = NULL;
- sciErr = getVarAddressFromPosition(pvApiCtx,pos,&piAddr);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //retrive the matrix of the R values
- sciErr = getMatrixOfInteger16InList(pvApiCtx, piAddr, 1, &iRows, &iCols, &pstDataR);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- //creating an image matrix with the no. of rows and columns we retrieved, and assigning it to be of the form 8-bit unsinged integers
- image = Mat(iRows,iCols,CV_16SC1);
-
- //Assigning image matrix values to pixels
- k=0;
- for(i=0;i(i,j)=pstDataR[i+iRows*j];
- }
- break;
- }
- }
- }
- else //for floating point/ double precision values
- {
- if(iItem==3)
- {
- double *pstDataR = NULL;
- double *pstDataG = NULL;
- double *pstDataB = NULL;
- sciErr = getVarAddressFromPosition(pvApiCtx,pos,&piAddr);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //retrive the matrix of the R values
- sciErr = getMatrixOfDoubleInList(pvApiCtx, piAddr, 1, &iRows, &iCols, &pstDataR);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //retrive address of the list
- sciErr = getVarAddressFromPosition(pvApiCtx,pos,&piAddrChild);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //retrive the matrix of the G values
- sciErr = getMatrixOfDoubleInList(pvApiCtx, piAddr, 2, &iRows, &iCols, &pstDataG);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //retrive address of the list
- sciErr = getVarAddressFromPosition(pvApiCtx,pos,&piAddrChild);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //retrive the matrix of the B values
- sciErr = getMatrixOfDoubleInList(pvApiCtx, piAddr, 3, &iRows, &iCols, &pstDataB);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- //creating an image matrix with the no. of rows and columns we retrieved, and assigning it to be of the form 8-bit unsinged integers
- image = Mat(iRows,iCols,CV_64FC3);
-
- //Now that we have the 3 matrices(R,G,B), we need to assign those values to the pixels. The following code does this
- k=0;
- for(i=0;i(i,j)[2]=pstDataR[i+iRows*j];
- image.at(i,j)[1]=pstDataG[i+iRows*j];
- image.at(i,j)[0]=pstDataB[i+iRows*j];
- }
- }
- }
- else
- {
- double *pstDataR = NULL;
- sciErr = getVarAddressFromPosition(pvApiCtx,pos,&piAddr);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //retrive the matrix of the R values
- sciErr = getMatrixOfDoubleInList(pvApiCtx, piAddr, 1, &iRows, &iCols, &pstDataR);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- //creating an image matrix with the no. of rows and columns we retrieved, and assigning it to be of the form 8-bit unsinged integers
- image = Mat(iRows,iCols,CV_64FC1);
-
- //Assigning image matrix values to pixels
- k=0;
- for(i=0;i(i,j)=pstDataR[i+iRows*j];
- }
- }
- return 1;
-}
-
-//function that returns an image matrix to the Scilab environment
-/*
- What we now need, is to pass the image matrix to the Scilab environment.
- We do this by passing a List of 2-D matrices. The size of the list, in our case is known(either 3 or 1,
- 3 for a coloured image and 1 for a grayscale image), hence we do not require the dynamic capability of a list.
- Incase of a 3-channel image, the first matrix will be a matrix with dimensions img.rows X img.cols, and will denote the R(red)
- values of the image. Similarly, the second will have the G(green) values, and the third will have B(blue) values.
- For a single-channeled image, we will have only a single matrix
-*/
-int returnImage(char *checker,Mat img,int pos)
-{
- int i,j,k=0;
- int *piAddrNew = NULL;
- SciErr sciErr;
- int num=no_of_channels(img.type()); //num now contains no. of channels of the image
- //creating the list that will be passed to the Scilab enviroment
- if(num==3)
- sciErr = createList(pvApiCtx, nbInputArgument(pvApiCtx) + pos, 3, &piAddrNew);
- else
- sciErr = createList(pvApiCtx, nbInputArgument(pvApiCtx) + pos, 1, &piAddrNew);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- if(strcmp(checker,"8U")==0) //for Unsigned Integer 8
- {
- if(num==3)
- {
- //Since we need to pass a single pointer as an arguement, for a 2-D matrix, we define it in this manner
- unsigned char *r = (unsigned char *)malloc(img.rows * img.cols * sizeof(unsigned char));
- unsigned char *g = (unsigned char *)malloc(img.rows * img.cols * sizeof(unsigned char));
- unsigned char *b = (unsigned char *)malloc(img.rows * img.cols * sizeof(unsigned char));
-
- //The next block of code retrieves the RGB values at a specified pixel, and assigns it to the matrices
- for(i=0;i(i, j);
- r [i+img.rows*j]=intensity.val[2];
- g [i+img.rows*j]=intensity.val[1];
- b [i+img.rows*j]=intensity.val[0];
- }
- }
-
-
- //Adding the R value matrix to the list
- sciErr = createMatrixOfUnsignedInteger8InList(pvApiCtx, nbInputArgument(pvApiCtx)+pos , piAddrNew, 1, img.rows,img.cols, r);
- free(r);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- //Adding the G value matrix to the list
- sciErr = createMatrixOfUnsignedInteger8InList(pvApiCtx, nbInputArgument(pvApiCtx)+pos , piAddrNew, 2, img.rows,img.cols,g);
- free(g);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- //Adding the B value matrix to the list
- sciErr = createMatrixOfUnsignedInteger8InList(pvApiCtx, nbInputArgument(pvApiCtx)+pos , piAddrNew, 3, img.rows,img.cols, b);
- free(b);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- }
- else
- {
- //Since we need to pass a single pointer as an arguement, for a 2-D matrix, we define it in this manner
- unsigned char *r = (unsigned char *)malloc(img.rows * img.cols * sizeof(unsigned char));
-
- //The next block of code retrieves the image colour values at a specified pixel, and assigns it to the matrices
- for(i=0;i(i, j);
-
-
- //Adding the image colour value matrix to the list
- sciErr = createMatrixOfUnsignedInteger8InList(pvApiCtx, nbInputArgument(pvApiCtx)+pos , piAddrNew, 1,img.rows,img.cols, r);
- free(r);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- }
- }
- else if(strcmp(checker,"16U")==0) //for Unsigned Integer 16
- {
- if(num==3)
- {
- //Since we need to pass a single pointer as an arguement, for a 2-D matrix, we define it in this manner
- short unsigned int *r = (short unsigned int *)malloc(img.rows * img.cols * sizeof(short unsigned int));
- short unsigned int *g = (short unsigned int *)malloc(img.rows * img.cols * sizeof(short unsigned int));
- short unsigned int *b = (short unsigned int *)malloc(img.rows * img.cols * sizeof(short unsigned int));
-
- //The next block of code retrieves the RGB values at a specified pixel, and assigns it to the matrices
- for(i=0;i(i, j);
- r[i+img.rows*j]=intensity.val[2];
- g[i+img.rows*j]=intensity.val[1];
- b[i+img.rows*j]=intensity.val[0];
- }
- }
-
- //Adding the R value matrix to the list
- sciErr = createMatrixOfUnsignedInteger16InList(pvApiCtx, nbInputArgument(pvApiCtx)+pos , piAddrNew, 1, img.rows,img.cols,r);
- free(r);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- //Adding the G value matrix to the list
- sciErr = createMatrixOfUnsignedInteger16InList(pvApiCtx, nbInputArgument(pvApiCtx)+pos , piAddrNew, 2, img.rows,img.cols,g);
- free(g);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- //Adding the B value matrix to the list
- sciErr = createMatrixOfUnsignedInteger16InList(pvApiCtx, nbInputArgument(pvApiCtx)+pos , piAddrNew, 3, img.rows,img.cols, b);
- free(b);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- }
- else
- {
- //Since we need to pass a single pointer as an arguement, for a 2-D matrix, we define it in this manner
- short unsigned int *r = (short unsigned int *)malloc(img.rows * img.cols * sizeof(short unsigned int));
-
- //The next block of code retrieves the image colour values at a specified pixel, and assigns it to the matrices
- for(i=0;i(i, j);
-
- //Adding the image colour value matrix to the list
- sciErr = createMatrixOfUnsignedInteger16InList(pvApiCtx, nbInputArgument(pvApiCtx)+pos , piAddrNew, 1, img.rows,img.cols,r);
- free(r);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- }
-
- }
- else if(strcmp(checker,"16S")==0) //for Signed Integer 16
- {
- if(num==3)
- {
- //Since we need to pass a single pointer as an arguement, for a 2-D matrix, we define it in this manner
- short int *r = (short int *)malloc(img.rows * img.cols * sizeof(short int));
- short int *g = (short int *)malloc(img.rows * img.cols * sizeof(short int));
- short int *b = (short int *)malloc(img.rows * img.cols * sizeof(short int));
- //The next block of code retrieves the RGB values at a specified pixel, and assigns it to the matrices
- for(i=0;i(i, j);
- r[i+img.rows*j]=intensity.val[2];
- g[i+img.rows*j]=intensity.val[1];
- b[i+img.rows*j]=intensity.val[0];
- }
- }
-
- //Adding the R value matrix to the list
- sciErr = createMatrixOfInteger16InList(pvApiCtx, nbInputArgument(pvApiCtx)+pos , piAddrNew, 1, img.rows,img.cols, r);
- free(r);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- //Adding the G value matrix to the list
- sciErr = createMatrixOfInteger16InList(pvApiCtx, nbInputArgument(pvApiCtx)+pos , piAddrNew, 2, img.rows,img.cols, g);
- free(g);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- //Adding the B value matrix to the list
- sciErr = createMatrixOfInteger16InList(pvApiCtx, nbInputArgument(pvApiCtx)+pos , piAddrNew, 3, img.rows,img.cols,b);
- free(b);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- }
-
- else
- {
- //Since we need to pass a single pointer as an arguement, for a 2-D matrix, we define it in this manner
- short int *r = (short int *)malloc(img.rows * img.cols * sizeof(short int));
-
- //The next block of code retrieves the image colour values at a specified pixel, and assigns it to the matrices
- for(i=0;i(i, j);
-
- //Adding the image colour value matrix to the list
- sciErr = createMatrixOfInteger16InList(pvApiCtx, nbInputArgument(pvApiCtx)+pos , piAddrNew, 1, img.rows,img.cols,r);
- free(r);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- }
- }
- else if(strcmp(checker,"32S")==0) //for Signed Integer 16
- {
- if(num==3)
- {
- //Since we need to pass a single pointer as an arguement, for a 2-D matrix, we define it in this manner
- int *r = (int *)malloc(img.rows * img.cols * sizeof(int));
- int *g = (int *)malloc(img.rows * img.cols * sizeof(int));
- int *b = (int *)malloc(img.rows * img.cols * sizeof(int));
- //The next block of code retrieves the RGB values at a specified pixel, and assigns it to the matrices
- for(i=0;i(i, j);
- r[i+img.rows*j]=intensity.val[2];
- g[i+img.rows*j]=intensity.val[1];
- b[i+img.rows*j]=intensity.val[0];
- }
- }
-
- //Adding the R value matrix to the list
- sciErr = createMatrixOfInteger32InList(pvApiCtx, nbInputArgument(pvApiCtx)+pos , piAddrNew, 1, img.rows,img.cols,r);
- free(r);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- //Adding the G value matrix to the list
- sciErr = createMatrixOfInteger32InList(pvApiCtx, nbInputArgument(pvApiCtx)+pos , piAddrNew, 2, img.rows,img.cols,g);
- free(g);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- //Adding the B value matrix to the list
- sciErr = createMatrixOfInteger32InList(pvApiCtx, nbInputArgument(pvApiCtx)+pos , piAddrNew, 3, img.rows,img.cols,b);
- free(b);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- }
- else
- {
- //Since we need to pass a single pointer as an arguement, for a 2-D matrix, we define it in this manner
- int *r = (int *)malloc(img.rows * img.cols * sizeof(int));
-
- //The next block of code retrieves the image colour values at a specified pixel, and assigns it to the matrices
- for(i=0;i(i, j);
-
- //Adding the image colour value matrix to the list
- sciErr = createMatrixOfInteger32InList(pvApiCtx, nbInputArgument(pvApiCtx)+pos , piAddrNew, 1,img.rows,img.cols, r);
- free(r);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- }
- }
-
- else if(strcmp(checker,"32F")==0) //for Float 32
- {
- if(num==3)
- {
- //Since we need to pass a single pointer as an arguement, for a 2-D matrix, we define it in this manner
- double *r = (double *)malloc(img.rows * img.cols * sizeof(double));
- double *g = (double *)malloc(img.rows * img.cols * sizeof(double));
- double *b = (double *)malloc(img.rows * img.cols * sizeof(double));
- //The next block of code retrieves the RGB values at a specified pixel, and assigns it to the matrices
- for(i=0;i(i, j);
- r[i+img.rows*j]=intensity.val[2];
- g[i+img.rows*j]=intensity.val[1];
- b[i+img.rows*j]=intensity.val[0];
- }
- }
-
- //Adding the R value matrix to the list
- sciErr = createMatrixOfDoubleInList(pvApiCtx, nbInputArgument(pvApiCtx)+pos , piAddrNew, 1, img.rows,img.cols,r);
- free(r);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- //Adding the G value matrix to the list
- sciErr = createMatrixOfDoubleInList(pvApiCtx, nbInputArgument(pvApiCtx)+pos , piAddrNew, 2, img.rows,img.cols,g);
- free(g);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- //Adding the B value matrix to the list
- sciErr = createMatrixOfDoubleInList(pvApiCtx, nbInputArgument(pvApiCtx)+pos , piAddrNew, 3, img.rows,img.cols,b);
- free(b);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- }
- else
- {
- //Since we need to pass a single pointer as an arguement, for a 2-D matrix, we define it in this manner
- double *r = (double *)malloc(img.rows * img.cols * sizeof(double));
- //The next block of code retrieves the image colour values at a specified pixel, and assigns it to the matrices
- for(i=0;i(i, j);
-
- //Adding the image colour value matrix to the list
- sciErr = createMatrixOfDoubleInList(pvApiCtx, nbInputArgument(pvApiCtx)+pos , piAddrNew, 1,img.rows,img.cols,r);
- free(r);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- }
- }
- else if(strcmp(checker,"64F")==0) //For Float 64
- {
- if(num==3)
- {
- //Since we need to pass a single pointer as an arguement, for a 2-D matrix, we define it in this manner
- double *r = (double *)malloc(img.rows * img.cols * sizeof(double));
- double *g = (double *)malloc(img.rows * img.cols * sizeof(double));
- double *b = (double *)malloc(img.rows * img.cols * sizeof(double));
- //The next block of code retrieves the RGB values at a specified pixel, and assigns it to the matrices
- for(i=0;i(i, j);
- r[i+img.rows*j]=intensity.val[2];
- g[i+img.rows*j]=intensity.val[1];
- b[i+img.rows*j]=intensity.val[0];
- }
- }
-
- //Adding the R value matrix to the list
- sciErr = createMatrixOfDoubleInList(pvApiCtx, nbInputArgument(pvApiCtx)+pos , piAddrNew, 1, img.rows,img.cols,r);
- free(r);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- //Adding the G value matrix to the list
- sciErr = createMatrixOfDoubleInList(pvApiCtx, nbInputArgument(pvApiCtx)+pos , piAddrNew, 2, img.rows,img.cols,g);
- free(g);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- //Adding the B value matrix to the list
- sciErr = createMatrixOfDoubleInList(pvApiCtx, nbInputArgument(pvApiCtx)+pos , piAddrNew, 3, img.rows,img.cols, b);
- free(b);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- }
- else
- {
- //Since we need to pass a single pointer as an arguement, for a 2-D matrix, we define it in this manner
- double *r = (double *)malloc(img.rows * img.cols * sizeof(double));
-
- //The next block of code retrieves the image colour values at a specified pixel, and assigns it to the matrices
- for(i=0;i(i, j);
-
- //Adding the image colour value matrix to the list
- sciErr = createMatrixOfDoubleInList(pvApiCtx, nbInputArgument(pvApiCtx)+pos , piAddrNew, 1, img.rows,img.cols, r);
- free(r);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- }
- }
-
-}
diff --git a/sci_gateway/cpp/libskeleton_imageprocessing.c b/sci_gateway/cpp/libskeleton_imageprocessing.c
deleted file mode 100644
index 73a082b..0000000
--- a/sci_gateway/cpp/libskeleton_imageprocessing.c
+++ /dev/null
@@ -1,36 +0,0 @@
-#ifdef __cplusplus
-extern "C" {
-#endif
-#include
-#include
-#include
-#include
-static int direct_gateway(char *fname,void F(void)) { F();return 0;};
-extern Gatefunc opencv_imread;
-extern Gatefunc opencv_rgb2xyz;
-extern Gatefunc opencv_CascadeObjectDetector;
-extern Gatefunc opencv_detectKAZEFeatures;
-static GenericTable Tab[]={
- {(Myinterfun)sci_gateway_without_putlhsvar,opencv_imread,"raw_imread"},
- {(Myinterfun)sci_gateway_without_putlhsvar,opencv_rgb2xyz,"raw_rgb2xyz"},
- {(Myinterfun)sci_gateway_without_putlhsvar,opencv_CascadeObjectDetector,"raw_CascadeObjectDetector"},
- {(Myinterfun)sci_gateway_without_putlhsvar,opencv_detectKAZEFeatures,"raw_detectKAZEFeatures"},
-};
-
-int C2F(libskeleton_imageprocessing)()
-{
- Rhs = Max(0, Rhs);
- if (*(Tab[Fin-1].f) != NULL)
- {
- if(pvApiCtx == NULL)
- {
- pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
- }
- pvApiCtx->pstName = (char*)Tab[Fin-1].name;
- (*(Tab[Fin-1].f))(Tab[Fin-1].name,Tab[Fin-1].F);
- }
- return 0;
-}
-#ifdef __cplusplus
-}
-#endif
diff --git a/sci_gateway/cpp/libskeleton_imageprocessing.so b/sci_gateway/cpp/libskeleton_imageprocessing.so
deleted file mode 100644
index 04852b0..0000000
Binary files a/sci_gateway/cpp/libskeleton_imageprocessing.so and /dev/null differ
diff --git a/sci_gateway/cpp/loader.sce b/sci_gateway/cpp/loader.sce
deleted file mode 100644
index 6d764aa..0000000
--- a/sci_gateway/cpp/loader.sce
+++ /dev/null
@@ -1,24 +0,0 @@
-// This file is released under the 3-clause BSD license. See COPYING-BSD.
-// Generated by builder.sce : Please, do not edit this file
-// ----------------------------------------------------------------------------
-//
-libskeleton_imagepr_path = get_absolute_file_path('loader.sce');
-//
-// ulink previous function with same name
-[bOK, ilib] = c_link('libskeleton_imageprocessing');
-if bOK then
- ulink(ilib);
-end
-//
-list_functions = [ 'raw_imread';
- 'raw_rgb2xyz';
- 'raw_CascadeObjectDetector';
- 'raw_detectKAZEFeatures';
-];
-addinter(libskeleton_imagepr_path + filesep() + 'libskeleton_imageprocessing' + getdynlibext(), 'libskeleton_imageprocessing', list_functions);
-// remove temp. variables on stack
-clear libskeleton_imagepr_path;
-clear bOK;
-clear ilib;
-clear list_functions;
-// ----------------------------------------------------------------------------
diff --git a/sci_gateway/cpp/opencv_CascadeObjectDetector.cpp b/sci_gateway/cpp/opencv_CascadeObjectDetector.cpp
deleted file mode 100644
index 50b1473..0000000
--- a/sci_gateway/cpp/opencv_CascadeObjectDetector.cpp
+++ /dev/null
@@ -1,398 +0,0 @@
-/********************************************************
-Author: Nihar Rao
-*********************************************************
-*/
-
-#include
-#include "opencv2/core/core.hpp"
-#include "opencv2/objdetect.hpp"
-#include "opencv2/highgui/highgui.hpp"
-#include "opencv2/opencv.hpp"
-#include
-#include "opencv2/videoio.hpp"
-#include
-using namespace cv;
-using namespace std;
-
-extern "C"
-{
- #include "api_scilab.h"
- #include "Scierror.h"
- #include "BOOL.h"
- #include
- #include "sciprint.h"
- #include "../common.h"
- double readdoublec_from_scilab(int cnt)
- {
-
- SciErr sciErr;
- int *piAddr=NULL;
- double val=0;
- int intErr;
-
- sciErr = getVarAddressFromPosition(pvApiCtx,cnt,&piAddr);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr ,&val);
-
- if(isDoubleType(pvApiCtx, piAddr))
- return val;
- else
- {
- Scierror(999,"Error: the input argument is not of type double");
- return 0;
-
-
- }
-
-
- }
- bool file_existsindirectory_check(const std::string& name) {
- struct stat buffer;
- return (stat (name.c_str(), &buffer) == 0);
- }
-
- int opencv_CascadeObjectDetector(char *fname, unsigned long fname_len)
- {
- SciErr sciErr;
- int intErr = 0;
- int iRows=0,iCols=0;
- int iRows1,iCols1;
- int *piAddr = NULL;
- int *piAddrNew = NULL;
- int *piAddr2 = NULL;
- int *piAddr3 = NULL;
- int *piLen = NULL;
- char **object = NULL;
- int i;
- double minX,minY,maxX,maxY;
- double *bboxes = NULL;
- double *minSize,*maxSize;
- double scale=1.05;//all optional arguments are set to their default values
- int minNeighbors=2,flags=2;
-
- CheckInputArgument(pvApiCtx, 2, 7);
- CheckOutputArgument(pvApiCtx, 1, 2) ;
- Mat image,new_image,image_gray;
- //get no. of input arguments
- int n=*getNbInputArgument(pvApiCtx);
- retrieveImage(image, 1);
-
- ///resize(image,image,Size(800,600),0,0,cv::INTER_AREA);
-
- sciErr = getVarAddressFromPosition(pvApiCtx,2, &piAddr2);
-
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- sciErr = getMatrixOfString(pvApiCtx, piAddr2, &iRows, &iCols, NULL, NULL);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- piLen = (int*)malloc(sizeof(int) * iRows * iCols);
- //second call to retrieve length of each string
- sciErr = getMatrixOfString(pvApiCtx, piAddr2, &iRows, &iCols, piLen, NULL);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- object= (char**)malloc(sizeof(char*) * iRows * iCols);
- for(i = 0 ; i < iRows * iCols ; i++)
- {
- object[i] = (char*)malloc(sizeof(char) * (piLen[i] + 1));//+ 1 for null termination
- }
- //third call to retrieve data
- sciErr = getMatrixOfString(pvApiCtx, piAddr2, &iRows, &iCols, piLen,object);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- ///Reading optional arguments
- int cnt=3;
- switch(n)
- {
- case 3:
-
- scale=readdoublec_from_scilab(cnt);
- cnt++;
- break;
- case 4:
-
- scale=readdoublec_from_scilab(cnt);
- cnt++;
- minNeighbors=(int)readdoublec_from_scilab(cnt);
- cnt++;
- break;
- case 5:
-
- scale=readdoublec_from_scilab(cnt);
- cnt++;
- minNeighbors=(int)readdoublec_from_scilab(cnt);
- cnt++;
- flags=(int)readdoublec_from_scilab(cnt);
- if(flags!=2 && flags!=1 && flags!=4 && flags!=8)
- {
- Scierror(999,"Error: the flag should be {1,2,4,8}\n");
- return 0;
-
- }
-
- cnt++;
- break;
- case 6:
-
- scale=readdoublec_from_scilab(cnt);
- cnt++;
- minNeighbors=(int)readdoublec_from_scilab(cnt);
- cnt++;
- flags=(int)readdoublec_from_scilab(cnt);
- cnt++;
- if(flags!=2 && flags!=1 && flags!=4 && flags!=8)
- {
- Scierror(999,"Error: the flag should be {1,2,4,8}\n");
- return 0;
-
- }
-
- sciErr = getVarAddressFromPosition(pvApiCtx,cnt,&piAddr);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &iRows1, &iCols1, &minSize);
- if(sciErr.iErr)
- {
- printError(&sciErr,0);
- return 0;
- }
-
- //check dimensions
- if(iCols1!=2 || iRows1!=1)
- {
- Scierror(999,"The minSize argument must have dimensions 1*2");
- return -1;
- }
-
- cnt++;
-
-
- break;
- case 7:
-
- scale=readdoublec_from_scilab(cnt);
- cnt++;
- minNeighbors=(int)readdoublec_from_scilab(cnt);
- cnt++;
- flags=(int)readdoublec_from_scilab(cnt);
- cnt++;
- if(flags!=2 && flags!=1 && flags!=4 && flags!=8)
- {
- Scierror(999,"Error: the flag should be {1,2,4,8}\n");
- return 0;
-
- }
-
- sciErr = getVarAddressFromPosition(pvApiCtx,cnt,&piAddr);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &iRows1, &iCols1, &minSize);
- if(sciErr.iErr)
- {
- printError(&sciErr,0);
- return 0;
- }
-
- //check dimensions
- if(iCols1!=2 || iRows1!=1)
- {
- Scierror(999,"The minSize argument must have dimensions 1*2 ");
- return -1;
- }
- cnt++;
-
- sciErr = getVarAddressFromPosition(pvApiCtx,cnt,&piAddr);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &iRows1, &iCols1, &maxSize);
- if(sciErr.iErr)
- {
- printError(&sciErr,0);
- return 0;
- }
-
- //check dimensions
- if(iCols1!=2 || iRows1!=1)
- {
- Scierror(999,"The maxSize argument must have dimensions 1*2 ");
- return -1;
- }
-
- break;
-
- }
-
-
- /* Actual Processing*/
- try{
- if(image.channels()==1)
- {
- image.convertTo(image,CV_8U);
- image.copyTo(image_gray);
-
- equalizeHist( image_gray, image_gray );
-
-
-
- }
- else
- {
- //Converting image from rgb to gray scale image.
- image.convertTo(image,CV_8U);
- cvtColor( image, image_gray, CV_BGR2GRAY );
- //equalizing the histrogram of gray scale image
- equalizeHist( image_gray, image_gray );
- }
-
-
-
- vector found;
-
- //set minSize and maxSize if passed
- if(n==6)
- {
- minX=minSize[0];
- minY=minSize[1];
-
- }
- else if(n==7)
- {
- minX=minSize[0];
- minY=minSize[1];
-
- maxX=maxSize[0];
- maxY=maxSize[1];
-
-
-
- }
-
-
-
- int j;
- for(j=0;j
+#include "opencv2/core/core.hpp"
+#include "opencv2/highgui/highgui.hpp"
+#include "opencv2/opencv.hpp"
+#include
+#include
+
+using namespace cv;
+using namespace std;
+
+extern "C"
+{
+ #include "api_scilab.h"
+ #include "Scierror.h"
+ #include "BOOL.h"
+ #include
+ #include "../common.h"
+
+ int opencv_DCT(char *fname, unsigned long fname_len)
+ {
+
+ /// Error management variable
+ SciErr sciErr;
+
+ /// Variables
+ int i, j;
+ int flags = 0;
+
+ //Checking number of input and output arguments (enviromnet variable, min arguments, max arguments)
+ CheckInputArgument(pvApiCtx, 1, 1);
+ CheckOutputArgument(pvApiCtx, 1, 1);
+
+ // to get the argument #1
+ Mat image;
+ retrieveImage(image, 1);
+
+ if(image.channels() != 1)
+ {
+ Scierror(999, "Input should be single channel\n");
+ return 0;
+ }
+
+ /// even sized rows and columns required
+ if(image.rows%2 != 0){
+ Scierror(999, "%s: Odd number of rows found\n");
+ return 0;
+ }
+
+ if(image.cols%2 != 0){
+ Scierror(999, "%s: Odd number of columns found\n");
+ return 0;
+ }
+
+ //Application Code
+ try
+ {
+ Mat new_image(image.rows, image.cols, image.type());
+ dct(image, new_image, flags);
+
+ string tempstring = type2str(new_image.type());
+ char *checker;
+ checker = (char *)malloc(tempstring.size() + 1);
+ memcpy(checker, tempstring.c_str(), tempstring.size() + 1);
+ returnImage(checker, new_image, 1);
+ free(checker);
+ }
+ catch(cv::Exception& e)
+ {
+ const char* err=e.what();
+ Scierror(999,("%s"),err);
+ }
+
+ //Assigning the list as the Output Variable
+ AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
+
+ //Returning the Output Variables as arguments to the Scilab environment
+ ReturnArguments(pvApiCtx);
+ return 0;
+
+ }
+/* ==================================================================== */
+}
+
diff --git a/sci_gateway/cpp/opencv_FFT.cpp b/sci_gateway/cpp/opencv_FFT.cpp
new file mode 100644
index 0000000..bc0beab
--- /dev/null
+++ b/sci_gateway/cpp/opencv_FFT.cpp
@@ -0,0 +1,111 @@
+/****************************************
+Author: Sridhar Reddy
+*****************************************/
+#include
+#include "opencv2/core/core.hpp"
+#include "opencv2/highgui/highgui.hpp"
+#include "opencv2/opencv.hpp"
+#include
+using namespace cv;
+using namespace std;
+extern "C"
+{
+ #include "api_scilab.h"
+ #include "Scierror.h"
+ #include "BOOL.h"
+ #include
+ #include "sciprint.h"
+ #include "../common.h"
+
+ int opencv_FFT(char *fname, unsigned long fname_len)
+ {
+ // Error management variables
+ SciErr sciErr;
+ int intErr=0;
+
+ // variables required to read arguments
+ int iRows=0,iCols=0,i,j;
+ int *piAddr1=NULL;
+ double *ipReal=NULL;
+ double *ipImg=NULL;
+ double *rsltReal=NULL;
+ double *rsltImg=NULL;
+ vector > vec_out;
+ vector vec_in;
+
+ //Checking number of input and output arguments (enviromnet variable, min arguments, max arguments)
+ CheckInputArgument(pvApiCtx, 1, 1);
+ CheckOutputArgument(pvApiCtx, 1, 1) ;
+
+ // to get the argument #1
+ sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr1);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ sciErr = getMatrixOfDouble(pvApiCtx, piAddr1, &iRows, &iCols, &ipReal);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ //Application Code
+ try
+ {
+
+ ipImg = (double*)malloc(sizeof(double) * iRows * iCols);
+ if(iRows==1)
+ {
+ for(i = 0 ; i
+#include "opencv2/core/core.hpp"
+#include "opencv2/highgui/highgui.hpp"
+#include "opencv2/opencv.hpp"
+#include
+using namespace cv;
+using namespace std;
+extern "C"
+{
+ #include "api_scilab.h"
+ #include "Scierror.h"
+ #include "BOOL.h"
+ #include
+ #include
+ #include "../common.h"
+
+ int opencv_affine2d(char *fname, unsigned long fname_len)
+ {
+
+ SciErr sciErr;
+ int intErr=0;
+ int iRows=0,iCols=0;
+ int *piLen = NULL;
+ int *piAddr1 = NULL;
+ char **ddepth = NULL;
+ int i,j,k;
+ double *inpMatrix;
+
+ //checking input argument
+ CheckInputArgument(pvApiCtx, 1, 1);
+ CheckOutputArgument(pvApiCtx, 1, 1) ;
+
+ //for inputMatrix
+ sciErr = getVarAddressFromPosition(pvApiCtx,1,&piAddr1);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ sciErr = getMatrixOfDouble(pvApiCtx, piAddr1, &iRows, &iCols ,&inpMatrix);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ int n=iRows;
+ double inputMatrix[n][n];
+ //assigning values to actual kernelMatrix
+ for(i=0;i(i,j) = warp_mat_t.at(i,j);
+
+ outputMatrix.at(0,2) = 0;
+ outputMatrix.at(1,2) = 0;
+ outputMatrix.at(2,2) = 1.0;
+
+ //returning image
+ string tempstring = type2str(outputMatrix.type());
+ char *checker;
+ checker = (char *)malloc(tempstring.size() + 1);
+ memcpy(checker, tempstring.c_str(), tempstring.size() + 1);
+ returnImage(checker,outputMatrix,1);
+ free(checker);
+ }
+ catch(cv::Exception& e)
+ {
+ const char* err=e.what();
+ Scierror(999,("%s"),err);
+ }
+
+ //Assigning the list as the Output Variable
+ AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
+
+ //Returning the Output Variables as arguments to the Scilab environment
+ ReturnArguments(pvApiCtx);
+ return 0;
+
+ }
+/* ==================================================================== */
+}
diff --git a/sci_gateway/cpp/opencv_arrowedline.cpp b/sci_gateway/cpp/opencv_arrowedline.cpp
deleted file mode 100644
index 9344f87..0000000
--- a/sci_gateway/cpp/opencv_arrowedline.cpp
+++ /dev/null
@@ -1,217 +0,0 @@
-/********************************************************
- Author: Abhilasha Sancheti & Sukul Bagai
-*********************************************************
- return_image = arrowedline(image , x1 , y1 , x2,y2,r_value,g_value,b_value,thickness,linetype,shift,tiplength);
-********************************************************/
-
-#include
-#include "opencv2/core/core.hpp"
-#include "opencv2/highgui/highgui.hpp"
-#include "opencv2/opencv.hpp"
-#include
-using namespace cv;
-using namespace std;
-extern "C"
-{
- #include "api_scilab.h"
- #include "Scierror.h"
- #include "BOOL.h"
- #include
- #include
- #include "../common.h"
-
- int opencv_arrowedline(char *fname, unsigned long fname_len)
- {
-
- SciErr sciErr;
- int intErr=0;
- int iRows=0,iCols=0;
- int *piAddr2 = NULL;
- int *piAddr3 = NULL;
- int *piAddr4 = NULL;
- int *piAddr5 = NULL;
- int *piAddr6 = NULL;
- int *piAddr7 = NULL;
- int *piAddr8 = NULL;
- int *piAddr9 = NULL;
- int *piAddr10 = NULL;
- int *piAddr11 = NULL;
- int *piAddr12 = NULL;
- int i,j,k;
- double thickness=1 , linetype=8,shift =0 ,tiplength=0.1;
- double x1,y1,x2,y2,r_value,g_value,b_value;
-
-
- //checking input argument
- CheckInputArgument(pvApiCtx, 8, 12);
- CheckOutputArgument(pvApiCtx, 1, 1) ;
- int n=*getNbInputArgument(pvApiCtx);
-
- Mat src;
- retrieveImage(src,1);
-
- //for value of x coordinate of first point
- sciErr = getVarAddressFromPosition(pvApiCtx,2,&piAddr2);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr2 ,&x1);
- if(intErr)
- return intErr;
-
- //for value of y coordinate of first point
- sciErr = getVarAddressFromPosition(pvApiCtx,3,&piAddr3);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr3,&y1);
- if(intErr)
- return intErr;
-
- //for value of x coordinate of second point
- sciErr = getVarAddressFromPosition(pvApiCtx,4,&piAddr4);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr4 ,&x2);
- if(intErr)
- return intErr;
-
- ///for value of y coordinate of second point
- sciErr = getVarAddressFromPosition(pvApiCtx,5,&piAddr5);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr5 ,&y2);
- if(intErr)
- return intErr;
-
- //for value of R value of colour
- sciErr = getVarAddressFromPosition(pvApiCtx,6,&piAddr6);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr6,&r_value);
- if(intErr)
- return intErr;
-
- // for G value of colour
- sciErr = getVarAddressFromPosition(pvApiCtx,7,&piAddr7);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr7,&g_value);
- if(intErr)
- return intErr;
-
- // for B value of colour
- sciErr = getVarAddressFromPosition(pvApiCtx,8,&piAddr8);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr8,&b_value);
- if(intErr)
- return intErr;
-
-
- //Reading optional arguments
- if(n>8)
- {
- for(int i=9;i<=n;i++)
- {
-
- double r;
- sciErr = getVarAddressFromPosition(pvApiCtx,i,&piAddr12);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- intErr = getScalarDouble(pvApiCtx, piAddr12,&r);
- if(intErr)
- return intErr;
- //assign value
- if(i==9)
- thickness=r;
- else if(i==10)
- linetype=r;
- else if(i==11)
- shift=r;
- else
- tiplength=r;
-
- }
- }
- //temporary pt variable, to use in function as centre
- Point pt1(x1,y1);
- Point pt2(x2,y2);
-
-
- /// checking the parmeters for correct values
- if( r_value <0 || r_value >255)
- {
- r_value=0;
- sciprint(" r value of colour should be between 0 and 255 , using 0 instead\n");
- }
- if( g_value <0 || g_value >255)
- {
- g_value=0;
- sciprint(" g value of colour should be between 0 and 255 , using 0 instead\n");
- }
- if( b_value <0 || b_value >255)
- {
- b_value=0;
- sciprint(" b value of colour should be between 0 and 255 , using 0 instead\n");
- }
- if ((linetype!=0) && (linetype!=4)&& (linetype!=8))
- {
- linetype=8;
- sciprint("Only 0/4/8 allowed , using 8 instead");
- }
- //calling the opencv function
- try
- {
- arrowedLine( src, pt1, pt2, Scalar(b_value,g_value,r_value), thickness, linetype, shift, tiplength);
- }
- catch(cv::Exception& e)
- {
-
- Scierror(999,e.what());
- return 0;;
-
- }
-
-
- string tempstring = type2str(src.type());
- char *checker;
- checker = (char *)malloc(tempstring.size() + 1);
- memcpy(checker, tempstring.c_str(), tempstring.size() + 1);
- returnImage(checker,src,1);
- free(checker);
-
- //Assigning the list as the Output Variable
- AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
- //Returning the Output Variables as arguments to the Scilab environment
- ReturnArguments(pvApiCtx);
- return 0;
-
-
- }
-
-}
-
diff --git a/sci_gateway/cpp/opencv_bboxOverlapRatio.cpp b/sci_gateway/cpp/opencv_bboxOverlapRatio.cpp
new file mode 100644
index 0000000..899b960
--- /dev/null
+++ b/sci_gateway/cpp/opencv_bboxOverlapRatio.cpp
@@ -0,0 +1,283 @@
+/***************************************************
+Author : Tanmay Chaudhari
+***************************************************/
+
+#include
+#include "opencv2/core/core.hpp"
+#include "opencv2/highgui/highgui.hpp"
+#include "opencv2/opencv.hpp"
+#include
+using namespace cv;
+using namespace std;
+extern "C"
+{
+ #include "api_scilab.h"
+ #include "Scierror.h"
+ #include "BOOL.h"
+ #include
+ #include "sciprint.h"
+
+ int opencv_bboxOverlapRatio(char *fname, unsigned long fname_len)
+ {
+ //Error management variable
+ SciErr sciErr;
+
+ //Variable declaration
+ int i, j;
+ int nbInputArguments = 0;
+ int iComplex = 0;
+ int iType = 0;
+ int iRows = 0;
+ int iCols = 0;
+ int rowsOfBboxA = 0;
+ int colsOfBboxA = 0;
+ int rowsOfBboxB = 0;
+ int colsOfBboxB = 0;
+ int unionOrMin = 0; //if 0 then union else min
+ int *piAddr = NULL;
+ int *piLen = NULL;
+ char **ratioType = NULL;
+ double x1 = 0;
+ double x2 = 0;
+ double y1 = 0;
+ double y2 = 0;
+ double w = 0;
+ double h = 0;
+ double intersectAB = 0;
+ double *overlapRatio = 0;
+ double *bboxA = NULL;
+ double *bboxB = NULL;
+ double *x1BboxA = NULL;
+ double *x2BboxA = NULL;
+ double *y1BboxA = NULL;
+ double *y2BboxA = NULL;
+ double *x1BboxB = NULL;
+ double *x2BboxB = NULL;
+ double *y1BboxB = NULL;
+ double *y2BboxB = NULL;
+ double *areaA = NULL;
+ double *areaB = NULL;
+
+ //Checking number of input and output arguments (enviromnet variable, min arguments, max arguments)
+ checkInputArgument(pvApiCtx, 2, 3);
+ checkOutputArgument(pvApiCtx, 1, 1);
+
+ //Get number of input arguments
+ nbInputArguments = *getNbInputArgument(pvApiCtx);
+
+ for( i = 1; i <= nbInputArguments; i++)
+ {
+ //Get variable address of the input arguent
+ sciErr = getVarAddressFromPosition(pvApiCtx, i, &piAddr);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ if(i != 3)
+ {
+ //Check type
+ sciErr = getVarType(pvApiCtx, piAddr, &iType);
+ if(sciErr.iErr || iType != sci_matrix)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ //Get complexity
+ iComplex = isVarComplex(pvApiCtx, piAddr);
+
+ //Check complexity
+ if(iComplex)
+ {
+ Scierror(999, "%s: Wrong type for input argument: A complex number is not expected.\n");
+ return 0;
+ }
+
+ if(i == 1)
+ sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &rowsOfBboxA, &colsOfBboxA, &bboxA);
+ else
+ sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &rowsOfBboxB, &colsOfBboxB, &bboxB);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ if((i == 1) && ((rowsOfBboxA == 0) || (colsOfBboxA !=4)))
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ if((i == 2) && ((rowsOfBboxB == 0) || (colsOfBboxB != 4)))
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ }
+ else
+ {
+ //first call to retrieve dimensions
+ sciErr = getMatrixOfString(pvApiCtx, piAddr, &iRows, &iCols, NULL, NULL);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ piLen = (int*)malloc(sizeof(int) * iRows * iCols);
+
+ //second call to retrieve the length of the string
+ sciErr = getMatrixOfString(pvApiCtx, piAddr, &iRows, &iCols, piLen, NULL);
+ if(sciErr.iErr || iRows != 1 || iCols != 1)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ ratioType = (char**)malloc(sizeof(char*) * iRows * iCols);
+ for(int i=0;i< iRows * iCols; i++)
+ {
+ ratioType[i] = (char*)malloc(sizeof(char) * (piLen[i] + 1)); //+1 for NULL character
+ }
+
+ //third call to retrieve data
+ sciErr = getMatrixOfString(pvApiCtx, piAddr, &iRows, &iCols, piLen, ratioType);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ if(piLen[0] != 5 && piLen[0] != 3)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ if(piLen[0] == 5 && ratioType[0][0] == 'U' && ratioType[0][1] == 'n' && ratioType[0][2] == 'i' && ratioType[0][3] == 'o' && ratioType[0][4] == 'n')
+ unionOrMin = 0;
+ else if(piLen[0] == 3 && ratioType[0][0] == 'M' && ratioType[0][1] == 'i' && ratioType[0][2] == 'n')
+ unionOrMin = 1;
+ else
+ {
+ Scierror(999, "%s: Wrong type for input argument: Union or Min is expected.\n");
+ return 0;
+ }
+ free(piLen);
+ free(ratioType);
+ }
+ }
+
+ //Application Code
+ try
+ {
+ x1BboxA = (double*)malloc(sizeof(double) * rowsOfBboxA);
+ x2BboxA = (double*)malloc(sizeof(double) * rowsOfBboxA);
+ y1BboxA = (double*)malloc(sizeof(double) * rowsOfBboxA);
+ y2BboxA = (double*)malloc(sizeof(double) * rowsOfBboxA);
+
+ x1BboxB = (double*)malloc(sizeof(double) * rowsOfBboxB);
+ x2BboxB = (double*)malloc(sizeof(double) * rowsOfBboxB);
+ y1BboxB = (double*)malloc(sizeof(double) * rowsOfBboxB);
+ y2BboxB = (double*)malloc(sizeof(double) * rowsOfBboxB);
+
+ areaA = (double*)malloc(sizeof(double) * rowsOfBboxA);
+ areaB = (double*)malloc(sizeof(double) * rowsOfBboxB);
+
+ overlapRatio = (double*)malloc(sizeof(double) * rowsOfBboxA * rowsOfBboxB);
+
+ for( i = 0; i < rowsOfBboxA; i++)
+ {
+ //Left top corner
+ x1BboxA[i] = bboxA[i];
+ y1BboxA[i] = bboxA[rowsOfBboxA + i];
+
+ //right bottom corner
+ x2BboxA[i] = x1BboxA[i] + bboxA[2 * rowsOfBboxA + i];
+ y2BboxA[i] = y1BboxA[i] + bboxA[3 * rowsOfBboxA + i];
+ }
+
+ for( i = 0; i < rowsOfBboxB; i++)
+ {
+ //Left top corner
+ x1BboxB[i] = bboxB[i];
+ y1BboxB[i] = bboxB[rowsOfBboxB + i];
+
+ //right bottom corner
+ x2BboxB[i] = x1BboxB[i] + bboxB[2 * rowsOfBboxB + i];
+ y2BboxB[i] = y1BboxB[i] + bboxB[3 * rowsOfBboxB + i];
+ }
+
+ //Computing area for each rectangle in bboxA
+ for( i = 0; i < rowsOfBboxA; i++)
+ areaA[i] = bboxA[2 * rowsOfBboxA + i] * bboxA[3 * rowsOfBboxA + i];
+
+ //Computing area for each rectangle in bboxB
+ for( i = 0 ; i < rowsOfBboxB; i++)
+ areaB[i] = bboxB[2 * rowsOfBboxB + i] * bboxB[3 * rowsOfBboxB + i];
+
+ for( i = 0; i < rowsOfBboxA * rowsOfBboxB; i++)
+ overlapRatio[i] = 0;
+
+ for( i = 0; i < rowsOfBboxA; i++)
+ {
+ for( j = 0; j < rowsOfBboxB; j++)
+ {
+ //Computing the corners of the intersect
+ x1 = (x1BboxA[i] > x1BboxB[j])?x1BboxA[i]:x1BboxB[j];
+ y1 = (y1BboxA[i] > y1BboxB[j])?y1BboxA[i]:y1BboxB[j];
+ x2 = (x2BboxA[i] < x2BboxB[j])?x2BboxA[i]:x2BboxB[j];
+ y2 = (y2BboxA[i] < y2BboxB[j])?y2BboxA[i]:y2BboxB[j];
+
+ w = x2 - x1;
+ if(w <= 0) //Skip if no intersection
+ continue;
+
+ h = y2 - y1;
+ if(h <= 0) //Skip if no intersection
+ continue;
+
+ intersectAB = w * h;
+
+ if(nbInputArguments == 2)
+ overlapRatio[j * rowsOfBboxA + i] = intersectAB/(areaA[i] + areaB[j] - intersectAB);
+ else
+ {
+ if(unionOrMin == 0)
+ overlapRatio[j * rowsOfBboxA + i] = intersectAB/(areaA[i] + areaB[j] - intersectAB);
+ else
+ overlapRatio[j * rowsOfBboxA + i] = intersectAB/((areaA[i] < areaB[j])?areaA[i]:areaB[j]);
+ }
+ }
+ }
+ }
+ catch(cv::Exception& e)
+ {
+ const char* err=e.what();
+ Scierror(999,("%s"),err);
+ }
+
+ sciErr = createList(pvApiCtx, nbInputArgument(pvApiCtx) + 1, 1, &piAddr);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ sciErr = createMatrixOfDoubleInList(pvApiCtx, nbInputArgument(pvApiCtx) + 1, piAddr, 1, rowsOfBboxA, rowsOfBboxB, overlapRatio);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ //Assigning the list as the Output Variable
+ AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
+
+ //Returning the Output Variables as arguments to the Scilab environment
+ ReturnArguments(pvApiCtx);
+
+ return 0;
+ }
+ /* ==================================================================== */
+}
diff --git a/sci_gateway/cpp/opencv_blur.cpp b/sci_gateway/cpp/opencv_blur.cpp
deleted file mode 100644
index 62f5db7..0000000
--- a/sci_gateway/cpp/opencv_blur.cpp
+++ /dev/null
@@ -1,143 +0,0 @@
-/***************************************************
-Author : Sukul Bagai
-***************************************************/
-
-#include
-#include "opencv2/core/core.hpp"
-#include "opencv2/highgui/highgui.hpp"
-#include "opencv2/opencv.hpp"
-#include
-using namespace cv;
-using namespace std;
-extern "C"
-{
- #include "api_scilab.h"
- #include "Scierror.h"
- #include "BOOL.h"
- #include
- #include
- #include "../common.h"
-
-
-
- int opencv_blur(char *fname, unsigned long fname_len)
- {
-
- SciErr sciErr;
- int intErr=0;
- int iRows=0,iCols=0;
- int *piAddr2 = NULL;
- int *piAddr3 = NULL;
- int *piAddr4 = NULL;
- int *piAddr5 = NULL;
- double ksize_width,ksize_height,anchorX,anchorY;
-
- //checking input argument
- CheckInputArgument(pvApiCtx, 5, 5);
- CheckOutputArgument(pvApiCtx, 1, 1) ;
-
- Mat image;
- retrieveImage(image,1);
-
- //for value of ksize_height
- sciErr = getVarAddressFromPosition(pvApiCtx,2,&piAddr2);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr2, &ksize_height);
- if(intErr)
- return intErr;
-
- //for value of ksize_width
- sciErr = getVarAddressFromPosition(pvApiCtx,3,&piAddr3);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr3 ,&ksize_width);
- if(intErr)
- return intErr;
-
- //for value of anchorX
- sciErr = getVarAddressFromPosition(pvApiCtx,4,&piAddr4);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr4, &anchorX);
- if(intErr)
- return intErr;
-
- //for value of anchorY
- sciErr = getVarAddressFromPosition(pvApiCtx,5,&piAddr5);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr5, &anchorY);
- if(intErr)
- return intErr;
-
- //applying checks on input parameters
- Mat new_image(image.rows,image.cols,image.type());
-
- //error checks
- if(ksize_height<0)
- {
- sciprint("Positive Value Required for Height. 1 value was used instead");
- ksize_height=1;
- }
- if(ksize_width<0)
- {
- sciprint("Positive Value Required for Width. 1 value was used instead");
- ksize_width=1;
- }
- if(ksize_width != ksize_height)
- {
- sciprint("Blurring Kernel Size not equal. Value of ksize_height used for ksize_width as well");
- ksize_width = ksize_height;
- }
- if(anchorX >= ksize_height || anchorY >= ksize_width)
- {
- sciprint("Invalid anchor points. Default point (-1,-1) used instead");
- anchorY=-1;
- anchorX=-1;
- }
-
- //defining temporary size and point type variables to use in the function
- Size sz(ksize_height,ksize_width);
- Point pt(anchorX,anchorY);
-
- //void blur(InputArray src, OutputArray dst, Size ksize, Point anchor=Point(-1,-1), int borderType=BORDER_DEFAULT )
- try
- {
- blur(image,new_image,sz,pt);
- }
- catch(cv::Exception& e)
- {
- sciprint("%s",e.what());
- return 0;
-
- }
-
- string tempstring = type2str(new_image.type());
- char *checker;
- checker = (char *)malloc(tempstring.size() + 1);
- memcpy(checker, tempstring.c_str(), tempstring.size() + 1);
- returnImage(checker,new_image,1);
- free(checker);
-
- //Assigning the list as the Output Variable
- AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
- //Returning the Output Variables as arguments to the Scilab environment
- ReturnArguments(pvApiCtx);
- return 0;
-
- }
-/* ==================================================================== */
-}
\ No newline at end of file
diff --git a/sci_gateway/cpp/opencv_boundingRect.cpp b/sci_gateway/cpp/opencv_boundingRect.cpp
deleted file mode 100644
index a016501..0000000
--- a/sci_gateway/cpp/opencv_boundingRect.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-/********************************************************
- Author: Sukul Bagai
-*********************************************************
- rectangle_dimensions_arry(height, width, x, y) = boundingRect ( vector )
-********************************************************/
-
-#include
-#include "opencv2/core/core.hpp"
-#include "opencv2/highgui/highgui.hpp"
-#include "opencv2/opencv.hpp"
-#include
-using namespace cv;
-using namespace std;
-extern "C"
-{
- #include "api_scilab.h"
- #include "Scierror.h"
- #include "BOOL.h"
- #include
- #include
- #include "../common.h"
-
- int opencv_boundingRect(char *fname, unsigned long fname_len)
- {
- SciErr sciErr;
- int intErr=0;
- int iRows=0,iCols=0;
- int *piAddr1 = NULL;
- int *piAddrNew = NULL;
- int i,j,k ;
- double *points;
-
- //checking input argument
- CheckInputArgument(pvApiCtx, 1, 1);
- CheckOutputArgument(pvApiCtx, 1, 1);
-
-//retreive the points
- sciErr = getVarAddressFromPosition(pvApiCtx,1,&piAddr1);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- sciErr = getMatrixOfDouble(pvApiCtx, piAddr1, &iRows, &iCols,&points);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- vector actualPoints;
- for(int i=0;i
+#include "opencv2/core/core.hpp"
+#include "opencv2/highgui/highgui.hpp"
+#include "opencv2/opencv.hpp"
+#include
+using namespace cv;
+using namespace std;
+extern "C"
+{
+#include "api_scilab.h"
+#include "Scierror.h"
+#include "BOOL.h"
+#include
+#include "sciprint.h"
+
+ int opencv_cameraMatrix(char *fname, unsigned long fname_len)
+ {
+ //Error management variable
+ SciErr sciErr;
+
+ //Variable declaration
+ int iComplex = 0;
+ int iType = 0;
+ int iRows = 0;
+ int iCols = 0;
+ int *piAddr = NULL;
+ double *instrinsicMatrix = NULL;
+ double *rotationMatrix = NULL;
+ double *translationVector = NULL;
+ double *camMatrix = NULL;
+ double *tempMatrix = NULL;
+
+ //Check input output arguments
+ checkInputArgument(pvApiCtx, 3, 3);
+ checkOutputArgument(pvApiCtx, 1, 1);
+
+ //Get variable address of the first input argument
+ sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ //Check type
+ sciErr = getVarType(pvApiCtx, piAddr, &iType);
+ if(sciErr.iErr || iType != sci_matrix)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ //Get complexity
+ iComplex = isVarComplex(pvApiCtx, piAddr);
+
+ //Check complexity
+ if(iComplex)
+ {
+ Scierror(999, "%s: Wrong type for input argument: A complex number is not expected.\n");
+ return 0;
+ }
+
+ sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &iRows, &iCols, &instrinsicMatrix);
+ if(sciErr.iErr || iCols != 3 || iRows != 3)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ //Get variable address of the second input argument
+ sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piAddr);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ //Check type
+ sciErr = getVarType(pvApiCtx, piAddr, &iType);
+ if(sciErr.iErr || iType != sci_matrix)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ //Get complexity
+ iComplex = isVarComplex(pvApiCtx, piAddr);
+
+ //Check complexity
+ if(iComplex)
+ {
+ Scierror(999, "%s: Wrong type for input argument: A complex number is not expected.\n");
+ return 0;
+ }
+
+ sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &iRows, &iCols, &rotationMatrix);
+ if(sciErr.iErr || iCols != 3 || iRows != 3)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ //Get variable address of the first third argument
+ sciErr = getVarAddressFromPosition(pvApiCtx, 3, &piAddr);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ //Check type
+ sciErr = getVarType(pvApiCtx, piAddr, &iType);
+ if(sciErr.iErr || iType != sci_matrix)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ //Get complexity
+ iComplex = isVarComplex(pvApiCtx, piAddr);
+
+ //Check complexity
+ if(iComplex)
+ {
+ Scierror(999, "%s: Wrong type for input argument: A complex number is not expected.\n");
+ return 0;
+ }
+
+ sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &iRows, &iCols, &translationVector);
+ if(sciErr.iErr || iCols != 3 || iRows != 1)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ //Application Code
+ try
+ {
+ tempMatrix = (double*)malloc(sizeof(double) * 12);
+ for(int i = 0; i < 4; i++)
+ {
+ for(int j = 0; j < 3; j++)
+ {
+ if(i == 3)
+ tempMatrix[j * 4 + i] = translationVector[j];
+ else
+ tempMatrix[j * 4 + i] = rotationMatrix[j * 3 + i];
+ }
+ }
+ camMatrix = (double*)malloc(sizeof(double) * 12);
+ for(int i = 0; i < 12; i++)
+ camMatrix[i] = 0;
+
+ for(int i = 0; i < 4; i++)
+ {
+ for(int j = 0; j < 3; j++)
+ {
+ for(int k = 0; k < 3; k++)
+ {
+ camMatrix[j * 4 + i] += (tempMatrix[k * 4 + i] * instrinsicMatrix[j * 3 + k]);
+ }
+ }
+ }
+ }
+ catch(cv::Exception& e)
+ {
+ const char* err=e.what();
+ Scierror(999,("%s"),err);
+ }
+ sciErr = createList(pvApiCtx, nbInputArgument(pvApiCtx) + 1, 1, &piAddr);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ sciErr = createMatrixOfDoubleInList(pvApiCtx, nbInputArgument(pvApiCtx) + 1, piAddr, 1, 4, 3, camMatrix);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ //Assigning the list as the Output Variable
+ AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
+
+ //Returning the Output Variables as arguments to the Scilab environment
+ ReturnArguments(pvApiCtx);
+ return 0;
+ }
+}
diff --git a/sci_gateway/cpp/opencv_circle.cpp b/sci_gateway/cpp/opencv_circle.cpp
deleted file mode 100644
index 96f1bc4..0000000
--- a/sci_gateway/cpp/opencv_circle.cpp
+++ /dev/null
@@ -1,250 +0,0 @@
-/********************************************************
- Author: Abhilasha Sancheti
-*********************************************************
- return_image = circle(input_image , x_coordinate_of_centre , y_coordinate_centre , radius, r_value,g_value,b_value,thickness,linetype,shift);
-********************************************************/
-
-#include
-#include "opencv2/core/core.hpp"
-#include "opencv2/highgui/highgui.hpp"
-#include "opencv2/opencv.hpp"
-#include
-using namespace cv;
-using namespace std;
-extern "C"
-{
- #include "api_scilab.h"
- #include "Scierror.h"
- #include "BOOL.h"
- #include
- #include
- #include "../common.h"
-
- int opencv_circle(char *fname, unsigned long fname_len)
- {
-
- SciErr sciErr;
- int intErr=0;
- int iRows=0,iCols=0;
- int *piAddrNew = NULL;
- int *piAddr2 = NULL;
- int *piAddr3 = NULL;
- int *piAddr4 = NULL;
- int *piAddr5 = NULL;
- int *piAddr6 = NULL;
- int *piAddr7 = NULL;
- int *piAddr8 = NULL;
- int *piAddr9 = NULL;
- int *piAddr10 = NULL;
- int i,j,k;
- double thickness=1 , linetype=8,shift =0 ,centre_x ,centre_y,radius,r_value,g_value,b_value;
-
-
- //checking input argument
- CheckInputArgument(pvApiCtx, 10, 10);
- CheckOutputArgument(pvApiCtx, 1, 1) ;
-
- Mat src;
- retrieveImage(src,1);
- int n=*getNbInputArgument(pvApiCtx);
-
- //for value of x coordinate of centre
- sciErr = getVarAddressFromPosition(pvApiCtx,2,&piAddr2);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr2,¢re_x);
- if(intErr)
- return intErr;
-
-
- //for value of y coordinate of centre
- sciErr = getVarAddressFromPosition(pvApiCtx,3,&piAddr3);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr3,¢re_y);
- if(intErr)
- return intErr;
-
- //for value of radius
- sciErr = getVarAddressFromPosition(pvApiCtx,4,&piAddr4);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr4,&radius);
- if(intErr)
- return intErr;
-
- //for value of R value of colour
- sciErr = getVarAddressFromPosition(pvApiCtx,5,&piAddr5);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr5 ,&r_value);
- if(intErr)
- return intErr;
-
- //for value of G value of colour
- sciErr = getVarAddressFromPosition(pvApiCtx,6,&piAddr6);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr6 ,&g_value);
- if(intErr)
- return intErr;
-
- // for B value of colour
- sciErr = getVarAddressFromPosition(pvApiCtx,7,&piAddr7);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr7,&b_value);
- if(intErr)
- return intErr;
-
- if(n==8)
- {
- // for thickness of circle default: 1
- sciErr = getVarAddressFromPosition(pvApiCtx,8,&piAddr8);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr8,&thickness);
- if(intErr)
- return intErr;
- }
- else if(n==9)
- {
- sciErr = getVarAddressFromPosition(pvApiCtx,8,&piAddr8);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr8,&thickness);
- if(intErr)
- return intErr;
- //for line type of circle default: 8
-
- sciErr = getVarAddressFromPosition(pvApiCtx,9,&piAddr9);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- intErr = getScalarDouble(pvApiCtx, piAddr9,&linetype);
- if(intErr)
- return intErr;
- }
- else if(n==10)
- { sciErr = getVarAddressFromPosition(pvApiCtx,8,&piAddr8);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr8,&thickness);
- if(intErr)
- return intErr;
- //for line type of circle default: 8
-
- sciErr = getVarAddressFromPosition(pvApiCtx,9,&piAddr9);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- intErr = getScalarDouble(pvApiCtx, piAddr9,&linetype);
- if(intErr)
- return intErr;
-
- // for shift in circle default : 0
- sciErr = getVarAddressFromPosition(pvApiCtx,10,&piAddr10);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr10,&shift);
- if(intErr)
- return intErr;
- }
-
- // for shift in circle defulat : 0
-
-
- // checking radius parameter
- if (radius <0)
- {
- radius=3;
- sciprint("Radius should be positive , 3 value was used instead\n");
- }
- // checking the parmeters for correct values
- if( r_value <0 || r_value >255)
- {
- r_value=0;
- sciprint(" r value of colour should be between 0 and 255 , using 0 instead\n");
- }
- if( g_value <0 || g_value >255)
- {
- g_value=0;
- sciprint(" g value of colour should be between 0 and 255 , using 0 instead\n");
- }
- if( b_value <0 || b_value >255)
- {
- b_value=0;
- sciprint(" b value of colour should be between 0 and 255 , using 0 instead\n");
- }
- if ((linetype!=0) && (linetype!=4)&& (linetype!=8))
- {
- linetype=8;
- sciprint("Only 0/4/8 allowed , using 8 instead\n");
- }
- //temporary pt variable, to use in function as centre
- Point pt(centre_x,centre_y);
- /// Draw the circles detected
- try
- {
- circle( src, pt, radius, Scalar(r_value,g_value,b_value), thickness, linetype, shift);
- }
- catch(cv::Exception& e)
- {
- Scierror(999,e.what());
- }
-//// sending the image
-
- string tempstring = type2str(src.type());
- char *checker;
- checker = (char *)malloc(tempstring.size() + 1);
- memcpy(checker, tempstring.c_str(), tempstring.size() + 1);
- returnImage(checker,src,1);
- free(checker);
-
- //Assigning the list as the Output Variable
- AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
- //Returning the Output Variables as arguments to the Scilab environment
- ReturnArguments(pvApiCtx);
- return 0;
-
-
- }
-
-}
-
diff --git a/sci_gateway/cpp/opencv_convolver.cpp b/sci_gateway/cpp/opencv_convolver.cpp
new file mode 100644
index 0000000..8a5d289
--- /dev/null
+++ b/sci_gateway/cpp/opencv_convolver.cpp
@@ -0,0 +1,167 @@
+/******************************************************************************************
+*Author : Kevin George , Manoj Sree Harsha
+*
+*-> To execute, Image = convolver(I1, size, values,scalar)
+* where 'I1' is image to be convoluted,
+* where 'size' is size of kernel i.e size x size gives total no. of values in kernel,
+* where 'values' contains the values of the kernel
+* where 'scalar' is a float value
+*
+*******************************************************************************************/
+#include
+#include
+#include "opencv2/core/core.hpp"
+#include "opencv2/highgui/highgui.hpp"
+#include "opencv2/opencv.hpp"
+#include "opencv2/imgproc/imgproc.hpp"
+#include "opencv2/features2d/features2d.hpp"
+#include
+#include
+#include
+
+using namespace cv;
+using namespace std;
+
+extern "C"
+{
+ #include "api_scilab.h"
+ #include "Scierror.h"
+ #include "BOOL.h"
+ #include
+ #include "sciprint.h"
+ #include "../common.h"
+
+ int opencv_convolver(char *fname, unsigned long fname_len)
+ {
+ //-> Error Management variables
+ SciErr sciErr;
+ int intErr=0;
+
+ //-> Mat containers for images
+ Mat image_1;
+ Mat image_2;
+
+ //-> Address of Various Arguments
+ int *piAddr = NULL;
+
+ //-> Local Variables
+ double *values1 = NULL;
+ float *values2 =NULL;
+ double size;
+ double scalar;
+ int iRows = 0;
+ int iCols = 0;
+ int *outList = NULL;
+ unsigned char *red = NULL;
+ unsigned char *green = NULL;
+ unsigned char *blue = NULL;
+
+ //-> Checks the number of arguments
+ //-> pvApiCtx is a Scilab environment pointer
+ CheckInputArgument(pvApiCtx, 4, 4); //Check on Number of Input Arguments
+ CheckOutputArgument(pvApiCtx, 1, 1); //Check on Number of Output Arguments
+
+ //-> Read Image
+ retrieveImage( image_1, 1);
+
+ //-> Taking in size of kernel
+ sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piAddr);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ intErr = getScalarDouble(pvApiCtx, piAddr, &size);
+ if(intErr)
+ {
+ return intErr;
+ }
+ if(size!=3 && size != 4 && size !=5)
+ {
+ Scierror(999," Invalid Value size. Please enter a non negative Double value\\n");
+ return 0;
+ }
+
+ //-> Taking the kernel values
+ sciErr = getVarAddressFromPosition(pvApiCtx, 3, &piAddr);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &iRows, &iCols, &values1);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ if(iRows*iCols!=9 && iRows*iCols!=16 && iRows*iCols!=25 )
+ {
+ Scierror(999,"Invalid Argument\n");
+ return 0;
+ }
+
+ values2 = (float*)malloc(sizeof(float)*size*size);
+ for(int i=0; i Taking scalar values
+ sciErr = getVarAddressFromPosition(pvApiCtx, 4, &piAddr);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ intErr = getScalarDouble(pvApiCtx, piAddr, &scalar);
+ if(intErr)
+ {
+ return intErr;
+ }
+
+ if( scalar == 0)
+ {
+ Scierror(999," Invalid scalar value. Please enter a non negative Double value\\n");
+ return 0;
+ }
+
+ //Application Code
+ try
+ {
+ Mat kernel(size,size,CV_32F, values2);
+ Mat kernel2 = kernel/ (float)(scalar);
+ Point anchor;
+ double delta;
+ int ddepth;
+ anchor = Point( -1, -1 );
+ delta = 0;
+ ddepth = -1;
+ filter2D(image_1, image_2, ddepth,kernel2,anchor,delta, BORDER_DEFAULT);
+
+ //returning final image
+ string tempstring = type2str(image_2.type());
+ char *checker;
+ checker = (char *)malloc(tempstring.size() + 1);
+ memcpy(checker, tempstring.c_str(), tempstring.size() + 1);
+ returnImage(checker,image_2,1);
+ free(checker);
+ }
+ catch(cv::Exception& e)
+ {
+ const char* err=e.what();
+ Scierror(999,("%s"),err);
+ }
+
+ //Assigning output variables
+ AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
+
+ //Returning the Output Variables as arguments to the Scilab environment
+ ReturnArguments(pvApiCtx);
+ return 0;
+ }
+
+}
\ No newline at end of file
diff --git a/sci_gateway/cpp/opencv_cornerEigenValsAndVecs.cpp b/sci_gateway/cpp/opencv_cornerEigenValsAndVecs.cpp
new file mode 100644
index 0000000..1a37225
--- /dev/null
+++ b/sci_gateway/cpp/opencv_cornerEigenValsAndVecs.cpp
@@ -0,0 +1,148 @@
+/********************************************************
+Author: Shubheksha Jalan
+********************************************************/
+
+#include
+#include "opencv2/core/core.hpp"
+#include "opencv2/highgui/highgui.hpp"
+#include "opencv2/opencv.hpp"
+#include
+using namespace cv;
+using namespace std;
+extern "C"
+{
+ #include "api_scilab.h"
+ #include "Scierror.h"
+ #include "BOOL.h"
+ #include
+ #include "../common.h"
+
+
+ int opencv_cornerEigenValsAndVecs(char *fname, unsigned long fname_len)
+ {
+ //Error management variables
+ SciErr sciErr;
+ int intErr = 0;
+
+ // variables required to read arguments
+ int iRows=0,iCols=0;
+ int *piLen = NULL;
+ int *piAddr = NULL;
+ int *piAddrNew = NULL;
+ int *piAddr2 = NULL;
+ int *piAddr3 = NULL;
+ int *piAddr4 = NULL;
+ int i,j,k;
+ double blockSize, ksize;
+ char **borderType;
+
+ //Checking number of input and output arguments (enviromnet variable, min arguments, max arguments)
+ CheckInputArgument(pvApiCtx, 4, 4);
+ CheckOutputArgument(pvApiCtx, 1, 1);
+
+ // to get the argument #1
+ Mat image;
+ retrieveImage(image, 1);
+ image.convertTo(image,CV_32F);
+ cvtColor(image,image,CV_BGR2GRAY);
+
+ // to get the argument #2
+ //for block size
+ sciErr = getVarAddressFromPosition(pvApiCtx,2,&piAddr2);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ intErr = getScalarDouble(pvApiCtx, piAddr2, &blockSize);
+ if(intErr)
+ {
+ return intErr;
+ }
+
+ // to get the argument #3
+ //for ksize
+ sciErr = getVarAddressFromPosition(pvApiCtx,3,&piAddr3);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ intErr = getScalarDouble(pvApiCtx, piAddr3, &ksize);
+ if(intErr)
+ {
+ return intErr;
+ }
+
+ // to get the argument #4
+ //for border type
+ sciErr = getVarAddressFromPosition(pvApiCtx, 4, &piAddr4);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ //Now, we will retrieve the string from the input parameter. For this, we will require 3 calls
+ //first call to retrieve dimensions
+ sciErr = getMatrixOfString(pvApiCtx, piAddr4, &iRows, &iCols, NULL, NULL);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ piLen = (int*)malloc(sizeof(int) * iRows * iCols);
+ //second call to retrieve length of each string
+ sciErr = getMatrixOfString(pvApiCtx, piAddr4, &iRows, &iCols, piLen, NULL);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ borderType = (char**)malloc(sizeof(char*) * iRows * iCols);
+ for(i = 0 ; i < iRows * iCols ; i++)
+ borderType[i] = (char*)malloc(sizeof(char) * (piLen[i] + 1));//+ 1 for null termination
+ //third call to retrieve data
+ sciErr = getMatrixOfString(pvApiCtx, piAddr4, &iRows, &iCols, piLen, borderType);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ //Application Code
+ Mat new_image(image.rows, image.cols, CV_32FC1);
+ try
+ {
+ if(strcmp(borderType[0], "BORDER_CONSTANT") == 0){
+ cornerEigenValsAndVecs(image, new_image, blockSize, ksize, BORDER_CONSTANT);
+ }
+ else if(strcmp(borderType[0], "BORDER_DEFAULT") == 0)
+ cornerEigenValsAndVecs(image, new_image, blockSize, ksize, BORDER_DEFAULT);
+ free(borderType);
+
+ }
+ catch(cv::Exception& e)
+ {
+ const char* err=e.what();
+ Scierror(999,("%s"),err);
+ }
+
+
+ //returning final Image
+ string tempstring = type2str(new_image.type());
+ char *checker;
+ checker = (char *)malloc(tempstring.size() + 1);
+ memcpy(checker, tempstring.c_str(), tempstring.size() + 1);
+ returnImage(checker,new_image,1);
+ free(checker);
+
+ //Assigning the list as the Output Variable
+ AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
+
+ //Returning the Output Variables as arguments to the Scilab environment
+ ReturnArguments(pvApiCtx);
+ return 0;
+
+ }
+/* ==================================================================== */
+}
diff --git a/sci_gateway/cpp/opencv_cornerHarris.cpp b/sci_gateway/cpp/opencv_cornerHarris.cpp
new file mode 100644
index 0000000..cda0694
--- /dev/null
+++ b/sci_gateway/cpp/opencv_cornerHarris.cpp
@@ -0,0 +1,158 @@
+/********************************************************
+Author: Shubheksha Jalan
+********************************************************/
+#include
+#include "opencv2/core/core.hpp"
+#include "opencv2/highgui/highgui.hpp"
+#include "opencv2/opencv.hpp"
+#include
+using namespace cv;
+using namespace std;
+extern "C"
+{
+ #include "api_scilab.h"
+ #include "Scierror.h"
+ #include "BOOL.h"
+ #include
+ #include "../common.h"
+
+ int opencv_cornerHarris(char *fname, unsigned long fname_len)
+ {
+ // Error management variables
+ SciErr sciErr;
+ int intErr = 0;
+
+ // variables required to read arguments
+ int iRows=0,iCols=0;
+ int *piLen = NULL;
+ int *piAddr = NULL;
+ int *piAddrNew = NULL;
+ int *piAddr2 = NULL;
+ int *piAddr3 = NULL;
+ int *piAddr4 = NULL;
+ int *piAddr5 = NULL;
+ int i,j;
+ double blockSize=0, ksize=0, k=0;
+ char **borderType;
+
+ //Checking number of input and output arguments (enviromnet variable, min arguments, max arguments)
+ CheckInputArgument(pvApiCtx, 5, 5);
+ CheckOutputArgument(pvApiCtx, 1, 1);
+
+ // to get the argument #1
+ Mat image;
+ retrieveImage(image, 1);
+ image.convertTo(image,CV_32F);
+ cvtColor(image,image,CV_BGR2GRAY);
+
+ // to get the argument #2
+ sciErr = getVarAddressFromPosition(pvApiCtx,2,&piAddr2);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ intErr = getScalarDouble(pvApiCtx, piAddr2, &blockSize);
+ if(intErr)
+ {
+ return intErr;
+ }
+
+ // to get the argument #3
+ //for ksize
+ sciErr = getVarAddressFromPosition(pvApiCtx,3,&piAddr3);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ intErr = getScalarDouble(pvApiCtx, piAddr3, &ksize);
+ if(intErr)
+ {
+ return intErr;
+ }
+
+ // to get the argument #4
+ //for value of k
+ sciErr = getVarAddressFromPosition(pvApiCtx,4,&piAddr4);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ intErr = getScalarDouble(pvApiCtx, piAddr4, &k);
+ if(intErr)
+ {
+ return intErr;
+ }
+
+ // to get the argument #5
+ //for border type
+ sciErr = getVarAddressFromPosition(pvApiCtx, 5, &piAddr5);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ //Now, we will retrieve the string from the input parameter. For this, we will require 3 calls
+ //first call to retrieve dimensions
+ sciErr = getMatrixOfString(pvApiCtx, piAddr5, &iRows, &iCols, NULL, NULL);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ piLen = (int*)malloc(sizeof(int) * iRows * iCols);
+ //second call to retrieve length of each string
+ sciErr = getMatrixOfString(pvApiCtx, piAddr5, &iRows, &iCols, piLen, NULL);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ borderType = (char**)malloc(sizeof(char*) * iRows * iCols);
+ for(i = 0 ; i < iRows * iCols ; i++)
+ borderType[i] = (char*)malloc(sizeof(char) * (piLen[i] + 1));//+ 1 for null termination
+ //third call to retrieve data
+ sciErr = getMatrixOfString(pvApiCtx, piAddr5, &iRows, &iCols, piLen, borderType);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ //Application Code
+ Mat new_image(image.rows, image.cols, CV_32FC1);
+ try
+ {
+ if(strcmp(borderType[0], "BORDER_CONSTANT") == 0){
+ cornerHarris(image, new_image, blockSize, ksize, k, BORDER_CONSTANT);
+ }
+ else if(strcmp(borderType[0], "BORDER_DEFAULT") == 0)
+ cornerHarris(image, new_image, blockSize, ksize, k, BORDER_DEFAULT);
+ }
+ catch(cv::Exception& e)
+ {
+ const char* err=e.what();
+ Scierror(999,("%s"),err);
+ }
+
+ //returning final Image
+ new_image.convertTo(new_image, CV_32FC1, 1.0/255.0);
+ string tempstring = type2str(new_image.type());
+ char *checker;
+ checker = (char *)malloc(tempstring.size() + 1);
+ memcpy(checker, tempstring.c_str(), tempstring.size() + 1);
+ returnImage(checker,new_image,1);
+ free(checker);
+
+ //Assigning the list as the Output Variable
+ AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
+
+ //Returning the Output Variables as arguments to the Scilab environment
+ ReturnArguments(pvApiCtx);
+ return 0;
+
+ }
+/* ==================================================================== */
+}
diff --git a/sci_gateway/cpp/opencv_cornerMinEigenVal.cpp b/sci_gateway/cpp/opencv_cornerMinEigenVal.cpp
new file mode 100644
index 0000000..d39e643
--- /dev/null
+++ b/sci_gateway/cpp/opencv_cornerMinEigenVal.cpp
@@ -0,0 +1,146 @@
+/********************************************************
+Author: Shubheksha Jalan
+********************************************************/
+
+#include
+#include "opencv2/core/core.hpp"
+#include "opencv2/highgui/highgui.hpp"
+#include "opencv2/opencv.hpp"
+#include
+using namespace cv;
+using namespace std;
+extern "C"
+{
+ #include "api_scilab.h"
+ #include "Scierror.h"
+ #include "BOOL.h"
+ #include
+ #include "../common.h"
+
+
+ int opencv_cornerMinEigenVal(char *fname, unsigned long fname_len)
+ {
+ // Error management variables
+ SciErr sciErr;
+ int intErr = 0;
+
+ // variables required to read arguments
+ int iRows=0,iCols=0;
+ int *piLen = NULL;
+ int *piAddr = NULL;
+ int *piAddrNew = NULL;
+ int *piAddr2 = NULL;
+ int *piAddr3 = NULL;
+ int *piAddr4 = NULL;
+ int i,j,k;
+ double blockSize, ksize;
+ char **borderType;
+
+ //Checking number of input and output arguments (enviromnet variable, min arguments, max arguments)
+ CheckInputArgument(pvApiCtx, 4, 4);
+ CheckOutputArgument(pvApiCtx, 1, 1) ;
+
+ // to get the argument #1
+ Mat image;
+ retrieveImage(image, 1);
+ image.convertTo(image,CV_32F);
+ cvtColor(image,image,CV_BGR2GRAY);
+
+ // to get the argument #2
+ sciErr = getVarAddressFromPosition(pvApiCtx,2,&piAddr2);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ intErr = getScalarDouble(pvApiCtx, piAddr2, &blockSize);
+ if(intErr)
+ {
+ return intErr;
+ }
+
+ // to get the argument #3
+ //for ksize
+ sciErr = getVarAddressFromPosition(pvApiCtx,3,&piAddr3);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ intErr = getScalarDouble(pvApiCtx, piAddr3, &ksize);
+ if(intErr)
+ {
+ return intErr;
+ }
+
+ // to get the argument #4
+ //for border type
+ sciErr = getVarAddressFromPosition(pvApiCtx, 4, &piAddr4);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ //Now, we will retrieve the string from the input parameter. For this, we will require 3 calls
+ //first call to retrieve dimensions
+ sciErr = getMatrixOfString(pvApiCtx, piAddr4, &iRows, &iCols, NULL, NULL);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ piLen = (int*)malloc(sizeof(int) * iRows * iCols);
+ //second call to retrieve length of each string
+ sciErr = getMatrixOfString(pvApiCtx, piAddr4, &iRows, &iCols, piLen, NULL);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ borderType = (char**)malloc(sizeof(char*) * iRows * iCols);
+ for(i = 0 ; i < iRows * iCols ; i++)
+ borderType[i] = (char*)malloc(sizeof(char) * (piLen[i] + 1));//+ 1 for null termination
+
+ //third call to retrieve data
+ sciErr = getMatrixOfString(pvApiCtx, piAddr4, &iRows, &iCols, piLen, borderType);
+ if(sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+
+ //Application Code
+ Mat new_image;
+ try
+ {
+ if(strcmp(borderType[0], "BORDER_CONSTANT") == 0){
+ cornerMinEigenVal(image, new_image, blockSize, ksize, BORDER_CONSTANT);
+ }
+ else if(strcmp(borderType[0], "BORDER_DEFAULT") == 0)
+ cornerMinEigenVal(image, new_image, blockSize, ksize, BORDER_DEFAULT);
+ }
+ catch(cv::Exception& e)
+ {
+ const char* err=e.what();
+ Scierror(999,("%s"),err);
+ }
+
+
+ //returning final Image
+ string tempstring = type2str(new_image.type());
+ char *checker;
+ checker = (char *)malloc(tempstring.size() + 1);
+ memcpy(checker, tempstring.c_str(), tempstring.size() + 1);
+ returnImage(checker,new_image,1);
+ free(checker);
+
+ //Assigning the list as the Output Variable
+ AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
+
+ //Returning the Output Variables as arguments to the Scilab environment
+ ReturnArguments(pvApiCtx);
+ return 0;
+
+ }
+/* ==================================================================== */
+}
diff --git a/sci_gateway/cpp/opencv_correctMatches.cpp b/sci_gateway/cpp/opencv_correctMatches.cpp
deleted file mode 100644
index 744815d..0000000
--- a/sci_gateway/cpp/opencv_correctMatches.cpp
+++ /dev/null
@@ -1,187 +0,0 @@
-//Author:- Nihar Rao
-
-
-
-
-#include
-#include
-#include "opencv2/core/core.hpp"
-#include "opencv2/highgui/highgui.hpp"
-#include "opencv2/opencv.hpp"
-#include "opencv2/calib3d/calib3d.hpp"
-#include
-#include
-using namespace cv;
-using namespace std;
-extern "C"
-{
- #include "api_scilab.h"
- #include "Scierror.h"
- #include "BOOL.h"
- #include
- #include
- #include "../common.h"
-
-
-
-int opencv_correctMatches(char *fname, unsigned long fname_len)
-{
-
- SciErr sciErr;
- int intErr = 0;
- int iRows=0,iCols=0;//for fundamental matrix
- int iRows1=0,iCols1=0;//for points1 array
- int iRows2=0,iCols2=0;//for points2 array
- int *piAddrNew = NULL;
- int *piAddr1 = NULL;
- int *piAddr2 = NULL;
- int *piAddr3 = NULL;
- double *points1,*points2,*fundamental_matrix;
- int i,j;
- double *new1,*new2;
- CheckInputArgument(pvApiCtx, 3,3);
- CheckOutputArgument(pvApiCtx, 2, 2);
- int n=*getNbInputArgument(pvApiCtx);//get number of input arguments
- vector Point1,Point2;
-
- //for fundamental matrix
- sciErr = getVarAddressFromPosition(pvApiCtx,1,&piAddr1);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- sciErr = getMatrixOfDouble(pvApiCtx, piAddr1, &iRows, &iCols, &fundamental_matrix);
- if(sciErr.iErr)
- {
- printError(&sciErr,0);
- return 0;
- }
- Mat F(3, 3, CV_32FC1, &fundamental_matrix);
-
- if(iRows!=3 || iCols!=3)
- {
-
- Scierror(999, "%s: The entered Fundamental matrix must have dimensions 3*3.\n", fname, 1);
- return 0;
-
-
- }
-
-
- //for points1
- sciErr = getVarAddressFromPosition(pvApiCtx,2,&piAddr2);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- sciErr = getMatrixOfDouble(pvApiCtx, piAddr2, &iRows1, &iCols1, &points1);
- if(sciErr.iErr)
- {
- printError(&sciErr,0);
- return 0;
- }
-
-
-
- //for points2
- sciErr = getVarAddressFromPosition(pvApiCtx,3,&piAddr3);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- sciErr = getMatrixOfDouble(pvApiCtx, piAddr3, &iRows2, &iCols2, &points2);
- if(sciErr.iErr)
- {
- printError(&sciErr,0);
- return 0;
- }
- if(iCols1 != iCols2)
- {
- Scierror(999, "There must be the same number of points in both input arrays(points)\n");
- return 0;
- }
-
- for(i=0;i(i,j);
- }
- }
-
-
-
- new2 = (double*) malloc(sizeof(double) * C.cols *2); //both C and D have same dimensions
- for(i = 0 ; i < C.cols ; i++)
- {
-
- for(j = 0 ; j < 2 ; j++)
- {
- new2[i + C.cols * j] = D.at(i,j);
-
- }
- }
- //Creating Output Arguments
- sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 1, C.cols, 2, new1);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 2, C.cols,2, new2);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
- AssignOutputVariable(pvApiCtx, 2) = nbInputArgument(pvApiCtx) + 2;
- ReturnArguments(pvApiCtx);
- return 0;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-}
-}
diff --git a/sci_gateway/cpp/opencv_cvtColor.cpp b/sci_gateway/cpp/opencv_cvtColor.cpp
deleted file mode 100644
index ba26282..0000000
--- a/sci_gateway/cpp/opencv_cvtColor.cpp
+++ /dev/null
@@ -1,204 +0,0 @@
-/********************************************************
- Author: Shubheksha Jalan , Nihar Rao
-*********************************************************
- void cvtColor(InputArray src, int code, int dstCn=0 )
-********************************************************/
-// number of channels in the destination image; if the parameter is 0, the number of the channels is derived automatically from src and code
-
-
-#include
-#include "opencv2/core/core.hpp"
-#include "opencv2/highgui/highgui.hpp"
-#include "opencv2/opencv.hpp"
-#include
-using namespace cv;
-using namespace std;
-extern "C"
-{
- #include "api_scilab.h"
- #include "Scierror.h"
- #include "sciprint.h"
- #include "BOOL.h"
- #include
- #include "../common.h"
-
- int opencv_cvtColor(char *fname, unsigned long fname_len)
- {
-
- SciErr sciErr;
- int intErr;
- int iRows=0,iCols=0;
- int *piAddr2 = NULL;
- int *piAddr3 = NULL;
- int *piAddr4 = NULL;
- int *piLen = NULL;
- double dstCn=0;
- int code;
- char **codeString = NULL;
- int i, j, k,n;
-
-
- //checking input argument
- CheckInputArgument(pvApiCtx, 2, 3);
- CheckOutputArgument(pvApiCtx, 1,1) ;
-
- n = *getNbInputArgument(pvApiCtx);
- Mat src;
- retrieveImage(src,1);
-
-
- sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piAddr2);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
-
- //Now, we will retrieve the string from the input parameter. For this, we will require 3 calls
- //first call to retrieve dimensions
- sciErr = getMatrixOfString(pvApiCtx, piAddr2, &iRows, &iCols, NULL, NULL);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- piLen = (int*)malloc(sizeof(int) * iRows * iCols);
- //second call to retrieve length of each string
- sciErr = getMatrixOfString(pvApiCtx, piAddr2, &iRows, &iCols, piLen, NULL);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- codeString = (char**)malloc(sizeof(char*) * iRows * iCols);
- for(i = 0 ; i < iRows * iCols ; i++)
- codeString[i] = (char*)malloc(sizeof(char) * (piLen[i] + 1));//+ 1 for null termination
-
- //third call to retrieve data
- sciErr = getMatrixOfString(pvApiCtx, piAddr2, &iRows, &iCols, piLen, codeString);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- if(n==3)
- {
- sciErr = getVarAddressFromPosition(pvApiCtx, 3, &piAddr3);
- if (sciErr.iErr){
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr3, &dstCn);
- if(intErr){
- return intErr;
- }
- }
-
- Mat dst;
- if(strcmp(codeString[0], "CV_BGR2GRAY") == 0)
- code = CV_BGR2GRAY;
- else if(strcmp(codeString[0], "CV_RGB2GRAY") == 0)
- code = CV_RGB2GRAY;
- else if(strcmp(codeString[0], "CV_GRAY2BGR") == 0)
- code = CV_GRAY2BGR;
- else if(strcmp(codeString[0], "CV_GRAY2RGB") == 0)
- code = CV_GRAY2RGB;
- else if(strcmp(codeString[0], "CV_BGR2XYZ") == 0)
- code = CV_BGR2XYZ;
- else if(strcmp(codeString[0], "CV_RGB2XYZ") == 0)
- code = CV_RGB2XYZ;
- else if(strcmp(codeString[0], "CV_XYZ2BGR") == 0)
- code = CV_XYZ2BGR;
- else if(strcmp(codeString[0], "CV_XYZ2RGB") == 0)
- code = CV_XYZ2RGB;
- else if(strcmp(codeString[0], "CV_BGR2YCrCb") == 0)
- code = CV_BGR2YCrCb;
- else if(strcmp(codeString[0], "CV_RGB2YCrCb") == 0)
- code = CV_RGB2YCrCb;
- else if(strcmp(codeString[0], "CV_YCrCb2BGR") == 0)
- code = CV_YCrCb2BGR;
- else if(strcmp(codeString[0], "CV_YCrCb2RGB") == 0)
- code = CV_YCrCb2RGB;
- else if(strcmp(codeString[0], "CV_BGR2HSV") == 0)
- code = CV_BGR2HSV;
- else if(strcmp(codeString[0], "CV_RGB2HSV") == 0)
- code = CV_RGB2HSV;
- else if(strcmp(codeString[0], "CV_HSV2BGR") == 0)
- code = CV_HSV2BGR;
- else if(strcmp(codeString[0], "CV_HSV2RGB") == 0)
- code = CV_HSV2RGB;
- else if(strcmp(codeString[0], "CV_BGR2HLS") == 0)
- code = CV_BGR2HLS;
- else if(strcmp(codeString[0], "CV_RGB2HLS") == 0)
- code = CV_RGB2HLS;
- else if(strcmp(codeString[0], "CV_HLS2BGR") == 0)
- code = CV_HLS2BGR;
- else if(strcmp(codeString[0], "CV_HLS2RGB") == 0)
- code = CV_HLS2RGB;
- else if(strcmp(codeString[0], "CV_BGR2Lab") == 0)
- code = CV_BGR2Lab;
- else if(strcmp(codeString[0], "CV_RGB2Lab") == 0)
- code = CV_RGB2Lab;
- else if(strcmp(codeString[0], "CV_Lab2BGR") == 0)
- code = CV_Lab2BGR;
- else if(strcmp(codeString[0], "CV_Lab2RGB") == 0)
- code = CV_Lab2RGB;
- else if(strcmp(codeString[0], "CV_BGR2Luv") == 0)
- code = CV_BGR2Luv;
- else if(strcmp(codeString[0], "CV_RGB2Luv") == 0)
- code = CV_RGB2Luv;
- else if(strcmp(codeString[0], "CV_Luv2BGR") == 0)
- code = CV_Luv2BGR;
- else if(strcmp(codeString[0], "CV_Luv2RGB") == 0)
- code = CV_Luv2RGB;
- else{
-
- sciprint("Invalid code");
- return 0;
- }
-
- try
- {
-
- if(src.channels()==3 || src.channels()==4)
- src.convertTo(src,CV_8U);
- else
- src.convertTo(src,CV_8UC3);
- cvtColor(src, dst, code, dstCn);
- }
- catch(cv::Exception& e)
- {
-
- sciprint("%s",e.what());
- return 0;
-
-
-
- }
-
- // namedWindow ("window", 1);
- // imshow("window", dst);
- // waitKey(0);
- // destroyWindow("window");
-
-
- string tempstring = type2str(dst.type());
- char *checker;
- checker = (char *)malloc(tempstring.size() + 1);
- memcpy(checker, tempstring.c_str(), tempstring.size() + 1);
- returnImage(checker,dst,1);
- free(checker);
-
-
-
-
- //Assigning the list as the Output Variable
- AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
- //Returning the Output Variables as arguments to the Scilab environment
- ReturnArguments(pvApiCtx);
- return 0;
-}
-/* ==================================================================== */
-}
diff --git a/sci_gateway/cpp/opencv_deconvlucy.cpp b/sci_gateway/cpp/opencv_deconvlucy.cpp
deleted file mode 100644
index a8fcd44..0000000
--- a/sci_gateway/cpp/opencv_deconvlucy.cpp
+++ /dev/null
@@ -1,134 +0,0 @@
-/********************************************************
-Author: Vinay Bhat
-********************************************************
-Usage: return_image = deconvlucy(input_image, PSF)
- return_image = deconvlucy(input_image, PSF, no_of_iterations)
-********************************************************/
-
-#include
-#include "opencv2/core/core.hpp"
-#include "opencv2/highgui/highgui.hpp"
-#include "opencv2/opencv.hpp"
-#include
-using namespace cv;
-using namespace std;
-extern "C"
-{
- #include "api_scilab.h"
- #include "Scierror.h"
- #include "BOOL.h"
- #include
- #include "sciprint.h"
- #include "../common.h"
-
- int opencv_deconvlucy(char *fname, unsigned long fname_len)
- {
-
- SciErr sciErr;
- int intErr = 0;
- int *piAddr = NULL;
- int i;
- double h;
-
- //checking input argument
- CheckInputArgument(pvApiCtx, 2, 3);
- CheckOutputArgument(pvApiCtx, 1, 1);
-
- // Get the input image from the Scilab environment
- Mat image, psf;
- retrieveImage(image, 1);
- retrieveImage(psf, 2);
-
-
- // Check if number of arguments are three,
- // if so, then the number of iterations is also
- // specified.
- // If not, then set number of iterations as
- // ten.
- if (nbInputArgument(pvApiCtx) == 3)
- {
- // Get the address of the iterations scalar
- sciErr = getVarAddressFromPosition(pvApiCtx, 3, &piAddr);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- // Get the no. of iterations scalar
- intErr = getScalarDouble(pvApiCtx, piAddr, &h);
- if(intErr)
- {
- return intErr;
- }
-
- if (h < 0)
- {
- sciprint("Please enter a nonnegative scalar for number of iterations.\n");
- return 0;
- }
- }
- else
- h = 10;
-
-
- // Check if the input image is grayscale or not,
-
-
- if (image.channels()!=1)
- {
- sciprint("\nthe first image must be grayscale!\n");
- return 0;
- }
-
- if (psf.channels()!=1)
- {
- sciprint("\nthe second image must be grayscale!\n");
- return 0;
-
- }
-
-
- // Apply the Lucy-Richardson method for deblurring
- // an image.
- Mat convRes, convRes2, temp;
- temp = image.clone();
-
- try
- {
-
- for (i = 0; i < h; i++)
- {
- filter2D(temp, convRes, -1, psf);
- max((temp - convRes), 0, convRes2);
- min((temp + convRes2), 255, convRes);
- temp = convRes.clone();
- }
-
- }
- catch(cv::Exception& e)
- {
- Scierror(999,e.what());
- return 0;
-
- }
-
- image = temp.clone();
-
- string tempstring = type2str(image.type());
- char *checker;
- checker = (char *)malloc(tempstring.size() + 1);
- memcpy(checker, tempstring.c_str(), tempstring.size() + 1);
- returnImage(checker, image, 1);
- free(checker);
-
- //Assigning the list as the Output Variable
- AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
- //Returning the Output Variables as arguments to the Scilab environment
- ReturnArguments(pvApiCtx);
- return 0;
-
- }
-/* ==================================================================== */
-}
-
diff --git a/sci_gateway/cpp/opencv_demosaic.cpp b/sci_gateway/cpp/opencv_demosaic.cpp
deleted file mode 100644
index 2aa3bb2..0000000
--- a/sci_gateway/cpp/opencv_demosaic.cpp
+++ /dev/null
@@ -1,152 +0,0 @@
-/********************************************************
- Author: V Srinivas
-*********************************************************
- void cvtColor(InputArray src, int code, int dstCn=0 )
-********************************************************/
-//Demosaicing using cvt color filter
-
-#include
-#include "opencv2/core/core.hpp"
-#include "opencv2/highgui/highgui.hpp"
-#include "opencv2/opencv.hpp"
-#include
-
-using namespace cv;
-using namespace std;
-extern "C"
-{
- #include "api_scilab.h"
- #include "Scierror.h"
- #include "sciprint.h"
- #include "BOOL.h"
- #include
- #include "../common.h"
-
- int opencv_demosaic(char *fname, unsigned long fname_len)
- {
-
- SciErr sciErr;
- int intErr;
- int iRows=0,iCols=0;
- int *piAddr2 = NULL;
- int *piAddr3 = NULL;
- int *piAddr4 = NULL;
- int *piLen = NULL;
- double dstCn;
- int code;
- char **codeString = NULL;
- int i, j, k;
-
- //checking input argument
- CheckInputArgument(pvApiCtx, 2,2);
- CheckOutputArgument(pvApiCtx, 1,1) ;
-
-
- Mat src;
- retrieveImage(src,1);
-
- sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piAddr2);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return -1;
- }
-
- //Now, we will retrieve the string from the input parameter. For this, we will require 3 calls
- //first call to retrieve dimensions
- sciErr = getMatrixOfString(pvApiCtx, piAddr2, &iRows, &iCols, NULL, NULL);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return -1;
- }
- piLen = (int*)malloc(sizeof(int) * iRows * iCols);
- //second call to retrieve length of each string
- sciErr = getMatrixOfString(pvApiCtx, piAddr2, &iRows, &iCols, piLen, NULL);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return -1;
- }
-
- codeString = (char**)malloc(sizeof(char*) * iRows * iCols);
- for(i = 0 ; i < iRows * iCols ; i++)
- codeString[i] = (char*)malloc(sizeof(char) * (piLen[i] + 1));//+ 1 for null termination
-
- //third call to retrieve data
- sciErr = getMatrixOfString(pvApiCtx, piAddr2, &iRows, &iCols, piLen, codeString);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
-
-
- Mat dst;
-
- if(strcmp(codeString[0], "gbrg") == 0)
- code = CV_BayerGR2RGB;
- else if(strcmp(codeString[0], "bggr") == 0)
- code = CV_BayerRG2RGB;
- else if(strcmp(codeString[0], "rggb") == 0)
- code = CV_BayerBG2RGB;
- else if(strcmp(codeString[0], "grbg") == 0)
- code = CV_BayerGB2RGB;
- else{
-
- sciprint("Invalid Bayer filter code");
- return 0;
- }
-
- try
- {
- //convert colored image to grayscale
- if(src.channels()>=3)
- {
-
- src.convertTo(src,CV_8U);
- cvtColor( src, src, CV_BGR2GRAY );
-
-
-
- }
- src.convertTo(src,CV_8U);
- cvtColor(src, dst, code, 0);
- }
- catch(cv::Exception& e)
- {
-
-
- Scierror(999,e.what());
- return 0;
-
-
-
-
- }
-
- // namedWindow ("window", 1);
- // imshow("window", dst);
- // waitKey(0);
- // destroyWindow("window");
-
-
- string tempstring = type2str(dst.type());
- char *checker;
- checker = (char *)malloc(tempstring.size() + 1);
- memcpy(checker, tempstring.c_str(), tempstring.size() + 1);
- returnImage(checker,dst,1);
- free(checker);
-
-
-
-
- //Assigning the list as the Output Variable
- AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
- //Returning the Output Variables as arguments to the Scilab environment
- ReturnArguments(pvApiCtx);
- return 0;
-}
-/* ==================================================================== */
-}
\ No newline at end of file
diff --git a/sci_gateway/cpp/opencv_demosaic.cpp~ b/sci_gateway/cpp/opencv_demosaic.cpp~
deleted file mode 100644
index 4c2ee4b..0000000
--- a/sci_gateway/cpp/opencv_demosaic.cpp~
+++ /dev/null
@@ -1,127 +0,0 @@
-/********************************************************
- Author: V Srinivas
-*********************************************************
- void cvtColor(InputArray src, int code, int dstCn=0 )
-********************************************************/
-//Demosaicing using cvt color filter
-
-#include
-#include "opencv2/core/core.hpp"
-#include "opencv2/highgui/highgui.hpp"
-#include "opencv2/opencv.hpp"
-#include
-
-using namespace cv;
-using namespace std;
-extern "C"
-{
- #include "api_scilab.h"
- #include "Scierror.h"
- #include "sciprint.h"
- #include "BOOL.h"
- #include
- #include "../common.h"
-
- int opencv_demosaic(char *fname, unsigned long fname_len)
- {
-
- SciErr sciErr;
- int intErr;
- int iRows=0,iCols=0;
- int *piAddr2 = NULL;
- int *piAddr3 = NULL;
- int *piAddr4 = NULL;
- int *piLen = NULL;
- double dstCn;
- int code;
- char **codeString = NULL;
- int i, j, k;
-
- //checking input argument
- CheckInputArgument(pvApiCtx, 2,2);
- CheckOutputArgument(pvApiCtx, 1,1) ;
-
-
- Mat src;
- retrieveImage(src,1);
-
- sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piAddr2);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return -1;
- }
-
- //Now, we will retrieve the string from the input parameter. For this, we will require 3 calls
- //first call to retrieve dimensions
- sciErr = getMatrixOfString(pvApiCtx, piAddr2, &iRows, &iCols, NULL, NULL);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return -1;
- }
- piLen = (int*)malloc(sizeof(int) * iRows * iCols);
- //second call to retrieve length of each string
- sciErr = getMatrixOfString(pvApiCtx, piAddr2, &iRows, &iCols, piLen, NULL);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return -1;
- }
-
- codeString = (char**)malloc(sizeof(char*) * iRows * iCols);
- for(i = 0 ; i < iRows * iCols ; i++)
- codeString[i] = (char*)malloc(sizeof(char) * (piLen[i] + 1));//+ 1 for null termination
-
- //third call to retrieve data
- sciErr = getMatrixOfString(pvApiCtx, piAddr2, &iRows, &iCols, piLen, codeString);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
-
-
- Mat dst;
-
- if(strcmp(codeString[0], "gbrg") == 0)
- code = CV_BayerGR2RGB;
- else if(strcmp(codeString[0], "bggr") == 0)
- code = CV_BayerRG2RGB;
- else if(strcmp(codeString[0], "rggb") == 0)
- code = CV_BayerBG2RGB;
- else if(strcmp(codeString[0], "grbg") == 0)
- code = CV_BayerGB2RGB;
- else{
-
- sciprint("Invalid Bayer filter code");
- return 0;
- }
-
- cvtColor(src, dst, code, 0);
-
- // namedWindow ("window", 1);
- // imshow("window", dst);
- // waitKey(0);
- // destroyWindow("window");
-
-
- string tempstring = type2str(dst.type());
- char *checker;
- checker = (char *)malloc(tempstring.size() + 1);
- memcpy(checker, tempstring.c_str(), tempstring.size() + 1);
- returnImage(checker,dst,1);
- free(checker);
-
-
-
-
- //Assigning the list as the Output Variable
- AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
- //Returning the Output Variables as arguments to the Scilab environment
- ReturnArguments(pvApiCtx);
- return 0;
-}
-/* ==================================================================== */
-}
\ No newline at end of file
diff --git a/sci_gateway/cpp/opencv_detectGFTTFeatures.cpp b/sci_gateway/cpp/opencv_detectGFTTFeatures.cpp
deleted file mode 100644
index 6b8b35f..0000000
--- a/sci_gateway/cpp/opencv_detectGFTTFeatures.cpp
+++ /dev/null
@@ -1,509 +0,0 @@
-/***************************************************
-Author : Nihar Rao
-***************************************************/
-#include
-#include
-#include
-#include
-#include
-#include "opencv2/core/core.hpp"
-#include "opencv2/features2d.hpp"
-#include "opencv2/xfeatures2d.hpp"
-#include "opencv2/highgui/highgui.hpp"
-#include "opencv2/imgproc/imgproc.hpp"
-
-using namespace cv;
-using namespace std;
-using namespace cv::xfeatures2d;
-
-
-extern "C"
-{
- #include "api_scilab.h"
- #include "Scierror.h"
- #include "BOOL.h"
- #include
- #include "sciprint.h"
- #include "../common.h"
-
- int opencv_detectGFTTFeatures(char *fname, unsigned long fname_len)
- {
-
- SciErr sciErr;
- int *piAddr = NULL;
- int *piAddrVal = NULL;
- int argPresence[7];
- for(int i=0;i<7;i++)
- argPresence[i]=0;
- int val_position;
- int iRows = 0;
- int iCols = 0;
- int *piLen = NULL;
- char ** pstData = NULL;
- char *currentArg = NULL;
- double *ROImat = NULL;
-
- double MinContrast = 0.2;
- double MinQuality = 0.1;
- double numBits = 0;
- double numFeatures = 0;
- double *featureVector = NULL;
-
-// DECLARING INPUT ARGUMENTS with their default values
-
-
-
- bool useHarris=false;
- int maxCorners=1000;
- double minDistance=1;
- double K = 0.04;
- double qualityLevel = 0.01;
- int blockSize=3;
-
-
-
-
-
-// DECLARING OUTPUT ARGUMENTS
-
- vector myPoints;
- int *LocationList = NULL;
- double *LocationData = NULL;
- int feature_rows=0;
- int feature_cols=0;
-
-
- int size;
-
-// ARGUMENT CHECK
-
- CheckInputArgument(pvApiCtx, 1,15);
- CheckOutputArgument(pvApiCtx,1,5);
-
-// RETRIEVING IMAGE
-
- Mat image;
- retrieveImage(image,1);
-
-// GRAYSCALE VALIDATION
-
- if(image.channels()!=1)
- {
- Scierror(999," Feature is not meant for RGB images\n");
- return 0;
- }
-
-// OBTAINING NUMBER OF ARGUMENTS
-
- int noOfarguments = *getNbInputArgument(pvApiCtx);
-
-// ARGUMENT COUNT CHECK
-
- if(noOfarguments%2==0)
- {
- Scierror(999," Invalid Number Of Arguments\n");
- return 0;
- }
-
-// MULTIPLE ARGUMENT HANDLING
-
- for(int i=2;iimage.cols || ROImat[1]>image.rows || ROImat[0]+ROImat[2]>image.cols
- || ROImat[1]+ROImat[3]>image.rows)
- {
- Scierror(999,"Please make sure the arguments are within the image range\n");
- return 0;
- }
-
- argPresence[3]=1;
- }
- else if(strcmp(currentArg,"maxCorners")==0)
- {
- val_position=i+1;
-
-
- if(argPresence[4]==1)
- {
- Scierror(999,"Do not enter the same parameter\n");
- return 0;
- }
-
- sciErr = getVarAddressFromPosition(pvApiCtx,val_position,&piAddrVal);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- if(!isDoubleType(pvApiCtx, piAddrVal))
- {
- Scierror(999," Invalid type for maxCorners\n");
- return 0;
- }
- double d=0;
-
- getScalarDouble(pvApiCtx, piAddrVal, &d);
- maxCorners=(int)d;
-
-
-
-
- argPresence[4]=1;
- }
- else if(strcmp(currentArg,"useHarris")==0)
- {
-
-
- val_position=i+1;
-
- if(argPresence[5]==1)
- {
- Scierror(999,"Do not enter the same parameter\n");
- return 0;
- }
-
- sciErr = getVarAddressFromPosition(pvApiCtx,val_position,&piAddrVal);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- int *r=NULL;
-
- sciErr = getMatrixOfBoolean(pvApiCtx, piAddrVal, &iRows, &iCols, &r);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
-
- if(r[0])
- useHarris=true;
- else
- useHarris=false;
- argPresence[5]=1;
-
-
- }
- else if(strcmp(currentArg,"blockSize")==0)
- {
- val_position=i+1;
-
-
- if(argPresence[6]==1)
- {
- Scierror(999,"Do not enter the same parameter\n");
- return 0;
- }
-
- sciErr = getVarAddressFromPosition(pvApiCtx,val_position,&piAddrVal);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- if(!isDoubleType(pvApiCtx, piAddrVal))
- {
- Scierror(999," Invalid type for blockSize\n");
- return 0;
- }
- double d=0;
-
- getScalarDouble(pvApiCtx, piAddrVal, &d);
- blockSize=(int)d;
-
-
-
-
- argPresence[6]=1;
- }
- else
- {
- Scierror(999, "Error: \"%s\" Invalid input argument.\n", currentArg);
- return 0;
- }
-
- }
-
-
-// DEFAULT ARGUMENTS
-
- if(argPresence[3]==0)
- {
- ROImat=(double *)malloc(sizeof(double)*1*4);
- ROImat[0]=0;
- ROImat[1]=0;
- ROImat[2]=image.cols;
- ROImat[3]=image.rows;
- }
-
-// CREATING REGION OF INTEREST
-
- Rect masker(ROImat[0], ROImat[1], ROImat[2], ROImat[3]);
-
- Mat mask(image.size(), CV_8UC1, Scalar::all(0));
- mask(masker).setTo(Scalar::all(255));
-//KAZE processing
- Mat descriptor;
- Ptr myobject = cv::GFTTDetector::create(maxCorners,qualityLevel,minDistance,blockSize,useHarris,K);
- try
- {
- image.convertTo(image, CV_8U);
- myobject->detect(image,myPoints,mask);
- Ptr obj=FREAK::create( true, true, 22.0f, 4 ,std::vector< int >());
- obj->compute(image, myPoints ,descriptor);
- numBits = descriptor.size[1];
- numFeatures = descriptor.size[0];
-
- featureVector = (double*)malloc(sizeof(double)*descriptor.size[0]*descriptor.size[1]);
- for( int i=0; i(i,j));
- }
- feature_rows = descriptor.size[0];
- feature_cols = descriptor.size[1];
- }
- catch(cv::Exception &e)
- {
- const char *err = e.what();
- sciprint("%s", err);
- return 0;
- }
-
-
-
- size = myPoints.size();
-
-
-// LOCATION ---->
-
- LocationData = (double *)malloc(sizeof(double) * size * 2);
- for(int i = 0; i < size; i++)
- {
- LocationData[i] = myPoints[i].pt.x;
- LocationData[i + size] = myPoints[i].pt.y;
- }
-
-
-//Creating Output Arguments
- sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 1, feature_rows, feature_cols, featureVector);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 2, 1, 1, &numBits);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 3, 1, 1, &numFeatures);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 4, size, 2, LocationData);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
-
- createScalarInteger32(pvApiCtx,nbInputArgument(pvApiCtx) + 5, size);
-
-// ASSIGNING ---->
-
- for(int i=1;i<=5;i++)
- {
- AssignOutputVariable(pvApiCtx, i) = nbInputArgument(pvApiCtx) + i;
- }
-
- ReturnArguments(pvApiCtx);
- }
-
-
-}
\ No newline at end of file
diff --git a/sci_gateway/cpp/opencv_detectKAZEFeatures.cpp b/sci_gateway/cpp/opencv_detectKAZEFeatures.cpp
deleted file mode 100644
index 1ab6100..0000000
--- a/sci_gateway/cpp/opencv_detectKAZEFeatures.cpp
+++ /dev/null
@@ -1,510 +0,0 @@
-/***************************************************
-Author : Nihar Rao
-***************************************************/
-#include
-#include "opencv2/core/core.hpp"
-#include "opencv2/highgui/highgui.hpp"
-#include "opencv2/opencv.hpp"
-#include
-using namespace cv;
-using namespace std;
-extern "C"
-{
- #include "api_scilab.h"
- #include "Scierror.h"
- #include "BOOL.h"
- #include
- #include "sciprint.h"
- #include "../common.h"
-
- int opencv_detectKAZEFeatures(char *fname, unsigned long fname_len)
- {
-
- SciErr sciErr;
- int *piAddr = NULL;
- int *piAddrVal = NULL;
- int argPresence[7];
- for(int i=0;i<7;i++)
- argPresence[i]=0;
- int val_position;
- int iRows = 0;
- int iCols = 0;
- int *piLen = NULL;
- char ** pstData = NULL;
- char *currentArg = NULL;
- double *ROImat = NULL;
-
- double MinContrast = 0.2;
- double MinQuality = 0.1;
- double numBits = 0;
- double numFeatures = 0;
- double *featureVector = NULL;
-
-// DECLARING INPUT ARGUMENTS with their default values
-
-
- bool extended=false;
- bool upright=false;
- double Threshold=0.001;
- double NumOctaves = 4;
- double NumLayers = 4;
- double diff=0;
- int diffusivity=1;
-
-
-
-// DECLARING OUTPUT ARGUMENTS
-
- vector myPoints;
- int *LocationList = NULL;
- double *LocationData = NULL;
- int feature_rows=0;
- int feature_cols=0;
-
-
- int size;
-
-// ARGUMENT CHECK
-
- CheckInputArgument(pvApiCtx, 1,15);
- CheckOutputArgument(pvApiCtx,1,5);
-
-// RETRIEVING IMAGE
-
- Mat image;
- retrieveImage(image,1);
-
-// GRAYSCALE VALIDATION
-
- if(image.channels()!=1)
- {
- Scierror(999," Feature is not meant for RGB images\n");
- return 0;
- }
-
-// OBTAINING NUMBER OF ARGUMENTS
-
- int noOfarguments = *getNbInputArgument(pvApiCtx);
-
-// ARGUMENT COUNT CHECK
-
- if(noOfarguments%2==0)
- {
- Scierror(999," Invalid Number Of Arguments\n");
- return 0;
- }
-
-// MULTIPLE ARGUMENT HANDLING
-
- for(int i=2;iimage.cols || ROImat[1]>image.rows || ROImat[0]+ROImat[2]>image.cols
- || ROImat[1]+ROImat[3]>image.rows)
- {
- Scierror(999,"Please make sure the arguments are within the image range\n");
- return 0;
- }
-
- argPresence[3]=1;
- }
- else if(strcmp(currentArg,"upright")==0)
- {
-
- sciprint("hey");
- val_position=i+1;
-
- if(argPresence[4]==1)
- {
- Scierror(999,"Do not enter the same parameter\n");
- return 0;
- }
-
- sciErr = getVarAddressFromPosition(pvApiCtx,val_position,&piAddrVal);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- int *r=NULL;
-
- sciErr = getMatrixOfBoolean(pvApiCtx, piAddrVal, &iRows, &iCols, &r);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- if(r[0])
- upright=true;
- else
- upright=false;
- argPresence[4]=1;
-
-
- }
- else if(strcmp(currentArg,"extended")==0)
- {
-
-
- val_position=i+1;
-
- if(argPresence[5]==1)
- {
- Scierror(999,"Do not enter the same parameter\n");
- return 0;
- }
-
- sciErr = getVarAddressFromPosition(pvApiCtx,val_position,&piAddrVal);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- int *r=NULL;
-
- sciErr = getMatrixOfBoolean(pvApiCtx, piAddrVal, &iRows, &iCols, &r);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
-
- if(r[0])
- extended=true;
- else
- extended=false;
- argPresence[5]=1;
-
-
- }
- else if(strcmp(currentArg,"diffusivity")==0)
- {
- val_position=i+1;
-
-
- if(argPresence[6]==1)
- {
- Scierror(999,"Do not enter the same parameter\n");
- return 0;
- }
-
- sciErr = getVarAddressFromPosition(pvApiCtx,val_position,&piAddrVal);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- if(!isDoubleType(pvApiCtx, piAddrVal))
- {
- Scierror(999," Invalid type for diffusivity\n");
- return 0;
- }
-
- getScalarDouble(pvApiCtx, piAddrVal, &diff);
- diffusivity=(int)diff;
-
- if(diffusivity>3 || diffusivity<0)
- {
- Scierror(999," diffusivity must be [0,3] \n");
- return 0;
-
-
- }
-
-
- argPresence[6]=1;
- }
- else
- {
- Scierror(999, "Error: \"%s\" Invalid input argument.\n", currentArg);
- return 0;
- }
-
- }
-
-
-// DEFAULT ARGUMENTS
-
- if(argPresence[3]==0)
- {
- ROImat=(double *)malloc(sizeof(double)*1*4);
- ROImat[0]=0;
- ROImat[1]=0;
- ROImat[2]=image.cols;
- ROImat[3]=image.rows;
- }
-
-// CREATING REGION OF INTEREST
-
- Rect masker(ROImat[0], ROImat[1], ROImat[2], ROImat[3]);
-
- Mat mask(image.size(), CV_8UC1, Scalar::all(0));
- mask(masker).setTo(Scalar::all(255));
-//KAZE processing
- Mat descriptor;
- Ptr myobject = KAZE::create(extended,upright,Threshold,NumOctaves,NumLayers,diffusivity);
- try
- {
- image.convertTo(image, CV_8U);
- myobject->detectAndCompute(image,mask,myPoints,descriptor,false);
-
-
- numBits = descriptor.size[1];
- numFeatures = descriptor.size[0];
-
- featureVector = (double*)malloc(sizeof(double)*descriptor.size[0]*descriptor.size[1]);
- for( int i=0; i(i,j));
- }
- feature_rows = descriptor.size[0];
- feature_cols = descriptor.size[1];
- }
- catch(cv::Exception &e)
- {
- const char *err = e.what();
- sciprint("%s", err);
- return 0;
- }
-
-
-
- size = myPoints.size();
-
-
-// LOCATION ---->
-
- LocationData = (double *)malloc(sizeof(double) * size * 2);
- for(int i = 0; i < size; i++)
- {
- LocationData[i] = myPoints[i].pt.x;
- LocationData[i + size] = myPoints[i].pt.y;
- }
-
-
-//Creating Output Arguments
- sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 1, feature_rows, feature_cols, featureVector);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 2, 1, 1, &numBits);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 3, 1, 1, &numFeatures);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 4, size, 2, LocationData);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
-
- createScalarInteger32(pvApiCtx,nbInputArgument(pvApiCtx) + 5, size);
-
-// ASSIGNING ---->
-
- for(int i=1;i<=5;i++)
- {
- AssignOutputVariable(pvApiCtx, i) = nbInputArgument(pvApiCtx) + i;
- }
-
- ReturnArguments(pvApiCtx);
- }
-
-
-}
\ No newline at end of file
diff --git a/sci_gateway/cpp/opencv_detectMSERFeatures.cpp b/sci_gateway/cpp/opencv_detectMSERFeatures.cpp
deleted file mode 100644
index 38a240e..0000000
--- a/sci_gateway/cpp/opencv_detectMSERFeatures.cpp
+++ /dev/null
@@ -1,465 +0,0 @@
-/********************************************************************************************************************************************************************************************************
-* Author: Umang Agrawal and nihar rao *
-* Code: detectMSERFeatures.cpp *
-* Function Format: [ list_pixels, ......] = detectMSERFeatures( image, Optional Arguments........) *
-* Input Arguments: 1. Image (Grayscale or RGB) *
-* 2. ThresholdDelta Value: (0:100] Expressed in Percentage *
-* 3. RegionAreaRange Value: [ Min_Area , Max_Area ] *
-* 4. MaxAreaVariation Value: Scalar Double typical range from 0.25 - 4 *
-* 5. ROI Value: [ x_cord , y_cord , width , height ] *
-* *
-* Output Argument: 1. List Of Pixels stating the Locus of all features detected *
-* 2. Count *
-* 3. Location: Centroid of each Locus *
-* 4. Axes: Major and Minor axis length of ellipse *
-* 5. Orientation: Tilt of the elliptical fit *
-* *
-********************************************************************************************************************************************************************************************************/
-
-
-#include
-#include
-#include
-#include
-#include "opencv2/core/core.hpp"
-#include "opencv2/features2d/features2d.hpp"
-#include "opencv2/features2d.hpp"
-#include "opencv2/xfeatures2d.hpp"
-#include "opencv2/highgui/highgui.hpp"
-#include "opencv2/imgproc/imgproc.hpp"
-
-using namespace cv;
-using namespace std;
-
-extern "C"
-{
- #include "api_scilab.h"
- #include "Scierror.h"
- #include "BOOL.h"
- #include
- #include "sciprint.h"
- #include "../common.h"
-
- int opencv_detectMSERFeatures(char *fname, unsigned long fname_len)
- {
- //Various Declarations
- //Error Variables
- SciErr sciErr;
- int sca_read;
-
- //Mat containers for image
- Mat image;
- Mat cropped;
-
- //Address of Various Arguments
- int *piAddr = NULL;
- int *piAddr2 = NULL;
- int *piAddr3 = NULL;
-
- int inp_params, out_params; //Count of Parameters
- double arg_val; //Memory for Scalar Argument Value
- int Rows, Cols; //Rows and Columns for Matrix Argument Value
- double *roi_arg = NULL; //Memory for Matrix Argument Value
- int *pilen = NULL; //For String Matrix Reading: Length of String
- char **arg = NULL; //For String Matrix Reading: String
- int count_area = 0, count_tres = 0, count_var = 0, count_roi = 0; //Count of all the optional Arguments
- double x = 0, y = 0, width = 0, height = 0; //Initials of all Cropped Varaibles
-
- int i,j; //Iterator
-
- int delta = 5, min_area = 60, max_area = 14400, max_evolution = 200, edge_blur_size = 5; //Arguments of MSER function with default values
- double max_variation = 0.25, min_diversity = 0.2, area_threshold = 1.01, min_margin = 0.003; //Arguments of MSER function with default values
-
- double *pixellist = NULL; //Output Argument Pixellist
- int count[1] ; //Output Argument Count
- double *location = NULL; //Output Argument Location
- double *axes = NULL; //Output Argument Axes
- double *orientation = NULL; //Output Argument Orientation
-
- vector< vector > mser_points; //3D vector for storing the locus of each detected feature
- vector< RotatedRect > regions;
- vector bboxes; //RotatedRect vector for storing each region associated with a feature
-
- CheckInputArgument(pvApiCtx, 1, 9); //Check on Number of Input Arguments
- CheckOutputArgument(pvApiCtx, 1, 5); //Check on Number of Output Arguments
-
- //Read Image
- retrieveImage(image, 1);
-
-
- //Getting Number of Input Arguments
- inp_params = *getNbInputArgument(pvApiCtx);
-
- //Based on the number of Input Arguments, alter the arguments of the MSER funtion.
- for(i=2; i<=inp_params; i++)
- {
- if( inp_params == 2 || inp_params == 4 || inp_params == 6 || inp_params == 8)
- {
- Scierror(999,"Either Argument Name or its Value missing\n");
- return 0;
- }
- //Reading the Name of the Argument
- sciErr = getVarAddressFromPosition(pvApiCtx, i, &piAddr2);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //Check for Argument type
- if( !isStringType(pvApiCtx, piAddr2))
- {
- Scierror(999, "%s: Wrong type of argument #%d. A string is expected.\n", fname, 1);
- return 0;
- }
- //Matrix of Stings
- sciErr = getMatrixOfString(pvApiCtx, piAddr2, &Rows, &Cols, NULL, NULL);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- pilen = (int*)malloc(sizeof(int) * Rows * Cols);
- //second call to retrieve the length of the string
- sciErr = getMatrixOfString(pvApiCtx, piAddr2, &Rows, &Cols, pilen, NULL);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- free(pilen);
- return 0;
- }
- arg = (char**)malloc(sizeof(char*) * Rows * Cols);
- for(int j=0;j< Rows * Cols; j++)
- {
- arg[j] = (char*)malloc(sizeof(char) * (pilen[j] + 1));
- }
-
- //third call to retrieve data
- sciErr = getMatrixOfString(pvApiCtx, piAddr2, &Rows, &Cols, pilen, arg);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- free(pilen);
- free(arg);
- return 0;
- }
-
- if(strcmp(arg[0],"ThresholdDelta") == 0)
- {
- if(count_tres == 0)
- {
- sciErr = getVarAddressFromPosition(pvApiCtx, i+1, &piAddr3);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //Checking the type of value
- if( !isDoubleType(pvApiCtx, piAddr3))
- {
- Scierror(999,"Not a valid type of value.\n");
- return 0;
- }
- //Reading the Value of the argument
- sca_read = getScalarDouble(pvApiCtx, piAddr3, &arg_val);
- if(sca_read)
- {
- Scierror(999,"Not a valid value.\n");
- return 0;
- }
- //Check for valid range
- if(arg_val <= 0 && arg_val > 100)
- {
- Scierror(999,"Not a valid range.Should be between 0 and 100.\n");
- return 0;
- }
- delta = arg_val;
- i++;
- count_tres += 1;
- }
- else
- {
- Scierror(999,"ThresholdDelta has been specified twice.Check the Arguments\n");
- return 0;
- }
- }
- else if(strcmp(arg[0],"RegionAreaRange") == 0)
- {
- if(count_area == 0)
- {
- sciErr = getVarAddressFromPosition(pvApiCtx, i+1, &piAddr3);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //Checking the type of argument
- if( !(isDoubleType(pvApiCtx, piAddr3) || isIntegerType(pvApiCtx, piAddr3)) )
- {
- Scierror(999,"Not a valid type of value.\n");
- return 0;
- }
- //Reading the Value of the argument
- sciErr = getMatrixOfDouble(pvApiCtx, piAddr3, &Rows, &Cols, &roi_arg);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- if( Rows*Cols != 2 )
- {
- Scierror(999,"Only 2 values are expected.Neither less nor more\n");
- return 0;
- }
- if( roi_arg[0] >= roi_arg[1] )
- {
- Scierror(999,"Max Area should be greater than Min Area\n");
- return 0;
- }
- //Assigning the elements of the list to their proper function
- min_area = roi_arg[0];
- max_area = roi_arg[1];
- i++;
- count_area += 1;
- }
- else
- {
- Scierror(999,"RegionAreaRange has been specified twice.Check the Arguments\n");
- return 0;
- }
- }
- else if(strcmp(arg[0],"MaxAreaVariation") == 0)
- {
- if(count_var == 0)
- {
- sciErr = getVarAddressFromPosition(pvApiCtx, i+1, &piAddr3);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //Checking the type of value
- if( !isDoubleType(pvApiCtx, piAddr3))
- {
- Scierror(999,"Not a valid type of value.\n");
- return 0;
- }
- //Reading the Value of the argument
- sca_read = getScalarDouble(pvApiCtx, piAddr3, &arg_val);
- if(sca_read)
- {
- Scierror(999,"Not a valid value.\n");
- return 0;
- }
- max_variation = arg_val;
- i++;
- count_var += 1;
- }
- else
- {
- Scierror(999,"MaxAreaVariation has been specified twice.Check the Arguments\n");
- return 0;
- }
- }
- else if(strcmp(arg[0],"ROI") == 0)
- {
- if(count_roi == 0)
- {
- sciErr = getVarAddressFromPosition(pvApiCtx, i+1, &piAddr3);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //Checking the type of argument
- if( !(isDoubleType(pvApiCtx, piAddr3) || isIntegerType(pvApiCtx, piAddr3)) )
- {
- Scierror(999,"Not a valid type of value.\n");
- return 0;
- }
- //Reading the Value of the argument
- sciErr = getMatrixOfDouble(pvApiCtx, piAddr3, &Rows, &Cols, &roi_arg);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- if( Rows*Cols != 4 )
- {
- Scierror(999,"Expected 4 arguments in format [x,y,width,height]\n");
- return 0;
- }
- //Assigning the elements of the list to their proper function
- x = roi_arg[0];
- y = roi_arg[1];
- width = roi_arg[2];
- height = roi_arg[3];
- if(x>=image.cols || y>=image.rows || x<0 || y<0)
- {
- sciprint("Invalid x or y value\n");
- return 0;
- }
- if(width<=0 || height<=0 || x+width > image.cols || y+height > image.rows)
- {
- sciprint("Invalid width or height value\n");
- return 0;
- }
- Rect myROI(x, y, width, height);
- Mat croppedRef(image, myROI);
- croppedRef.copyTo(cropped);
- i++; //Incrementing iterator to count for the value argument read
- count_roi += 1; //Indicating ROI has been called once
- }
- else
- {
- Scierror(999,"ROI has been specified twice.Check the Arguments\n");
- return 0;
- }
- }
- else
- {
- Scierror(999,"Invalid Argument\n");
- return 0;
- }
- }
- try
- {
- image.convertTo(image,CV_8UC3);
- //Creating an MSER class Object with specified conditions
-
- Ptr img_ms = cv::
- MSER::create(delta, min_area, max_area, max_variation, min_diversity, max_evolution, area_threshold, min_margin, edge_blur_size);
-
- //Checking if have to operate on original image or cropped one
- // 1st Argument: Image on which MSER features has to be detected
- // 2nd Argument: Locus of all the points detected
- // 3rd Argument: Mask of empty Mat container
- if(count_roi == 0)
- img_ms->detectRegions( image, mser_points,bboxes);
- else
- img_ms->detectRegions( cropped, mser_points,bboxes);
-
- // Extracting Regions from the mser_points locus and approximating them to an elliptic fit
- for(i=0; i= regions[i].size.height )
- {
- axes[i] = regions[i].size.width; //Axis: Major Axis of Ellipse
- axes[mser_points.size() + i] = regions[i].size.height; //Axis: Minor Axis of Ellipse
- }
- else
- {
- axes[i] = regions[i].size.height; //Axis: Major Axis of Ellipse
- axes[mser_points.size() + i] = regions[i].size.width; //Axis: Minor Axis of Ellipse
- }
- orientation[i] = regions[i].angle; //Orientation
- }
-
- //Reading the number of output Arguments user demands
-
- //Assigning Pixel_List
-
- out_params = *getNbOutputArgument(pvApiCtx);
- if( out_params >= 1 )
- {
- sciErr = createList(pvApiCtx, nbInputArgument(pvApiCtx) + 1, mser_points.size(), &piAddr);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- for(i = 0; i= 2 )
- {
- sciErr = createMatrixOfInteger32(pvApiCtx, nbInputArgument(pvApiCtx) + 2, 1, 1, count);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- AssignOutputVariable(pvApiCtx, 2) = nbInputArgument(pvApiCtx) + 2;
- }
-
- //Assigning Location
- if( out_params >= 3 )
- {
- sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 3, mser_points.size(), 2, location);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- AssignOutputVariable(pvApiCtx, 3) = nbInputArgument(pvApiCtx) + 3;
- }
-
- //Assigning Axes
- if( out_params >= 4 )
- {
- sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 4, mser_points.size(), 2, axes);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- AssignOutputVariable(pvApiCtx, 4) = nbInputArgument(pvApiCtx) + 4;
- }
-
- //Assigning Orientation
- if( out_params == 5 )
- {
- sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 5, mser_points.size(), 1, orientation);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- AssignOutputVariable(pvApiCtx, 5) = nbInputArgument(pvApiCtx) + 5;
- }
-
- //Releasing all the memory Captured
- free(location);
- free(axes);
- free(orientation);
-
- //Returning the Output Arguments
- ReturnArguments(pvApiCtx);
- return 0;
- }
-}
\ No newline at end of file
diff --git a/sci_gateway/cpp/opencv_detectMinEigenFeatures.cpp b/sci_gateway/cpp/opencv_detectMinEigenFeatures.cpp
deleted file mode 100644
index a1de682..0000000
--- a/sci_gateway/cpp/opencv_detectMinEigenFeatures.cpp
+++ /dev/null
@@ -1,367 +0,0 @@
-/***************************************************
-Author : Rohit Suri
-***************************************************/
-#include
-#include
-#include "opencv2/core/core.hpp"
-#include "opencv2/highgui/highgui.hpp"
-#include "opencv2/opencv.hpp"
-#include "opencv2/imgproc/imgproc.hpp"
-#include
-#include
-using namespace cv;
-using namespace std;
-extern "C"
-{
- #include "api_scilab.h"
- #include "Scierror.h"
- #include "BOOL.h"
- #include
- #include "sciprint.h"
- #include "../common.h"
-
-
- int opencv_detectMinEigenFeatures(char *fname, unsigned long fname_len)
- {
- // Error management variables
- SciErr sciErr;
- int intErr;
-
- //------Local variables------//
- int *location = NULL;
- double *metric = NULL;
- int *piAddr = NULL;
- int *piLen = NULL;
- int nbInputArguments;
- char **pstData = NULL;
- char *currentArg = NULL;
- bool *providedArgs = NULL;
- double *matrixOfRoi; // ROI[xStart, yStart, width, height]
- int iRows, iCols;
- Mat sourceImage, dst, dstThresholded, ucharDstThresholded, extended;
- vector > contours;
- double filterSize = 5, minQuality = 0.01, blockSize = 2, maxDst, localMax;
- bool *included = NULL;
- int pointCount = 0, localMaxPos;
- double tempForSwapping;
- int coordinateMin, coordinatePos;
-
- //------Check number of parameters------//
- CheckInputArgument(pvApiCtx, 1, 7);
- CheckOutputArgument(pvApiCtx, 1, 3);
-
- //------Get input arguments------//
- retrieveImage(sourceImage, 1);
- sourceImage.convertTo(sourceImage,CV_8U);
- if(sourceImage.channels() != 1)
- {
- Scierror(999, "The input image is not a grayscale image.");
- return 0;
- }
- matrixOfRoi = (double*) malloc(sizeof(double) * 4);
- providedArgs = (bool*) malloc(sizeof(bool) * 3);
- memset(providedArgs, 0, 3);
- matrixOfRoi[0] = 0;
- matrixOfRoi[1] = 0;
- matrixOfRoi[2] = sourceImage.cols;
- matrixOfRoi[3] = sourceImage.rows;
- nbInputArguments = *getNbInputArgument(pvApiCtx);
-
- // The following loop is for checking if optional arguments have been provided
- for(int iter=2; iter <= nbInputArguments; iter++)
- {
- // Getting address of next argument
- sciErr = getVarAddressFromPosition(pvApiCtx, iter, &piAddr);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- // Extracting name of next argument takes three calls to getMatrixOfString
- sciErr = getMatrixOfString(pvApiCtx, piAddr, &iRows, &iCols, NULL, NULL);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- piLen = (int*) malloc(sizeof(int) * iRows * iCols);
-
- sciErr = getMatrixOfString(pvApiCtx, piAddr, &iRows, &iCols, piLen, NULL);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- pstData = (char**) malloc(sizeof(char*) * iRows * iCols);
- for(int iterPstData = 0; iterPstData < iRows * iCols; iterPstData++)
- {
- pstData[iterPstData] = (char*) malloc(sizeof(char) * piLen[iterPstData] + 1);
- }
-
- sciErr = getMatrixOfString(pvApiCtx, piAddr, &iRows, &iCols, piLen, pstData);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- currentArg = pstData[0];
- // providedArgs[] makes sure that no optional argument is provided more than once
- if(strcmp(currentArg, "MinQuality")==0)
- {
- if(iter+1<=nbInputArguments && !providedArgs[0])
- {
- sciErr = getVarAddressFromPosition(pvApiCtx, ++iter, &piAddr);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr, &minQuality);
- if(intErr)
- {
- return intErr;
- }
- // Checking if values are in proper range. Same for all optional arguments
- if(minQuality < 0 || minQuality > 1)
- {
- Scierror(999, "Error: Please provide proper value for \"%s\". Permissible range is [0, 1].\n", currentArg);
- return 0;
- }
- providedArgs[0] = 1;
- }
- else if(providedArgs[0]) // Send an error message if an argument is provided more than once. Same for all optional arguments.
- {
- Scierror(999, "Please provide optional arguments only once.\n");
- return 0;
- }
- else // Send an error message if name of argument is given but type is incorrect. Same for all optional arguments.
- {
- Scierror(999, "Incorrect number of arguments provided. Please check the documentation for more information.\n");
- return 0;
- }
- }
- else if(strcmp(currentArg, "FilterSize")==0)
- {
- if(iter+1 <= nbInputArguments && !providedArgs[1])
- {
- sciErr = getVarAddressFromPosition(pvApiCtx, ++iter, &piAddr);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr, &filterSize);
- if(intErr)
- {
- return intErr;
- }
- providedArgs[1] = 1;
- if(filterSize!=1 && filterSize!=3 && filterSize!=5 && filterSize!=7)
- {
- Scierror(999, "Error: Please provide proper value for \"%s\". Permissible values are {1, 3, 5, 7}.\n", currentArg);
- return 0;
- }
- }
- else if(providedArgs[1])
- {
- Scierror(999, "Please provide optional arguments only once.\n");
- return 0;
- }
- else
- {
- Scierror(999, "Incorrect number of arguments provided. Please check the documentation for more information.\n");
- return 0;
- }
- }
- else if(strcmp(currentArg, "ROI")==0)
- {
- if(iter+1 <= nbInputArguments && !providedArgs[2])
- {
- sciErr = getVarAddressFromPosition(pvApiCtx, ++iter, &piAddr);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- if(!isDoubleType(pvApiCtx, piAddr) || isVarComplex(pvApiCtx, piAddr))
- {
- Scierror(999, "%s: Wrong type for input argument #%d: A real matrix expected.\n", fname, iter);
- return 0;
- }
- sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &iRows, &iCols, &matrixOfRoi);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- if(iRows!=1 || iCols!=4)
- {
- Scierror(999, "Incorrect dimension of matrix for argument ROI.\n");
- return 0;
- }
- providedArgs[2] = 1;
- if(matrixOfRoi[0] < 0 || matrixOfRoi[0] > sourceImage.cols || matrixOfRoi[1] < 0 ||
- matrixOfRoi[1] > sourceImage.cols || matrixOfRoi[2] < 0 || matrixOfRoi[0] + matrixOfRoi[2] > sourceImage.cols
- || matrixOfRoi[3] < 0 || matrixOfRoi[1] + matrixOfRoi[3] > sourceImage.rows)
- {
- Scierror(999, "Error: Please provide proper values for \"%s\".\n", currentArg);
- return 0;
- }
- }
- else if(providedArgs[2])
- {
- Scierror(999, "Please provide optional arguments only once.\n");
- return 0;
- }
- else
- {
- Scierror(999, "Incorrect number of arguments provided. Please check the documentation for more information.\n");
- return 0;
- }
- }
- else
- {
- Scierror(999, "Error: \"%s\" name for input argument is not valid.\n", currentArg);
- return 0;
- }
- }
- try
- {
- //------Actual processing------//
- cornerMinEigenVal(sourceImage(Rect(matrixOfRoi[0], matrixOfRoi[1], matrixOfRoi[2], matrixOfRoi[3])), dst, blockSize, filterSize, BORDER_DEFAULT);
-
- // Finding the maximum value at a pixel in dst
- maxDst = 0;
- for(int rowIter=0; rowIter < dst.rows; rowIter++)
- {
- for(int colIter=0; colIter < dst.cols; colIter++)
- {
- if(dst.at(rowIter, colIter) > maxDst)
- {
- maxDst = dst.at(rowIter, colIter);
- }
- }
- }
-
- /* First, we threshold dst according to the minQuality expected by the user.
- We then find contours in the thresholded image and check each pixel's value
- to compute the local maxima. A extended mat is created because contours
- having edges on the boundaries of the images are not considered by
- findContours */
- threshold(dst, dstThresholded, maxDst*minQuality, 255, THRESH_BINARY);
- dstThresholded.convertTo(ucharDstThresholded, CV_8UC1);
- extended = Mat(dst.rows+2, dst.cols+2, CV_8UC1);
- for(int rowIter = 0; rowIter < extended.rows; rowIter++)
- {
- for(int colIter = 0; colIter < extended.cols; colIter++)
- {
- if(rowIter == 0 || rowIter == extended.rows - 1
- || colIter == 0 || colIter == extended.cols - 1)
- {
- extended.at(rowIter, colIter) = 0;
- }
- else
- {
- extended.at(rowIter, colIter) = ucharDstThresholded.at(rowIter-1, colIter-1);
- }
- }
- }
-
- findContours(extended, contours, CV_RETR_TREE, CV_CHAIN_APPROX_NONE);
- pointCount = contours.size();
- location = (int*) malloc(sizeof(int) * pointCount * 2);
- metric = (double*) malloc(sizeof(double)*pointCount);
- for(int rowIter = 0; rowIter < contours.size(); rowIter++)
- {
- localMax = 0;
- localMaxPos = 0;
- for(int colIter=0; colIter(contours[rowIter][colIter].y-1, contours[rowIter][colIter].x-1)>localMax)
- {
- localMax = dst.at(contours[rowIter][colIter].y-1, contours[rowIter][colIter].x-1);
- localMaxPos = colIter;
- }
- }
- if(localMax > maxDst*minQuality)
- {
- location[rowIter] = contours[rowIter][localMaxPos].x-1 + matrixOfRoi[0];
- location[pointCount + rowIter] = contours[rowIter][localMaxPos].y-1 + matrixOfRoi[1];
- metric[rowIter] = dst.at(location[pointCount + rowIter], location[rowIter]);
- }
- }
- }
- catch(cv::Exception& e)
- {
- const char* err=e.what();
- sciprint("\n%s\n",err);
-
-
- }
- // To return coordinates in order
- for(int iter1 = 0; iter1 < pointCount - 1; iter1++)
- {
- coordinateMin = location[iter1];
- coordinatePos = iter1;
- for(int iter2 = iter1 + 1; iter2 < pointCount; iter2++)
- {
- if(location[iter2] < coordinateMin)
- {
- coordinateMin = location[iter2];
- coordinatePos = iter2;
- }
- else if(location[iter2] == coordinateMin)
- {
- if(location[pointCount + iter2] < location[pointCount + coordinatePos])
- {
- coordinateMin = location[iter2];
- coordinatePos = iter2;
- }
- }
- }
- // Swapping x coordinate
- tempForSwapping = location[coordinatePos];
- location[coordinatePos] = location[iter1];
- location[iter1] = tempForSwapping;
- // Swapping y coordinate
- tempForSwapping = location[pointCount + coordinatePos];
- location[pointCount + coordinatePos] = location[pointCount + iter1];
- location[pointCount + iter1] = tempForSwapping;
- // Swapping metric
- tempForSwapping = metric[coordinatePos];
- metric[coordinatePos] = metric[iter1];
- metric[iter1] = tempForSwapping;
- }
- //------Create output arguments------//
- sciErr = createMatrixOfInteger32(pvApiCtx, nbInputArgument(pvApiCtx)+1, pointCount, 2, location);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx)+2, pointCount, 1, metric);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- sciErr = createMatrixOfInteger32(pvApiCtx, nbInputArgument(pvApiCtx)+3, 1, 1, &pointCount);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- //------Return Arguments------//
- AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx)+1;
- AssignOutputVariable(pvApiCtx, 2) = nbInputArgument(pvApiCtx)+2;
- AssignOutputVariable(pvApiCtx, 3) = nbInputArgument(pvApiCtx)+3;
- ReturnArguments(pvApiCtx);
- return 0;
- }
-/* ==================================================================== */
-}
\ No newline at end of file
diff --git a/sci_gateway/cpp/opencv_ellipse.cpp b/sci_gateway/cpp/opencv_ellipse.cpp
deleted file mode 100644
index db9a284..0000000
--- a/sci_gateway/cpp/opencv_ellipse.cpp
+++ /dev/null
@@ -1,324 +0,0 @@
-/********************************************************
- Author: Sukul Bagai
-*********************************************************
- return_image = ellipse(input_image , x_coordinate_of_centre , y_coordinate_centre , first_axis, second_axis, angle, startAngle, endAngle, r_value,g_value,b_value,thickness,linetype,shift);
-********************************************************/
-
-#include
-#include "opencv2/core/core.hpp"
-#include "opencv2/highgui/highgui.hpp"
-#include "opencv2/opencv.hpp"
-#include
-using namespace cv;
-using namespace std;
-extern "C"
-{
- #include "api_scilab.h"
- #include "Scierror.h"
- #include "BOOL.h"
- #include
- #include
- #include "../common.h"
-
- int opencv_ellipse(char *fname, unsigned long fname_len)
- {
-
- SciErr sciErr;
- int intErr=0;
- int iRows=0,iCols=0;
- int *piAddrNew = NULL;
- int *piAddr2 = NULL;
- int *piAddr3 = NULL;
- int *piAddr4 = NULL;
- int *piAddr5 = NULL;
- int *piAddr6 = NULL;
- int *piAddr7 = NULL;
- int *piAddr8 = NULL;
- int *piAddr9 = NULL;
- int *piAddr10 = NULL;
- int *piAddr11 = NULL;
- int *piAddr12 = NULL;
- int *piAddr13 = NULL;
- int *piAddr14 = NULL;
- int i,j,k;
- double thickness=1 , linetype=8, shift=0 ,centre_x ,centre_y,first_axis,second_axis,angle,startAngle,endAngle,r_value,g_value,b_value;
-
- //checking input argument
- CheckInputArgument(pvApiCtx, 11, 14);
- CheckOutputArgument(pvApiCtx, 1, 1) ;
- //get number of input arguments
- int n=*getNbInputArgument(pvApiCtx);
- Mat src;
- retrieveImage(src,1);
-
- //for value of x coordinate of centre
- sciErr = getVarAddressFromPosition(pvApiCtx,2,&piAddr2);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr2,¢re_x);
- if(intErr)
- return intErr;
-
-
- //for value of y coordinate of centre
- sciErr = getVarAddressFromPosition(pvApiCtx,3,&piAddr3);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr3,¢re_y);
- if(intErr)
- return intErr;
-
- //for value of first_axis
- sciErr = getVarAddressFromPosition(pvApiCtx,4,&piAddr4);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr4,&first_axis);
- if(intErr)
- return intErr;
-
- //for value of second_axis
- sciErr = getVarAddressFromPosition(pvApiCtx,5,&piAddr5);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr5,&first_axis);
- if(intErr)
- return intErr;
-
- //for value of angle
- sciErr = getVarAddressFromPosition(pvApiCtx,6,&piAddr6);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr6,&angle);
- if(intErr)
- return intErr;
-
- //for value of startAngle
- sciErr = getVarAddressFromPosition(pvApiCtx,7,&piAddr7);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr7,&startAngle);
- if(intErr)
- return intErr;
-
- //for value of endAngle
- sciErr = getVarAddressFromPosition(pvApiCtx,8,&piAddr8);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr8,&endAngle);
- if(intErr)
- return intErr;
-
- //for value of R value of colour
- sciErr = getVarAddressFromPosition(pvApiCtx,9,&piAddr9);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr9 ,&r_value);
- if(intErr)
- return intErr;
-
- //for value of G value of colour
- sciErr = getVarAddressFromPosition(pvApiCtx,10,&piAddr10);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr10 ,&g_value);
- if(intErr)
- return intErr;
-
- // for B value of colour
- sciErr = getVarAddressFromPosition(pvApiCtx,11,&piAddr11);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr11,&b_value);
- if(intErr)
- return intErr;
- if(n==12)
- {
- // for thickness of circle default: 1
- sciErr = getVarAddressFromPosition(pvApiCtx,12,&piAddr12);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr12,&thickness);
- if(intErr)
- return intErr;
- }
- else if(n==13)
- {
- sciErr = getVarAddressFromPosition(pvApiCtx,12,&piAddr12);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr12,&thickness);
- if(intErr)
- return intErr;
- //for line type of circle default: 8
-
- sciErr = getVarAddressFromPosition(pvApiCtx,13,&piAddr13);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- intErr = getScalarDouble(pvApiCtx, piAddr13,&linetype);
- if(intErr)
- return intErr;
- }
- else if(n==14)
- { sciErr = getVarAddressFromPosition(pvApiCtx,12,&piAddr12);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr12,&thickness);
- if(intErr)
- return intErr;
- //for line type of circle default: 8
-
- sciErr = getVarAddressFromPosition(pvApiCtx,13,&piAddr13);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- intErr = getScalarDouble(pvApiCtx, piAddr13,&linetype);
- if(intErr)
- return intErr;
-
- // for shift in circle default : 0
- sciErr = getVarAddressFromPosition(pvApiCtx,14,&piAddr14);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- intErr = getScalarDouble(pvApiCtx, piAddr14,&shift);
- if(intErr)
- return intErr;
- }
- // checking radius parameter
- if (first_axis < 0)
- {
- first_axis=3;
- sciprint("first_axis should be positive , 3 value was used instead\n");
- }
- if (second_axis < 0)
- {
- second_axis=3;
- sciprint("second_axis should be positive , 3 value was used instead\n");
- }
- if (first_axis < second_axis)
- {
- double temp;
- temp=first_axis;
- first_axis=second_axis;
- second_axis=temp;
- sciprint("first_axis should be greater than second_axis. Values swapped.\n");
- }
- if(angle < 0 || angle > 360)
- {
- angle=45;
- sciprint("Imvalid angle value used. Using 45 instead");
- }
- if(startAngle < 0 || startAngle > 360)
- {
- startAngle=45;
- sciprint("Imvalid startAngle value used. Using 120 instead");
- }
- if(endAngle < 0 || endAngle > 360)
- {
- endAngle=45;
- sciprint("Imvalid endAngle value used. Using 120 instead");
- }
- // checking the parmeters for correct values
- if( r_value <0 || r_value >255)
- {
- r_value=0;
- sciprint(" r value of colour should be between 0 and 255 , using 0 instead\n");
- }
- if( g_value <0 || g_value >255)
- {
- g_value=0;
- sciprint(" g value of colour should be between 0 and 255 , using 0 instead\n");
- }
- if( b_value <0 || b_value >255)
- {
- b_value=0;
- sciprint(" b value of colour should be between 0 and 255 , using 0 instead\n");
- }
- if ((linetype!=0) && (linetype!=4)&& (linetype!=8))
- {
- linetype=8;
- sciprint("Only 0/4/8 allowed , using 8 instead\n");
- }
- //temporary pt variable, to use in function as centre
- Point pt(centre_x,centre_y);
- Size sz(first_axis,second_axis);
- /// Draw the circles detected
- try
- {
- ellipse( src, pt, sz, angle, startAngle, endAngle, Scalar(r_value,g_value,b_value), thickness, linetype, shift);
- }
- catch(cv::Exception& e)
- {
-
- Scierror(999,e.what());
-
-
-
- }
-//// sending the image
- string tempstring = type2str(src.type());
- char *checker;
- checker = (char *)malloc(tempstring.size() + 1);
- memcpy(checker, tempstring.c_str(), tempstring.size() + 1);
- returnImage(checker,src,1);
- free(checker);
-
- //Assigning the list as the Output Variable
- AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
- //Returning the Output Variables as arguments to the Scilab environment
- ReturnArguments(pvApiCtx);
- return 0;
-
-
- }
-
-}
-
diff --git a/sci_gateway/cpp/opencv_erode.cpp b/sci_gateway/cpp/opencv_erode.cpp
deleted file mode 100644
index 2876c3b..0000000
--- a/sci_gateway/cpp/opencv_erode.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-#include
-#include "opencv2/core/core.hpp"
-#include "opencv2/highgui/highgui.hpp"
-#include "opencv2/opencv.hpp"
-#include
-#include
-using namespace cv;
-using namespace std;
-extern "C"
-{
- #include "api_scilab.h"
- #include "Scierror.h"
- #include "BOOL.h"
- #include
- #include
- #include "../common.h"
-
- int opencv_erode(char *fname, unsigned long fname_len)
- {
-
- SciErr sciErr;
- int intErr = 0;
- int iRows=0,iCols=0;
- int *piLen = NULL;
- int *piAddr = NULL;
- int *piAddrNew = NULL;
- int *piAddr2 = NULL;
- int *piAddr3 = NULL;
- int *piAddr4 = NULL;
- int *piAddr5 = NULL;
- char **type = NULL;
- int i,j,k;
- double anchorX,anchorY,iterations;
- double *kernel;
-
- //checking input argument
- CheckInputArgument(pvApiCtx, 5, 5);
- CheckOutputArgument(pvApiCtx, 1, 1) ;
-
- Mat image;
- retrieveImage(image,1);
-
- //for kernel
- sciErr = getVarAddressFromPosition(pvApiCtx,2,&piAddr2);
- if (sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- sciErr = getMatrixOfDouble(pvApiCtx, piAddr2, &iRows, &iCols, &kernel);
- if(sciErr.iErr)
- {
- printError(&sciErr,0);
- return 0;
- }
-
- double actualkernel[iRows][iCols];
- for(i=0;i
-#include "opencv2/core/core.hpp"
-#include "opencv2/highgui/highgui.hpp"
-#include "opencv2/opencv.hpp"
-#include "opencv2/imgproc/imgproc.hpp"
-#include "opencv2/calib3d/calib3d.hpp"
-#include
-using namespace cv;
-using namespace std;
-extern "C"
-{
- #include "api_scilab.h"
- #include "Scierror.h"
- #include "BOOL.h"
- #include
- #include
- #include "../common.h"
-
- int opencv_estimateFundamentalMat(char *fname, unsigned long fname_len)
- {
-
- SciErr sciErr;
- int intErr=0;
- int iComplex = 0;
- int iType = 0;
- int *piAddr = NULL;
- int *piLen = NULL;
- int iRows,iCols;
- int iA1Rows=0,iA1Cols=0,iA2Rows=0,iA2Cols=0;
- int method=FM_RANSAC;
- int nbInputArguments,iter,i,j;
- char **pstData = NULL;
- char *currentArg = NULL;
- bool *providedArgs = NULL;
- double* pdblReal = NULL;
- double *iArray1=NULL,*iArray2=NULL;
- double param1=3,param2=0.99;
-
- vector point1,point2;
-
- CheckInputArgument(pvApiCtx, 2, 8);
- CheckOutputArgument(pvApiCtx, 1, 1) ;
-
- nbInputArguments = *getNbInputArgument(pvApiCtx);
- providedArgs = (bool*) malloc(sizeof(bool) * 3);
-
-
- sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- sciErr = getVarType(pvApiCtx, piAddr, &iType);
- if(sciErr.iErr || iType != sci_matrix)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //Get complexity
- iComplex = isVarComplex(pvApiCtx, piAddr);
- //Check complexity
- if(iComplex)
- {
- Scierror(999, "%s: Wrong type for input argument: A complex number is not expected.\n");
- return 0;
- }
-
- sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &iA1Rows, &iA1Cols, &iArray1);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
-
- sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piAddr);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- sciErr = getVarType(pvApiCtx, piAddr, &iType);
- if(sciErr.iErr || iType != sci_matrix)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //Get complexity
- iComplex = isVarComplex(pvApiCtx, piAddr);
- //Check complexity
- if(iComplex)
- {
- Scierror(999, "%s: Wrong type for input argument: A complex number is not expected.\n");
- return 0;
- }
-
- sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &iA2Rows, &iA2Cols, &iArray2);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- if(iA1Rows != iA2Rows)
- {
- Scierror(999, "There must be the same number of points in both input arrays\n");
- return 0;
- }
-
- for(i=0;i(i,j);
- }
- }
- sciErr = createMatrixOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 1, fm.rows , 3, pdblReal);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
- ReturnArguments(pvApiCtx);
- return 0;
- }
-}
diff --git a/sci_gateway/cpp/opencv_exposure.cpp b/sci_gateway/cpp/opencv_exposure.cpp
new file mode 100644
index 0000000..6d956b3
--- /dev/null
+++ b/sci_gateway/cpp/opencv_exposure.cpp
@@ -0,0 +1,148 @@
+/********************************************************
+Author: Manoj Sree Harsha
+********************************************************/
+#include
+#include "opencv2/core/core.hpp"
+#include "opencv2/highgui/highgui.hpp"
+#include "opencv2/opencv.hpp"
+#include "opencv2/stitching/detail/exposure_compensate.hpp"
+#include "opencv2/imgproc/imgproc.hpp"
+#include "opencv2/core/utility.hpp"
+#include
+using namespace cv;
+using namespace std;
+extern "C"
+{
+ #include "api_scilab.h"
+ #include "Scierror.h"
+ #include "BOOL.h"
+ #include
+ #include "sciprint.h"
+ #include "../common.h"
+
+ int opencv_exposure(char *fname,unsigned long fname_len)
+ {
+
+ // Error management variables
+ SciErr sciErr;
+ int intErr=0;
+
+ //variable declarations
+ int *piaddrvar1=NULL;
+ int *piaddrvar2=NULL;
+ double index=0;
+ double choice=0;
+ int i,num;
+
+ //Checking number of input and output arguments (enviromnet variable, min arguments, max arguments)
+ CheckInputArgument(pvApiCtx, 4, 8);
+ CheckOutputArgument(pvApiCtx, 1, 1);
+
+ //number of input arguments
+ num=*getNbInputArgument(pvApiCtx);
+
+ //for argument #1
+ sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piaddrvar1);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ if ( !isDoubleType(pvApiCtx, piaddrvar1))
+ {
+ Scierror(999, _("%s: Wrong type for input argument #%d: A scalar expected.\n"), fname, 1);
+ return 0;
+ }
+ intErr = getScalarDouble(pvApiCtx, piaddrvar1,&choice);
+ if (intErr)
+ {
+ return intErr;
+ }
+
+ //for argument #2
+ sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piaddrvar2);
+ if (sciErr.iErr)
+ {
+ printError(&sciErr, 0);
+ return 0;
+ }
+ if ( !isDoubleType(pvApiCtx, piaddrvar2))
+ {
+ Scierror(999, _("%s: Wrong type for input argument #%d: A scalar expected.\n"), fname,2);
+ return 0;
+ }
+ intErr = getScalarDouble(pvApiCtx, piaddrvar2,&index);
+ if (intErr)
+ {
+ return intErr;
+ }
+
+ //for images
+ vector images;
+ vector masks;
+ vector points;
+ for(i=3;i<=num;i++)
+ {
+ Mat image1;
+ retrieveImage(image1, i);
+ image1.convertTo(image1,CV_8U);
+ Mat mask1(image1.size(), CV_8U);
+ mask1(Rect(0, 0, mask1.cols, mask1.rows)).setTo(255);
+ UMat img1 = image1.getUMat( ACCESS_READ );
+ UMat m1 = mask1.getUMat( ACCESS_READ );
+ images.push_back(img1);
+ masks.push_back(m1);
+ points.push_back(Point(0,0));
+ }
+
+ //Application Code
+ try
+ {
+ if(choice==1)
+ {
+ Ptr compensator = detail::ExposureCompensator::createDefault(detail::ExposureCompensator::GAIN);
+ compensator->feed(points,images,masks);
+ compensator->apply(index-1,points[index-1],images[index-1],masks[index-1]);
+ }
+ else if(choice==2)
+ {
+ Ptr compensator = detail::ExposureCompensator::createDefault(detail::ExposureCompensator::GAIN_BLOCKS);
+ compensator->feed(points,images,masks);
+ compensator->apply(index-1,points[index-1],images[index-1],masks[index-1]);
+ }
+ else if(choice==3)
+ {
+ Ptr compensator = detail::ExposureCompensator::createDefault(detail::ExposureCompensator::NO);
+ compensator->feed(points,images,masks);
+ compensator->apply(index-1,points[index-1],images[index-1],masks[index-1]);
+ }
+ else
+ {
+ Scierror(999,("%s: Wrong value for input argument #%d: A value b/w [1,3] is expected.\n"), fname,2);
+ return 0;
+ }
+
+ //returning final image for which exposure is compensated
+ Mat result=images[index-1].getMat(ACCESS_RW);
+ string tempstring = type2str(result.type());
+ char *checker;
+ checker = (char *)malloc(tempstring.size() + 1);
+ memcpy(checker, tempstring.c_str(), tempstring.size() + 1);
+ returnImage(checker,result,1);
+ free(checker);
+ }
+ catch(cv::Exception& e)
+ {
+ const char* err=e.what();
+ Scierror(999,("%s",err));
+ }
+
+ //Assigning output variables
+ AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
+
+ //Returning the Output Variables as arguments to the Scilab environment
+ ReturnArguments(pvApiCtx);
+ return 0;
+
+ }
+}
diff --git a/sci_gateway/cpp/opencv_extractFeatures.cpp b/sci_gateway/cpp/opencv_extractFeatures.cpp
deleted file mode 100644
index d47cf88..0000000
--- a/sci_gateway/cpp/opencv_extractFeatures.cpp
+++ /dev/null
@@ -1,1775 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-#include "opencv2/core/core.hpp"
-#include "opencv2/features2d.hpp"
-#include "opencv2/xfeatures2d.hpp"
-#include "opencv2/highgui/highgui.hpp"
-#include "opencv2/imgproc/imgproc.hpp"
-
-using namespace cv;
-using namespace std;
-using namespace cv::xfeatures2d;
-
-extern "C"
-{
- #include "api_scilab.h"
- #include "Scierror.h"
- #include "BOOL.h"
- #include
- #include "sciprint.h"
- #include "../common.h"
-
- /*string type2str(int type)
- {
- string r;
- uchar depth = type & CV_MAT_DEPTH_MASK;
- uchar chans = 1 + (type >> CV_CN_SHIFT);
- switch ( depth )
- {
- case CV_8U: r = "8U"; break;
- case CV_8S: r = "8S"; break;
- case CV_16U: r = "16U"; break;
- case CV_16S: r = "16S"; break;
- case CV_32S: r = "32S"; break;
- case CV_32F: r = "32F"; break;
- case CV_64F: r = "64F"; break;
- default: r = "User"; break;
- }
- r += "C";
- r += (chans+'0');
- return r;
- }*/
-
- int opencv_extractFeatures(char *fname, unsigned long fname_len)
- {
- //......................................................................................................................................................................................
- //Declarations
- // Error Handling
- SciErr sciErr;
-
- // Address of Various Scilab API
- int *piAddr1 = NULL;
- int *piAddr2 = NULL;
- int *piAddr3 = NULL;
- int *piAddr4 = NULL;
-
- // Number of input and output Arguments
- int inputArguments = 0;
- int out_params;
-
- // Matrix Reading Argument
- int iPrec = 0;
- int noItemInList = 0;
- int iRows,iCols;
- int Rows, Cols;
- int *pilen = NULL;
- char **arg = NULL;
- char **method = NULL;
- char **clas = NULL;
- int length_M = 0;
-
- // Necessary Output Arguments
- double *valid_points = NULL;
- double numBits = 0;
- double numFeatures = 0;
- double *featureVector = NULL;
-
- // Count of various Arguments
- int count_method=0, count_block=0, count_surf=0, count_upright=0 ,count_metric=0;
- int count_orient=0, count_scale=0, count_axes=0, count_sign=0, count_class=0;
-
- // Iterator
- int i;
-
- //Input Arguments Parameters
- double *metric = NULL;
- double *orient = NULL;
- double *axes = NULL;
- double *scale = NULL;
- double *sign = NULL;
- double block_size = 0;
- double upright = 0;
- double surf_size = 64;
-
- // Keypoint Vector
- vector keypoints;
- vector copy_k;
-
- //Image Container
- Mat image;
-
- //Output Argument
- int feature_rows, feature_cols;
- int valid_rows;
- double count;
- double *metric_o = NULL;
- double *scale_o = NULL;
- double *orientation_o = NULL;
- double *axes_o = NULL;
- double *sign_o = NULL;
-
-
- // Checks on Number of Input and Output Arguments
- CheckInputArgument(pvApiCtx, 4, 22);
- CheckOutputArgument(pvApiCtx, 2, 9);
-
-
- inputArguments = *getNbInputArgument(pvApiCtx);
-
- //.......................................................................................................................................................................................
- //Checking for the Presence of Valid Number of Arguments
- if( inputArguments%2 == 0)
- {
-
- //Argument 1 - Image
- sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr1);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- if(isListType(pvApiCtx, piAddr1))
- {
- sciErr = getListItemNumber(pvApiCtx, piAddr1, &noItemInList);
- if( noItemInList != 1)
- {
- Scierror(999,"Expecting a grayscale image as first Argument\n");
- return 0;
- }
- retrieveImage(image, 1);
- }
- else
- {
- if( !isDoubleType(pvApiCtx, piAddr1))
- {
- Scierror(999,"Expecting a grayscale Image as first Argument\n");
- return 0;
- }
- retrieveImage(image, 1);
- }
-
-
- //..............................................................................................................................................................................
- //Argument 2 - Location Co-ordinates
- sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piAddr2);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- if( !isVarMatrixType(pvApiCtx, piAddr2))
- {
- Scierror(999,"Expecting a Matrix of Mx2 order depicting the Location Coordinates as 2nd Argument.\n");
- return 0;
- }
- //Checking the type of location coordinates
- if(isDoubleType(pvApiCtx, piAddr2))
- {
- //for double location co-ordinates
- double *points = NULL;
- sciErr = getMatrixOfDouble(pvApiCtx, piAddr2, &iRows, &iCols, &points);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- length_M = iRows;
- KeyPoint *X = new KeyPoint;
- for(int i=0; ipt = Point2f(points[i],points[iRows+i]);
- X->size = 7;
- keypoints.push_back(*X);
- copy_k.push_back(*X);
- }
- }
- else if(isIntegerType(pvApiCtx, piAddr2))
- {
- sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddr2, &iPrec);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- switch(iPrec)
- {
- case SCI_UINT8: //for unsigned integer 8 location co-ordinates
- {
- unsigned char *points = NULL;
- sciErr = getMatrixOfUnsignedInteger8(pvApiCtx, piAddr2, &iRows, &iCols, &points);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- length_M = iRows;
- KeyPoint *X = new KeyPoint;
- for(int i=0; ipt = Point2f(points[i],points[iRows+i]);
- X->size = 7;
- keypoints.push_back(*X);
- copy_k.push_back(*X);
- }
- break;
- }
- case SCI_UINT16: //for unsigned integer 16 location co-ordinates
- {
- unsigned short *points = NULL;
- sciErr = getMatrixOfUnsignedInteger16(pvApiCtx, piAddr2, &iRows, &iCols, &points);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- length_M = iRows;
- KeyPoint *X = new KeyPoint;
- for(int i=0; ipt = Point2f(points[i],points[iRows+i]);
- X->size = 7;
- keypoints.push_back(*X);
- copy_k.push_back(*X);
- }
- break;
- }
- case SCI_INT32:
- {
- int *points = NULL;
- sciErr = getMatrixOfInteger32(pvApiCtx, piAddr2, &iRows, &iCols, &points);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- length_M = iRows;
- KeyPoint *X = new KeyPoint;
- for(int i=0; ipt = Point2f(points[i],points[iRows+i]);
- X->size = 7;
- keypoints.push_back(*X);
- copy_k.push_back(*X);
- }
- break;
- }
- }
- }
- else
- {
- Scierror(999,"Expecting a Double or an Integer Matrix as Location Coordinates in 2nd Argument.\n");
- return 0;
- }
-
-
- //.............................................................................................................................................................................
- //Argument 3 - Class
- sciErr = getVarAddressFromPosition(pvApiCtx, 3, &piAddr3);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //Check for Argument type
- if( !isStringType(pvApiCtx, piAddr3))
- {
- Scierror(999,"Expecting String Argument \"Class\" as Argument 3.\n");
- return 0;
- }
- //Matrix of Stings
- sciErr = getMatrixOfString(pvApiCtx, piAddr3, &Rows, &Cols, NULL, NULL);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- pilen = (int*)malloc(sizeof(int) * Rows * Cols);
- //second call to retrieve the length of the string
- sciErr = getMatrixOfString(pvApiCtx, piAddr3, &Rows, &Cols, pilen, NULL);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- free(pilen);
- return 0;
- }
- arg = (char**)malloc(sizeof(char*) * Rows * Cols);
- for(int j=0;j< Rows * Cols; j++)
- {
- arg[j] = (char*)malloc(sizeof(char) * (pilen[j] + 1));
- }
- //third call to retrieve data
- sciErr = getMatrixOfString(pvApiCtx, piAddr3, &Rows, &Cols, pilen, arg);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- free(pilen);
- free(arg);
- return 0;
- }
-
- //Checking Whether Argument 3 is Method or not
- if(strcmp(arg[0],"Class") == 0)
- {
- //If method extracting the Value of the Argument
- if(count_class != 0)
- {
- Scierror(999,"Class Argument has been called twice\n");
- return 0;
- }
- free(arg);
- free(pilen);
- sciErr = getVarAddressFromPosition(pvApiCtx, 4, &piAddr4);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //Check for Argument type
- if( !isStringType(pvApiCtx, piAddr4))
- {
- Scierror(999, "%s: Wrong type of 2nd argument #%d. A string is expected.\n", fname, 1);
- return 0;
- }
- //Matrix of Stings
- sciErr = getMatrixOfString(pvApiCtx, piAddr4, &Rows, &Cols, NULL, NULL);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- pilen = (int*)malloc(sizeof(int) * Rows * Cols);
- //second call to retrieve the length of the string
- sciErr = getMatrixOfString(pvApiCtx, piAddr4, &Rows, &Cols, pilen, NULL);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- free(pilen);
- return 0;
- }
- clas = (char**)malloc(sizeof(char*) * Rows * Cols);
- for(int j=0;j< Rows*Cols; j++)
- {
- clas[j] = (char*)malloc(sizeof(char) * (pilen[j] + 1));
- }
- //third call to retrieve data
- sciErr = getMatrixOfString(pvApiCtx, piAddr4, &Rows, &Cols, pilen, clas);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- free(pilen);
- free(clas);
- return 0;
- }
- count_class += 1;
- }
- else
- {
- Scierror(999,"Expecting \"Class\" as the 3rd Argument\n");
- return 0;
- }
- }
- else
- {
- Scierror(999,"Required Arguments are Missing\n");
- return 0;
- }
-
- //..........................................................................................................................................................................................
- //Getting Optional Input Arguments
- for( i=5; i<= inputArguments; i++)
- {
-
-
-
-
-
- sciErr = getVarAddressFromPosition(pvApiCtx, i, &piAddr3);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //Check for Argument type
- if( !isStringType(pvApiCtx, piAddr3))
- {
- Scierror(999, "%s: Wrong type of argument #%d. A string is expected.\n", fname, 1);
- return 0;
- }
- //Matrix of Stings
- sciErr = getMatrixOfString(pvApiCtx, piAddr3, &Rows, &Cols, NULL, NULL);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- pilen = (int*)malloc(sizeof(int) * Rows * Cols);
- //second call to retrieve the length of the string
- sciErr = getMatrixOfString(pvApiCtx, piAddr3, &Rows, &Cols, pilen, NULL);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- free(pilen);
- return 0;
- }
- arg = (char**)malloc(sizeof(char*) * Rows * Cols);
- for(int j=0;j< Rows * Cols; j++)
- {
- arg[j] = (char*)malloc(sizeof(char) * (pilen[j] + 1));
- }
- //third call to retrieve data
- sciErr = getMatrixOfString(pvApiCtx, piAddr3, &Rows, &Cols, pilen, arg);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- free(pilen);
- free(arg);
- return 0;
- }
-
-
-
- //.................................................................................................................................................................................
- //Reading the Value of Optional Arguments
- //If Optional Argument is Method
- if(strcmp(arg[0],"Method") == 0)
- {
- if(count_method!= 0)
- {
- Scierror(999,"Method Argument has been called twice\n");
- return 0;
- }
- free(arg);
- free(pilen);
- sciErr = getVarAddressFromPosition(pvApiCtx, i+1, &piAddr4);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //Check for Argument type
- if( !isStringType(pvApiCtx, piAddr4))
- {
- Scierror(999, "%s: Wrong type of 2nd argument #%d. A string is expected.\n", fname, 1);
- return 0;
- }
- //Matrix of Stings
- sciErr = getMatrixOfString(pvApiCtx, piAddr4, &Rows, &Cols, NULL, NULL);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- pilen = (int*)malloc(sizeof(int) * Rows * Cols);
- //second call to retrieve the length of the string
- sciErr = getMatrixOfString(pvApiCtx, piAddr4, &Rows, &Cols, pilen, NULL);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- free(pilen);
- return 0;
- }
- method = (char**)malloc(sizeof(char*) * Rows * Cols);
- for(int j=0;j< Rows*Cols; j++)
- {
- method[j] = (char*)malloc(sizeof(char) * (pilen[j] + 1));
- }
- //third call to retrieve data
- sciErr = getMatrixOfString(pvApiCtx, piAddr4, &Rows, &Cols, pilen, method);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- free(pilen);
- free(method);
- return 0;
- }
-
- i++;
-
- count_method += 1;
- }
- //.................................................................................................................................................................................
- //If Optional Argument is Metric
- else if(strcmp(arg[0],"Metric") == 0)
- {
- if(count_metric != 0)
- {
- Scierror(999,"Metric Argument has been called twice\n");
- return 0;
- }
- free(arg);
- free(pilen);
- sciErr = getVarAddressFromPosition(pvApiCtx, i+1, &piAddr4);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //Check for Argument type
- if( !isVarMatrixType(pvApiCtx, piAddr4))
- {
- Scierror(999,"Expecting a Matrix of Mx1 order depicting the Metric Values as Value of Metric Argument.\n");
- return 0;
- }
- sciErr = getMatrixOfDouble(pvApiCtx, piAddr4, &iRows, &iCols, &metric);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- if( iCols != 1)
- {
- Scierror(999,"Expecting a single Column Metric Matrix\n");
- return 0;
- }
- if( iRows != length_M)
- {
- Scierror(999,"Expecting a M Row matrix having M number of elements corresponding to M rows of location coordinates\n");
- return 0;
- }
- i++;
- count_metric += 1;
- }
- //.................................................................................................................................................................................
- //If Optional Argument is BlockSize
- else if(strcmp(arg[0],"blockSize") == 0)
- {
- if(count_block != 0)
- {
- Scierror(999,"BlockSize has been called twice\n");
- return 0;
- }
- free(arg);
- free(pilen);
- sciErr = getVarAddressFromPosition(pvApiCtx, i+1, &piAddr4);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //Check for Argument type
- if( !(isDoubleType(pvApiCtx, piAddr4)) )
- {
- Scierror(999,"BlockSize Value should be an odd Integer\n");
- return 0;
- }
- if(getScalarDouble(pvApiCtx, piAddr4, &block_size))
- {
- Scierror(999,"Cannot Read Block Size Value");
- return 0;
- }
- if(int(block_size)%2 == 0)
- {
- Scierror(999,"Expecting a odd value for Block Size");
- return 0;
- }
-
- i++;
- count_block += 1;
- }
- //.................................................................................................................................................................................
- //If Optional Argument is Upright
- else if(strcmp(arg[0],"upright") == 0)
- {
- if(count_upright != 0)
- {
- Scierror(999,"Upright Argument has been called twice\n");
- return 0;
- }
- free(arg);
- free(pilen);
- sciErr = getVarAddressFromPosition(pvApiCtx, i+1, &piAddr4);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //Check for Argument type
- if( !(isDoubleType(pvApiCtx, piAddr4)) )
- {
- Scierror(999,"Upright Value must be a logic scalar\n");
- return 0;
- }
- if(getScalarDouble(pvApiCtx, piAddr4, &upright))
- {
- Scierror(999,"Cannot Read Upright Value\n");
- return 0;
- }
- i++;
- count_upright += 1;
- }
- //.................................................................................................................................................................................
- //If Optional Argument is SURFSize
- else if(strcmp(arg[0],"surfSize") == 0)
- {
-
- if(count_surf != 0)
- {
- Scierror(999,"SURFSize Argument has been called twice\n");
- return 0;
- }
- free(arg);
- free(pilen);
- sciErr = getVarAddressFromPosition(pvApiCtx, i+1, &piAddr4);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //Check for Argument type
- if( !(isDoubleType(pvApiCtx, piAddr4)) )
- {
- Scierror(999,"Surf Size Value should be an Integer\n");
- return 0;
- }
- if(getScalarDouble(pvApiCtx, piAddr4, &surf_size))
- {
- Scierror(999,"Cannot Read Surf Size Value");
- return 0;
- }
- if( int(surf_size) != 64 && int(surf_size) !=128 )
- {
- Scierror(999,"Expecting value 64 or 128 for Surf Size\n");
- return 0;
- }
-
- i++;
- count_surf += 1;
- }
- //.................................................................................................................................................................................
- //If Optional Argument is Orientation
- else if(strcmp(arg[0],"Orientation") == 0)
- {
- if(count_orient != 0)
- {
- Scierror(999,"Orientation Argument has been called twice\n");
- return 0;
- }
- free(arg);
- free(pilen);
- sciErr = getVarAddressFromPosition(pvApiCtx, i+1, &piAddr4);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //Check for Argument type
- if( !isVarMatrixType(pvApiCtx, piAddr4))
- {
- Scierror(999,"Expecting a Matrix of Mx1 order depicting the Orientation Values as Value of Orientation Argument.\n");
- return 0;
- }
- sciErr = getMatrixOfDouble(pvApiCtx, piAddr4, &iRows, &iCols, &orient);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- if( iCols != 1)
- {
- Scierror(999,"Expecting a single Column Orientation Matrix\n");
- return 0;
- }
- if( iRows != length_M)
- {
- Scierror(999,"Expecting a M Row matrix having M number of elements corresponding to M rows of location coordinates\n");
- return 0;
- }
- i++;
- count_orient += 1;
- }
- //.................................................................................................................................................................................
- //If Optional Argument is Axes
- else if(strcmp(arg[0],"Axes") == 0)
- {
- if(count_axes != 0)
- {
- Scierror(999,"Axes Argument has been called twice\n");
- return 0;
- }
- free(arg);
- free(pilen);
- sciErr = getVarAddressFromPosition(pvApiCtx, i+1, &piAddr4);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //Check for Argument type
- if( !isVarMatrixType(pvApiCtx, piAddr4))
- {
- Scierror(999,"Expecting a Matrix of Mx2 order depicting the Axes as Value of Axes Argument.\n");
- return 0;
- }
- sciErr = getMatrixOfDouble(pvApiCtx, piAddr4, &iRows, &iCols, &axes);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- if( iCols != 2)
- {
- Scierror(999,"Expecting a 2 Column Axes Matrix\n");
- return 0;
- }
- if( iRows != length_M)
- {
- Scierror(999,"Expecting a M Row matrix having M number of elements corresponding to M rows of location coordinates\n");
- return 0;
- }
- i++;
- count_axes += 1;
- }
- //................................................................................................................................................................................
- //If Optional Argument is Scale
- else if(strcmp(arg[0],"Scale") == 0)
- {
- if(count_scale != 0)
- {
- Scierror(999,"Scale Argument has been called twice\n");
- return 0;
- }
- free(arg);
- free(pilen);
- sciErr = getVarAddressFromPosition(pvApiCtx, i+1, &piAddr4);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //Check for Argument type
- if( !isVarMatrixType(pvApiCtx, piAddr4))
- {
- Scierror(999,"Expecting a Matrix of Mx1 order depicting the Scale as Value of Scale Argument.\n");
- return 0;
- }
- sciErr = getMatrixOfDouble(pvApiCtx, piAddr4, &iRows, &iCols, &scale);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- if( iCols != 1)
- {
- Scierror(999,"Expecting a single Column Scale Matrix\n");
- return 0;
- }
- if( iRows != length_M)
- {
- Scierror(999,"Expecting a M Row matrix having M number of elements corresponding to M rows of location coordinates\n");
- return 0;
- }
- i++;
- count_scale += 1;
- }
- //................................................................................................................................................................................
- //If Optional Argument is SignOfLaplacian
- else if(strcmp(arg[0],"SignOfLaplacian") == 0)
- {
-
- if(count_sign != 0)
- {
- Scierror(999,"SignOfLaplacian Argument has been called twice\n");
- return 0;
- }
- free(arg);
- free(pilen);
-
- sciErr = getVarAddressFromPosition(pvApiCtx, i+1, &piAddr4);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //Check for Argument type
-
- if( !isVarMatrixType(pvApiCtx, piAddr4))
- {
- Scierror(999,"Expecting a Matrix of Mx1 order depicting the Sign Of Laplacian as Value of SignOfLaplacian Argument.\n");
- return 0;
- }
-
- sciErr = getMatrixOfDouble(pvApiCtx, piAddr4, &iRows, &iCols, &sign);
-
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
-
- if( iCols != 1)
- {
- Scierror(999,"Expecting a single Column Axes Matrix\n");
- return 0;
- }
-
- if( iRows != length_M)
- {
- Scierror(999,"Expecting a M Row matrix having M number of elements corresponding to M rows of location coordinates\n");
- return 0;
- }
- i++;
- count_sign += 1;
-
- //Check for Validity of Laplacian Matrix
- for(int i=0; i obj=FREAK::create( true, true, 22.0f, 4 ,std::vector< int >());
- image.convertTo(image,CV_8U);
- obj->compute(image, keypoints, descriptor);
- numBits = descriptor.size[1];
- numFeatures = descriptor.size[0];
-
- valid_points = (double *)malloc(sizeof(double) * keypoints.size() * 2);
-
- for( int i=0; i(i,j));
- }
- feature_rows = descriptor.size[0];
- feature_cols = descriptor.size[1];
- valid_rows = descriptor.size[0];
- count = descriptor.size[0];
- }
- catch(cv::Exception& e)
- {
- const char* err=e.what();
- sciprint("\n%s\n",err);
- }
- if( strcmp(clas[0],"cornerPoints") == 0)
- {
- try
- {
- metric_o = (double*)malloc(sizeof(double) * valid_rows);
- int iterator = 0;
- for(int i=0; i obj;
- if( int(upright) == 1)
- {
- if( int(surf_size) == 64)
- obj = SURF::create(100, 4, 3, 0, 1);
- else if ( int(surf_size) == 128)
- obj = SURF::create(100, 4, 3, 1, 1);
- }
- else if( int(upright) == 0)
- {
- if( int(surf_size) == 64)
- obj = SURF::create(100, 4, 3, 0, 0);
- else if ( int(surf_size) == 128)
- obj = SURF::create(100, 4, 3, 1, 0);
- }
-
- image.convertTo(image,CV_8U);
- obj->compute(image, keypoints, descriptor);
-
- numBits = descriptor.size[1];
- numFeatures = descriptor.size[0];
-
- valid_points = (double *)malloc(sizeof(double) * keypoints.size() * 2);
-
- for( int i=0; i(i,j));
- }
- feature_rows = descriptor.size[0];
- feature_cols = descriptor.size[1];
- valid_rows = descriptor.size[0];
- count = descriptor.size[0];
- }
- catch(cv::Exception& e)
- {
- const char* err=e.what();
- sciprint("\n%s\n",err);
-
-
- }
- if( strcmp(clas[0],"cornerPoints") == 0)
- {
- metric_o = (double*)malloc(sizeof(double) * valid_rows);
- int iterator = 0;
- for(int i=0; i(i,j));
- }
- feature_rows = descriptor.size[0];
- feature_cols = descriptor.size[1];
- valid_rows = descriptor.size[0];
- count = descriptor.size[0];
-
- if( strcmp(clas[0],"cornerPoints") == 0)
- {
- metric_o = (double*)malloc(sizeof(double) * valid_rows);
- int iterator = 0;
- for(int i=0; i valid;
- for( i=0; i image.cols || keypoints[i].pt.y + (block_size-1)/2 > image.rows)
- continue;
- valid.push_back(keypoints[i]);
- }
- valid_points = (double *)malloc(sizeof(double)*valid.size()*2);
- featureVector = (double *)malloc(sizeof(double)*valid.size()*int(block_size)*int(block_size));
- for( int i=0; i(j,k);
- iterator = iterator+1;
- }
- }
- feature_rows = valid.size();
- feature_cols = int(block_size)*int(block_size);
- valid_rows = valid.size();
- numFeatures = valid.size();
- numBits = int(block_size)*int(block_size);
- count = valid.size();
-
- if( strcmp(clas[0],"cornerPoints") == 0)
- {
- metric_o = (double*)malloc(sizeof(double) * valid_rows);
- int iterator = 0;
- for(int i=0; i
-#include "opencv2/core/core.hpp"
-#include "opencv2/highgui/highgui.hpp"
-#include "opencv2/opencv.hpp"
-#include
-#include
-#include
-using namespace cv;
-using namespace std;
- extern "C"
- {
- #include "api_scilab.h"
- #include "Scierror.h"
- #include "BOOL.h"
- #include
- #include "../common.h"
- int opencv_fitellipse(char *fname, unsigned long fname_len)
- {
- // Error management variable
- SciErr sciErr;
- //variable info
- int iRows = 0;
- int iCols = 0;
- int piRows = 0;
- int piCols = 0;
- int* piAddr = NULL;
- int* piAddr2 = NULL;
- int* piAddr3 = NULL;
- int* piAddr4 = NULL;
- int* piAddr5 = NULL;
- int* piAddr6 = NULL;
- int* piAddrNew = NULL;
- int* piLen = NULL;
- double* pstData = NULL;
- int* pstData2 = NULL;
- double *rrows;
- double *rcols;
- double sigmaSpace;
- int error;
- vector contours;
- ////checking input argument
- CheckInputArgument(pvApiCtx,1,1);
- //checking output argument
- CheckOutputArgument(pvApiCtx,5,5);
- //for first argument
- // get Address of first input
- sciErr = getVarAddressFromPosition(pvApiCtx,1,&piAddr);
- //check for any error
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- //retrieve input array
- //SciErr getMatrixOfDouble(void* _pvCtx, int* _piAddress, int* _piRows, int* _piCols, double** _pdblReal)
- sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &iRows, &iCols,&pstData);
- if(sciErr.iErr)
- {
- printError(&sciErr, 0);
- return 0;
- }
- int k=0;
-
- //The input array can be N*2 or 2*N
- int temp=max(iCols,iRows);
- contours.resize(temp);
- for(int i=0;i
+#include "opencv2/core/core.hpp"
+#include "opencv2/highgui/highgui.hpp"
+#include "opencv2/opencv.hpp"
+#include "opencv2/stitching/detail/blenders.hpp"
+#include "opencv2/imgproc/imgproc.hpp"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include