summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
Diffstat (limited to 'macros')
-rw-r--r--macros/BRISKPoints.binbin0 -> 3984 bytes
-rw-r--r--macros/BRISKPoints.sci30
-rw-r--r--macros/CascadeObjectDetector.binbin0 -> 4516 bytes
-rw-r--r--macros/CascadeObjectDetector.sci31
-rw-r--r--macros/DCT.binbin0 -> 3216 bytes
-rw-r--r--macros/DCT.sci33
-rw-r--r--macros/Deinterlacer.binbin0 -> 7228 bytes
-rw-r--r--macros/Deinterlacer.sci56
-rw-r--r--macros/FFT.binbin0 -> 2288 bytes
-rw-r--r--macros/FFT.sci22
-rw-r--r--macros/ForegroundDetector.binbin0 -> 10240 bytes
-rw-r--r--macros/ForegroundDetector.sci55
-rw-r--r--macros/IDCT.binbin0 -> 4956 bytes
-rw-r--r--macros/IDCT.sci46
-rw-r--r--macros/IFFT.binbin0 -> 2648 bytes
-rw-r--r--macros/IFFT.sci31
-rw-r--r--macros/KalmanFilter.binbin0 -> 4016 bytes
-rw-r--r--macros/KalmanFilter.sci25
-rw-r--r--macros/SURFPoints.binbin0 -> 4752 bytes
-rw-r--r--macros/SURFPoints.sci33
-rw-r--r--macros/TemplateMatcher.binbin0 -> 6668 bytes
-rw-r--r--macros/TemplateMatcher.sci60
-rw-r--r--macros/VideoReader.binbin0 -> 5536 bytes
-rw-r--r--macros/VideoReader.sci37
-rw-r--r--macros/adapthisteq.binbin0 -> 1664 bytes
-rw-r--r--macros/adapthisteq.sci16
-rw-r--r--macros/affine2d.binbin0 -> 860 bytes
-rw-r--r--macros/affine2d.sci12
-rw-r--r--macros/approxpolyDP.binbin0 -> 368 bytes
-rw-r--r--macros/approxpolyDP.sci5
-rw-r--r--macros/arclength.binbin0 -> 308 bytes
-rw-r--r--macros/arclength.sci5
-rw-r--r--macros/arrowedline.binbin0 -> 3872 bytes
-rw-r--r--macros/arrowedline.sci25
-rw-r--r--macros/autoCorrelator.binbin0 -> 7004 bytes
-rw-r--r--macros/autoCorrelator.sci46
-rw-r--r--macros/bagOfFeatures.binbin0 -> 8280 bytes
-rw-r--r--macros/bagOfFeatures.sci50
-rw-r--r--macros/bagStructToList.binbin0 -> 2536 bytes
-rw-r--r--macros/bagStructToList.sci16
-rw-r--r--macros/bbox2points.binbin0 -> 2388 bytes
-rw-r--r--macros/bbox2points.sci24
-rw-r--r--macros/bboxOverlapRatio.binbin0 -> 4864 bytes
-rw-r--r--macros/bboxOverlapRatio.sci37
-rw-r--r--macros/bilateralFilter.binbin0 -> 1044 bytes
-rw-r--r--macros/bilateralFilter.sci13
-rw-r--r--macros/binaryFeatures.binbin0 -> 4672 bytes
-rw-r--r--macros/binaryFeatures.sci34
-rw-r--r--macros/blobAnalysis.binbin0 -> 15592 bytes
-rw-r--r--macros/blobAnalysis.sci103
-rw-r--r--macros/blur.binbin0 -> 1088 bytes
-rw-r--r--macros/blur.sci9
-rw-r--r--macros/borderInterpolate.binbin0 -> 368 bytes
-rw-r--r--macros/borderInterpolate.sci6
-rw-r--r--macros/boundingRect.binbin0 -> 240 bytes
-rw-r--r--macros/boundingRect.sci3
-rw-r--r--macros/boxfilter.binbin0 -> 1208 bytes
-rw-r--r--macros/boxfilter.sci9
-rw-r--r--macros/buildmacros.sce2
-rw-r--r--macros/bundleAdjustment.binbin0 -> 4876 bytes
-rw-r--r--macros/bundleAdjustment.sci29
-rw-r--r--macros/bwlookup.binbin0 -> 904 bytes
-rw-r--r--macros/bwlookup.sci8
-rw-r--r--macros/bwulterode.binbin0 -> 864 bytes
-rw-r--r--macros/bwulterode.sci13
-rw-r--r--macros/cameraMatrix.binbin0 -> 4460 bytes
-rw-r--r--macros/cameraMatrix.sci28
-rw-r--r--macros/cameraParameters.binbin0 -> 39564 bytes
-rw-r--r--macros/cameraParameters.sci242
-rw-r--r--macros/canny.binbin0 -> 1088 bytes
-rw-r--r--macros/canny.sci9
-rw-r--r--macros/checkCCE.binbin0 -> 1348 bytes
-rw-r--r--macros/checkCCE.sci11
-rw-r--r--macros/checkCEE.binbin0 -> 3292 bytes
-rw-r--r--macros/checkCEE.sci22
-rw-r--r--macros/checkCIE.binbin0 -> 6136 bytes
-rw-r--r--macros/checkCIE.sci27
-rw-r--r--macros/checkSCE.binbin0 -> 4712 bytes
-rw-r--r--macros/checkSCE.sci29
-rw-r--r--macros/checkStereoParam.binbin0 -> 7584 bytes
-rw-r--r--macros/checkStereoParam.sci33
-rw-r--r--macros/circle.binbin0 -> 1388 bytes
-rw-r--r--macros/circle.sci9
-rw-r--r--macros/classifierToList.binbin0 -> 1092 bytes
-rw-r--r--macros/classifierToList.sci10
-rw-r--r--macros/clipline.binbin0 -> 540 bytes
-rw-r--r--macros/clipline.sci3
-rw-r--r--macros/contourarea.binbin0 -> 300 bytes
-rw-r--r--macros/contourarea.sci3
-rw-r--r--macros/convexhull.binbin0 -> 364 bytes
-rw-r--r--macros/convexhull.sci4
-rw-r--r--macros/convmtx2.binbin0 -> 984 bytes
-rw-r--r--macros/convmtx2.sci17
-rw-r--r--macros/convolver.binbin0 -> 1024 bytes
-rw-r--r--macros/convolver.sci8
-rw-r--r--macros/copymakeborder.binbin0 -> 1860 bytes
-rw-r--r--macros/copymakeborder.sci20
-rw-r--r--macros/corner.binbin0 -> 1832 bytes
-rw-r--r--macros/corner.sci26
-rw-r--r--macros/cornerEigenValsAndVecs.binbin0 -> 944 bytes
-rw-r--r--macros/cornerEigenValsAndVecs.sci7
-rw-r--r--macros/cornerHarris.binbin0 -> 1004 bytes
-rw-r--r--macros/cornerHarris.sci7
-rw-r--r--macros/cornerMinEigenVal.binbin0 -> 944 bytes
-rw-r--r--macros/cornerMinEigenVal.sci7
-rw-r--r--macros/crossCorrelator.binbin0 -> 7740 bytes
-rw-r--r--macros/crossCorrelator.sci48
-rw-r--r--macros/cvHoughLines.binbin0 -> 4008 bytes
-rw-r--r--macros/cvHoughLines.sci29
-rw-r--r--macros/cvMaximum.binbin0 -> 43224 bytes
-rw-r--r--macros/cvMaximum.sci295
-rw-r--r--macros/cvMean.binbin0 -> 28476 bytes
-rw-r--r--macros/cvMean.sci217
-rw-r--r--macros/cvMedian.binbin0 -> 16868 bytes
-rw-r--r--macros/cvMedian.sci119
-rw-r--r--macros/cvMinimum.binbin0 -> 47824 bytes
-rw-r--r--macros/cvMinimum.sci311
-rw-r--r--macros/cvStandardDeviation.binbin0 -> 29096 bytes
-rw-r--r--macros/cvStandardDeviation.sci217
-rw-r--r--macros/cvVariance.binbin0 -> 28672 bytes
-rw-r--r--macros/cvVariance.sci217
-rw-r--r--macros/cv_imread.binbin0 -> 724 bytes
-rw-r--r--macros/cv_imread.sci11
-rw-r--r--macros/cv_imread.sci~11
-rw-r--r--macros/cvtColor.binbin0 -> 1476 bytes
-rw-r--r--macros/cvtColor.sci20
-rw-r--r--macros/dctmtx.binbin0 -> 244 bytes
-rw-r--r--macros/dctmtx.sci4
-rw-r--r--macros/decorrstretch.binbin0 -> 860 bytes
-rw-r--r--macros/decorrstretch.sci12
-rw-r--r--macros/demosaic.binbin0 -> 964 bytes
-rw-r--r--macros/demosaic.sci8
-rw-r--r--macros/detectBRISKFeatures.binbin0 -> 9856 bytes
-rw-r--r--macros/detectBRISKFeatures.sci47
-rw-r--r--macros/detectCheckerboardPoints.binbin0 -> 7168 bytes
-rw-r--r--macros/detectCheckerboardPoints.sci50
-rw-r--r--macros/detectFASTFeatures.binbin0 -> 9556 bytes
-rw-r--r--macros/detectFASTFeatures.sci53
-rw-r--r--macros/detectHarrisFeatures.binbin0 -> 8564 bytes
-rw-r--r--macros/detectHarrisFeatures.sci52
-rw-r--r--macros/detectMSERFeatures.binbin0 -> 12708 bytes
-rw-r--r--macros/detectMSERFeatures.sci57
-rw-r--r--macros/detectMinEigenFeatures.binbin0 -> 7692 bytes
-rw-r--r--macros/detectMinEigenFeatures.sci50
-rw-r--r--macros/detectSURFFeatures.binbin0 -> 12224 bytes
-rw-r--r--macros/detectSURFFeatures.sci45
-rw-r--r--macros/dilate.binbin0 -> 1084 bytes
-rw-r--r--macros/dilate.sci8
-rw-r--r--macros/displayErrors.binbin0 -> 38552 bytes
-rw-r--r--macros/displayErrors.sci249
-rw-r--r--macros/ellipse.sce9
-rw-r--r--macros/ellipse2poly.binbin0 -> 660 bytes
-rw-r--r--macros/ellipse2poly.sci3
-rw-r--r--macros/erode.binbin0 -> 1088 bytes
-rw-r--r--macros/erode.sci9
-rw-r--r--macros/estimateFundamentalMatrix.binbin0 -> 7588 bytes
-rw-r--r--macros/estimateFundamentalMatrix.sci41
-rw-r--r--macros/estimateGeometricTransform.binbin0 -> 572 bytes
-rw-r--r--macros/estimateGeometricTransform.sci5
-rw-r--r--macros/estimateUncalibratedRectification.binbin0 -> 5644 bytes
-rw-r--r--macros/estimateUncalibratedRectification.sci35
-rw-r--r--macros/evaluate.binbin0 -> 3400 bytes
-rw-r--r--macros/evaluate.sci31
-rw-r--r--macros/evaluateImageRetrieval.binbin0 -> 13080 bytes
-rw-r--r--macros/evaluateImageRetrieval.sci104
-rw-r--r--macros/extractFeatures.binbin0 -> 28204 bytes
-rw-r--r--macros/extractFeatures.sci168
-rw-r--r--macros/extractHOGFeatures.binbin0 -> 3716 bytes
-rw-r--r--macros/extractHOGFeatures.sci24
-rw-r--r--macros/extractLBPFeatures.binbin0 -> 11004 bytes
-rw-r--r--macros/extractLBPFeatures.sci46
-rw-r--r--macros/fftshift.binbin0 -> 848 bytes
-rw-r--r--macros/fftshift.sci9
-rw-r--r--macros/fillconvexpoly.binbin0 -> 1264 bytes
-rw-r--r--macros/fillconvexpoly.sci8
-rw-r--r--macros/filter.binbin0 -> 1144 bytes
-rw-r--r--macros/filter.sci8
-rw-r--r--macros/findcontours.binbin0 -> 1004 bytes
-rw-r--r--macros/findcontours.sci7
-rw-r--r--macros/fitellipse.binbin0 -> 788 bytes
-rw-r--r--macros/fitellipse.sci4
-rw-r--r--macros/fsamp2.binbin0 -> 1928 bytes
-rw-r--r--macros/fsamp2.sci31
-rw-r--r--macros/ftrans2.binbin0 -> 1244 bytes
-rw-r--r--macros/ftrans2.sci25
-rw-r--r--macros/gabor.binbin0 -> 688 bytes
-rw-r--r--macros/gabor.sci6
-rw-r--r--macros/gaussianblur.binbin0 -> 1004 bytes
-rw-r--r--macros/gaussianblur.sci7
-rw-r--r--macros/genCheckerboardPoints.binbin0 -> 3332 bytes
-rw-r--r--macros/genCheckerboardPoints.sci26
-rw-r--r--macros/geometricshearer.binbin0 -> 3820 bytes
-rw-r--r--macros/geometricshearer.sci33
-rw-r--r--macros/getStructuringElement.binbin0 -> 488 bytes
-rw-r--r--macros/getStructuringElement.sci5
-rw-r--r--macros/getTextSize.binbin0 -> 472 bytes
-rw-r--r--macros/getTextSize.sci3
-rw-r--r--macros/getgaussiankernel.binbin0 -> 368 bytes
-rw-r--r--macros/getgaussiankernel.sci5
-rw-r--r--macros/getkerneltype.binbin0 -> 364 bytes
-rw-r--r--macros/getkerneltype.sci4
-rw-r--r--macros/getrectsubpix.binbin0 -> 1164 bytes
-rw-r--r--macros/getrectsubpix.sci13
-rw-r--r--macros/getrotationmatrix2d.binbin0 -> 360 bytes
-rw-r--r--macros/getrotationmatrix2d.sci3
-rw-r--r--macros/goodfeaturestotrack.binbin0 -> 748 bytes
-rw-r--r--macros/goodfeaturestotrack.sci7
-rw-r--r--macros/grayconnected.binbin0 -> 2352 bytes
-rw-r--r--macros/grayconnected.sci21
-rw-r--r--macros/graycoprops.binbin0 -> 1328 bytes
-rw-r--r--macros/graycoprops.sci19
-rw-r--r--macros/graydiffweight.binbin0 -> 908 bytes
-rw-r--r--macros/graydiffweight.sci9
-rw-r--r--macros/graydist.binbin0 -> 924 bytes
-rw-r--r--macros/graydist.sci13
-rw-r--r--macros/has_frame.binbin0 -> 2368 bytes
-rw-r--r--macros/has_frame.sci22
-rw-r--r--macros/histeq.binbin0 -> 848 bytes
-rw-r--r--macros/histeq.sci9
-rw-r--r--macros/houghcircles.binbin0 -> 1124 bytes
-rw-r--r--macros/houghcircles.sci7
-rw-r--r--macros/houghlines.binbin0 -> 676 bytes
-rw-r--r--macros/houghlines.sci4
-rw-r--r--macros/houghlinesp.binbin0 -> 688 bytes
-rw-r--r--macros/houghlinesp.sci7
-rw-r--r--macros/ifftshift.binbin0 -> 860 bytes
-rw-r--r--macros/ifftshift.sci12
-rw-r--r--macros/im2double.binbin0 -> 864 bytes
-rw-r--r--macros/im2double.sci13
-rw-r--r--macros/imadd.binbin0 -> 452 bytes
-rw-r--r--macros/imadd.sci7
-rw-r--r--macros/imageSet.binbin0 -> 6236 bytes
-rw-r--r--macros/imageSet.sci47
-rw-r--r--macros/imageSetToList.binbin0 -> 4456 bytes
-rw-r--r--macros/imageSetToList.sci30
-rw-r--r--macros/imboxfilt3.binbin0 -> 1688 bytes
-rw-r--r--macros/imboxfilt3.sci28
-rw-r--r--macros/imcomplement.binbin0 -> 864 bytes
-rw-r--r--macros/imcomplement.sci13
-rw-r--r--macros/imcontour.binbin0 -> 388 bytes
-rw-r--r--macros/imcontour.sci7
-rw-r--r--macros/imcontrast.binbin0 -> 508 bytes
-rw-r--r--macros/imcontrast.sci7
-rw-r--r--macros/imcrop.binbin0 -> 680 bytes
-rw-r--r--macros/imcrop.sci5
-rw-r--r--macros/imcrop.sci~5
-rw-r--r--macros/imdivide.binbin0 -> 308 bytes
-rw-r--r--macros/imdivide.sci5
-rw-r--r--macros/imextendedmax.binbin0 -> 924 bytes
-rw-r--r--macros/imextendedmax.sci13
-rw-r--r--macros/imextendedmin.binbin0 -> 924 bytes
-rw-r--r--macros/imextendedmin.sci13
-rw-r--r--macros/imfill.binbin0 -> 1380 bytes
-rw-r--r--macros/imfill.sci20
-rw-r--r--macros/imfindcircles.binbin0 -> 1916 bytes
-rw-r--r--macros/imfindcircles.sci25
-rw-r--r--macros/imfuse.binbin0 -> 1176 bytes
-rw-r--r--macros/imfuse.sci13
-rw-r--r--macros/imgSetToList.binbin0 -> 10556 bytes
-rw-r--r--macros/imgSetToList.sci50
-rw-r--r--macros/imgaborfit.binbin0 -> 984 bytes
-rw-r--r--macros/imgaborfit.sci13
-rw-r--r--macros/imgaussfilt3.binbin0 -> 1004 bytes
-rw-r--r--macros/imgaussfilt3.sci7
-rw-r--r--macros/imguidedfilter.binbin0 -> 2072 bytes
-rw-r--r--macros/imguidedfilter.sci26
-rw-r--r--macros/imhistmatch.binbin0 -> 1896 bytes
-rw-r--r--macros/imhistmatch.sci17
-rw-r--r--macros/imhmin.binbin0 -> 1068 bytes
-rw-r--r--macros/imhmin.sci15
-rw-r--r--macros/imhmin.sci~15
-rw-r--r--macros/imimposemin.binbin0 -> 784 bytes
-rw-r--r--macros/imimposemin.sci11
-rw-r--r--macros/immultiply.binbin0 -> 780 bytes
-rw-r--r--macros/immultiply.sci10
-rw-r--r--macros/impixel.binbin0 -> 500 bytes
-rw-r--r--macros/impixel.sci5
-rw-r--r--macros/imread.binbin0 -> 856 bytes
-rw-r--r--macros/imread.sci11
-rw-r--r--macros/imread.sci~11
-rw-r--r--macros/imrect.binbin0 -> 964 bytes
-rw-r--r--macros/imrect.sci8
-rw-r--r--macros/imresize.binbin0 -> 964 bytes
-rw-r--r--macros/imresize.sci8
-rw-r--r--macros/imsharpen.binbin0 -> 1600 bytes
-rw-r--r--macros/imsharpen.sci18
-rw-r--r--macros/imsharpen.sci~18
-rw-r--r--macros/imshow.binbin0 -> 4052 bytes
-rw-r--r--macros/imshow.sci26
-rw-r--r--macros/imshowpair.binbin0 -> 1080 bytes
-rw-r--r--macros/imshowpair.sci8
-rw-r--r--macros/imsubtract.binbin0 -> 308 bytes
-rw-r--r--macros/imsubtract.sci5
-rw-r--r--macros/imwarp.binbin0 -> 904 bytes
-rw-r--r--macros/imwarp.sci8
-rw-r--r--macros/imwrite.binbin0 -> 412 bytes
-rw-r--r--macros/imwrite.sci4
-rw-r--r--macros/ind2gray.binbin0 -> 904 bytes
-rw-r--r--macros/ind2gray.sci8
-rw-r--r--macros/indexImages.binbin0 -> 7548 bytes
-rw-r--r--macros/indexImages.sci54
-rw-r--r--macros/indexImages.sci~53
-rw-r--r--macros/integralFilter.binbin0 -> 4016 bytes
-rw-r--r--macros/integralFilter.sci29
-rw-r--r--macros/integralImage.binbin0 -> 1380 bytes
-rw-r--r--macros/integralImage.sci20
-rw-r--r--macros/integralImage.sci~20
-rw-r--r--macros/integralKernel.binbin0 -> 3580 bytes
-rw-r--r--macros/integralKernel.sci27
-rw-r--r--macros/invertedIndexImages.binbin0 -> 5144 bytes
-rw-r--r--macros/invertedIndexImages.sci32
-rw-r--r--macros/isEpipoleInImage.binbin0 -> 6340 bytes
-rw-r--r--macros/isEpipoleInImage.sci48
-rw-r--r--macros/lab2double.binbin0 -> 708 bytes
-rw-r--r--macros/lab2double.sci7
-rw-r--r--macros/lab2rgb.binbin0 -> 708 bytes
-rw-r--r--macros/lab2rgb.sci7
-rw-r--r--macros/lab2uint16.binbin0 -> 708 bytes
-rw-r--r--macros/lab2uint16.sci7
-rw-r--r--macros/lab2uint8.binbin0 -> 708 bytes
-rw-r--r--macros/lab2uint8.sci7
-rw-r--r--macros/lab2xyz.binbin0 -> 1912 bytes
-rw-r--r--macros/lab2xyz.sci20
-rw-r--r--macros/laplacian.binbin0 -> 1004 bytes
-rw-r--r--macros/laplacian.sci7
-rw-r--r--macros/libbin0 -> 5652 bytes
-rw-r--r--macros/line.binbin0 -> 1364 bytes
-rw-r--r--macros/line.sci7
-rw-r--r--macros/lineToBorderPoints.binbin0 -> 4464 bytes
-rw-r--r--macros/lineToBorderPoints.sci29
-rw-r--r--macros/localMaximaFinder.binbin0 -> 14332 bytes
-rw-r--r--macros/localMaximaFinder.sci118
-rw-r--r--macros/makecform.binbin0 -> 376 bytes
-rw-r--r--macros/makecform.sci4
-rw-r--r--macros/matchFeatures.binbin0 -> 13064 bytes
-rw-r--r--macros/matchFeatures.sci62
-rw-r--r--macros/mattolist.binbin0 -> 844 bytes
-rw-r--r--macros/mattolist.sci9
-rw-r--r--macros/mattolist.sci~9
-rw-r--r--macros/mean.binbin0 -> 376 bytes
-rw-r--r--macros/mean.sci4
-rw-r--r--macros/medianblur.binbin0 -> 824 bytes
-rw-r--r--macros/medianblur.sci7
-rw-r--r--macros/minAreaRect.binbin0 -> 788 bytes
-rw-r--r--macros/minAreaRect.sci4
-rw-r--r--macros/minimumenclosingcirlce.binbin0 -> 608 bytes
-rw-r--r--macros/minimumenclosingcirlce.sci4
-rw-r--r--macros/montage.binbin0 -> 832 bytes
-rw-r--r--macros/montage.sci8
-rw-r--r--macros/morphologyEx.binbin0 -> 1232 bytes
-rw-r--r--macros/morphologyEx.sci15
-rw-r--r--macros/names219
-rw-r--r--macros/ntsc2rgb.binbin0 -> 828 bytes
-rw-r--r--macros/ntsc2rgb.sci7
-rw-r--r--macros/ocr.binbin0 -> 3076 bytes
-rw-r--r--macros/ocr.sci27
-rw-r--r--macros/opencv_imread.binbin0 -> 724 bytes
-rw-r--r--macros/opencv_imread.sci11
-rw-r--r--macros/opticalFlowFarneback.binbin0 -> 4788 bytes
-rw-r--r--macros/opticalFlowFarneback.sci21
-rw-r--r--macros/partition.binbin0 -> 7184 bytes
-rw-r--r--macros/partition.sci52
-rw-r--r--macros/peopleDetector.binbin0 -> 12088 bytes
-rw-r--r--macros/peopleDetector.sci79
-rw-r--r--macros/predict.binbin0 -> 3520 bytes
-rw-r--r--macros/predict.sci32
-rw-r--r--macros/puttext.binbin0 -> 3824 bytes
-rw-r--r--macros/puttext.sci31
-rw-r--r--macros/pyrDown.binbin0 -> 1028 bytes
-rw-r--r--macros/pyrDown.sci9
-rw-r--r--macros/pyrMeanShiftFiltering.binbin0 -> 888 bytes
-rw-r--r--macros/pyrMeanShiftFiltering.sci8
-rw-r--r--macros/pyrMeanShiftFiltering.sci~8
-rw-r--r--macros/pyrUp.binbin0 -> 1028 bytes
-rw-r--r--macros/pyrUp.sci9
-rw-r--r--macros/pyramid.binbin0 -> 5268 bytes
-rw-r--r--macros/pyramid.sci35
-rw-r--r--macros/readForegroundMask.binbin0 -> 3796 bytes
-rw-r--r--macros/readForegroundMask.sci37
-rw-r--r--macros/readframe.binbin0 -> 2264 bytes
-rw-r--r--macros/readframe.sci23
-rw-r--r--macros/rectangle.binbin0 -> 1448 bytes
-rw-r--r--macros/rectangle.sci9
-rw-r--r--macros/rectifyStereoImages.binbin0 -> 8508 bytes
-rw-r--r--macros/rectifyStereoImages.sci59
-rw-r--r--macros/rectifyStereoImages.sci~59
-rw-r--r--macros/regionfill.binbin0 -> 1576 bytes
-rw-r--r--macros/regionfill.sci18
-rw-r--r--macros/retrieveImages.binbin0 -> 12300 bytes
-rw-r--r--macros/retrieveImages.sci103
-rw-r--r--macros/rgb2lab.binbin0 -> 932 bytes
-rw-r--r--macros/rgb2lab.sci10
-rw-r--r--macros/rgb2ntsc.binbin0 -> 844 bytes
-rw-r--r--macros/rgb2ntsc.sci8
-rw-r--r--macros/rgb2xyz.binbin0 -> 844 bytes
-rw-r--r--macros/rgb2xyz.sci8
-rw-r--r--macros/roifill.binbin0 -> 2216 bytes
-rw-r--r--macros/roifill.sci28
-rw-r--r--macros/roipoly.binbin0 -> 984 bytes
-rw-r--r--macros/roipoly.sci13
-rw-r--r--macros/rotationVectorToMatrix.binbin0 -> 1860 bytes
-rw-r--r--macros/rotationVectorToMatrix.sci24
-rw-r--r--macros/scharr.binbin0 -> 1164 bytes
-rw-r--r--macros/scharr.sci13
-rw-r--r--macros/selectStrongestBbox.binbin0 -> 21820 bytes
-rw-r--r--macros/selectStrongestBbox.sci147
-rw-r--r--macros/sepFilter2D.binbin0 -> 1284 bytes
-rw-r--r--macros/sepFilter2D.sci13
-rw-r--r--macros/show.binbin0 -> 2540 bytes
-rw-r--r--macros/show.sci18
-rw-r--r--macros/showMatchedFeatures.binbin0 -> 1040 bytes
-rw-r--r--macros/showMatchedFeatures.sci10
-rw-r--r--macros/showReprojectionErrors.binbin0 -> 7672 bytes
-rw-r--r--macros/showReprojectionErrors.sci57
-rw-r--r--macros/sobel.binbin0 -> 1224 bytes
-rw-r--r--macros/sobel.sci13
-rw-r--r--macros/ssim.binbin0 -> 448 bytes
-rw-r--r--macros/ssim.sci7
-rw-r--r--macros/stereoParameters.binbin0 -> 10800 bytes
-rw-r--r--macros/stereoParameters.sci85
-rw-r--r--macros/threshold.binbin0 -> 996 bytes
-rw-r--r--macros/threshold.sci7
-rw-r--r--macros/trainCascadeObjectDetector.binbin0 -> 28504 bytes
-rw-r--r--macros/trainCascadeObjectDetector.sci163
-rw-r--r--macros/trainImageCategoryClassifier.binbin0 -> 4076 bytes
-rw-r--r--macros/trainImageCategoryClassifier.sci31
-rw-r--r--macros/triangulatePoints.binbin0 -> 5720 bytes
-rw-r--r--macros/triangulatePoints.sci40
-rw-r--r--macros/undistort.binbin0 -> 944 bytes
-rw-r--r--macros/undistort.sci7
-rw-r--r--macros/undistortImage.binbin0 -> 7684 bytes
-rw-r--r--macros/undistortImage.sci68
-rw-r--r--macros/undistortPoints.binbin0 -> 6684 bytes
-rw-r--r--macros/undistortPoints.sci37
-rw-r--r--macros/viscircle.binbin0 -> 3248 bytes
-rw-r--r--macros/viscircle.sci27
-rw-r--r--macros/warpaffine.binbin0 -> 1144 bytes
-rw-r--r--macros/warpaffine.sci8
-rw-r--r--macros/watershed.binbin0 -> 856 bytes
-rw-r--r--macros/watershed.sci11
-rw-r--r--macros/whitepoint.binbin0 -> 672 bytes
-rw-r--r--macros/whitepoint.sci10
-rw-r--r--macros/wiener2.binbin0 -> 884 bytes
-rw-r--r--macros/wiener2.sci7
-rw-r--r--macros/xyz2double.binbin0 -> 708 bytes
-rw-r--r--macros/xyz2double.sci7
-rw-r--r--macros/xyz2lab.binbin0 -> 1916 bytes
-rw-r--r--macros/xyz2lab.sci21
-rw-r--r--macros/xyz2rgb.binbin0 -> 844 bytes
-rw-r--r--macros/xyz2rgb.sci8
-rw-r--r--macros/xyz2uint16.binbin0 -> 708 bytes
-rw-r--r--macros/xyz2uint16.sci7
452 files changed, 7318 insertions, 0 deletions
diff --git a/macros/BRISKPoints.bin b/macros/BRISKPoints.bin
new file mode 100644
index 0000000..ccb0151
--- /dev/null
+++ b/macros/BRISKPoints.bin
Binary files differ
diff --git a/macros/BRISKPoints.sci b/macros/BRISKPoints.sci
new file mode 100644
index 0000000..d3d80f3
--- /dev/null
+++ b/macros/BRISKPoints.sci
@@ -0,0 +1,30 @@
+function [varargout] = BRISKPoints(inp)
+// This function returns a BRISKPoints struct for storing BRISK interest points.
+//
+// Calling Sequence
+// myStruct = BRISKPoints(Location of KeyPoints)
+//
+// Parameters
+// results: BRISKPoints struct which contains Location, Orientation, Metric, Scale and Count.
+// Location: Location of Interest Point.
+//
+// Description
+// This function returns a BRISKPoints struct with default values.
+//
+// Examples
+// image = imread('sample.jpg');
+// results = detectBRISKFeatures(image);
+// myStruct = BRISKPoints(results.KeyPoints);
+//
+// Authors
+// Shashank Shekhar
+ [ lhs, rhs ] = argn(0)
+ if rhs > 1 then
+ error(msprintf("Too many input arguments"))
+ end
+ if lhs > 1 then
+ error(msprintf("Too many output arguments"))
+ end
+ [a b c d e] = ocv_BRISKPoints(inp);
+ varargout(1) = struct('Location', a, 'Orientation', b, 'Metric', c ,'Scale', d, 'Count', e);
+endfunction
diff --git a/macros/CascadeObjectDetector.bin b/macros/CascadeObjectDetector.bin
new file mode 100644
index 0000000..ea78a31
--- /dev/null
+++ b/macros/CascadeObjectDetector.bin
Binary files differ
diff --git a/macros/CascadeObjectDetector.sci b/macros/CascadeObjectDetector.sci
new file mode 100644
index 0000000..c1c4a7f
--- /dev/null
+++ b/macros/CascadeObjectDetector.sci
@@ -0,0 +1,31 @@
+function [out]=insertObjectAnnotation(input_image,object)
+// Detect human body parts like face ,nose,eye and ear.
+//
+// Calling Sequence
+// output_image = insertObjectAnnotation(input_image,object);
+//
+// Parameters
+//
+// input_image : image matrix on which Cascadeobject detection has to be performed
+// object : An input string which specify the name of the object which has to be detect
+// output_image : an output image in which object are bounded by rectangle.
+//
+// Description
+// This function uses the Viola-Jones algorithm to detect the object from given input image.The function first finds the target object on the image then makes a rectangle on detected part of the image.To detect the object it uses already trained data which are stored in .xml file.User can use own trained data for better object detection.
+//
+// Examples
+// a = imread('lena.jpeg');
+// b = insertObjectAnnotation(a,'face');
+// imshow(b)
+//
+// Authors.
+//
+//Diwakar Bhardwaj
+ input_image1=mattolist(input_image);
+ a=opencv_CascadeObjectDetector(input_image,object);
+ 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..19443dc
--- /dev/null
+++ b/macros/DCT.bin
Binary files differ
diff --git a/macros/DCT.sci b/macros/DCT.sci
new file mode 100644
index 0000000..d7dd08a
--- /dev/null
+++ b/macros/DCT.sci
@@ -0,0 +1,33 @@
+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
+// Returns the forward transform of the input matrix. It uses the flag to perform the transform. The flag is 0 by default so as to perform forward transform.
+//
+// Examples
+// [srcMat] = [230.3 23.1 432.5; 321 543.1 89.5]
+// [dstMAt] = DCT(srcMat)
+//
+// Bibliography
+// Literature references one pr. line
+//
+// code for the above function
+//
+
+ srcMat = mattolist(srcImg)
+ output = opencv_DCT(srcMat)
+
+ channels = size(output)
+
+ for i = 1:channels // for i channel image
+ output_image(:,:,i) = output(i)
+ end
+endfunction
+
diff --git a/macros/Deinterlacer.bin b/macros/Deinterlacer.bin
new file mode 100644
index 0000000..14f0bdc
--- /dev/null
+++ b/macros/Deinterlacer.bin
Binary files differ
diff --git a/macros/Deinterlacer.sci b/macros/Deinterlacer.sci
new file mode 100644
index 0000000..6ced08a
--- /dev/null
+++ b/macros/Deinterlacer.sci
@@ -0,0 +1,56 @@
+function [dstImg] = Deinterlacer(srcImg, varargin)
+// Removes the motion antiquity from Images
+//
+// Calling Sequence
+// [dstImg] = Deinterlacer(srcImg)
+// [dstImg] = Deinterlacer(srcImg, method)
+//
+// Parameters
+// srcImg: The input Matrix
+// method: for specifying the method used for deinterlacing
+// dstimg: The output Matrix
+//
+// Description
+// The input is an image, srcImg, containing the motion antiquity. The varargin specifies the 2nd argument(method) for the function. If second argument i.e method is not specified then default method is used.
+// The method may be any of following types :-
+// <itemizedlist>
+// <listitem><para>Line repeatation</para></listitem>
+// <listitem><para>Linear interpolation</para></listitem>
+// <listitem><para>Vertical temporal median filtering</para></listitem>
+// </itemizedlist>
+//
+// Examples
+// srcImg = imread('lena.jpeg')
+// [dstImg] = Deinterlacer(srcImg) // no method specified, default method used
+// [dstImg] = Deinterlacer(srcImg, "Linear interpolation") // Deinterlacing done using Linear interpolation
+//
+// start of coding after on empty line to mark the end of the head_comments section
+//
+
+ [lhs,rhs]=argn(0)
+
+ //To check the number of input and output arguments
+ if rhs>2 then
+ error(msprintf(" Too many input arguments to the function"))
+ end
+
+ srcMat = mattolist(srcImg)
+
+ select rhs
+ case 1 then // if no method specified then use default method
+ output = opencv_Deinterlacer(srcMat)
+ case 2 then // if method specified
+ if typeof(varargin(1)) <> "string" then
+ error(msprintf(" argument 2 must string"))
+ end
+ output = opencv_Deinterlacer(srcMat, varargin(1))
+ end
+
+ channels = size(output)
+
+ for i = 1:channels
+ dstImg(:,:,i) = output(i)
+ end
+
+endfunction
+
diff --git a/macros/FFT.bin b/macros/FFT.bin
new file mode 100644
index 0000000..c3b6185
--- /dev/null
+++ b/macros/FFT.bin
Binary files differ
diff --git a/macros/FFT.sci b/macros/FFT.sci
new file mode 100644
index 0000000..3ada874
--- /dev/null
+++ b/macros/FFT.sci
@@ -0,0 +1,22 @@
+function fourierTransform=FFT(inputMatrix)
+// This funtions 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("cameraman.tif");
+// fourier=FFT(I);
+
+ [rows cols channels]=size(inputMatrix);
+ if channels <> 1 then
+ error(msprintf("Wrong input, input must be 2-D matrix"));
+ end
+ fourierTransform=opencv_FFT(inputMatrix);
+endfunction
diff --git a/macros/ForegroundDetector.bin b/macros/ForegroundDetector.bin
new file mode 100644
index 0000000..6a4edff
--- /dev/null
+++ b/macros/ForegroundDetector.bin
Binary files differ
diff --git a/macros/ForegroundDetector.sci b/macros/ForegroundDetector.sci
new file mode 100644
index 0000000..16a1e81
--- /dev/null
+++ b/macros/ForegroundDetector.sci
@@ -0,0 +1,55 @@
+function [varargout] = ForegroundDetector(varargin)
+// This function creates a ForeggroundDetector struct which is used to detect Foreground with Gaussian Mixture Models.
+//
+// Calling Sequence
+// result = ForegroundDetector()
+// result = ForegroundDetector(Name, Value, ..)
+//
+// Parameters
+// results: ForegroundDetector struct containing AdaptLearningRate, NumTrainingFrames, MinimumBackgroundRatio, NumGaussians and LearningRate.
+// AdaptLearningRate : (optional) If true, it enables the adaptation of Learning Rate during the period specified by number of training frames.
+// NumTrainingFrames : (optional) The number of initial video frames employed to train the Background Model.
+// MinimumBackgroundRatio : (optional)
+// NumGaussians : (optional)
+// LearningRate : (optional) This comes into action when AdaptLearningRate is enabled.
+//
+// Description
+// This function returns a ForegreoundDetector Struct which basically sets a background model and tracks changes in an input video frame with respect to the background and then computes the Foreground Mask.
+//
+// Examples
+// myStr = ForegroundDetector("NumGaussians", 4)
+//
+// Authors
+// Shashank Shekhar
+ [ lhs, rhs ] = argn(0)
+ if modulo(rhs,2)~=0 then
+ error(msprintf("Incorrect number of input arguments"))
+ end
+
+ if rhs > 10 then
+ error(msprintf("Too many input arguments"))
+ end
+ if lhs > 1 then
+ error(msprintf("Too many output arguments"))
+ end
+ select rhs
+ case 0 then
+ [fdAdaptLearningRate, fdNumTrainingFrames,fdMinimumBackgroundRatio, fdNumGaussians, fdLearningRate ]= ocv_ForegroundDetector()
+
+ case 2 then
+ [fdAdaptLearningRate, fdNumTrainingFrames,fdMinimumBackgroundRatio, fdNumGaussians, fdLearningRate ] = ocv_ForegroundDetector(varargin(1), varargin(2))
+
+ case 4 then
+ [fdAdaptLearningRate, fdNumTrainingFrames,fdMinimumBackgroundRatio, fdNumGaussians, fdLearningRate ] = ocv_ForegroundDetector(varargin(1), varargin(2), varargin(3), varargin(4))
+
+ case 6 then
+ [fdAdaptLearningRate, fdNumTrainingFrames,fdMinimumBackgroundRatio, fdNumGaussians, fdLearningRate ] = ocv_ForegroundDetector(varargin(1), varargin(2), varargin(3), varargin(4), varargin(5), varargin(6))
+
+ case 8 then
+ [fdAdaptLearningRate, fdNumTrainingFrames,fdMinimumBackgroundRatio, fdNumGaussians, fdLearningRate ] = ocv_ForegroundDetector(varargin(1), varargin(2), varargin(3), varargin(4), varargin(5), varargin(6), varargin(7), varargin(8))
+
+ case 10 then
+ [fdAdaptLearningRate, fdNumTrainingFrames,fdMinimumBackgroundRatio, fdNumGaussians, fdLearningRate ] = ocv_ForegroundDetector(varargin(1), varargin(2), varargin(3), varargin(4), varargin(5), varargin(6), varargin(7), varargin(8), varargin(9), varargin(10))
+ end
+ varargout(1) = struct("AdaptLearningRate", fdAdaptLearningRate, "NumTrainingFrames", fdNumTrainingFrames, "MinimumBackgroundRatio", fdMinimumBackgroundRatio, "NumGaussians", fdNumGaussians, "LearningRate", fdLearningRate);
+endfunction
diff --git a/macros/IDCT.bin b/macros/IDCT.bin
new file mode 100644
index 0000000..00196cb
--- /dev/null
+++ b/macros/IDCT.bin
Binary files differ
diff --git a/macros/IDCT.sci b/macros/IDCT.sci
new file mode 100644
index 0000000..217b00c
--- /dev/null
+++ b/macros/IDCT.sci
@@ -0,0 +1,46 @@
+function new_image = IDCT(image)
+// Compute inverse Discrete Transform of image
+//
+// Calling Sequence
+// newimage = IDCT(image)
+//
+// Parameters
+// image : floating-point image
+// newimage : IDCT of the input image
+//
+// Description
+// The IDCT function computes the inverse cosine transform of a floating-point image with even number of rows and columns.
+//
+// Examples
+// I = imread('cameraman.tif')
+// I = double(I)
+// J = IDCT(I)
+// imshow(J)
+//
+// Authors
+// Suraj Prakash
+
+ [rows, cols, channel] = size(image);
+
+ if (modulo(rows, 2) <> 0) & (modulo(cols, 2) <> 0) then
+ error(msprintf("Image doesnot have even number of rows and columns\n"));
+ elseif (modulo(rows, 2)) <> 0 then
+ error(msprintf("Image doesnot have even number of rows\n"));
+ elseif (modulo(cols, 2)) <> 0 then
+ error(msprintf("Image doesnot have even number of cols\n"));
+ end
+
+ if channel > 1 then
+ error(msprintf("Input image should be single channel"));
+ end
+ image_list = mattolist(image)
+
+ out = opencv_IDCT(image_list)
+
+ length_out = size(out)
+
+ for i = 1 : length_out
+ new_image(:, :, i) = out(i)
+ end
+
+endfunction
diff --git a/macros/IFFT.bin b/macros/IFFT.bin
new file mode 100644
index 0000000..ab750d5
--- /dev/null
+++ b/macros/IFFT.bin
Binary files differ
diff --git a/macros/IFFT.sci b/macros/IFFT.sci
new file mode 100644
index 0000000..7f10c42
--- /dev/null
+++ b/macros/IFFT.sci
@@ -0,0 +1,31 @@
+function [out]=IFFT(inputimage)
+// Computes the inverse descrete fourier transform of image
+//
+// Calling Sequence
+// output_image = IFFT(inputimage);
+//
+// Parameters
+//
+// inputimage : Grayscale image
+// out_image : IFFT of input image
+//
+// Description
+// This function computes the inverse descrete fourier transform of input image.The image should be grayscale.
+//
+// Examples
+// a = imread('cameraman.tif');
+// b = IFFT(a);
+// imshow(b)
+//
+// Authors:
+//
+//Diwakar Bhardwaj
+
+
+ inputimage1=mattolist(inputimage);
+ a=opencv_IFFT(inputimage1);
+ dimension=size(a)
+ for i = 1:dimension
+ out(:,:,i)=a(i);
+ end
+endfunction;
diff --git a/macros/KalmanFilter.bin b/macros/KalmanFilter.bin
new file mode 100644
index 0000000..5c72453
--- /dev/null
+++ b/macros/KalmanFilter.bin
Binary files differ
diff --git a/macros/KalmanFilter.sci b/macros/KalmanFilter.sci
new file mode 100644
index 0000000..0275099
--- /dev/null
+++ b/macros/KalmanFilter.sci
@@ -0,0 +1,25 @@
+function [output] = KalmanFilter(varargin)
+ [lhs,rhs] = argn(0)
+ if rhs>10
+ error(msprintf(" Too many input arguments"));
+ end
+ select rhs
+ case 0 then
+ a = opencv_KalmanFilter();
+ case 2 then
+ a = opencv_KalmanFilter(varargin(0),varargin(1));
+ case 4 then
+ a = opencv_KalmanFilter(varargin(0),varargin(1),varargin(2),varargin(3));
+ case 6 then
+ a = opencv_KalmanFilter(varargin(0),varargin(1),varargin(2),varargin(3),varargin(4),varargin(5));
+ case 8 then
+ a = opencv_KalmanFilter(varargin(0),varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6),varargin(7));
+ case 10 then
+ a = opencv_KalmanFilter(varargin(0),varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6),varargin(7),varargin(8),varargin(9));
+ end
+
+ d = size(a);
+ for i = 1:d
+ output(:,:,i) = a(i);
+ end
+endfunction
diff --git a/macros/SURFPoints.bin b/macros/SURFPoints.bin
new file mode 100644
index 0000000..2a70e05
--- /dev/null
+++ b/macros/SURFPoints.bin
Binary files differ
diff --git a/macros/SURFPoints.sci b/macros/SURFPoints.sci
new file mode 100644
index 0000000..ac305d1
--- /dev/null
+++ b/macros/SURFPoints.sci
@@ -0,0 +1,33 @@
+function varargout=SURFPoints(varargin)
+// This function returns a SURFPoints struct for storing SURF interest points.
+//
+// Calling Sequence
+// myStruct = SURFPoints(Location of Interest Points)
+//
+// Parameters
+// results: SURFPoints struct which contains Location, Orientation, Metric, SignOfLaplacian, Scale and Count.
+// Location: Location of Interest Point.
+//
+// Description
+// This function returns a SURFPoints struct with default values.
+//
+// Examples
+// image = imread('sample.jpg');
+// results = detectSURFFeatures(image);
+// myStruct = SURFPoints(results.KeyPoints);
+//
+// Authors
+// Shashank Shekhar
+ [lhs rhs]=argn(0);
+ if lhs<1 then
+ error(msprintf(" Not enough output arguments. One expected"))
+ elseif lhs>1 then
+ error(msprintf(" Too many output arguments. One expected"))
+ end
+ if rhs>1 then
+ error(msprintf(" Too many input arguments. One expected"))
+ end
+ [a b c d e f] = ocv_SURFPoints(varargin(1));
+ varargout(1) = struct('KeyPoints', a, 'Orientation', b, 'Metric', c ,'SignOfLaplacian', d,'Scale', e, 'Count', f );
+endfunction
+
diff --git a/macros/TemplateMatcher.bin b/macros/TemplateMatcher.bin
new file mode 100644
index 0000000..2c72f06
--- /dev/null
+++ b/macros/TemplateMatcher.bin
Binary files differ
diff --git a/macros/TemplateMatcher.sci b/macros/TemplateMatcher.sci
new file mode 100644
index 0000000..d5e60d8
--- /dev/null
+++ b/macros/TemplateMatcher.sci
@@ -0,0 +1,60 @@
+function new_image = TemplateMatcher(image, template_image, varargin)
+// Compares a template in overlapped image regions
+//
+// Calling Sequence
+// newimage = TemplateMatcher(image, template_image)
+//
+// Parameters
+// image : 8-bit or 32-bit floating image
+// template_image : Searched template. It must not be greater than the source image and have the same data type of input image.
+// newimage : Map of comparison results. It must be single channel 32-bit floating-point. Its size is (W-w+1) * (H-h+1) if image is W * H and template_image is w * h
+//
+// Description
+// The function compares the w * h sized images of the original image against the template image and stores the result in the new_image.
+//
+// Examples
+// I = imread('cameraman.tif');
+// Igray = rgb2gray(I);
+// T = Igray(20:75, 90:135);
+// J = TemplateImage(I, T);
+// imshow(J);
+//
+// Authors
+// Suraj Prakash
+
+
+ [ lhs rhs ] = argn(0)
+ if lhs > 1 then
+ error(msprintf("Too many output argument"))
+ end
+
+ if rhs > 2 then
+ error(msprintf("Too many input arguments"))
+ end
+
+ [imagerows imagecols imagechannel] = size(image)
+ [t_rows t_cols t_channel] = size(template_image)
+ if t_rows > imagerows | t_cols > imagecols then
+ error(msprintf("Template image is greater than image\n"))
+ end
+
+ image_list = mattolist(image)
+ template_image_list = mattolist(template_image)
+
+ if rhs == 2 then
+
+ temp = opencv_TemplateMatcher(image_list, template_image_list)
+
+ elseif rhs == 3 then
+
+ temp = opencv_TemplateMatcher(image_list, template_image_list, varargin(1))
+
+ end
+
+ sz = size(temp)
+
+ for i=1 : sz
+ new_image(:, :, i) = temp(i)
+ end
+
+endfunction
diff --git a/macros/VideoReader.bin b/macros/VideoReader.bin
new file mode 100644
index 0000000..54b4800
--- /dev/null
+++ b/macros/VideoReader.bin
Binary files differ
diff --git a/macros/VideoReader.sci b/macros/VideoReader.sci
new file mode 100644
index 0000000..b9ecb76
--- /dev/null
+++ b/macros/VideoReader.sci
@@ -0,0 +1,37 @@
+function[varargout] = VideoReader(varargin)
+// This function creates a SURFPoints struct, needed to read Video Files.
+//
+// Calling Sequence
+// result = VideoReader(filename)
+// result = VideoReader(filename, Name, Value)
+//
+// Parameters
+// results: VideoReader Struct containing Name, Duration, FramesPerSecond, CurrentTime, FramesCount, Width, Height and Path.
+// filename: name of the video file
+// CurrentTime : (optional) The timestamp of video in seconds from the beginning of the video.
+//
+// Description
+// This function returns a VideoReader struct with the properties of the video
+//
+// Examples
+// videoStruct = VideoReader('sample.mp4');
+//
+// Authors
+// Shashank Shekhar
+// Tanmay Chaudhari
+ [lhs, rhs] = argn(0)
+ if rhs>3 then
+ error(msprintf(" Too many input arguments. One expected"))
+ end
+ if lhs>1 then
+ error(msprintf(" Too many output arguments. One expected"))
+ end
+
+ if rhs==3 then
+ [FileName, duration, fps, currentTime, frames, width, height, fullPath] = ocv_VideoReader(varargin(1), varargin(2), varargin(3));
+ else
+ [FileName, duration, fps, currentTime, frames, width, height, fullPath] = ocv_VideoReader(varargin(1));
+ end
+
+ varargout(1) = struct('Filename', FileName, 'Duration', duration, 'FramesPerSecond', fps, 'CurrentTime', currentTime, 'FramesCount', frames, 'Width', width, 'Height', height, "Path", fullPath);
+endfunction
diff --git a/macros/adapthisteq.bin b/macros/adapthisteq.bin
new file mode 100644
index 0000000..c88934e
--- /dev/null
+++ b/macros/adapthisteq.bin
Binary files differ
diff --git a/macros/adapthisteq.sci b/macros/adapthisteq.sci
new file mode 100644
index 0000000..7d9f17f
--- /dev/null
+++ b/macros/adapthisteq.sci
@@ -0,0 +1,16 @@
+function [outputImg]=adapthisteq(inputImage,varargin)
+ [lhs rhs]=argn(0);
+ if rhs>2
+ error(msprintf(" Too many input arguments"));
+ end
+ inputList=mattolist(inputImage);
+ select rhs
+ case 1 then
+ outputList=opencv_adapthisteq(inputList);
+ case 2 then
+ outputList=opencv_adapthisteq(inputList,varargin(1));
+ end
+ for i=1:size(outputList)
+ outputImg(:,:,i)=outputList(i)
+ end
+endfunction
diff --git a/macros/affine2d.bin b/macros/affine2d.bin
new file mode 100644
index 0000000..9c079b7
--- /dev/null
+++ b/macros/affine2d.bin
Binary files differ
diff --git a/macros/affine2d.sci b/macros/affine2d.sci
new file mode 100644
index 0000000..d0078cd
--- /dev/null
+++ b/macros/affine2d.sci
@@ -0,0 +1,12 @@
+function tform = affine2d(image)
+
+ image_list = mattolist(image)
+
+ out = opencv_affine2d(image_list)
+
+ sz = size(out)
+ for i=1:sz
+ tform(:, :, i) = out(i)
+ end
+
+endfunction
diff --git a/macros/approxpolyDP.bin b/macros/approxpolyDP.bin
new file mode 100644
index 0000000..04079f1
--- /dev/null
+++ b/macros/approxpolyDP.bin
Binary files differ
diff --git a/macros/approxpolyDP.sci b/macros/approxpolyDP.sci
new file mode 100644
index 0000000..616febe
--- /dev/null
+++ b/macros/approxpolyDP.sci
@@ -0,0 +1,5 @@
+function output_curve = approxpolyDP(input_curve, epsilon, closed)
+
+ output_curve = opencv_approxpolyDP(input_curve, epsilon, closed)
+
+endfunction
diff --git a/macros/arclength.bin b/macros/arclength.bin
new file mode 100644
index 0000000..8a8c97d
--- /dev/null
+++ b/macros/arclength.bin
Binary files differ
diff --git a/macros/arclength.sci b/macros/arclength.sci
new file mode 100644
index 0000000..88b1480
--- /dev/null
+++ b/macros/arclength.sci
@@ -0,0 +1,5 @@
+function result = arclength(input_curve, closed)
+
+ result = opencv_arclength(input_curve, closed)
+
+endfunction
diff --git a/macros/arrowedline.bin b/macros/arrowedline.bin
new file mode 100644
index 0000000..2ecfabf
--- /dev/null
+++ b/macros/arrowedline.bin
Binary files differ
diff --git a/macros/arrowedline.sci b/macros/arrowedline.sci
new file mode 100644
index 0000000..efbe94e
--- /dev/null
+++ b/macros/arrowedline.sci
@@ -0,0 +1,25 @@
+function[dstImg] = arrowedline(srcImg, x1, y1, x2, y2, R, G, B, varargin)
+
+ [lhs, rhs] = argn(0)
+
+ srcMat = mattolist(srcImg)
+
+ select rhs
+ case 8 then
+ out = arrowedline(srcMat, x1, y1, x2, y2, R, G, B)
+ case 9 then
+ out = arrowedline(srcMat, x1, y1, x2, y2, R, G, B,varargin(1))
+ case 10 then
+ out = arrowedline(srcMat, x1, y1, x2, y2, R, G, B, varargin(1),varargin(2))
+ case 11 then
+ out = arrowedline(srcMat, x1, y1, x2, y2, R, G, B, varargin(1),varargin(2), varargin(3))
+ case 12 then
+ out = 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(:,:,1) = out(1)
+ end
+endfunction
diff --git a/macros/autoCorrelator.bin b/macros/autoCorrelator.bin
new file mode 100644
index 0000000..7475f1e
--- /dev/null
+++ b/macros/autoCorrelator.bin
Binary files differ
diff --git a/macros/autoCorrelator.sci b/macros/autoCorrelator.sci
new file mode 100644
index 0000000..991b903
--- /dev/null
+++ b/macros/autoCorrelator.sci
@@ -0,0 +1,46 @@
+function relation = autoCorrelator(inputMatrix)
+//Calculate 2-D auto correlation of input matrix
+//
+//Calling Sequence
+// relation=autoCorrelator(inputMatrix)
+//
+//Parameters
+// inputMatrix: input matrix to calculate auto correlation
+//
+//Description
+//This function computes 2-D auto correlation of input matrix
+//
+// Examples
+// rel = autoCorrelator([3 1;2 4]) // examples of use
+
+ [lhs rhs]=argn(0);
+ if rhs<1 then
+ error(msprintf("Wrong arguments: Need atleast one argument"))
+ end
+ [r,c,channels] = size(inputMatrix);
+ if channels<> 1 then
+ error(msprintf("Auto correlator function do not support more than two dimensions"))
+ elseif type(inputMatrix)<> 1
+ error(msprintf("Auto correlator function do not support input type %s",typeof(inputMatrix)))
+ end
+ Rep = zeros(r + r*2-2, c + c*2-2);
+ for x = r : r+r-1
+ for y = c : c+c-1
+ Rep(x,y) = inputMatrix(x-r+1, y-c+1);
+ end
+ end
+ conjMatrix=conj(inputMatrix);
+ //(mROw,mCols)- It indicates middle value of the output matrix
+ relation = zeros(r+r-1,c+c-1); //output matrix
+ //calculating only half of the output matrix
+ for x = 1 : r+r-1
+ for y = 1 : c+c-1
+ for i = 1 : r
+ for j = 1 : c
+ relation(x, y) = relation(x, y) + (Rep(x+i-1, y+j-1) * conjMatrix(i, j));
+ end
+ end
+ end
+ end
+ //Copying remainig values
+endfunction
diff --git a/macros/bagOfFeatures.bin b/macros/bagOfFeatures.bin
new file mode 100644
index 0000000..9d54678
--- /dev/null
+++ b/macros/bagOfFeatures.bin
Binary files differ
diff --git a/macros/bagOfFeatures.sci b/macros/bagOfFeatures.sci
new file mode 100644
index 0000000..480d775
--- /dev/null
+++ b/macros/bagOfFeatures.sci
@@ -0,0 +1,50 @@
+function [bag]=bagOfFeatures(imageSet,varargin)
+// This function is used to create a Bag-of-Words model (BoW model).
+//
+// Calling Sequence
+// bag = bagOfFeatures(imgSet);
+// bag = bagOfFeatures(imgSet, Name, Value, ...);
+//
+// Parameters
+// bag: Bag of visual words
+// imgSet: An imageSet structure
+// VocabularySize: (Optional) Number of visual words (Default- 500)
+// StrongestFeatures: (Optional) Fraction of strongest features (Default- 1.0)
+// Upright: (Optional) Orientation of SURF feature vector (Default- true)
+// Verbose: (Optional) Enable progress display to screen (Default- true)
+//
+// Description
+// BoW model is applied to classify images by treating image features as words. The bagOfFeatures object contains a bag of visual words that help in image classification.
+//
+// Examples
+// imgSet = imageSet(directory,'recursive');
+// [trainingSet testSet] = partition(imgSet,[0.8]);
+// bag = bagOfFeatures(trainingSet);
+//
+// Authors
+// Rohit Suri
+// Umang Agrawal
+
+ [lhs rhs]=argn(0);
+ if lhs>1
+ error(msprintf(" Too many output arguments"));
+ elseif rhs<1
+ error(msprintf("At least one argument is required"));
+ elseif rhs>9
+ error(msprintf(" Too many input arguments"));
+ end
+ imageSetList=imageSetToList(imageSet);
+ select rhs
+ case 1 then
+ bagList=opencv_bagOfFeatures(imageSetList);
+ case 3 then
+ bagList=opencv_bagOfFeatures(imageSetList,varargin(1),varargin(2));
+ case 5 then
+ bagList=opencv_bagOfFeatures(imageSetList,varargin(1),varargin(2),varargin(3),varargin(4));
+ case 7 then
+ bagList=opencv_bagOfFeatures(imageSetList,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6));
+ case 9 then
+ bagList=opencv_bagOfFeatures(imageSetList,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6),varargin(7),varargin(8));
+ end
+ bag=struct('FilePath',bagList(2)(1,1),'VocabularySize',bagList(3)(1,1),'StrongestFeatures',bagList(4)(1,1),'Upright',bagList(5)(1,1));
+endfunction
diff --git a/macros/bagStructToList.bin b/macros/bagStructToList.bin
new file mode 100644
index 0000000..8733a0c
--- /dev/null
+++ b/macros/bagStructToList.bin
Binary files differ
diff --git a/macros/bagStructToList.sci b/macros/bagStructToList.sci
new file mode 100644
index 0000000..6ac8c67
--- /dev/null
+++ b/macros/bagStructToList.sci
@@ -0,0 +1,16 @@
+function bagList=bagStructToList(bag)
+ if isstruct(bag)<> %T then
+ error(msprintf("Error: The input argument is not of type bagOfFeatures."));
+ end
+ fieldNamesActual=["FilePath";"VocabularySize";"StrongestFeatures";"Upright"];
+ fieldNamesInput=fieldnames(bag);
+ if fieldNamesActual <> fieldNamesInput then
+ error(msprintf("Error: The input argument is not of type bagOfFeatures, Wrong field names"));
+ end
+ bagList=list();
+ bagList(1)='bagOfFeatures';
+ bagList(2)=bag.FilePath;
+ bagList(3)=bag.VocabularySize;
+ bagList(4)=bag.StrongestFeatures;
+ bagList(5)=bag.Upright;
+endfunction
diff --git a/macros/bbox2points.bin b/macros/bbox2points.bin
new file mode 100644
index 0000000..d848915
--- /dev/null
+++ b/macros/bbox2points.bin
Binary files differ
diff --git a/macros/bbox2points.sci b/macros/bbox2points.sci
new file mode 100644
index 0000000..ca58841
--- /dev/null
+++ b/macros/bbox2points.sci
@@ -0,0 +1,24 @@
+function [ bbox ] = bbox2points(rectangle)
+// Returns list of corner points of a rectangle.
+//
+// Calling Sequence
+// bbox = bbox2points(rectangle);
+//
+// Parameters
+// rectangle: A Nx4 matrix where each row is a rectangle of the form [x, y, width, height];
+// points: Returns 4x2xN size matrix which contains all the 4 co-ordinates of each of the N bounding boxes.
+//
+// Description
+// List of corner points of a rectangle.
+//
+// Examples
+// bbox = [1 2 3 4; 5 6 7 8];
+// results = bbox2points(bbox);
+//
+// Authors
+// Tanmay Chaudhari
+
+ a=opencv_bbox2points(rectangle);
+ out(:,:,1)=a(1);
+
+endfunction
diff --git a/macros/bboxOverlapRatio.bin b/macros/bboxOverlapRatio.bin
new file mode 100644
index 0000000..e52928a
--- /dev/null
+++ b/macros/bboxOverlapRatio.bin
Binary files differ
diff --git a/macros/bboxOverlapRatio.sci b/macros/bboxOverlapRatio.sci
new file mode 100644
index 0000000..682b8c8
--- /dev/null
+++ b/macros/bboxOverlapRatio.sci
@@ -0,0 +1,37 @@
+function [ overlapRatio ] = bboxOverlapRatio(bboxA, bboxB, ratioType)
+// 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);
+//
+// Authors
+// Tanmay Chaudhari
+
+ [lhs rhs] = argn(0)
+ if rhs>3 then
+ error(msprintf("Too many input arguments"))
+ elseif rhs==3 then
+ a=opencv_bboxOverlapRatio(input1,input2,varargin(1))
+ out=a
+ elseif rhs==2 then
+ a=opencv_bboxOverlapRatio(input1,input2)
+ out=a
+ end
+
+endfunction
diff --git a/macros/bilateralFilter.bin b/macros/bilateralFilter.bin
new file mode 100644
index 0000000..c824f64
--- /dev/null
+++ b/macros/bilateralFilter.bin
Binary files differ
diff --git a/macros/bilateralFilter.sci b/macros/bilateralFilter.sci
new file mode 100644
index 0000000..c686363
--- /dev/null
+++ b/macros/bilateralFilter.sci
@@ -0,0 +1,13 @@
+function new_image = bilateralFilter(image, d, sigmaColor, sigmaSpace)
+
+ image_list = mattolist(image)
+
+ out = opencv_bilateralFilter(image_list, d, sigmaColor, sigmaSpace)
+
+ sz = size(out)
+
+ for i = 1: sz
+ new_image(:, :, i) = out(i)
+ end
+
+endfunction
diff --git a/macros/binaryFeatures.bin b/macros/binaryFeatures.bin
new file mode 100644
index 0000000..ec5b6c5
--- /dev/null
+++ b/macros/binaryFeatures.bin
Binary files differ
diff --git a/macros/binaryFeatures.sci b/macros/binaryFeatures.sci
new file mode 100644
index 0000000..bd009c9
--- /dev/null
+++ b/macros/binaryFeatures.sci
@@ -0,0 +1,34 @@
+function [features]=binaryFeatures(featureVectors)
+// Object for storing Feature Vectors
+//
+// Calling Sequence
+// features = binaryFeatures(featureVector);
+//
+// Parameters
+// featureVector: M-by-N matrix consisting of M features stored in N uint8 containers
+// features: Binary Feature object for the extracted Features
+//
+// Description
+// This object provides the ability to pass data between extractFeatures and matchFeatures function
+//
+// Examples
+// image_1 = imread('sample1.jpg');
+// points_1 = detectFASTFeatures(image_1);
+// [ f1 vpts_1 ] = extractFeatures(image_1, points_1);
+// features1 = binaryFeatures(f1);
+//
+// Authors
+// Umang Agrawal
+// Sridhar Reddy
+
+ [lhs rhs]=argn(0);
+ if lhs>1
+ error(msprintf(" Too many output arguments"));
+ elseif rhs>1
+ error(msprintf(" Too many input arguments"));
+ elseif inttype(featureVectors) <> 11 then
+ error(msprintf("wrong argument #%d: FeatureVectors must be uint8",1));
+ end
+ [rows cols]=size(featureVectors);
+ features=struct('Type','binaryFeatures','Features',featureVectors,'NumBits',cols*8,'NumFeatures',rows);
+endfunction
diff --git a/macros/blobAnalysis.bin b/macros/blobAnalysis.bin
new file mode 100644
index 0000000..07e0889
--- /dev/null
+++ b/macros/blobAnalysis.bin
Binary files differ
diff --git a/macros/blobAnalysis.sci b/macros/blobAnalysis.sci
new file mode 100644
index 0000000..216ab7e
--- /dev/null
+++ b/macros/blobAnalysis.sci
@@ -0,0 +1,103 @@
+function [blob] = blobAnalysis(srcImg, varargin)
+// Detects blob in the source image
+//
+// Calling Sequence
+// [blob] = blobAnalysis(srcImg)
+// [blob] = blobAnalysis(srcImg, Name, Value)
+//
+// Parameters
+// srcImg: The input image Matrix
+// Name: filteration method
+// Value: filteration method constraints, [1X2] vector
+// blob: stores different parameters of the blob
+//
+// Description
+// The function uses SimpleBlobDetector function to detect the blobs then it checks for different Name Value pair arguments and accordingly returns the parameters of the blob such as 2D coordinates of the blob, size of the blob.
+//
+// The Name-Value pair may be any of following types :-
+// <itemizedlist>
+// <listitem><para>bool filterByArea, vector [minArea maxArea]</para></listitem>
+// <listitem><para>bool filterByCircularity, vector [minCircularity maxCircularity]</para></listitem>
+// <listitem><para>bool filterByConvexity, vector [minConvexity maxConvexity]</para></listitem>
+// <listitem><para>bool filterByThreshold, vector [minThreshold maxThreshold]</para></listitem>
+// </itemizedlist>
+//
+// Examples
+// [srcImg] = imread('blobdetection.jpg');
+// [blob] = blobAnalysis(srcImg);
+// [blob] = blobAnalysis(srcImg, "filterByArea", [0.01 1]);
+//
+// Authors
+// Deepshikha
+
+[lhs,rhs] = argn(0)
+
+ // To check the number of input and output arguments
+
+ if rhs<1 then
+ error(msprintf(" Not enough input arguments"))
+ elseif rhs>10 then
+ error(msprintf(" Too many input arguments to the function"))
+ elseif lhs<1 then
+ error(msprintf(" Not enough output arguments"))
+ elseif lhs>1 then
+ error(msprintf(" Too many output arguments"))
+ end
+
+ srcMat = mattolist(srcImg)
+
+ if modulo(rhs,2) == 0 then
+ error(msprintf("Number of input arguments must be odd"))
+ end
+
+ select rhs
+ case 1 then
+ output = opencv_blobAnalysis(srcMat)
+
+ case 3 then
+ if typeof(varargin(1))<> "string"
+ error(msprintf("argument at position 2 must be string"))
+ end
+ output = opencv_blobAnalysis(srcMat, varargin(1), varargin(2))
+
+ case 5 then
+ if typeof(varargin(1))<> "string"
+ error(msprintf("argument at position 2 must be string"))
+ end
+ if typeof(varargin(3))<> "string"
+ error(msprintf("argument at position 4 must be string"))
+ end
+ output = opencv_blobAnalysis(srcMat, varargin(1), varargin(2), varargin(3), varargin(4))
+
+ case 7 then
+ if typeof(varargin(1))<> "string"
+ error(msprintf("argument at position 2 must be string"))
+ end
+ if typeof(varargin(3))<> "string"
+ error(msprintf("argument at position 4 must be string"))
+ end
+ if typeof(varargin(5))<> "string"
+ error(msprintf("argument at position 6 must be string"))
+ end
+ output = opencv_blobAnalysis(srcMat, varargin(1), varargin(2), varargin(3), varargin(4), varargin(5), varargin(6))
+
+ case 9 then
+ if typeof(varargin(1))<> "string"
+ error(msprintf("argument at position 2 must be string"))
+ end
+ if typeof(varargin(3))<> "string"
+ error(msprintf("argument at position 4 must be string"))
+ end
+ if typeof(varargin(5))<> "string"
+ error(msprintf("argument at position 6 must be string"))
+ end
+ if typeof(varargin(7))<> "string"
+ error(msprintf("argument at position 8 must be string"))
+ end
+ output = opencv_blobAnalysis(srcMat, varargin(1), varargin(2), varargin(3), varargin(4), varargin(5), varargin(6), varargin(7), varargin(8))
+ end
+
+ blob = struct("Points", output(1), "Size", output(2))
+
+endfunction
+
diff --git a/macros/blur.bin b/macros/blur.bin
new file mode 100644
index 0000000..789ec51
--- /dev/null
+++ b/macros/blur.bin
Binary files differ
diff --git a/macros/blur.sci b/macros/blur.sci
new file mode 100644
index 0000000..4b3bcd0
--- /dev/null
+++ b/macros/blur.sci
@@ -0,0 +1,9 @@
+function [out]=blur(input_image ,ksize_width,ksize_height,anchorX,anchorY)
+ input_image1=mattolist(input_image);
+ a=opencv_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/borderInterpolate.bin b/macros/borderInterpolate.bin
new file mode 100644
index 0000000..138900b
--- /dev/null
+++ b/macros/borderInterpolate.bin
Binary files differ
diff --git a/macros/borderInterpolate.sci b/macros/borderInterpolate.sci
new file mode 100644
index 0000000..1f9323d
--- /dev/null
+++ b/macros/borderInterpolate.sci
@@ -0,0 +1,6 @@
+
+function result = borderInterpolate(p, len, borderType)
+
+ result = opencv_borderInterpolate(p, len, borderType)
+
+endfunction
diff --git a/macros/boundingRect.bin b/macros/boundingRect.bin
new file mode 100644
index 0000000..7c2fd69
--- /dev/null
+++ b/macros/boundingRect.bin
Binary files differ
diff --git a/macros/boundingRect.sci b/macros/boundingRect.sci
new file mode 100644
index 0000000..9c8e882
--- /dev/null
+++ b/macros/boundingRect.sci
@@ -0,0 +1,3 @@
+function [rectMat]=boundingRect(points)
+ rectMat=opencv_boundingRect(points);
+endfunction
diff --git a/macros/boxfilter.bin b/macros/boxfilter.bin
new file mode 100644
index 0000000..099d375
--- /dev/null
+++ b/macros/boxfilter.bin
Binary files differ
diff --git a/macros/boxfilter.sci b/macros/boxfilter.sci
new file mode 100644
index 0000000..a29f3a5
--- /dev/null
+++ b/macros/boxfilter.sci
@@ -0,0 +1,9 @@
+function [out]=boxfilter(InputArraysrc, intddepth,size1x,size1y,pointx,pointy, bool_normalize)
+ input_image1=mattolist(InputArraysrc);
+ a=opencv_boxfilter(input_image1, intddepth,size1x,size1y,pointx,pointy, bool_normalize);
+ dimension=size(a)
+ for i = 1:dimension
+ out(:,:,i)=a(i);
+ end
+
+endfunction;
diff --git a/macros/buildmacros.sce b/macros/buildmacros.sce
new file mode 100644
index 0000000..b4c63c7
--- /dev/null
+++ b/macros/buildmacros.sce
@@ -0,0 +1,2 @@
+tbx_build_macros("Image",get_absolute_file_path("buildmacros.sce"));
+clear tbx_build_macros;
diff --git a/macros/bundleAdjustment.bin b/macros/bundleAdjustment.bin
new file mode 100644
index 0000000..628938e
--- /dev/null
+++ b/macros/bundleAdjustment.bin
Binary files differ
diff --git a/macros/bundleAdjustment.sci b/macros/bundleAdjustment.sci
new file mode 100644
index 0000000..73d0ca4
--- /dev/null
+++ b/macros/bundleAdjustment.sci
@@ -0,0 +1,29 @@
+function xyzrefinedPoints = bundleAdjustment(_3dpoints, imagepoints, visibility, cameramatrix, rotation, translation, distcoeffs)
+// Refine camera poses and 3-d points
+//
+// Calling Sequence
+// xyzrefinedPoints = bundleAdjustment(_3dpoints, imagepoints, visibility, cameramatrix, rotation, translation, distcoeffs)
+//
+// Parameters
+// _3dpoints : N * 3 object points
+// imagepoints : M * N * 2 image points for each camera and each points
+// visibility : M * N * 1 visibility matrix, element[i][j] = 1 when object point i is visible from camera j and 0 if not
+// cameramatrix : M * 3 * 3 camera matrix(intrinsic parameters) 3 * 3 camera matrix for each image
+// rotation : M * 3 * 3 rotation matrix for each image
+// translation : M * 3 * 1 translation matrix for each image
+// distcoeffs : M * (4 * 5 * 8) * 1 distortion coefficient for each image
+// xyzrefinedPoints : Refined N * 3 object points
+//
+// Description
+// The function returns the refined 3-D points. The refinement procedure uses Levenberg-Marquardt algorithm.
+//
+// Examples
+// xyzrefinedPoints = bundleAdjustment(_3dpoints, imagepoints, visibility, cameramatrix, rotation, translation, distcoeffs)
+//
+// Authors
+// Suraj Prakash
+
+
+ xyzrefinedPoints = opencv_bundleAdjustment(_3dpoints, imagepoints, visibility, cameramatrix, rotation, translation, distcoeffs)
+
+endfunction
diff --git a/macros/bwlookup.bin b/macros/bwlookup.bin
new file mode 100644
index 0000000..0051716
--- /dev/null
+++ b/macros/bwlookup.bin
Binary files differ
diff --git a/macros/bwlookup.sci b/macros/bwlookup.sci
new file mode 100644
index 0000000..5ab8f66
--- /dev/null
+++ b/macros/bwlookup.sci
@@ -0,0 +1,8 @@
+function [out]=bwlookup(image,lut)
+ image1=mattolist(image);
+ a=opencv_bwlookup(image1,lut);
+ dimension=size(a)
+ for i = 1:dimension
+ out(:,:,i)=a(i);
+ end
+endfunction;
diff --git a/macros/bwulterode.bin b/macros/bwulterode.bin
new file mode 100644
index 0000000..3c985a5
--- /dev/null
+++ b/macros/bwulterode.bin
Binary files differ
diff --git a/macros/bwulterode.sci b/macros/bwulterode.sci
new file mode 100644
index 0000000..501c50d
--- /dev/null
+++ b/macros/bwulterode.sci
@@ -0,0 +1,13 @@
+function[dstImg] = bwulterode(srcImg)
+
+ srcMat = mattolist(srcImg)
+
+ out = opencv_bwulterode(srcMat)
+
+ channels = size(out)
+
+ for i = 1:channels
+ dstImg(:,:,i) = out(i)
+ end
+
+endfunction
diff --git a/macros/cameraMatrix.bin b/macros/cameraMatrix.bin
new file mode 100644
index 0000000..baea024
--- /dev/null
+++ b/macros/cameraMatrix.bin
Binary files differ
diff --git a/macros/cameraMatrix.sci b/macros/cameraMatrix.sci
new file mode 100644
index 0000000..de177c9
--- /dev/null
+++ b/macros/cameraMatrix.sci
@@ -0,0 +1,28 @@
+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=opencv_cameraMatrix(instrinsicMatrix,rotationMatrix,translationVector);
+ camMatrix(:,:,1)=a(1);
+
+endfunction
diff --git a/macros/cameraParameters.bin b/macros/cameraParameters.bin
new file mode 100644
index 0000000..bd05ac5
--- /dev/null
+++ b/macros/cameraParameters.bin
Binary files differ
diff --git a/macros/cameraParameters.sci b/macros/cameraParameters.sci
new file mode 100644
index 0000000..9d2d131
--- /dev/null
+++ b/macros/cameraParameters.sci
@@ -0,0 +1,242 @@
+function varargout=cameraParameters(varargin)
+// It returns the cameraParameters structure
+//
+// Calling Sequence
+// cameraParams=cameraParameters(Name,value);
+//
+// Parameters
+// IntrinsicMatrix: 3-by-3 matrix, it specifies the principal point, skew and focal length. Default- 3-by-3 identity matrix
+// RadialDistortion: 2 or 3 element vector. Default- [0 0 0]
+// TangentialDistortion: 2 element vector. Default- [0 0]
+// RotationVectors: P-by-3 matrix. Each row of the matrix represents 3-D rotation of the camera. Default- []
+// TranslationVectors: P-by-3 matrix. Each row of the matrix represents 3-D translation of the camera. Number of rotation vectors should be equal to number of transation vectors. Default- []
+// WorldPoints: M-by-2 matrix. M indicates the number of keypoints. Default- []
+// WorldUnits: Unit of measure of world points. Default- "mm"
+// EstimateSkew: logical scalar. Default- %F
+// NumRadialDistortionCoefficients: 2 or 3. Default- 2
+// EstimateTangentialDistortion: logical scalar. Default- %F
+// ReprojectionErrors: M-by-2-p array. Number of channels must be equal to number of rotation vectors and number of rows should be equal to number of world points. Default-[]
+//
+// Description
+// This function creates cameraParameters struct based on the arguments provided. The struct contains intrinsic, extrinsic, estimation and lens properties.
+//
+// Examples
+// cameraParms=cameraParams("IntrinsicMatrix", [2 0 0; 0 3 0;4 5 1]);
+// Output:
+// IntrinsicMatrix: [3x3 constant]
+// PrincipalPoint: [4,5]
+// FocalLength: [2,3]
+// Skew: 0
+// RadialDistortion: [0,0,0]
+// TangentialDistortion: [0,0]
+// RotationMatrices: [0x0 constant]
+// RotationVectors: [0x0 constant]
+// TranslationVectors: [0x0 constant]
+// meanReprojectionError: 0
+// ReprojectionErrors: [0x0 constant]
+// ReprojectedPoints: [0x0 constant]
+// NumPatterns: 0
+// WorldPoints: [0x0 constant]
+// WorldUnits: "mm"
+// EstimateSkew: 0
+// NumRadialDistortionCoefficients: 2
+// EstimateTangentialDistortion: 0
+
+ [lhs rhs]=argn(0);
+ if lhs<1 then
+ error(msprintf(" Not enough output arguments"))
+ elseif lhs>1 then
+ error(msprintf(" Too many output arguments to the function"))
+ end
+
+ //default values
+ IntrinsicMatrix=[1 0 0;0 1 0;0 0 1];
+ RadialDistortion=[0 0 0];
+ TangentialDistortion=[0 0];
+ RotationVectors=[];
+ TranslationVectors=[];
+ WorldPoints=[];
+ WorldUnits='mm';
+ EstimateSkew=0;
+ NumRadialDistortionCoefficients=2;
+ EstimateTangentialDistortion=0;
+ ReprojectionErrors=[];
+
+ imRows=0,imCols=0;
+ rdRows=0,rdCols=0;
+ tdRows=0,tdCols=0;
+ rvRows=0,rvCols=0;
+ tvRows=0,tvCols=0;
+ wpRows=0,wpCols=0;
+
+ if modulo(rhs,2) then
+ error(msprintf(" Wrong number of input arguments"));
+ end
+
+ for i=1:2:rhs
+ if strcmpi(varargin(i),"IntrinsicMatrix")==0 then
+ i=i+1;
+ IntrinsicMatrix=varargin(i);
+ [imRows imCols]=size(IntrinsicMatrix);
+ if ~imRows==3 | ~imCols==3 then
+ error(msprintf(" wrong value for the input argument %d, IntrinsicMatrix must be 3*3",i))
+ end
+
+ elseif strcmpi(varargin(i),'RadialDistortion')==0 then
+ i=i+1;
+ RadialDistortion=varargin(i);
+ [rdRows rdCols]=size(RadialDistortion);
+ if ~rdRows==1 | (~rdCols==2 & ~rdCols==3) then
+ error(msprintf(" wrong value for the input argument %d, RadialDistortion must be a vector with 2 or 3 elements",i))
+ end
+
+ elseif strcmpi(varargin(i),'TangentialDistortion')==0 then
+ i=i+1;
+ TangentialDistortion=varargin(i);
+ [tdRows tdCols]=size(TangentialDistortion);
+ if ~tdRows==1 | ~tdCols==2 then
+ error(msprintf(" wrong value for the input argument %d, TangentialDistortion must be 2-element vector",i))
+ end
+
+ elseif strcmpi(varargin(i),'RotationVectors')==0 then
+ i=i+1;
+ RotationVectors=varargin(i);
+ [rvRows rvCols]=size(RotationVectors);
+ if ~rvCols==3 then
+ error(msprintf(" wrong value for the input argument %d, RotationVectors must be M*3",i))
+ end
+
+ elseif strcmpi(varargin(i),'TranslationVectors')==0 then
+ i=i+1;
+ TranslationVectors=varargin(i);
+ [tvRows tvCols]=size(TranslationVectors);
+ if ~tvCols==3 then
+ error(msprintf(" wrong value for the input argument %d, TranslationVectors must be M*3",i))
+ end
+
+ elseif strcmpi(varargin(i),'WorldPoints')==0 then
+ i=i+1;
+ WorldPoints=varargin(i);
+ [wpRows wpCols]=size(WorldPoints);
+ if ~wpCols==2 then
+ error(msprintf(" wrong value for the input argument %d, WorldPoints must be M*2",i))
+ end
+
+ elseif strcmpi(varargin(i),'WorldUnits')==0 then
+ i=i+1;
+ WorldUnits=varargin(i);
+ if ~typeof(WorldUnits)=='string'
+ error(msprintf(" wrong value for the input argument %d, WorldUnits must be string",i))
+ end
+
+ elseif strcmpi(varargin(i),'EstimateSkew')==0 then
+ i=i+1;
+ EstimateSkew=varargin(i);
+ if EstimateSkew==%T
+ EstimateSkew=1;
+ elseif EstimateSkew==%F
+ EstimateSkew=0;
+ else
+ error(msprintf(" wrong value for the input argument %d,EstimateSkew must be logical scalar",i))
+ end
+
+ elseif strcmpi(varargin(i),'NumRadialDistortionCoefficients')==0 then
+ i=i+1;
+ NumRadialDistortionCoefficients=varargin(i);
+ if ~(NumRadialDistortionCoefficients==2 | NumRadialDistortionCoefficients==3) then
+ error(msprintf(" wrong value for the input argument %d, NumRadialDistortionCoefficients must be 2 or 3",i))
+ end
+
+ elseif strcmpi(varargin(i),'EstimateTangentialDistortion')==0 then
+ i=i+1;
+ EstimateTangentialDistortion=varargin(i);
+ EstimateSkew=varargin(i);
+ if EstimateSkew==%T
+ EstimateSkew=1;
+ elseif EstimateSkew==%F
+ EstimateSkew=0;
+ else
+ error(msprintf(" wrong value for the input argument %d, EstimateTangentialDistortion must be logical scalar",i))
+ end
+
+ elseif strcmpi(varargin(i),'ReprojectionErrors')==0 then
+ i=i+1;
+ ReprojectionErrors=varargin(i);
+ [reRows reCols reChannels]=size(ReprojectionErrors);
+ if ~reCols==2 then
+ error(msprintf(" wrong value for the input argument %d, ReprojectionErrors must be M-by-2-by-P array",i))
+ end
+
+ else
+ error(msprintf(" Wrong value for the input argument %d, %s is not a recognised parameter",i,varargin(i)));
+ end
+ end
+
+ if ~rvRows==tvRows then
+ error(msprintf(" wrong value for the input arguments, RotationalVectors and TranslationVectors must be of same size"))
+ end
+ if ~isempty(ReprojectionErrors) then
+ if ~reRows==wpRows then
+ error(msprintf("wrong value for the input arguments, World points and ReprojectctionErrors must contain same number of rows"))
+ end
+ if ~reChannels==rvRows then
+ error(msprintf("wrong value for the input arguments, Number of patterns in ReprojectionErrors and RotationVectors must be of same size"))
+ end
+ end
+
+ RotationMatrices=[]
+ FocalLength=[IntrinsicMatrix(1,1) IntrinsicMatrix(2,2)];
+ PrincipalPoint=[IntrinsicMatrix(3,1) IntrinsicMatrix(3,2)];
+ Skew=IntrinsicMatrix(2,1);
+ for i=1:rvRows
+ RotationVector=RotationVectors(i,:);
+ angle=norm(RotationVector);
+ if angle < %eps
+ RotationMatrices(:,:,i) = eye(3);
+ else
+ n= RotationVector ./ angle;
+ A = [n(1)^2, n(1)*n(2), n(1)*n(3);...
+ n(2)*n(1), n(2)^2, n(2)*n(3);...
+ n(3)*n(1), n(3)*n(2), n(3)^2 ];
+
+ B = [ 0, -n(3), n(2);...
+ n(3), 0, -n(1);...
+ -n(2), n(1), 0 ];
+ RotationMatrices(:,:,i) = eye(3) * cos(angle) + (1 - cos(angle)) * A + sin(angle) * B;
+ end
+ end
+
+ distCoeffs(1,1)=RadialDistortion(1,1);
+ distCoeffs(1,2)=RadialDistortion(1,2);
+ distCoeffs(1,3)=TangentialDistortion(1,1);
+ distCoeffs(1,4)=TangentialDistortion(1,2);
+ if rdCols==3
+ distCoeffs(1,5)=RadiallDistortion(1,3);
+ else
+ distCoeffs(1,5)=0;
+ end
+
+ ReprojectedPoints=[];
+ meanReprojectionError=0;
+ NumPatterns=rvRows;
+ if(WorldPoints <> [])
+ for i=1:NumPatterns
+ ReprojectedPoints(:,:,i)=opencv_projectPoints(WorldPoints,RotationVectors(i,:),TranslationVectors(i,:),IntrinsicMatrix,distCoeffs);
+ end
+ end
+ if ~isempty(ReprojectionErrors) then
+ ImagePoints=ReprojectedPoints-ReprojectionErrors;
+ totalErr=0;
+ for i=1:rvRows
+ err=0;
+ for j=1:wpRows
+ err=err+((ReprojectedPoints(j,1,i)-ImagePoints(j,1,i))+(ReprojectedPoints(j,2,i)-ImagePoints(j,2,i))).^2;
+ end
+ totalErr=totalErr+err;
+ end
+ totalPoints=rvRows*wpRows;
+ meanReprojectionError=sqrt(totalErr/totalPoints);
+ end
+
+ varargout(1)=struct('IntrinsicMatrix',IntrinsicMatrix,'PrincipalPoint',PrincipalPoint,'FocalLength',FocalLength,'Skew',Skew,'RadialDistortion',RadialDistortion,'TangentialDistortion',TangentialDistortion,'RotationMatrices',RotationMatrices,'RotationVectors',RotationVectors,'TranslationVectors',TranslationVectors,'meanReprojectionError',meanReprojectionError,'ReprojectionErrors',ReprojectionErrors,'ReprojectedPoints',ReprojectedPoints,'NumPatterns',NumPatterns,'WorldPoints',WorldPoints,'WorldUnits',WorldUnits,'EstimateSkew',EstimateSkew,'NumRadialDistortionCoefficients',NumRadialDistortionCoefficients,'EstimateTangentialDistortion',EstimateTangentialDistortion);
+endfunction;
diff --git a/macros/canny.bin b/macros/canny.bin
new file mode 100644
index 0000000..f7f0833
--- /dev/null
+++ b/macros/canny.bin
Binary files differ
diff --git a/macros/canny.sci b/macros/canny.sci
new file mode 100644
index 0000000..0cb9ed7
--- /dev/null
+++ b/macros/canny.sci
@@ -0,0 +1,9 @@
+function [out]=canny(input_image ,aperture, threshold1, threshold2, gradient)
+ input_image1=mattolist(input_image);
+ a=opencv_canny(input_image1 , aperture, threshold1, threshold2, gradient);
+ dimension=size(a)
+ for i = 1:dimension
+ out(:,:,i)=a(i);
+ end
+
+endfunction;
diff --git a/macros/checkCCE.bin b/macros/checkCCE.bin
new file mode 100644
index 0000000..18213fb
--- /dev/null
+++ b/macros/checkCCE.bin
Binary files differ
diff --git a/macros/checkCCE.sci b/macros/checkCCE.sci
new file mode 100644
index 0000000..a6396e9
--- /dev/null
+++ b/macros/checkCCE.sci
@@ -0,0 +1,11 @@
+function checkCCE(varargin)
+ errors = varargin(1)
+
+ if ~isfield(errors, 'IntrinsicsErrors' ) | ~isfield(errors, 'ExtrinsicsErrors') then
+ error(msprintf("A CameraCalibrationErrors Struct expected."))
+ end
+
+ checkCIE(errors.IntrinsicsErrors);
+ checkCEE(errors.ExtrinsicsErrors);
+endfunction
+
diff --git a/macros/checkCEE.bin b/macros/checkCEE.bin
new file mode 100644
index 0000000..a22b151
--- /dev/null
+++ b/macros/checkCEE.bin
Binary files differ
diff --git a/macros/checkCEE.sci b/macros/checkCEE.sci
new file mode 100644
index 0000000..bd868ef
--- /dev/null
+++ b/macros/checkCEE.sci
@@ -0,0 +1,22 @@
+function checkCEE(varargin)
+ extErr = varargin(1)
+
+ if ~isfield(extErr, 'RotVectorsError') | ~isfield(extErr, 'TransVectorsError') then
+ error(msprintf("An ExtrinsicsEstimationErrors Struct expected."))
+ end
+
+ rvErr = extErr.RotVectorsError;
+ tvErr = extErr.TransVectorsError;
+
+ if type(rvErr)~=1 | type(tvErr)~=1 | ~isreal(rvErr) | ~isreal(tvErr) then
+ error(msprintf("An ExtrinsicsEstimationErrors Struct expected."))
+ end
+
+ [size11 size12] = size(rvErr);
+ [size11 size12] = size(tvErr);
+
+ if size12~=3 | size11==0 | size11==0 | size12~=3 then
+ error(msprintf("An ExtrinsicsEstimationErrors Struct expected."))
+ end
+
+endfunction
diff --git a/macros/checkCIE.bin b/macros/checkCIE.bin
new file mode 100644
index 0000000..695ba78
--- /dev/null
+++ b/macros/checkCIE.bin
Binary files differ
diff --git a/macros/checkCIE.sci b/macros/checkCIE.sci
new file mode 100644
index 0000000..37cbdbe
--- /dev/null
+++ b/macros/checkCIE.sci
@@ -0,0 +1,27 @@
+function checkCIE(varargin)
+ intErr = varargin(1)
+ if ~isfield(intErr, 'SkewError') | ~isfield(intErr,'FocalLengthError' ) | ~isfield(intErr, 'PrincipalPointError') | ~isfield(intErr, 'RadDistortionError') | ~isfield(intErr, 'TanDistortionError' ) then
+ error(msprintf("An IntrinsicsEstimationErrors Struct expected."))
+ end
+
+ skewErr = intErr.SkewError;
+ flErr = intErr.FocalLengthError;
+ ppErr = intErr.PrincipalPointError;
+ rdErr = intErr.RadDistortionError;
+ tdErr = intErr.TanDistortionError;
+
+ if type(skewErr)~=1 | type(flErr)~=1 | type(ppErr)~=1 | type(rdErr)~=1 | type(tdErr)~=1 | ~isreal(skewErr) | ~isreal(flErr) | ~isreal(ppErr) | ~isreal(rdErr) | ~isreal(tdErr) then
+ error(msprintf("An IntrinsicsEstimationErrors Struct expected."))
+ end
+
+ [size11 size12] = size(skewErr);
+ [size21 size22] = size(flErr);
+ [size31 size32] = size(ppErr);
+ [size41 size42] = size(rdErr);
+ [size51 size52] = size(tdErr);
+
+ if (size11*size12)~=1 | (size21*size22)~=2 | (size31*size32)~=2 | (size41*size42)<2 | (size41*size42)>3 | (size51*size52)~=2 then
+ error(msprintf("An IntrinsicsEstimationErrors Struct expected."))
+ end
+
+endfunction
diff --git a/macros/checkSCE.bin b/macros/checkSCE.bin
new file mode 100644
index 0000000..70b5477
--- /dev/null
+++ b/macros/checkSCE.bin
Binary files differ
diff --git a/macros/checkSCE.sci b/macros/checkSCE.sci
new file mode 100644
index 0000000..eea8fc9
--- /dev/null
+++ b/macros/checkSCE.sci
@@ -0,0 +1,29 @@
+function checkSCE(varargin)
+ stErrors = varargin(1)
+
+ if ~isfield(stErrors,'Camera1IntrinsicsErrors' ) | ~isfield(stErrors,'Camera1ExtrinsicsErrors' ) | ~isfield(stErrors,'Camera2IntrinsicsErrors' ) | ~isfield(stErrors, 'RotationOfCamera2Error' ) | ~isfield(stErrors, 'TransOfCamera2Error') then
+ error(msprintf("A StereoCalibrationErrors struct expected."))
+ end
+
+ cam1intErr = stErrors.Camera1IntrinsicsErrors;
+ cam1extErr = stErrors.Camera1ExtrinsicsErrors;
+ cam2intErr = stErrors.Camera2IntrinsicsErrors;
+
+ checkCIE(cam1intErr);
+ checkCEE(cam1extErr);
+ checkCIE(cam2intErr);
+ rotErr = stErrors.RotationOfCamera2Error;
+ transErr = stErrors.TransOfCamera2Error;
+
+ if type(rotErr)~=1 | type(transErr)~=1 | ~isreal(rotErr) | ~isreal(transErr) then
+ error(msprintf("A StereoCalibrationErrors struct expected."))
+ end
+
+ [size11 size12] = size(rotErr);
+ [size21 size22] = size(transErr);
+
+ if size11*size12~=3 | size21*size22~=3 then
+ error(msprintf("A StereoCalibrationErrors struct expected."))
+ end
+endfunction
+
diff --git a/macros/checkStereoParam.bin b/macros/checkStereoParam.bin
new file mode 100644
index 0000000..f5c29d4
--- /dev/null
+++ b/macros/checkStereoParam.bin
Binary files differ
diff --git a/macros/checkStereoParam.sci b/macros/checkStereoParam.sci
new file mode 100644
index 0000000..b064f90
--- /dev/null
+++ b/macros/checkStereoParam.sci
@@ -0,0 +1,33 @@
+function checkStereoParam(varargin)
+ stereoParam = varargin(1);
+
+ if ~isfield(stereoParam, 'CameraParameters1') | ~isfield(stereoParam,'CameraParameters2') | ~isfield(stereoParam, 'RotationOfCamera2') | ~isfield(stereoParam, 'TranslationOfCamera2') | ~isfield(stereoParam, 'FundamentalMatrix') | ~isfield(stereoParam, 'EssentialMatrix') | ~isfield(stereoParam, 'MeanReprojectionError') | ~isfield(stereoParam, 'NumPatterns') | ~isfield(stereoParam, 'WorldPoints') | ~isfield(stereoParam, 'WorldUnits') then
+ error(msprintf("A Stereo Paramter struct expected."))
+ end
+
+ cam1 = stereoParam.CameraParameters1;
+ cam2 = stereoParam.CameraParameters2;
+ checkCameraParam(cam1);
+ checkCameraParam(cam2);
+
+ rotCam = stereoParam.RotationOfCamera2;
+ transCam = stereoParam.TranslationOfCamera2;
+ funMat = stereoParam.FundamentalMatrix;
+ essenMat = stereoParam.EssentialMatrix;
+ mre = stereoParam.MeanReprojectionError;
+ numPat = stereoParam.NumPatterns;
+ worldPoints = stereoParam.WorldPoints;
+ worldUnits = stereoParam.WorldUnits;
+
+ if type(rotCam)~=1 | type(transCam)~=1 | type(funMat)~=1 | type(essenMat)~=1 | type(mre)~=1 | type(numPat)~=1 | type(worldPoints)~=1 | type(worldUnits)~=10 | ~isreal(rotCam) | ~isreal(transCam) | ~isreal(funMat) | ~isreal(essenMat) | ~isreal(mre) | ~isreal(numPat) | ~isreal(worldPoints) then
+ error(msprintf("A Stereo Paramter struct expected."))
+ end
+
+ [size11 size12] = size(rotCam);
+ [size21 size22] = size(transCam);
+
+ if (size11*size12)~=9 | (size21*size22)~=3 then
+ error(msprintf("A Stereo Paramter struct expected."))
+ end
+
+endfunction
diff --git a/macros/circle.bin b/macros/circle.bin
new file mode 100644
index 0000000..4828201
--- /dev/null
+++ b/macros/circle.bin
Binary files differ
diff --git a/macros/circle.sci b/macros/circle.sci
new file mode 100644
index 0000000..37b8dfe
--- /dev/null
+++ b/macros/circle.sci
@@ -0,0 +1,9 @@
+function [out]=circle(input_image , x_coordinate_of_centre , y_coordinate_centre , radius, r_value,g_value,b_value,thickness,linetype,shift)
+ input_image1=mattolist(input_image);
+ a=opencv_circle(input_image1 , x_coordinate_of_centre , y_coordinate_centre , radius, r_value,g_value,b_value,thickness,linetype,shift);
+ dimension=size(a)
+ for i = 1:dimension
+ out(:,:,i)=a(i);
+ end
+
+endfunction;
diff --git a/macros/classifierToList.bin b/macros/classifierToList.bin
new file mode 100644
index 0000000..3241106
--- /dev/null
+++ b/macros/classifierToList.bin
Binary files differ
diff --git a/macros/classifierToList.sci b/macros/classifierToList.sci
new file mode 100644
index 0000000..98fad46
--- /dev/null
+++ b/macros/classifierToList.sci
@@ -0,0 +1,10 @@
+function classifier_list = classifierToList(classifier)
+ /// classifier is a struct
+
+ if ~isstruct(classifier)
+ error(msprintf("Structure of classifier required\n"));
+ end
+
+ classifier_list = list("classifier",classifier.ClassifierLocation, classifier.BagofFeaturesLocation, classifier.Description);
+
+endfunction
diff --git a/macros/clipline.bin b/macros/clipline.bin
new file mode 100644
index 0000000..6e60bfd
--- /dev/null
+++ b/macros/clipline.bin
Binary files differ
diff --git a/macros/clipline.sci b/macros/clipline.sci
new file mode 100644
index 0000000..9f177f1
--- /dev/null
+++ b/macros/clipline.sci
@@ -0,0 +1,3 @@
+function [out]=clipline(width, height, x1 , y1 , x2,y2)
+ out=opencv_clipline(width, height, x1 , y1 , x2,y2);
+endfunction;
diff --git a/macros/contourarea.bin b/macros/contourarea.bin
new file mode 100644
index 0000000..776b70f
--- /dev/null
+++ b/macros/contourarea.bin
Binary files differ
diff --git a/macros/contourarea.sci b/macros/contourarea.sci
new file mode 100644
index 0000000..feeb7d1
--- /dev/null
+++ b/macros/contourarea.sci
@@ -0,0 +1,3 @@
+function [out]=contourarea(InputArraycontour, booloriented)
+ out=opencv_contourarea(InputArraycontour, booloriented);
+endfunction
diff --git a/macros/convexhull.bin b/macros/convexhull.bin
new file mode 100644
index 0000000..72abcd3
--- /dev/null
+++ b/macros/convexhull.bin
Binary files differ
diff --git a/macros/convexhull.sci b/macros/convexhull.sci
new file mode 100644
index 0000000..0937f55
--- /dev/null
+++ b/macros/convexhull.sci
@@ -0,0 +1,4 @@
+function [out]=convexhull(pstData,clkwise,returnpoints)
+ out=opencv_convexhull(pstData,clkwise,returnpoints);
+
+endfunction;
diff --git a/macros/convmtx2.bin b/macros/convmtx2.bin
new file mode 100644
index 0000000..906812b
--- /dev/null
+++ b/macros/convmtx2.bin
Binary files differ
diff --git a/macros/convmtx2.sci b/macros/convmtx2.sci
new file mode 100644
index 0000000..5f172d3
--- /dev/null
+++ b/macros/convmtx2.sci
@@ -0,0 +1,17 @@
+// Function Name = 2-D convolution matrix
+// Output = Convolution matrix T
+// Input = Input matrix srcMat, Dimensions [m, n]
+
+function[T] = convmtx2(srcImg, m, n)
+
+ srcMat = mattolist(srcImg)
+
+ out = opencv_convmtx2(srcMat, m, n)
+
+ channels = size(out)
+
+ for i = 1:channels
+ T(:,:,i) = out(i)
+ end
+
+endfunction
diff --git a/macros/convolver.bin b/macros/convolver.bin
new file mode 100644
index 0000000..4d17a0d
--- /dev/null
+++ b/macros/convolver.bin
Binary files differ
diff --git a/macros/convolver.sci b/macros/convolver.sci
new file mode 100644
index 0000000..ac75c19
--- /dev/null
+++ b/macros/convolver.sci
@@ -0,0 +1,8 @@
+function [output] = convolver(image1,ksize,values1,scalar)
+ image = mattolist(image1)
+ a = opencv_convolver(image,ksize,values1,scalar);
+ d = size(a);
+ for i = 1:d
+ output(:,:,i) = a(i);
+ end
+endfunction
diff --git a/macros/copymakeborder.bin b/macros/copymakeborder.bin
new file mode 100644
index 0000000..5ad2de9
--- /dev/null
+++ b/macros/copymakeborder.bin
Binary files differ
diff --git a/macros/copymakeborder.sci b/macros/copymakeborder.sci
new file mode 100644
index 0000000..3f1d567
--- /dev/null
+++ b/macros/copymakeborder.sci
@@ -0,0 +1,20 @@
+function new_image = copymakeborder(image, top, bottom, left, right, borderType, varargin)
+
+ [lhs, rhs] = argn(0)
+
+ image_list = mattolist(image)
+
+ select rhs
+ case 6 then
+ out = opencv_copymakeborder(image_list, top, bottom, left, right, borderType)
+
+ case 7 then
+ out = opencv_copymakeborder(image_list, top, bottom, left, right, borderType, varargin(1))
+ end
+
+ sz = size(out)
+ for i = 1 : sz
+ new_image(:, :, i) = out(i)
+ end
+
+endfunction
diff --git a/macros/corner.bin b/macros/corner.bin
new file mode 100644
index 0000000..e4c85b1
--- /dev/null
+++ b/macros/corner.bin
Binary files differ
diff --git a/macros/corner.sci b/macros/corner.sci
new file mode 100644
index 0000000..b86a75e
--- /dev/null
+++ b/macros/corner.sci
@@ -0,0 +1,26 @@
+// This function detects corner in image I and returns it in the matrix C
+
+function[C] = corner(I, varargin)
+
+ [lhs, rhs] = argn(0)
+
+ if rhs == 2 then
+ error(msprintf("No of input cannot be 2"))
+ end
+
+ srcMat = mattolist(I)
+ select rhs
+ case 1 then
+ out = opencv_corner(srcMat)
+
+ case 3 then
+ out = opencv_corner(srcMat, varargin(1), varargin(2))
+ end
+
+ channels = size(out)
+
+ for i = 1:channels
+ C(:,:,i) = out(i)
+ end
+
+endfunction
diff --git a/macros/cornerEigenValsAndVecs.bin b/macros/cornerEigenValsAndVecs.bin
new file mode 100644
index 0000000..dce8b0c
--- /dev/null
+++ b/macros/cornerEigenValsAndVecs.bin
Binary files differ
diff --git a/macros/cornerEigenValsAndVecs.sci b/macros/cornerEigenValsAndVecs.sci
new file mode 100644
index 0000000..11d7905
--- /dev/null
+++ b/macros/cornerEigenValsAndVecs.sci
@@ -0,0 +1,7 @@
+function [outputImg]= cornerEigenValsAndVecs(inputImage, blockSize, kSize, borderType)
+ inputList=mattolist(inputImage);
+ outputList=opencv_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..2b2760e
--- /dev/null
+++ b/macros/cornerHarris.bin
Binary files differ
diff --git a/macros/cornerHarris.sci b/macros/cornerHarris.sci
new file mode 100644
index 0000000..b2aaa26
--- /dev/null
+++ b/macros/cornerHarris.sci
@@ -0,0 +1,7 @@
+function [outputImg]= cornerHarris(inputImage, blockSize, kSize, k, borderType)
+ inputList=mattolist(inputImage);
+ outputList=opencv_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..0f47c74
--- /dev/null
+++ b/macros/cornerMinEigenVal.bin
Binary files differ
diff --git a/macros/cornerMinEigenVal.sci b/macros/cornerMinEigenVal.sci
new file mode 100644
index 0000000..8d8f82d
--- /dev/null
+++ b/macros/cornerMinEigenVal.sci
@@ -0,0 +1,7 @@
+function [outputImg]= cornerMinEigenVal(inputImage, blockSize, kSize, borderType)
+ inputList=mattolist(inputImage);
+ outputList=opencv_cornerMinEigenVal(inputList, blockSize, kSize, borderType);
+ for i=1:size(outputList)
+ outputImg(:,:,i)=outputList(i)
+ end
+endfunction
diff --git a/macros/crossCorrelator.bin b/macros/crossCorrelator.bin
new file mode 100644
index 0000000..33517cf
--- /dev/null
+++ b/macros/crossCorrelator.bin
Binary files differ
diff --git a/macros/crossCorrelator.sci b/macros/crossCorrelator.sci
new file mode 100644
index 0000000..c676044
--- /dev/null
+++ b/macros/crossCorrelator.sci
@@ -0,0 +1,48 @@
+function relation = crossCorrelator(inputMatrix1,inputMatrix2)
+//Calculate 2-D cross correlation of two input matrices
+//
+//Calling Sequence
+// relation=crossCorrelator(inputMatrix1, inputMatrix2);
+//
+//Parameters
+// inputMatrix1: matrix of any size
+// inputMatrix2: matrix of any size
+//
+//Description
+//This function computes 2-D cross correlation of two input matrices
+//
+// Examples
+// A=[1 4;2 3];
+// B=[2 3 5;6 1 4];
+// relation=crossCorrelator(A,B);
+
+[r,c,channels1] = size(inputMatrix1);
+[m,n,channels2] = size(inputMatrix2);
+ if channels1<> 1 then
+ error(msprintf("wrong argument #1: cross correlator function do not support more than two dimensions"))
+ elseif type(inputMatrix1)<> 1
+ error(msprintf("wrong argument #1: cross correlator function do not support input type %s",typeof(A)))
+ end
+ if channels2<> 1 then
+ error(msprintf("wrong argument #2: cross correlator function do not support more than two dimensions"))
+ elseif type(inputMatrix2)<> 1
+ error(msprintf("wrong argument #2: cross correlator function do not support input type %s",typeof(B)))
+ end
+conjMatrix=conj(inputMatrix2);
+Rep = zeros(r + m*2-2, c + n*2-2);
+for x = m : m+r-1
+ for y = n : n+c-1
+ Rep(x,y) = inputMatrix1(x-m+1, y-n+1);
+ end
+end
+relation = zeros(r+m-1,n+c-1);
+for x = 1 : r+m-1
+ for y = 1 : n+c-1
+ for i = 1 : m
+ for j = 1 : n
+ relation(x, y) = relation(x, y) + (Rep(x+i-1, y+j-1) * conjMatrix(i, j));
+ end
+ end
+ end
+end
+endfunction
diff --git a/macros/cvHoughLines.bin b/macros/cvHoughLines.bin
new file mode 100644
index 0000000..432a49e
--- /dev/null
+++ b/macros/cvHoughLines.bin
Binary files differ
diff --git a/macros/cvHoughLines.sci b/macros/cvHoughLines.sci
new file mode 100644
index 0000000..cdf7d59
--- /dev/null
+++ b/macros/cvHoughLines.sci
@@ -0,0 +1,29 @@
+function [points] = cvHoughLines(image,theta,rho)
+// Cartesian co-ordinates of points defined by rho and theta pairs.
+//
+// Calling Sequence
+// points = cvHoughLines(image, theta, rho)
+//
+// Parameters
+// image : input image matrix
+// theta : vector of values of theta that represent the input line
+// rho : vector of values of theta that represent the input line
+// points : It is an MX4 matrix containing the points of intersection of the line(represented by rho and theta) with the image boundary.
+//
+// Description
+//
+// The function returns the points of intersection of the line defined by rho and theta pairs with the image boundary. Image boundary refers to the left and right vertical boundary and top and bottom horizontal boundary.
+//
+// Examples
+// //Load an image
+// I = imread('lena.jpeg');
+// // Calculate the points of intersection
+// points = cvHoughLines(I,[pi/3 pi/6],[5 9]);
+//
+// Authors
+// Asmita Bhar
+//
+
+ img = mattolist(image);
+ points = opencv_HoughLines(img,theta,rho);
+endfunction
diff --git a/macros/cvMaximum.bin b/macros/cvMaximum.bin
new file mode 100644
index 0000000..463602d
--- /dev/null
+++ b/macros/cvMaximum.bin
Binary files differ
diff --git a/macros/cvMaximum.sci b/macros/cvMaximum.sci
new file mode 100644
index 0000000..a9ba428
--- /dev/null
+++ b/macros/cvMaximum.sci
@@ -0,0 +1,295 @@
+//*********************************************************************//
+// Author : Asmita Bhar, Kevin George
+//*********************************************************************//
+
+function varargout = cvMaximum(image, varargin)
+// Finds maximum values in an input
+//
+// Calling Sequence
+// [val ind] = cvMaximum(image);
+// val = cvMaximum(image); (only when IndexOutputPort is false)
+// ind = cvMaximum(image); (only when ValueOutputPort is false)
+// [val ind] = cvMaximum(image, name, value,...);
+// val = cvMaximum(image, name, value, ...); (only when IndexOutputPort is false)
+// ind = cvMaximum(image, name, value, ...); (only when ValueOutputPort is false)
+// [val ind] = cvMaximum(image, name, value,c,r); (only when ROI Processing is true)
+// val = cvMaximum(image, name, value,c,r); (only when ROI Processing is true and IndexOutputPort is false)
+// ind = cvMaximum(image, name, value,c,r); (only when ROI Processing is true and ValueOutputPort is false)
+//
+// Parameters
+// image : Input image matrix
+// ValueOutputPort (Optional) : This property is set to true to output the maximum value. Default : true.
+// IndexOutputPort (Optional) : This property is set to true to output the index of the maximum value. Default : true.
+// Dimension (Output) : Dimension along which the function operates - Row, Column, All or Custom. Default : All
+// CustomDimension (Optional) : The integer dimension over which the function calculates the maximum. This value cannot exceed the number of dimensions in input. It applies only when 'Dimension' property is set to 'Custom'. Default : 1
+// ROIProcessing (Optional) : It applies only when 'Dimension' property is set to 'All'. It calculates the maximum within a particular region of the image. Default : false
+// c (Optional): vector of y-coordinates of vectices of a rectangle(ROI). Applicable only when 'ROIProcssing' is set to 'true'.
+// r (Optional): vector of x-coordinates of vectices of a rectangle(ROI). Applicable only when 'ROIProcssing' is set to 'true'.
+// val : Stores the maximum value calculated
+// ind : Stores the index at which the maximum value occurs.
+//
+// Description
+// The function calculates the maximum value in a given image matrix.
+//
+// Examples
+// //Load an image
+// I = imread('peppers.png');
+// //Calculate the maximum (default dimension is 'All')
+// [val ind] = cvMaximum(I);
+// //Calculate the maximum when dimension is 'Row' and IndexOutputPort is set to false
+// val = cvMaximum(I,'ValueOutputPort','false','Dimension','Row');
+// //Calculate the maximum within a given ROI
+// a = [0 100 100 0];
+// b = [0 0 100 100];
+// [val ind] = cvMaximum(I,'ROIProcessing','true',a,b);
+//
+// Authors
+// Asmita Bhar
+// Kevin George
+//
+ [lhs,rhs] = argn(0);
+ if rhs<1 then
+ error(msprintf("Not enough input arguments"));
+ end
+ if rhs>13 then
+ error(msprintf("Too many input arguments"));
+ end
+ if lhs>2 then
+ error(msprintf("Too many output arguments"));
+ end
+ [iRows iCols]=size(image(1))
+ iChannels = size(image)
+
+ valueOutputPort = 'true';
+ indexOutputPort = 'true';
+ dimension = 'All';
+ customDimension = 1;
+ roiProcessing = 'false';
+
+ flag1=0;
+ i=1;
+ while(i<rhs-1)
+ if strcmpi(varargin(i),'ValueOutputPort')==0 then
+ valueOutputPort = varargin(i+1)
+ if strcmpi(valueOutputPort,"true") & strcmpi(valueOutputPort,"false") then
+ error(msprintf(" wrong input argument #%d,ValidityOutputPort not matched",i))
+ end
+ i=i+2;
+ elseif strcmpi(varargin(i),'IndexOutputPort')==0 then
+ indexOutputPort = varargin(i+1)
+ if strcmpi(indexOutputPort,"true") & strcmpi(indexOutputPort,"false") then
+ error(msprintf(" wrong input argument #%d, IndexOutputPort not matched",i))
+ end
+ i=i+2;
+ elseif strcmpi(varargin(i),'Dimension')==0 then
+ dimension = varargin(i+1)
+ if strcmpi(dimension,"Column") & strcmpi(dimension,"Row") &strcmpi(dimension,"All") & strcmpi(dimension,"Custom") then
+ error(msprintf(" wrong input argument #%d, Dimension not matched",i))
+ end
+ i=i+2;
+ elseif strcmpi(varargin(i),'CustomDimension')==0 then
+ customDimension = varargin(i+1)
+ flag1=1;
+ i=i+2;
+ elseif strcmpi(varargin(i), 'ROIProcessing')==0 then
+ roiProcessing = varargin(i+1)
+ if(roiProcessing=='true') then
+ c = varargin(i+2);
+ r = varargin(i+3);
+ i=i+4;
+ else
+ i=i+2;
+ end
+ end
+
+ end
+
+ if (~strcmpi(valueOutputPort,'false') & ~strcmpi(indexOutputPort,'false'))
+ error(msprintf("Both cannot be false at the same time"));
+ end
+ if (strcmpi(dimension,'Custom') & (flag1==1))
+ error(msprintf("The CustomDimension property is not relevant in this configuration"));
+ end
+
+ if (strcmpi(dimension,"All") & strcmpi(roiProcessing,'true'))
+ error(msprintf("ROI Property is not relevant in this configuration"));
+ end
+
+ if(customDimension<1)
+ error(msprintf("CustomDimension must be greater than or equal to 1"));
+ end
+
+ if(iChannels==1) then
+ if(customDimension>2)
+ error(msprintf("CustomDimension cannot be greater than the dimension of the input."));
+ end
+ elseif(iChannels==3) then
+ if(customDimension>3)
+ error(msprintf("CustomDimension cannot be greater than the dimension of the input."));
+ end
+ end
+
+ if(roiProcessing=='false') then
+ if (dimension=='All') then
+ if(iChannels==1) then
+ [val ind] = max(image(1))
+ ind(1) = 1;
+ elseif (iChannels==3) then
+ val1 = max(image(1))
+ val2 = max(image(2))
+ val3 = max(image(3))
+ if (val1>=val2) & (val1>=val3) then
+ [val ind] = max(image(1))
+ ind(3) = 1
+ elseif (val2>=val1) & (val2>=val3) then
+ [val ind] = max(image(2))
+ ind(3) = 2
+ else
+ [val ind] = max(image(3))
+ ind(3) = 3
+ end
+ end
+ t = ind(1)
+ ind(1) = ind(2)
+ ind(2) = t
+ end
+ if (dimension=='Row') then
+ if(iChannels==1) then
+ [val ind] = max(image(1),'c');
+ elseif(iChannels==3) then
+ [val1 ind1] = max(image(1),'c');
+ [val2 ind2] = max(image(2),'c');
+ [val3 ind3] = max(image(3),'c');
+ val(:,:,1) = val1;
+ val(:,:,2) = val2;
+ val(:,:,3) = val3;
+ ind(:,:,1) = ind1;
+ ind(:,:,2) = ind2;
+ ind(:,:,3) = ind3;
+ end
+ end
+ if (dimension=='Column') then
+ if(iChannels==1) then
+ [val ind] = max(image(1),'r');
+ elseif(iChannels==3) then
+ [val1 ind1] = max(image(1),'r');
+ [val2 ind2] = max(image(2),'r');
+ [val3 ind3] = max(image(3),'r');
+ val(:,:,1) = val1;
+ val(:,:,2) = val2;
+ val(:,:,3) = val3;
+ ind(:,:,1) = ind1;
+ ind(:,:,2) = ind2;
+ ind(:,:,3) = ind3;
+ end
+ end
+ if (dimension=='Custom') then
+ if(iChannels==1) then
+ if(customDimension==1) then
+ [val ind] = max(image(1),'r');
+ elseif(customDimension==2) then
+ [val ind] = max(image(1),'c');
+ end
+ elseif(iChannels==3) then
+ if(customDimension==1) then
+ [val1 ind1] = max(image(1),'r');
+ [val2 ind2] = max(image(2),'r');
+ [val3 ind3] = max(image(3),'r');
+ val(:,:,1) = val1;
+ val(:,:,2) = val2;
+ val(:,:,3) = val3;
+ ind(:,:,1) = ind1;
+ ind(:,:,2) = ind2;
+ ind(:,:,3) = ind3;
+ elseif(customDimension==2) then
+ [val1 ind1] = max(image(1),'c');
+ [val2 ind2] = max(image(2),'c');
+ [val3 ind3] = max(image(3),'c');
+ val(:,:,1) = val1;
+ val(:,:,2) = val2;
+ val(:,:,3) = val3;
+ ind(:,:,1) = ind1;
+ ind(:,:,2) = ind2;
+ ind(:,:,3) = ind3;
+ elseif(customDimension==3) then
+ a = image(1);
+ b = image(2);
+ c = image(3);
+ for i=1:iRows
+ for j=1:iCols
+ val(i,j)= max([a(i,j) b(i,j) c(i,j)]);
+ if(val(i,j)==a(i,j)) then
+ ind(i,j)=1;
+ elseif(val(i,j)==b(i,j)) then
+ ind(i,j)=2;
+ else
+ ind(i,j)=3;
+ end
+ end
+
+ end
+ end
+ end
+ end
+ end
+ if(roiProcessing=='true') then
+ I2 = roipoly(image,c,r);
+ out = I2;
+ output = find(out>0);
+ [rows cols] = size(out);
+ if(iChannels==1)
+ ROI = zeros(iRows,iCols);
+ for i=1:cols
+ ROI(output(i)) = image(1)(output(i));
+ end
+ elseif(iChannels==3)
+ ROI1 = zeros(iRows,iCols);
+ ROI2 = zeros(iRows,iCols);
+ ROI3 = zeros(iRows,iCols);
+ for i=1:cols
+ ROI1(output(i)) = image(1)(output(i));
+ ROI2(output(i)) = image(2)(output(i));
+ ROI3(output(i)) = image(3)(output(i));
+ end
+ ROI = list(ROI1,ROI2,ROI3);
+ end
+ if (dimension=='All') then
+ if(iChannels==1) then
+ a=ROI;
+ [val ind] = max(a(find(a>0)));
+ //ind(1) = 1;
+ elseif (iChannels==3) then
+ a=ROI(1);
+ b=ROI(2);
+ c=ROI(3);
+ val1 = max(a(find(a>0)));
+ val2 = max(b(find(b>0)));
+ val3 = max(c(find(c>0)));
+ if (val1>=val2) & (val1>=val3) then
+ [val ind] = max(ROI(1))
+ //ind(3) = 1
+ elseif (val2>=val1) & (val2>=val3) then
+ [val ind] = max(ROI(2))
+ //ind(3) = 2
+ else
+ [val ind] = max(ROI(3))
+ //ind(3) = 3
+ end
+ end
+ //t = ind(1)
+ //ind(1) = ind(2)
+ //ind(2) = t
+ end
+ end
+
+
+ if (~strcmpi(valueOutputPort,'true') & ~strcmpi(indexOutputPort,'true')) then
+ varargout = list(val,ind);
+ elseif (~strcmpi(valueOutputPort,'true') & ~strcmpi(indexOutputPort,'false')) then
+ varargout = val
+ elseif (~strcmpi(indexOutputPort,'true') & ~strcmpi(valueOutputPort,'false')) then
+ varargout = ind
+ end
+
+endfunction
+
diff --git a/macros/cvMean.bin b/macros/cvMean.bin
new file mode 100644
index 0000000..b2977a0
--- /dev/null
+++ b/macros/cvMean.bin
Binary files differ
diff --git a/macros/cvMean.sci b/macros/cvMean.sci
new file mode 100644
index 0000000..ce8318e
--- /dev/null
+++ b/macros/cvMean.sci
@@ -0,0 +1,217 @@
+//*********************************************************************//
+// Author : Asmita Bhar, Kevin George
+//*********************************************************************//
+
+function [val] = cvMean(image, varargin)
+// Finds mean values in an input
+//
+// Calling Sequence
+// val = cvMean(image);
+// val = cvMean(image, name, value,...);
+// val = cvMean(image, name, value,c,r); (only when ROI Processing is true)
+//
+// Parameters
+// image : Input image matrix
+// Dimension (Output) : Dimension along which the function operates - Row, Column, All or Custom. Default : All
+// CustomDimension (Optional) : The integer dimension over which the function calculates the mean. This value cannot exceed the number of dimensions in input. It applies only when 'Dimension' property is set to 'Custom'. Default : 1
+// ROIProcessing (Optional) : It applies only when 'Dimension' property is set to 'All'. It calculates the mean within a particular region of the image. Default : false
+// c (Optional): vector of y-coordinates of vectices of a rectangle(ROI). Applicable only when 'ROIProcssing' is set to 'true'.
+// r (Optional): vector of x-coordinates of vectices of a rectangle(ROI). Applicable only when 'ROIProcssing' is set to 'true'.
+// val : Stores the mean value calculated
+//
+// Description
+// The function calculates the mean value in a given image matrix.
+//
+// Examples
+// //Load an image
+// I = imread('peppers.png');
+// //Calculate the mean (default dimension is 'All')
+// val = cvMean(I);
+// //Calculate the mean when dimension is 'Row'
+// val = cvMean(I,'Dimension','Row');
+// //Calculate the mean within a given ROI
+// a = [0 100 100 0];
+// b = [0 0 100 100];
+// val = cvMean(I,'ROIProcessing','true',a,b);
+//
+// Authors
+// Asmita Bhar
+// Kevin George
+//
+ [lhs,rhs] = argn(0);
+ if rhs<1 then
+ error(msprintf("Not enough input arguments"));
+ end
+ if rhs>9 then
+ error(msprintf("Too many input arguments"));
+ end
+ [iRows iCols]=size(image(1))
+ iChannels = size(image)
+
+ dimension = 'All';
+ customDimension = 1;
+ roiProcessing = 'false';
+
+ flag1=0;
+ i=1;
+ while(i<rhs-1)
+ if strcmpi(varargin(i),'Dimension')==0 then
+ dimension = varargin(i+1)
+ if strcmpi(dimension,"Column") & strcmpi(dimension,"Row") &strcmpi(dimension,"All") & strcmpi(dimension,"Custom") then
+ error(msprintf(" wrong input argument #%d, Dimension not matched",i))
+ end
+ i=i+2;
+ elseif strcmpi(varargin(i),'CustomDimension')==0 then
+ customDimension = varargin(i+1)
+ flag1=1;
+ i=i+2;
+ elseif strcmpi(varargin(i), 'ROIProcessing')==0 then
+ roiProcessing = varargin(i+1)
+ if(roiProcessing=='true') then
+ c = varargin(i+2);
+ r = varargin(i+3);
+ i=i+4;
+ else
+ i=i+2;
+ end
+ end
+
+ end
+
+ if (strcmpi(dimension,'Custom') & (flag1==1))
+ error(msprintf("The CustomDimension property is not relevant in this configuration"));
+ end
+
+ if (strcmpi(dimension,"All") & strcmpi(roiProcessing,'true'))
+ error(msprintf("ROI Property is not relevant in this configuration"));
+ end
+
+ if(customDimension<1)
+ error(msprintf("CustomDimension must be greater than or equal to 1"));
+ end
+
+ if(iChannels==1) then
+ if(customDimension>2)
+ error(msprintf("CustomDimension cannot be greater than the dimension of the input."));
+ end
+ elseif(iChannels==3) then
+ if(customDimension>3)
+ error(msprintf("CustomDimension cannot be greater than the dimension of the input."));
+ end
+ end
+
+ if(iChannels==1)
+ I = double(image(1));
+ elseif(iChannels==3)
+ I1 = double(image(1));
+ I2 = double(image(2));
+ I3 = double(image(3));
+ end
+
+ if(roiProcessing=='false') then
+ if (dimension=='All') then
+ if(iChannels==1) then
+ val = mean(I)
+ elseif (iChannels==3) then
+ val1 = mean(I1)
+ val2 = mean(I2)
+ val3 = mean(I3)
+ val = mean([val1 val2 val3])
+ end
+ end
+ if (dimension=='Row') then
+ if(iChannels==1) then
+ val = mean(I,'c');
+ elseif(iChannels==3) then
+ val1 = mean(I1,'c');
+ val2 = mean(I2,'c');
+ val3 = mean(I3,'c');
+ val(:,:,1) = val1;
+ val(:,:,2) = val2;
+ val(:,:,3) = val3;
+ end
+ end
+ if (dimension=='Column') then
+ if(iChannels==1) then
+ val = mean(I,'r');
+ elseif(iChannels==3) then
+ val1 = mean(I1,'r');
+ val2 = mean(I2,'r');
+ val3 = mean(I3,'r');
+ val(:,:,1) = val1;
+ val(:,:,2) = val2;
+ val(:,:,3) = val3;
+ end
+ end
+ if (dimension=='Custom') then
+ if(iChannels==1) then
+ if(customDimension==1) then
+ val = mean(I,'r');
+ elseif(customDimension==2) then
+ val = mean(I,'c');
+ end
+ elseif(iChannels==3) then
+ if(customDimension==1) then
+ val1 = mean(I1,'r');
+ val2 = mean(I2,'r');
+ val3 = mean(I3,'r');
+ val(:,:,1) = val1;
+ val(:,:,2) = val2;
+ val(:,:,3) = val3;
+ elseif(customDimension==2) then
+ val1 = mean(I1,'c');
+ val2 = mean(I2,'c');
+ val3 = mean(I3,'c');
+ val(:,:,1) = val1;
+ val(:,:,2) = val2;
+ val(:,:,3) = val3;
+ elseif(customDimension==3) then
+ for i=1:iRows
+ for j=1:iCols
+ val(i,j)= mean([I1(i,j) I2(i,j) I3(i,j)]);
+ end
+
+ end
+ end
+ end
+ end
+ end
+ if(roiProcessing=='true') then
+ I4 = roipoly(image,c,r);
+ out = I4;
+ output = find(out>0);
+ [rows cols] = size(out);
+ if(iChannels==1)
+ ROI = zeros(iRows,iCols);
+ for i=1:cols
+ ROI(output(i)) = image(1)(output(i));
+ end
+ elseif(iChannels==3)
+ ROI1 = zeros(iRows,iCols);
+ ROI2 = zeros(iRows,iCols);
+ ROI3 = zeros(iRows,iCols);
+ for i=1:cols
+ ROI1(output(i)) = image(1)(output(i));
+ ROI2(output(i)) = image(2)(output(i));
+ ROI3(output(i)) = image(3)(output(i));
+ end
+ ROI = list(ROI1,ROI2,ROI3);
+ end
+ if (dimension=='All') then
+ if(iChannels==1) then
+ a=ROI;
+ val = mean(a(find(a>0)));
+ elseif (iChannels==3) then
+ a=ROI(1);
+ b=ROI(2);
+ c=ROI(3);
+ val1 = mean(a(find(a>0)));
+ val2 = mean(b(find(b>0)));
+ val3 = mean(c(find(c>0)));
+ val = mean([val1 val2 val3]);
+ end
+ end
+ end
+
+endfunction
+
diff --git a/macros/cvMedian.bin b/macros/cvMedian.bin
new file mode 100644
index 0000000..1424ac4
--- /dev/null
+++ b/macros/cvMedian.bin
Binary files differ
diff --git a/macros/cvMedian.sci b/macros/cvMedian.sci
new file mode 100644
index 0000000..a403984
--- /dev/null
+++ b/macros/cvMedian.sci
@@ -0,0 +1,119 @@
+//**************************************************
+// Author : Asmita Bhar
+//**************************************************
+
+function [out] = cvMedian(image,varargin)
+// Finds median values in an input
+//
+// Calling Sequence
+// val = cvMedian(image)
+// val = cvMedian(image, name, value, .....)
+//
+// Parameters
+// image : Input image matrix
+// SortMethod (Optional) : The sort method to calculate the median - Quick sort or Insertion Sort. Default : Quick sort
+// Dimension (Optional) : Dimension along which the function operates - Row, Column, All or Custom. Default : All
+// CustomDimension (Optional) : The integer dimension over which the function calculates the median. This value cannot exceed the number of dimensions in input. It applies only when 'Dimension' property is set to 'Custom'. Default : 1
+//
+// Description
+// The function calculates the median values in a given input image matrix.
+//
+// Examples
+// //Load an image
+// I = imread('peppers.png');
+// val1 = cvMedian(I); // calculates the median value considering dimension as 'All'
+// val2 = cvMedian(I,'Dimension','Row'); //calculates the median value in 'Row' dimension
+//
+// Authors
+// Asmita Bhar
+//
+
+ [lhs,rhs] = argn(0);
+ if rhs<1 then
+ error(msprintf("Not enough input arguments"));
+ end
+ if rhs>7 then
+ error(msprintf("Too many input arguments"));
+ end
+
+ [iRows iCols]=size(image(1))
+ iChannels = size(image)
+
+ sortMethod = 'Quick sort';
+ dimension = 'All';
+ customDimension = 1;
+
+ flag=0;
+ i=1;
+ while(i<rhs-1)
+ if strcmpi(varargin(i),'SortMethod')==0 then
+ sortMethod = varargin(i+1);
+ if strcmpi(sortMethod,"Quick sort") & strcmpi(sortMethod,"Insertion sort") then
+ error(msprintf(" wrong input argument #%d,SortMethod not matched",i))
+ end
+ elseif strcmpi(varargin(i),'Dimension')==0 then
+ dimension = varargin(i+1)
+ if strcmpi(dimension,"Column") & strcmpi(dimension,"Row") &strcmpi(dimension,"All") & strcmpi(dimension,"Custom") then
+ error(msprintf(" wrong input argument #%d, Dimension not matched",i))
+ end
+ elseif strcmpi(varargin(i),'CustomDimension')==0 then
+ customDimension = varargin(i+1)
+ flag=1;
+ end
+ i=i+2;
+ end
+
+ if (strcmpi(dimension,'Custom') & (flag==1))
+ error(msprintf("The CustomDimension property is not relevant in this configuration"));
+ end
+
+ if(iChannels==1) then
+ if(dimension=='All') then
+ out = median(image(1));
+ elseif(dimension=='Row') then
+ out = median(image(1),'c');
+ elseif(dimension=='Column') then
+ out = median(image(1),'r');
+ elseif(dimension=='Custom') then
+ if(customDimension==1) then
+ out = median(image(1),'r');
+ elseif(customDimension==2) then
+ out = median(image(1),'c');
+ end
+ end
+ elseif(iChannels==3)
+ if(dimension=='All') then
+ out = median([image(1) image(2) image(3)]);
+ elseif(dimension=='Row') then
+ out(:,:,1) = median(image(1),'c');
+ out(:,:,2) = median(image(2),'c');
+ out(:,:,3) = median(image(3),'c');
+ elseif(dimension=='Column') then
+ out(:,:,1) = median(image(1),'r');
+ out(:,:,2) = median(image(2),'r');
+ out(:,:,3) = median(image(3),'r');
+ elseif(dimension=='Custom') then
+ if(customDimension==1) then
+ out(:,:,1) = median(image(1),'r');
+ out(:,:,2) = median(image(2),'r');
+ out(:,:,3) = median(image(3),'r');
+ elseif(customDimension==2) then
+ out(:,:,1) = median(image(1),'c');
+ out(:,:,2) = median(image(2),'c');
+ out(:,:,3) = median(image(3),'c');
+ elseif(customDimension==3) then
+ a = median(image(1),3);
+ b = median(image(2),3);
+ c = median(image(3),3);
+ for i=1:iRows
+ for j=1:iCols
+ out(i,j) = median([a(i,j) b(i,j) c(i,j)]);
+ end
+
+ end
+ end
+ end
+ end
+
+endfunction
+
diff --git a/macros/cvMinimum.bin b/macros/cvMinimum.bin
new file mode 100644
index 0000000..ca23065
--- /dev/null
+++ b/macros/cvMinimum.bin
Binary files differ
diff --git a/macros/cvMinimum.sci b/macros/cvMinimum.sci
new file mode 100644
index 0000000..e29a263
--- /dev/null
+++ b/macros/cvMinimum.sci
@@ -0,0 +1,311 @@
+//*********************************************************************//
+// Author : Asmita Bhar, Kevin George
+//*********************************************************************//
+
+function varargout = cvMinimum(image, varargin)
+// Finds minimum values in an input
+//
+// Calling Sequence
+// [val ind] = cvMinimum(image);
+// val = cvMinimum(image); (only when IndexOutputPort is false)
+// ind = cvMinimum(image); (only when ValueOutputPort is false)
+// [val ind] = cvMinimum(image, name, value,...);
+// val = cvMinimum(image, name, value, ...); (only when IndexOutputPort is false)
+// ind = cvMinimum(image, name, value, ...); (only when ValueOutputPort is false)
+// [val ind] = cvMinimum(image, name, value,c,r); (only when ROI Processing is true)
+// val = cvMinimum(image, name, value,c,r); (only when ROI Processing is true and IndexOutputPort is false)
+// ind = cvMinimum(image, name, value,c,r); (only when ROI Processing is true and ValueOutputPort is false)
+//
+// Parameters
+// image : Input image matrix
+// ValueOutputPort (Optional) : This property is set to true to output the minimum value. Default : true.
+// IndexOutputPort (Optional) : This property is set to true to output the index of the minimum value. Default : true.
+// Dimension (Output) : Dimension along which the function operates - Row, Column, All or Custom. Default : All
+// CustomDimension (Optional) : The integer dimension over which the function calculates the minimum. This value cannot exceed the number of dimensions in input. It applies only when 'Dimension' property is set to 'Custom'. Default : 1
+// ROIProcessing (Optional) : It applies only when 'Dimension' property is set to 'All'. It calculates the minimum within a particular region of the image. Default : false
+// c (Optional): vector of y-coordinates of vectices of a rectangle(ROI). Applicable only when 'ROIProcssing' is set to 'true'.
+// r (Optional): vector of x-coordinates of vectices of a rectangle(ROI). Applicable only when 'ROIProcssing' is set to 'true'.
+// val : Stores the maximum value calculated
+// ind : Stores the index at which the minimum value occurs.
+//
+// Description
+// The function calculates the minimum value in a given image matrix.
+//
+// Examples
+// //Load an image
+// I = imread('peppers.png');
+// //Calculate the minimum (default dimension is 'All')
+// [val ind] = cvMinimum(I);
+// //Calculate the minimum when dimension is 'Row' and IndexOutputPort is set to false
+// val = cvMinimum(I,'ValueOutputPort','false','Dimension','Row');
+// //Calculate the minimum within a given ROI
+// a = [0 100 100 0];
+// b = [0 0 100 100];
+// [val ind] = cvMinimum(I,'ROIProcessing','true',a,b);
+//
+// Authors
+// Asmita Bhar
+// Kevin George
+//
+ [lhs,rhs] = argn(0); //finding the number of input and output arguments
+ if rhs<1 then
+ error(msprintf("Not enough input arguments"));
+ end
+ if rhs>13 then
+ error(msprintf("Too many input arguments"));
+ end
+ if lhs>2 then
+ error(msprintf("Too many output arguments"));
+ end
+ [iRows iCols]=size(image(1)) // finding the number of rows and columns of the image
+ iChannels = size(image) //finding the number of channels in the image
+
+
+ // default values
+ valueOutputPort = 'true';
+ indexOutputPort = 'true';
+ dimension = 'All';
+ customDimension = 1;
+ roiProcessing = 'false';
+
+ flag1=0;
+ i=1;
+
+ // taking the optional argumnets as input
+ while(i<rhs-1)
+ if strcmpi(varargin(i),'ValueOutputPort')==0 then
+ valueOutputPort = varargin(i+1)
+ if strcmpi(valueOutputPort,"true") & strcmpi(valueOutputPort,"false") then
+ error(msprintf(" wrong input argument #%d,ValidityOutputPort not matched",i))
+ end
+ i=i+2;
+ elseif strcmpi(varargin(i),'IndexOutputPort')==0 then
+ indexOutputPort = varargin(i+1)
+ if strcmpi(indexOutputPort,"true") & strcmpi(indexOutputPort,"false") then
+ error(msprintf(" wrong input argument #%d, IndexOutputPort not matched",i))
+ end
+ i=i+2;
+ elseif strcmpi(varargin(i),'Dimension')==0 then
+ dimension = varargin(i+1)
+ if strcmpi(dimension,"Column") & strcmpi(dimension,"Row") &strcmpi(dimension,"All") & strcmpi(dimension,"Custom") then
+ error(msprintf(" wrong input argument #%d, Dimension not matched",i))
+ end
+ i=i+2;
+ elseif strcmpi(varargin(i),'CustomDimension')==0 then
+ customDimension = varargin(i+1)
+ flag1=1;
+ i=i+2;
+ elseif strcmpi(varargin(i), 'ROIProcessing')==0 then
+ roiProcessing = varargin(i+1)
+ if(roiProcessing=='true') then
+ c = varargin(i+2);
+ r = varargin(i+3);
+ i=i+4;
+ else
+ i=i+2;
+ end
+ end
+
+ end
+
+ // error display with user input (if any)
+ if (~strcmpi(valueOutputPort,'false') & ~strcmpi(indexOutputPort,'false'))
+ error(msprintf("Both cannot be false at the same time"));
+ end
+ if (strcmpi(dimension,'Custom') & (flag1==1))
+ error(msprintf("The CustomDimension property is not relevant in this configuration"));
+ end
+
+ if (strcmpi(dimension,"All") & strcmpi(roiProcessing,'true'))
+ error(msprintf("ROI Property is not relevant in this configuration"));
+ end
+
+ if(customDimension<1)
+ error(msprintf("CustomDimension must be greater than or equal to 1"));
+ end
+
+ if(iChannels==1) then
+ if(customDimension>2)
+ error(msprintf("CustomDimension cannot be greater than the dimension of the input."));
+ end
+ elseif(iChannels==3) then
+ if(customDimension>3)
+ error(msprintf("CustomDimension cannot be greater than the dimension of the input."));
+ end
+ end
+
+ // calculating minimum for the image if ROI is not mentioned
+ if(roiProcessing=='false') then
+ //calculating minimum if dimension is all
+ if (dimension=='All') then
+ //calculating minimum for a single channel image
+ if(iChannels==1) then
+ [val ind] = min(image(1))
+ ind(3) = 1;
+ // calculating minimum for a 3-channel image
+ elseif (iChannels==3) then
+ val1 = min(image(1))
+ val2 = min(image(2))
+ val3 = min(image(3))
+ if (val1<=val2) & (val1<=val3) then
+ [val ind] = min(image(1))
+ ind(3) = 1
+ elseif (val2<=val1) & (val2<=val3) then
+ [val ind] = min(image(2))
+ ind(3) = 2
+ else
+ [val ind] = min(image(3))
+ ind(3) = 3
+ end
+ end
+ // swapping the indices to match matlab output
+ t = ind(1)
+ ind(1) = ind(2)
+ ind(2) = t
+ end
+ // calculating minimum if dimension is Row
+ if (dimension=='Row') then
+ //calculating minimum if dimension is all
+ if(iChannels==1) then
+ [val ind] = min(image(1),'c');
+ // calculating minimum for a 3-channel image
+ elseif(iChannels==3) then
+ [val1 ind1] = min(image(1),'c');
+ [val2 ind2] = min(image(2),'c');
+ [val3 ind3] = min(image(3),'c');
+ val(:,:,1) = val1;
+ val(:,:,2) = val2;
+ val(:,:,3) = val3;
+ ind(:,:,1) = ind1;
+ ind(:,:,2) = ind2;
+ ind(:,:,3) = ind3;
+ end
+ end
+ if (dimension=='Column') then
+ //calculating minimum if dimension is Column
+ if(iChannels==1) then
+ [val ind] = min(image(1),'r');
+ // calculating minimum for a 3-channel image
+ elseif(iChannels==3) then
+ [val1 ind1] = min(image(1),'r');
+ [val2 ind2] = min(image(2),'r');
+ [val3 ind3] = min(image(3),'r');
+ val(:,:,1) = val1;
+ val(:,:,2) = val2;
+ val(:,:,3) = val3;
+ ind(:,:,1) = ind1;
+ ind(:,:,2) = ind2;
+ ind(:,:,3) = ind3;
+ end
+ end
+ if (dimension=='Custom') then
+ //calculating minimum if dimension is Custom
+ if(iChannels==1) then
+ //calculating for dimension 1 i.e. Column
+ if(customDimension==1) then
+ [val ind] = min(image(1),'r');
+ //calculating for imension 2 i.e. Row
+ elseif(customDimension==2) then
+ [val ind] = min(image(1),'c');
+ end
+ // calculating minimum for a 3-channel image
+ elseif(iChannels==3) then
+ //calculating for dimension 1 i.e. Column
+ if(customDimension==1) then
+ [val1 ind1] = min(image(1),'r');
+ [val2 ind2] = min(image(2),'r');
+ [val3 ind3] = min(image(3),'r');
+ val(:,:,1) = val1;
+ val(:,:,2) = val2;
+ val(:,:,3) = val3;
+ ind(:,:,1) = ind1;
+ ind(:,:,2) = ind2;
+ ind(:,:,3) = ind3;
+ //calculating for dimension 2 i.e. Row
+ elseif(customDimension==2) then
+ [val1 ind1] = min(image(1),'c');
+ [val2 ind2] = min(image(2),'c');
+ [val3 ind3] = min(image(3),'c');
+ val(:,:,1) = val1;
+ val(:,:,2) = val2;
+ val(:,:,3) = val3;
+ ind(:,:,1) = ind1;
+ ind(:,:,2) = ind2;
+ ind(:,:,3) = ind3;
+ //calculating for dimension 3 i.e Channel
+ elseif(customDimension==3) then
+ a = image(1);
+ b = image(2);
+ c = image(3);
+ for i=1:iRows
+ for j=1:iCols
+ val(i,j)= min([a(i,j) b(i,j) c(i,j)]);
+ if(val(i,j)==a(i,j)) then
+ ind(i,j)=1;
+ elseif(val(i,j)==b(i,j)) then
+ ind(i,j)=2;
+ else
+ ind(i,j)=3;
+ end
+ end
+
+ end
+ end
+ end
+ end
+ end
+ //calculating minimum if ROI is mentioned
+ if(roiProcessing=='true') then
+ I2 = roipoly(image,c,r);
+ out = I2;
+ output = find(out>0);
+ [rows cols] = size(out);
+ if(iChannels==1)
+ ROI = zeros(iRows,iCols);
+ for i=1:cols
+ ROI(output(i)) = image(1)(output(i));
+ end
+ elseif(iChannels==3)
+ ROI1 = zeros(iRows,iCols);
+ ROI2 = zeros(iRows,iCols);
+ ROI3 = zeros(iRows,iCols);
+ for i=1:cols
+ ROI1(output(i)) = image(1)(output(i));
+ ROI2(output(i)) = image(2)(output(i));
+ ROI3(output(i)) = image(3)(output(i));
+ end
+ ROI = list(ROI1,ROI2,ROI3);
+ end
+ if (dimension=='All') then
+ if(iChannels==1) then
+ a=ROI;
+ [val ind] = min(a(find(a>0)));
+ elseif (iChannels==3) then
+ a=ROI(1);
+ b=ROI(2);
+ c=ROI(3);
+ val1 = min(a(find(a>0)));
+ val2 = min(b(find(b>0)));
+ val3 = min(c(find(c>0)));
+ if (val1<=val2) & (val1<=val3) then
+ [val ind] = min(a(find(a>0)));
+ elseif (val2<=val1) & (val2<=val3) then
+ [val ind] = min(b(find(b>0)));
+ else
+ [val ind] = min(c(find(c>0)));
+ end
+ end
+ end
+ end
+
+ // output values according to the user input for valueoutputport and indexoutputport
+ if (~strcmpi(valueOutputPort,'true') & ~strcmpi(indexOutputPort,'true')) then
+ varargout = list(val,ind);
+ elseif (~strcmpi(valueOutputPort,'true') & ~strcmpi(indexOutputPort,'false')) then
+ varargout = list(val);
+ elseif (~strcmpi(indexOutputPort,'true') & ~strcmpi(valueOutputPort,'false')) then
+ varargout = list(ind);
+ end
+
+endfunction
+
diff --git a/macros/cvStandardDeviation.bin b/macros/cvStandardDeviation.bin
new file mode 100644
index 0000000..5cdfb93
--- /dev/null
+++ b/macros/cvStandardDeviation.bin
Binary files differ
diff --git a/macros/cvStandardDeviation.sci b/macros/cvStandardDeviation.sci
new file mode 100644
index 0000000..260553b
--- /dev/null
+++ b/macros/cvStandardDeviation.sci
@@ -0,0 +1,217 @@
+//*********************************************************************//
+// Author : Asmita Bhar, Kevin George
+//*********************************************************************//
+
+function [val] = cvStandardDeviation(image, varargin)
+// Finds standard deviation values in an input
+//
+// Calling Sequence
+// val = cvStandardDeviation(image);
+// val = cvStandardDeviation(image, name, value,...);
+// val = cvStandardDeviation(image, name, value,c,r); (only when ROI Processing is true)
+//
+// Parameters
+// image : Input image matrix
+// Dimension (Output) : Dimension along which the function operates - Row, Column, All or Custom. Default : All
+// CustomDimension (Optional) : The integer dimension over which the function calculates the minimum. This value cannot exceed the number of dimensions in input. It applies only when 'Dimension' property is set to 'Custom'. Default : 1
+// ROIProcessing (Optional) : It applies only when 'Dimension' property is set to 'All'. It calculates the standard deviation within a particular region of the image. Default : false
+// c (Optional): vector of y-coordinates of vectices of a rectangle(ROI). Applicable only when 'ROIProcssing' is set to 'true'.
+// r (Optional): vector of x-coordinates of vectices of a rectangle(ROI). Applicable only when 'ROIProcssing' is set to 'true'.
+// val : Stores the standard deviation value calculated
+//
+// Description
+// The function calculates the standard deviation value in a given image matrix.
+//
+// Examples
+// //Load an image
+// I = imread('peppers.png');
+// //Calculate the standard deviation (default dimension is 'All')
+// val = cvStandardDeviation(I);
+// //Calculate the standard deviation when dimension is 'Row'
+// val = cvStandardDeviation(I,'Dimension','Row');
+// //Calculate the standard deviation within a given ROI
+// a = [0 100 100 0];
+// b = [0 0 100 100];
+// val = cvStandardDeviation(I,'ROIProcessing','true',a,b);
+//
+// Authors
+// Asmita Bhar
+// Kevin George
+//
+ [lhs,rhs] = argn(0);
+ if rhs<1 then
+ error(msprintf("Not enough input arguments"));
+ end
+ if rhs>9 then
+ error(msprintf("Too many input arguments"));
+ end
+ [iRows iCols]=size(image(1))
+ iChannels = size(image)
+
+ dimension = 'All';
+ customDimension = 1;
+ roiProcessing = 'false';
+
+ flag1=0;
+ i=1;
+ while(i<rhs-1)
+ if strcmpi(varargin(i),'Dimension')==0 then
+ dimension = varargin(i+1)
+ if strcmpi(dimension,"Column") & strcmpi(dimension,"Row") &strcmpi(dimension,"All") & strcmpi(dimension,"Custom") then
+ error(msprintf(" wrong input argument #%d, Dimension not matched",i))
+ end
+ i=i+2;
+ elseif strcmpi(varargin(i),'CustomDimension')==0 then
+ customDimension = varargin(i+1)
+ flag1=1;
+ i=i+2;
+ elseif strcmpi(varargin(i), 'ROIProcessing')==0 then
+ roiProcessing = varargin(i+1)
+ if(roiProcessing=='true') then
+ c = varargin(i+2);
+ r = varargin(i+3);
+ i=i+4;
+ else
+ i=i+2;
+ end
+ end
+
+ end
+
+ if (strcmpi(dimension,'Custom') & (flag1==1))
+ error(msprintf("The CustomDimension property is not relevant in this configuration"));
+ end
+
+ if (strcmpi(dimension,"All") & strcmpi(roiProcessing,'true'))
+ error(msprintf("ROI Property is not relevant in this configuration"));
+ end
+
+ if(customDimension<1)
+ error(msprintf("CustomDimension must be greater than or equal to 1"));
+ end
+
+ if(iChannels==1) then
+ if(customDimension>2)
+ error(msprintf("CustomDimension cannot be greater than the dimension of the input."));
+ end
+ elseif(iChannels==3) then
+ if(customDimension>3)
+ error(msprintf("CustomDimension cannot be greater than the dimension of the input."));
+ end
+ end
+
+ if(iChannels==1)
+ I = double(image(1));
+ elseif(iChannels==3)
+ I1 = double(image(1));
+ I2 = double(image(2));
+ I3 = double(image(3));
+ end
+
+ if(roiProcessing=='false') then
+ if (dimension=='All') then
+ if(iChannels==1) then
+ val = stdev(I)
+ elseif (iChannels==3) then
+ val1 = stdev(I1)
+ val2 = stdev(I2)
+ val3 = stdev(I3)
+ val = stdev([val1 val2 val3])
+ end
+ end
+ if (dimension=='Row') then
+ if(iChannels==1) then
+ val = stdev(I,'c');
+ elseif(iChannels==3) then
+ val1 = stdev(I1,'c');
+ val2 = stdev(I2,'c');
+ val3 = stdev(I3,'c');
+ val(:,:,1) = val1;
+ val(:,:,2) = val2;
+ val(:,:,3) = val3;
+ end
+ end
+ if (dimension=='Column') then
+ if(iChannels==1) then
+ val = stdev(I,'r');
+ elseif(iChannels==3) then
+ val1 = stdev(I1,'r');
+ val2 = stdev(I2,'r');
+ val3 = stdev(I3,'r');
+ val(:,:,1) = val1;
+ val(:,:,2) = val2;
+ val(:,:,3) = val3;
+ end
+ end
+ if (dimension=='Custom') then
+ if(iChannels==1) then
+ if(customDimension==1) then
+ val = stdev(I,'r');
+ elseif(customDimension==2) then
+ val = stdev(I,'c');
+ end
+ elseif(iChannels==3) then
+ if(customDimension==1) then
+ val1 = stdev(I1,'r');
+ val2 = stdev(I2,'r');
+ val3 = stdev(I3,'r');
+ val(:,:,1) = val1;
+ val(:,:,2) = val2;
+ val(:,:,3) = val3;
+ elseif(customDimension==2) then
+ val1 = stdev(I1,'c');
+ val2 = stdev(I2,'c');
+ val3 = stdev(I3,'c');
+ val(:,:,1) = val1;
+ val(:,:,2) = val2;
+ val(:,:,3) = val3;
+ elseif(customDimension==3) then
+ for i=1:iRows
+ for j=1:iCols
+ val(i,j)= stdev([I1(i,j) I2(i,j) I3(i,j)]);
+ end
+
+ end
+ end
+ end
+ end
+ end
+ if(roiProcessing=='true') then
+ I4 = roipoly(image,c,r);
+ out = I4;
+ output = find(out>0);
+ [rows cols] = size(out);
+ if(iChannels==1)
+ ROI = zeros(iRows,iCols);
+ for i=1:cols
+ ROI(output(i)) = I(output(i));
+ end
+ elseif(iChannels==3)
+ ROI1 = zeros(iRows,iCols);
+ ROI2 = zeros(iRows,iCols);
+ ROI3 = zeros(iRows,iCols);
+ for i=1:cols
+ ROI1(output(i)) = I1(output(i));
+ ROI2(output(i)) = I2(output(i));
+ ROI3(output(i)) = I3(output(i));
+ end
+ ROI = list(ROI1,ROI2,ROI3);
+ end
+ if (dimension=='All') then
+ if(iChannels==1) then
+ a=ROI;
+ val = stdev(a(find(a>0)));
+ elseif (iChannels==3) then
+ a=ROI(1);
+ b=ROI(2);
+ c=ROI(3);
+ val1 = stdev(a(find(a>0)));
+ val2 = stdev(b(find(b>0)));
+ val3 = stdev(c(find(c>0)));
+ val = stdev([val1 val2 val3]);
+ end
+ end
+ end
+
+endfunction
+
diff --git a/macros/cvVariance.bin b/macros/cvVariance.bin
new file mode 100644
index 0000000..94c7ae2
--- /dev/null
+++ b/macros/cvVariance.bin
Binary files differ
diff --git a/macros/cvVariance.sci b/macros/cvVariance.sci
new file mode 100644
index 0000000..bbe18ad
--- /dev/null
+++ b/macros/cvVariance.sci
@@ -0,0 +1,217 @@
+//*********************************************************************//
+// Author : Asmita Bhar, Kevin George
+//*********************************************************************//
+
+function [val] = cvVariance(image, varargin)
+// Finds variance values in an input
+//
+// Calling Sequence
+// val = cvVariance(image);
+// val = cvVariance(image, name, value,...);
+// val = cvVariance(image, name, value,c,r); (only when ROI Processing is true)
+//
+// Parameters
+// image : Input image matrix
+// Dimension (Output) : Dimension along which the function operates - Row, Column, All or Custom. Default : All
+// CustomDimension (Optional) : The integer dimension over which the function calculates the minimum. This value cannot exceed the number of dimensions in input. It applies only when 'Dimension' property is set to 'Custom'. Default : 1
+// ROIProcessing (Optional) : It applies only when 'Dimension' property is set to 'All'. It calculates the variance within a particular region of the image. Default : false
+// c (Optional): vector of y-coordinates of vectices of a rectangle(ROI). Applicable only when 'ROIProcssing' is set to 'true'.
+// r (Optional): vector of x-coordinates of vectices of a rectangle(ROI). Applicable only when 'ROIProcssing' is set to 'true'.
+// val : Stores the variance calculated
+//
+// Description
+// The function calculates the variance value in a given image matrix.
+//
+// Examples
+// //Load an image
+// I = imread('peppers.png');
+// //Calculate the variance (default dimension is 'All')
+// val = cvVariance(I);
+// //Calculate the variance when dimension is 'Row'
+// val = cvVariance(I,'Dimension','Row');
+// //Calculate the variance within a given ROI
+// a = [0 100 100 0];
+// b = [0 0 100 100];
+// val = cvVariance(I,'ROIProcessing','true',a,b);
+//
+// Authors
+// Asmita Bhar
+// Kevin George
+//
+ [lhs,rhs] = argn(0);
+ if rhs<1 then
+ error(msprintf("Not enough input arguments"));
+ end
+ if rhs>9 then
+ error(msprintf("Too many input arguments"));
+ end
+ [iRows iCols]=size(image(1))
+ iChannels = size(image)
+
+ dimension = 'All';
+ customDimension = 1;
+ roiProcessing = 'false';
+
+ flag1=0;
+ i=1;
+ while(i<rhs-1)
+ if strcmpi(varargin(i),'Dimension')==0 then
+ dimension = varargin(i+1)
+ if strcmpi(dimension,"Column") & strcmpi(dimension,"Row") &strcmpi(dimension,"All") & strcmpi(dimension,"Custom") then
+ error(msprintf(" wrong input argument #%d, Dimension not matched",i))
+ end
+ i=i+2;
+ elseif strcmpi(varargin(i),'CustomDimension')==0 then
+ customDimension = varargin(i+1)
+ flag1=1;
+ i=i+2;
+ elseif strcmpi(varargin(i), 'ROIProcessing')==0 then
+ roiProcessing = varargin(i+1)
+ if(roiProcessing=='true') then
+ c = varargin(i+2);
+ r = varargin(i+3);
+ i=i+4;
+ else
+ i=i+2;
+ end
+ end
+
+ end
+
+ if (strcmpi(dimension,'Custom') & (flag1==1))
+ error(msprintf("The CustomDimension property is not relevant in this configuration"));
+ end
+
+ if (strcmpi(dimension,"All") & strcmpi(roiProcessing,'true'))
+ error(msprintf("ROI Property is not relevant in this configuration"));
+ end
+
+ if(customDimension<1)
+ error(msprintf("CustomDimension must be greater than or equal to 1"));
+ end
+
+ if(iChannels==1) then
+ if(customDimension>2)
+ error(msprintf("CustomDimension cannot be greater than the dimension of the input."));
+ end
+ elseif(iChannels==3) then
+ if(customDimension>3)
+ error(msprintf("CustomDimension cannot be greater than the dimension of the input."));
+ end
+ end
+
+ if(iChannels==1)
+ I = double(image(1));
+ elseif(iChannels==3)
+ I1 = double(image(1));
+ I2 = double(image(2));
+ I3 = double(image(3));
+ end
+
+ if(roiProcessing=='false') then
+ if (dimension=='All') then
+ if(iChannels==1) then
+ val = variance(I)
+ elseif (iChannels==3) then
+ val1 = variance(I1)
+ val2 = variance(I2)
+ val3 = variance(I3)
+ val = variance([val1 val2 val3])
+ end
+ end
+ if (dimension=='Row') then
+ if(iChannels==1) then
+ val = variance(I,'c');
+ elseif(iChannels==3) then
+ val1 = variance(I1,'c');
+ val2 = variance(I2,'c');
+ val3 = variance(I3,'c');
+ val(:,:,1) = val1;
+ val(:,:,2) = val2;
+ val(:,:,3) = val3;
+ end
+ end
+ if (dimension=='Column') then
+ if(iChannels==1) then
+ val = variance(I,'r');
+ elseif(iChannels==3) then
+ val1 = variance(I1,'r');
+ val2 = variance(I2,'r');
+ val3 = variance(I3,'r');
+ val(:,:,1) = val1;
+ val(:,:,2) = val2;
+ val(:,:,3) = val3;
+ end
+ end
+ if (dimension=='Custom') then
+ if(iChannels==1) then
+ if(customDimension==1) then
+ val = variance(I,'r');
+ elseif(customDimension==2) then
+ val = variance(I,'c');
+ end
+ elseif(iChannels==3) then
+ if(customDimension==1) then
+ val1 = variance(I1,'r');
+ val2 = variance(I2,'r');
+ val3 = variance(I3,'r');
+ val(:,:,1) = val1;
+ val(:,:,2) = val2;
+ val(:,:,3) = val3;
+ elseif(customDimension==2) then
+ val1 = variance(I1,'c');
+ val2 = variance(I2,'c');
+ val3 = variance(I3,'c');
+ val(:,:,1) = val1;
+ val(:,:,2) = val2;
+ val(:,:,3) = val3;
+ elseif(customDimension==3) then
+ for i=1:iRows
+ for j=1:iCols
+ val(i,j)= variance([I1(i,j) I2(i,j) I3(i,j)]);
+ end
+
+ end
+ end
+ end
+ end
+ end
+ if(roiProcessing=='true') then
+ I4 = roipoly(image,c,r);
+ out = I4;
+ output = find(out>0);
+ [rows cols] = size(out);
+ if(iChannels==1)
+ ROI = zeros(iRows,iCols);
+ for i=1:cols
+ ROI(output(i)) = image(1)(output(i));
+ end
+ elseif(iChannels==3)
+ ROI1 = zeros(iRows,iCols);
+ ROI2 = zeros(iRows,iCols);
+ ROI3 = zeros(iRows,iCols);
+ for i=1:cols
+ ROI1(output(i)) = image(1)(output(i));
+ ROI2(output(i)) = image(2)(output(i));
+ ROI3(output(i)) = image(3)(output(i));
+ end
+ ROI = list(ROI1,ROI2,ROI3);
+ end
+ if (dimension=='All') then
+ if(iChannels==1) then
+ a=ROI;
+ val = variance(a(find(a>0)));
+ elseif (iChannels==3) then
+ a=ROI(1);
+ b=ROI(2);
+ c=ROI(3);
+ val1 = variance(a(find(a>0)));
+ val2 = variance(b(find(b>0)));
+ val3 = variance(c(find(c>0)));
+ val = variance([val1 val2 val3]);
+ end
+ end
+ end
+
+endfunction
+
diff --git a/macros/cv_imread.bin b/macros/cv_imread.bin
new file mode 100644
index 0000000..214b649
--- /dev/null
+++ b/macros/cv_imread.bin
Binary files differ
diff --git a/macros/cv_imread.sci b/macros/cv_imread.sci
new file mode 100644
index 0000000..100cae3
--- /dev/null
+++ b/macros/cv_imread.sci
@@ -0,0 +1,11 @@
+function[dstMat] = cv_imread(matA)
+
+ out = opencv_imread(matA)
+
+ channel = size(out)
+
+ for i = 1: channel
+ dstMat(:,:,i) = out(i)
+ end
+
+endfunction
diff --git a/macros/cv_imread.sci~ b/macros/cv_imread.sci~
new file mode 100644
index 0000000..de70a07
--- /dev/null
+++ b/macros/cv_imread.sci~
@@ -0,0 +1,11 @@
+function[dstMat] = imread(matA)
+
+ out = opencv_imread(matA)
+
+ channel = size(out)
+
+ for i = 1: channel
+ dstMat(:,:,i) = out(i)
+ end
+
+endfunction
diff --git a/macros/cvtColor.bin b/macros/cvtColor.bin
new file mode 100644
index 0000000..379c49c
--- /dev/null
+++ b/macros/cvtColor.bin
Binary files differ
diff --git a/macros/cvtColor.sci b/macros/cvtColor.sci
new file mode 100644
index 0000000..e112154
--- /dev/null
+++ b/macros/cvtColor.sci
@@ -0,0 +1,20 @@
+function new_image = cvtColor(image, code, varargin)
+
+ [ lhs, rhs ] = argn(0)
+
+ image_list = mattolist(image)
+
+ select rhs
+ case 2 then
+ out = opencv_cvtColor(image_list, code)
+
+ case 3 then
+ out = opencv_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/dctmtx.bin b/macros/dctmtx.bin
new file mode 100644
index 0000000..0f89e5b
--- /dev/null
+++ b/macros/dctmtx.bin
Binary files differ
diff --git a/macros/dctmtx.sci b/macros/dctmtx.sci
new file mode 100644
index 0000000..b17d25d
--- /dev/null
+++ b/macros/dctmtx.sci
@@ -0,0 +1,4 @@
+function [out]=dctmtx(n)
+ out=opencv_dctmtx(n);
+
+endfunction;
diff --git a/macros/decorrstretch.bin b/macros/decorrstretch.bin
new file mode 100644
index 0000000..d72aad5
--- /dev/null
+++ b/macros/decorrstretch.bin
Binary files differ
diff --git a/macros/decorrstretch.sci b/macros/decorrstretch.sci
new file mode 100644
index 0000000..257f191
--- /dev/null
+++ b/macros/decorrstretch.sci
@@ -0,0 +1,12 @@
+function new_image = decorrstretch(image)
+
+ image_list = mattolist(image)
+
+ out = opencv_decorrstretch(image_list)
+
+ sz = size(out)
+ for i=1:sz
+ new_image(:, :, i) = out(i)
+ end
+
+endfunction
diff --git a/macros/demosaic.bin b/macros/demosaic.bin
new file mode 100644
index 0000000..9547d64
--- /dev/null
+++ b/macros/demosaic.bin
Binary files differ
diff --git a/macros/demosaic.sci b/macros/demosaic.sci
new file mode 100644
index 0000000..529511a
--- /dev/null
+++ b/macros/demosaic.sci
@@ -0,0 +1,8 @@
+function [out]=demosaic(src,code,dstCn)
+ input_image1=mattolist(src);
+ a=opencv_demosaic( input_image1,code,dstCn);
+ dimension=size(a)
+ for i = 1:dimension
+ out(:,:,i)=a(i);
+ end
+endfunction;
diff --git a/macros/detectBRISKFeatures.bin b/macros/detectBRISKFeatures.bin
new file mode 100644
index 0000000..dc7de07
--- /dev/null
+++ b/macros/detectBRISKFeatures.bin
Binary files differ
diff --git a/macros/detectBRISKFeatures.sci b/macros/detectBRISKFeatures.sci
new file mode 100644
index 0000000..4449727
--- /dev/null
+++ b/macros/detectBRISKFeatures.sci
@@ -0,0 +1,47 @@
+function [varargout] = detectBRISKFeatures(image, varargin)
+// This function is used to detect BRISK(Binary Robust Invariant Scalable Keypoints) Features in a grayscale Image.
+//
+// Calling Sequence
+// result = detectBRISKFeatures(Image);
+// result = detectBRISKFeatures(Image, Name, Value, ...)
+//
+// Parameters
+// result: BRISKPoints struct which contains Location of KeyPoints, Orientation, Metric, SignOfLaplacian, Scale and Count of the features.
+// Image : Input image, specified as a A-by-N 2D grayscale.
+// MinContrast : (Optional) The minimum difference in intensity between a corner and its surrounding region. (Default: 0.2). The value must be between 0 and 1.
+// NumOctaves : (Optional)The number of Octaves that the detector uses. (Default - 3) The value must be an integer scalar in between 1 and 4.
+// MinQuality : (Optional) This specifies the minimum quality accepted for corners. (Default - 0.1) The value must be between 0 and 1.
+// ROI : (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 returns the BRISK features detected in a 2D grayscale image.
+//
+// Examples
+// image = imread('sample.jpg');
+// results = detectBRISKFeatures(image);
+//
+// Authors
+// Shashank Shekhar
+
+ image_list = mattolist(image);
+ [ lhs, rhs ] = argn(0)
+ if rhs > 9 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]= ocv_detectBRISKFeatures(image_list)
+ case 3 then
+ [a b c d e]= ocv_detectBRISKFeatures(image_list, varargin(1), varargin(2))
+ case 5 then
+ [a b c d e]= ocv_detectBRISKFeatures(image_list, varargin(1), varargin(2), varargin(3), varargin(4))
+ case 7 then
+ [a b c d e]= ocv_detectBRISKFeatures(image_list, varargin(1), varargin(2), varargin(3), varargin(4), varargin(5), varargin(6))
+ case 9 then
+ [a b c d e]= ocv_detectBRISKFeatures(image_list, varargin(1), varargin(2), varargin(3), varargin(4), varargin(5), varargin(6), varargin(7), varargin(8))
+ end
+ varargout(1) = struct('Keypoints', a, 'Orientation', b, 'Metric', c ,'Scale', d, 'Count', e);
+endfunction
diff --git a/macros/detectCheckerboardPoints.bin b/macros/detectCheckerboardPoints.bin
new file mode 100644
index 0000000..0e17878
--- /dev/null
+++ b/macros/detectCheckerboardPoints.bin
Binary files differ
diff --git a/macros/detectCheckerboardPoints.sci b/macros/detectCheckerboardPoints.sci
new file mode 100644
index 0000000..b4e50c7
--- /dev/null
+++ b/macros/detectCheckerboardPoints.sci
@@ -0,0 +1,50 @@
+function [imagePoints,boardSize,varargout]=detectCheckerboardPoints(input1,varargin)
+// This function is used to detect a checkerboard pattern in an image.
+//
+// Calling Sequence
+// [imagePoints boardSize] = detectCheckerboardPoints(I);
+// [imagePoints boardSize imagesUsed] = detectCheckerboardPoints(imageFileNames);
+// [imagePoints boardSize imagesUsed] = detectCheckerboardPoints(images);
+// [imagePoints boardSize imagesUsed] = detectCheckerboardPoints(imageFileNames1,imageFileNames2);
+// [imagePoints boardSize imagesUsed] = detectCheckerboardPoints(images1,images2);
+//
+// Parameters
+// imagePoints: Matrix containing checkerboard points.
+// boardSize: Matrix (1x2) containing boardSize
+// imagesUsed: Images used to detect checkerboard in case of multiple input images
+// imageFileNames: Path to image files
+// images: Input images
+//
+// Description
+// This function detects a checkerboard in an image and returns the points of the checkeboard corners.
+//
+// Examples
+// [imagePoints boardSize imagesUsed] = detectCheckerboardPoints(imageFileNames);
+//
+// [imagePoints boardSize imagesUsed] = detectCheckerboardPoints(images1,images2);
+//
+// Authors
+// Rohit Suri
+
+ [lhs rhs]=argn(0);
+ if lhs>3
+ error(msprintf(" Too many output arguments"));
+ elseif rhs>2
+ error(msprintf(" Too many input arguments"));
+ end
+ select rhs
+ case 1 then
+ [points boardSize usedImages]=opencv_detectCheckerboardPoints(input1);
+ case 2 then
+ [points boardSize usedImages]=opencv_detectCheckerboardPoints(input1,varargin(1));
+ end
+ for i=1:size(points(1))
+ for j=1:size(points(1)(1),'r')
+ imagePoints(:,:,i)=points(1)(i);
+ end
+ end
+ if lhs==3 then
+ len=size(usedImages,'c');
+ varargout(1)=matrix(usedImages,len,1);
+ end
+endfunction
diff --git a/macros/detectFASTFeatures.bin b/macros/detectFASTFeatures.bin
new file mode 100644
index 0000000..da32183
--- /dev/null
+++ b/macros/detectFASTFeatures.bin
Binary files differ
diff --git a/macros/detectFASTFeatures.sci b/macros/detectFASTFeatures.sci
new file mode 100644
index 0000000..e78baba
--- /dev/null
+++ b/macros/detectFASTFeatures.sci
@@ -0,0 +1,53 @@
+function [cornerPoints]=detectFASTFeatures(image,varargin)
+// This function is used to detect the corner points using FAST Alogrithm
+//
+// Calling Sequence
+// [ Location Count Metric ] = detectFASTFeatures( Image, Name, Value... )
+//
+// Parameters
+// Image: Input Image, should be a 2-D grayscale. The Input Image should be real
+// MinQuality [Optional Input Argument]: Minimum Accepted Quality of Corners, can be specified as a scalar value between [0,1]. Default: 0.1
+// MinContrast [Optional Input Argument]: Minimum Intensity difference for Corners to be detected, can be specified as a scalar value between[0,1]. Default: 0.2
+// ROI [Optional Input Argument]: Specify a rectangular region of operation. Format [ x y width height ]. Default: [1 1 size(Image,2) size(Image,1)]
+// Location: Set of x,y coordinates for the deteccted points
+// Count: Number of corner points detected
+// Metric: Value describing the strength of each detected Point
+//
+// Description
+// The detectFASTFeatures function uses the Features from Accelerated Segment Test (FAST) algorithm to find feature points.
+//
+// Examples
+// image = imread('sample.jpg');
+// [location count metric] = detectFastFeatures(image);
+//
+// With Optional Arguments:
+// [location count metric] = detectFASTFeatures(image,"MinContrast",0.2);
+//
+// Authors
+// Umang Agrawal
+// Sridhar Reddy
+
+ [lhs rhs]=argn(0);
+ if lhs>3
+ error(msprintf(" Too many output arguments"));
+ elseif rhs-1>6
+ 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
+ [location count metric]=opencv_detectFASTFeatures(imageList);
+ case 2 then
+ [location count metric]=opencv_detectFASTFeatures(imageList,varargin(1),varargin(2));
+ case 4 then
+ [location count metric]=opencv_detectFASTFeatures(imageList,varargin(1),varargin(2),varargin(3),varargin(4));
+ case 6 then
+ [location count metric]=opencv_detectFASTFeatures(imageList,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6));
+ end
+ cornerPoints=struct('Type','cornerPoints','Location',location,'Metric',metric,'Count',count);
+ //for i=1:count
+ // cornerPoints(i)=struct('Location',location(i,:),'metric',metric(i,:),'Count',1);
+ //end
+endfunction
diff --git a/macros/detectHarrisFeatures.bin b/macros/detectHarrisFeatures.bin
new file mode 100644
index 0000000..60db293
--- /dev/null
+++ b/macros/detectHarrisFeatures.bin
Binary files differ
diff --git a/macros/detectHarrisFeatures.sci b/macros/detectHarrisFeatures.sci
new file mode 100644
index 0000000..f4792f7
--- /dev/null
+++ b/macros/detectHarrisFeatures.sci
@@ -0,0 +1,52 @@
+function [cornerPoints]=detectHarrisFeatures(image,varargin)
+// This function is used to find corner points in an image using Harris algorithm.
+//
+// Calling Sequence
+// points = detectHarrisFeatures(I);
+// points = detectHarrisFeatures(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
+// SensitivityFactor: (Optional) SensitivityFactor of Harris algorithm (Default- 0.04)
+//
+// 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 = detectHarrisFeatures(I);
+//
+// Authors
+// Rohit Suri
+// Sridhar Reddy
+
+ [lhs rhs]=argn(0);
+ if lhs>1
+ error(msprintf(" Too many output arguments"));
+ elseif rhs>9
+ 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]=opencv_detectHarrisFeatures(imageList);
+ case 2 then
+ [location metric count]=opencv_detectHarrisFeatures(imageList,varargin(1),varargin(2));
+ case 4 then
+ [location metric count]=opencv_detectHarrisFeatures(imageList,varargin(1),varargin(2),varargin(3),varargin(4));
+ case 6 then
+ [location metric count]=opencv_detectHarrisFeatures(imageList,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6));
+ case 8 then
+ [location metric count]=opencv_detectHarrisFeatures(imageList,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6),varargin(7),varargin(8));
+ end
+ cornerPoints=struct('Type','cornerPoints','Location',location,'Metric',metric,'Count',count);
+ //for i=1:count(1,1)
+ // cornerPoints(i)=struct('Location',location(i,:),'Metric',metric(i,:),'Count',1);
+ //end
+endfunction
diff --git a/macros/detectMSERFeatures.bin b/macros/detectMSERFeatures.bin
new file mode 100644
index 0000000..ec3010b
--- /dev/null
+++ b/macros/detectMSERFeatures.bin
Binary files differ
diff --git a/macros/detectMSERFeatures.sci b/macros/detectMSERFeatures.sci
new file mode 100644
index 0000000..9e1377a
--- /dev/null
+++ b/macros/detectMSERFeatures.sci
@@ -0,0 +1,57 @@
+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)
+//
+// Authors
+// Umang Agrawal
+// Sridhar Reddy
+
+ [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]=opencv_detectMSERFeatures(imageList);
+ case 2 then
+ [pixelIdxList count location axes orientation]=opencv_detectMSERFeatures(imageList,varargin(1),varargin(2));
+ case 4 then
+ [pixelIdxList count location axes orientation]=opencv_detectMSERFeatures(imageList,varargin(1),varargin(2),varargin(3),varargin(4));
+ case 6 then
+ [pixelIdxList count location axes orientation]=opencv_detectMSERFeatures(imageList,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6));
+ case 8 then
+ [pixelIdxList count location axes orientation]=opencv_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
new file mode 100644
index 0000000..80a65bb
--- /dev/null
+++ b/macros/detectMinEigenFeatures.bin
Binary files differ
diff --git a/macros/detectMinEigenFeatures.sci b/macros/detectMinEigenFeatures.sci
new file mode 100644
index 0000000..e6b4485
--- /dev/null
+++ b/macros/detectMinEigenFeatures.sci
@@ -0,0 +1,50 @@
+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);
+//
+// Authors
+// Rohit Suri
+// Sridhar Reddy
+
+ [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]=opencv_detectMinEigenFeaturess(imageList);
+ case 2 then
+ [location metric count]=opencv_detectMinEigenFeatures(imageList,varargin(1),varargin(2));
+ case 4 then
+ [location metric count]=opencv_detectMinEigenFeatures(imageList,varargin(1),varargin(2),varargin(3),varargin(4));
+ case 6 then
+ [location metric count]=opencv_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/detectSURFFeatures.bin b/macros/detectSURFFeatures.bin
new file mode 100644
index 0000000..ebefc15
--- /dev/null
+++ b/macros/detectSURFFeatures.bin
Binary files differ
diff --git a/macros/detectSURFFeatures.sci b/macros/detectSURFFeatures.sci
new file mode 100644
index 0000000..1ee7395
--- /dev/null
+++ b/macros/detectSURFFeatures.sci
@@ -0,0 +1,45 @@
+function [varargout] = detectSURFFeatures(image, varargin)
+// This function is used to detect SURF(Speeded Up Robust Features) Features in a grayscale Image.
+//
+// Calling Sequence
+// result = detectSURFFeatures(Image);
+// result = detectSURFFeatures(Image, Name, Value, ...)
+//
+// Parameters
+// result: SURFPoints struct which contains Location of KeyPoints, Orientation, Metric, SignOfLaplacian, Scale and Count of the features.
+// Image : Input image, specified as a A-by-N 2D grayscale.
+// MetricThreshold : (Optional) With default value equal to 1000, it is to be specified as a scalar. Every interest point detected has a strength associated with it. In case, only the stronget ones are needed, this parameter has to be given a larger value. To get more no of interest points/blobs, it is to be reduced.
+// NumOctaves : (Optional)With default value equal to 3, it is to be specified as a scalar. Larger the number of octaves, larger is the size of blobs detected. This is because higher octave use large sized filters. Value must be an integer scalar in between 1 and 4.
+// NumScaleLevels : (Optional)With default value equal to 4, it is to be specified as a scalar. It denotes the number of scale level for each octave. The Value must be an integer scalar greater than or equal to 3.
+// ROI : (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 return the SURF(Speeded Up Robust Features) Interest Points for a 2D Grayscale image. It is scale- and rotation- invariant point detector and descriptor and its application include Camera Calibration, 3D Reconstruction, Object Recognition to name a few.
+//
+// Examples
+// image = imread('sample.jpg');
+// results = detectSURFFeatures(image);
+//
+// Authors
+// Shashank Shekhar
+ image_list = mattolist(image);
+ [ lhs, rhs ] = argn(0)
+ if rhs > 9 then
+ error(msprintf("Too many input arguments"))
+ end
+ if lhs > 1 then
+ error(msprintf("Not enough input arguments"))
+ end
+ select rhs
+ case 1 then
+ [a b c d e f] = ocv_detectSURFFeatures(image_list)
+ case 3 then
+ [a b c d e f] = ocv_detectSURFFeatures(image_list, varargin(1), varargin(2))
+ case 5 then
+ [a b c d e f] = ocv_detectSURFFeatures(image_list, varargin(1), varargin(2), varargin(3), varargin(4))
+ case 7 then
+ [a b c d e f] = ocv_detectSURFFeatures(image_list, varargin(1), varargin(2), varargin(3), varargin(4), varargin(5), varargin(6))
+ case 9 then
+ [a b c d e f] = ocv_detectSURFFeatures(image_list, varargin(1), varargin(2), varargin(3), varargin(4), varargin(5), varargin(6), varargin(7), varargin(8))
+ end
+ varargout(1) = struct('KeyPoints', a, 'Orientation', b, 'Metric', c ,'SignOfLaplacian', d,'Scale', e, 'Count', f );
+endfunction \ No newline at end of file
diff --git a/macros/dilate.bin b/macros/dilate.bin
new file mode 100644
index 0000000..a3f0780
--- /dev/null
+++ b/macros/dilate.bin
Binary files differ
diff --git a/macros/dilate.sci b/macros/dilate.sci
new file mode 100644
index 0000000..0c21511
--- /dev/null
+++ b/macros/dilate.sci
@@ -0,0 +1,8 @@
+function [out]=dilate(input_image,actualkernel,anchor_x,anchor_y,iteration)
+ input_image1=mattolist(input_image);
+ a=opencv_dilate(input_image1,actualkernel,anchor_x,anchor_y,iteration);
+ dimension=size(a)
+ for i = 1:dimension
+ out(:,:,i)=a(i);
+ end
+endfunction;
diff --git a/macros/displayErrors.bin b/macros/displayErrors.bin
new file mode 100644
index 0000000..944fc58
--- /dev/null
+++ b/macros/displayErrors.bin
Binary files differ
diff --git a/macros/displayErrors.sci b/macros/displayErrors.sci
new file mode 100644
index 0000000..ae16b53
--- /dev/null
+++ b/macros/displayErrors.sci
@@ -0,0 +1,249 @@
+function displayErrors(varargin)
+ [lhs rhs]=argn(0);
+ if rhs<2 then
+ error(msprintf(" Not enough input arguments"))
+ elseif rhs>2 then
+ error(msprintf(" Too many input arguments. Two arguments expected."))
+ end
+ typeOferrors =0;
+ errors = varargin(1);
+ if ~isstruct(errors) then
+ error(msprintf("Invalid Input Argument. A CameraCalibrationError Struct or StereoCalibrationError Struct expected. "))
+ end
+ errorNames = fieldnames(errors);
+ [size1 zz] = size(errorNames);
+
+ if size1 == 2 then
+ typeOferrors = 1;
+ elseif size1 == 5 then
+ typeOferrors = 2;
+ else
+ error(msprintf("Invalid Input Argument. A CameraCalibrationError Struct or StereoCalibrationError Struct expected. "))
+ end
+
+ if typeOferrors == 1 then
+ cameraParam = varargin(2);
+ checkCCE(errors);
+ if ~isstruct(cameraParam) then
+ error(msprintf(" A CameraParameters Struct expected"))
+ end
+ jj = fieldnames(cameraParam)
+ [size3 zz] = size(jj);
+ if size3~=18 then
+ error(msprintf("An CameraParameters struct expected."))
+ end
+ checkCameraParam(cameraParam);
+ focalErr = string(cameraParam.FocalLength) + " +/- ";
+ fE = string(errors.IntrinsicsErrors.FocalLengthError) ;
+ prinErr = string(cameraParam.PrincipalPoint) + " +/- ";
+ pE = string(errors.IntrinsicsErrors.PrincipalPointError);
+ radErr = string(cameraParam.RadialDistortion) + " +/- ";
+ rdE = string(errors.IntrinsicsErrors.RadDistortionError);
+ for i=1:2
+ focalErr(i) = focalErr(i) + fE(i);
+ prinErr(i) = prinErr(i) + pE(i);
+ end
+ [size1 xx] = size(radErr);
+ size1 =size1*xx;
+ for i=1:size1
+ radErr(i) = radErr(i) + rdE(i);
+ end
+
+ rotVecErr = string(cameraParam.RotationVectors) + " +/- ";
+ rvE = string(errors.ExtrinsicsErrors.RotVectorsError);
+ [size21 size22] = size(rotVecErr);
+ printf("%d %d \n", size21,size22);
+ for i=1:size21
+ for j=1:size22
+ rotVecErr(i,j) = rotVecErr(i,j) + rvE(i,j);
+ end
+ end
+
+ tranVecErr = string(cameraParam.TranslationVectors) + " +/- ";
+ tvE = string(errors.ExtrinsicsErrors.TransVectorsError);
+ [size31 size32] = size(tranVecErr);
+ printf("%d %d \n", size31,size32);
+ for i=1:size31
+ for j=1:size32
+ tranVecErr(i,j) = tranVecErr(i,j) + tvE(i,j);
+ end
+ end
+
+
+ printf("\n\t\t\tStandard Errors of Estimated Camera Parameters\n");
+ printf("\t\t\t----------------------------------------------\n\n");
+ printf(" Intrinsics\n");
+ printf(" ----------\n");
+ printf(" Focal length (pixels): [\t");
+ printf("%s\t\t%s\t]\n", focalErr(1), focalErr(2));
+ printf(" Principal point (pixels): [\t");
+ printf("%s\t\t%s\t]\n", prinErr(1), prinErr(2));
+ printf(" Radial distortion: [\t");
+ for i=1:size1
+ printf("%s\t\t", radErr(i));
+ end
+ printf("\t]\n\n");
+ printf(" Extrinsics\n");
+ printf(" ----------\n");
+ printf(" Rotation vectors:\n");
+ for i=1:size21
+ printf(" [\t");
+ for j=1:size22
+ printf("%s\t\t", rotVecErr(i,j));
+ end
+ printf("\t]\n");
+ end
+ if size21*size22==0 then
+ printf("\n");
+ end
+ printf(" Translation vectors (mm):\n");
+ for i=1:size21
+ printf(" [\t");
+ for j=1:size22
+ printf("%s\t\t", tranVecErr(i,j));
+ end
+ printf("\t]\n");
+
+ end
+ printf("\n");
+
+ else
+ stereoParam = varargin(2);
+ checkSCE(errors);
+ if ~isstruct(stereoParam) then
+ error(msprintf(" A Stereo Parameter Struct expected"))
+ end
+ jj = fieldnames(stereoParam)
+ [size4 zz] = size(jj);
+ if size4~=10 then
+ error(msprintf("A Stereo Parameters Struct Expected"))
+ end
+ checkStereoParam(stereoParam);
+ focalErr1 = string(stereoParam.CameraParameters1.FocalLength) + " +/- ";
+ fE1 = string(errors.Camera1IntrinsicsErrors.FocalLengthError) ;
+ prinErr1 = string(stereoParam.CameraParameters1.PrincipalPoint) + " +/- ";
+ pE1 = string(errors.Camera1IntrinsicsErrors.PrincipalPointError);
+ radErr1 = string(stereoParam.CameraParameters1.RadialDistortion) + " +/- ";
+ rdE1 = string(errors.Camera1IntrinsicsErrors.RadDistortionError);
+ for i=1:2
+ focalErr1(i) = focalErr1(i) + fE1(i);
+ prinErr1(i) = prinErr1(i) + pE1(i);
+ end
+ [size11 xx] = size(radErr1);
+ size11 =size11*xx;
+ for i=1:size11
+ radErr1(i) = radErr1(i) + rdE1(i);
+ end
+
+ focalErr2 = string(stereoParam.CameraParameters2.FocalLength) + " +/- ";
+ fE2 = string(errors.Camera2IntrinsicsErrors.FocalLengthError) ;
+ prinErr2 = string(stereoParam.CameraParameters2.PrincipalPoint) + " +/- ";
+ pE2 = string(errors.Camera2IntrinsicsErrors.PrincipalPointError);
+ radErr2 = string(stereoParam.CameraParameters2.RadialDistortion) + " +/- ";
+ rdE2 = string(errors.Camera2IntrinsicsErrors.RadDistortionError);
+ for i=1:2
+ focalErr2(i) = focalErr2(i) + fE2(i);
+ prinErr2(i) = prinErr2(i) + pE2(i);
+ end
+ [size12 xx] = size(radErr2);
+ size12 =size12*xx;
+ for i=1:size12
+ radErr2(i) = radErr2(i) + rdE2(i);
+ end
+
+ rotVecErr = string(stereoParam.CameraParameters1.RotationVectors) + " +/- ";
+ rvE = string(errors.Camera1ExtrinsicsErrors.RotVectorsError);
+ [size21 size22] = size(rotVecErr);
+ printf("%d %d \n", size21,size22);
+ for i=1:size21
+ for j=1:size22
+ rotVecErr(i,j) = rotVecErr(i,j) + rvE(i,j);
+ end
+ end
+
+ tranVecErr = string(stereoParam.CameraParameters1.TranslationVectors) + " +/- ";
+ tvE = string(errors.Camera1ExtrinsicsErrors.TransVectorsError);
+ [size31 size32] = size(tranVecErr);
+ printf("%d %d \n", size31,size32);
+ for i=1:size31
+ for j=1:size32
+ tranVecErr(i,j) = tranVecErr(i,j) + tvE(i,j);
+ end
+ end
+
+ rotOfCam = stereoParam.RotationOfCamera2;
+ rotOfCamErr = string([rotOfCam(1,1) rotOfCam(2,1) rotOfCam(3,1)]) + " +/- ";
+ rotE = string(errors.RotationOfCamera2Error);
+ for i=1:3
+ rotOfCamErr(i) = rotOfCamErr(i) + rotE(i);
+ end
+
+ transOfCamErr = string(stereoParam.TranslationOfCamera2) + " +/- ";
+ toCE = string(errors.TransOfCamera2Error) ;
+ for i=1:3
+ transOfCamErr(i) = transOfCamErr(i) + toCE(i);
+ end
+
+
+
+ printf("\n\t\t\tStandard Errors of Estimated Stereo Camera Parameters\n");
+ printf("\t\t\t-----------------------------------------------------\n\n");
+ printf(" Camera 1 Intrinsics\n");
+ printf(" -------------------\n");
+ printf(" Focal length (pixels): [\t");
+ printf("%s\t\t%s\t]\n", focalErr1(1), focalErr1(2));
+ printf(" Principal point (pixels): [\t");
+ printf("%s\t\t%s\t]\n", prinErr1(1), prinErr1(2));
+ printf(" Radial distortion: [\t");
+ for i=1:size11
+ printf("%s\t\t", radErr1(i));
+ end
+ printf("\t]\n\n");
+ printf(" Camera 1 Extrinsics\n");
+ printf(" -------------------\n");
+ printf(" Rotation vectors:\n");
+ for i=1:size21
+ printf(" [\t");
+ for j=1:size22
+ printf("%s\t\t", rotVecErr(i,j));
+ end
+ printf("\t]\n");
+ end
+ if size21*size22==0 then
+ printf("\t]\n");
+ end
+ printf(" Translation vectors (mm):\n");
+ for i=1:size21
+ printf(" [\t");
+ for j=1:size22
+ printf("%s\t\t", tranVecErr(i,j));
+ end
+ printf("\t]\n");
+ end
+ printf("\n");
+ printf(" Camera 2 Intrinsics\n");
+ printf(" -------------------\n");
+ printf(" Focal length (pixels): [\t");
+ printf("%s\t\t%s\t]\n", focalErr2(1), focalErr2(2));
+ printf(" Principal point (pixels): [\t");
+ printf("%s\t\t%s\t]\n", prinErr2(1), prinErr2(2));
+ printf(" Radial distortion: [\t");
+ for i=1:size12
+ printf("%s\t\t", radErr2(i));
+ end
+ printf("\t]\n\n");
+ printf(" Position And Orientation of Camera 2 Relative to Camera 1\n");
+ printf(" ---------------------------------------------------------\n");
+ printf(" Rotation of camera 2: [\t");
+ for i=1:3
+ printf("%s\t\t", rotOfCamErr(i));
+ end
+ printf("\t]\n");
+ printf(" Translation of camera 2 (mm): [\t");
+ for i=1:3
+ printf("%s\t\t", transOfCamErr(i));
+ end
+ printf("\t]\n");
+ end
+
+endfunction
diff --git a/macros/ellipse.sce b/macros/ellipse.sce
new file mode 100644
index 0000000..f6fc170
--- /dev/null
+++ b/macros/ellipse.sce
@@ -0,0 +1,9 @@
+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,thickness,linetype,shift)
+input_image1=mattolist(input_image);
+ a=opencv_ellipse(input_image1 , x_coordinate_of_centre , y_coordinate_centre , first_axis, second_axis, angle, startAngle, endAngle, r_value,g_value,b_value,thickness,linetype,shift);
+ dimension=size(a)
+ for i = 1:dimension
+ out(:,:,i)=a(i);
+ end
+
+endfunction;
diff --git a/macros/ellipse2poly.bin b/macros/ellipse2poly.bin
new file mode 100644
index 0000000..77e4307
--- /dev/null
+++ b/macros/ellipse2poly.bin
Binary files differ
diff --git a/macros/ellipse2poly.sci b/macros/ellipse2poly.sci
new file mode 100644
index 0000000..da7b157
--- /dev/null
+++ b/macros/ellipse2poly.sci
@@ -0,0 +1,3 @@
+function [out] = ellipse2poly(centre_x,centre_y,width,height,angle,arcstart,arcend,delta)
+ out = opencv_ellipse2poly(centre_x,centre_y,width,height,angle,arcstart,arcend,delta);
+endfunction
diff --git a/macros/erode.bin b/macros/erode.bin
new file mode 100644
index 0000000..d2dd61b
--- /dev/null
+++ b/macros/erode.bin
Binary files differ
diff --git a/macros/erode.sci b/macros/erode.sci
new file mode 100644
index 0000000..336e220
--- /dev/null
+++ b/macros/erode.sci
@@ -0,0 +1,9 @@
+function [out]=erode(input_image ,kernel,actualkernel,anchorX,anchorY)
+input_image1=mattolist(input_image);
+ a=opencv_erode(input_image1 ,kernel,actualkernel,anchorX,anchorY);
+ dimension=size(a)
+ for i = 1:dimension
+ out(:,:,i)=a(i);
+ end
+
+endfunction;
diff --git a/macros/estimateFundamentalMatrix.bin b/macros/estimateFundamentalMatrix.bin
new file mode 100644
index 0000000..6c6b83e
--- /dev/null
+++ b/macros/estimateFundamentalMatrix.bin
Binary files differ
diff --git a/macros/estimateFundamentalMatrix.sci b/macros/estimateFundamentalMatrix.sci
new file mode 100644
index 0000000..433db08
--- /dev/null
+++ b/macros/estimateFundamentalMatrix.sci
@@ -0,0 +1,41 @@
+function [fundamentalMatrix]=estimateFundamentalMatrix(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"));
+ elseif modulo(rhs,2)==0
+ error(msprintf("Either Argument Name or its Value missing"));
+ end
+ select rhs
+ case 2 then
+ [fundamentalMatrix]=opencv_estimateFundamentalMatrix(matchedPoints1,matchedPoints2);
+ case 4 then
+ [fundamentalMatrix]=opencv_estimateFundamentalMatrix(matchedPoints1,matchedPoints2,varargin(1),varargin(2));
+ case 6 then
+ [fundamentalMatrix]=opencv_estimateFundametanlMatrix(matchedPoints1,matchedPoints2,varargin(1),varargin(2),varargin(3),varargin(4));
+ case 8 then
+ [fundamentalMatrix]=opencv_estimateFundamentalMatrix(matchedPoints1,matchedPoints2,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6));
+ end
+endfunction
diff --git a/macros/estimateGeometricTransform.bin b/macros/estimateGeometricTransform.bin
new file mode 100644
index 0000000..c501a9a
--- /dev/null
+++ b/macros/estimateGeometricTransform.bin
Binary files differ
diff --git a/macros/estimateGeometricTransform.sci b/macros/estimateGeometricTransform.sci
new file mode 100644
index 0000000..f0ef6fa
--- /dev/null
+++ b/macros/estimateGeometricTransform.sci
@@ -0,0 +1,5 @@
+function [output] = estimateGeometricTransform(img1,img2)
+ I1 = mattolist(img1);
+ I2 = mattolist(img2);
+ output = opencv_estimateGeometricTransform(I1,I2)
+endfunction
diff --git a/macros/estimateUncalibratedRectification.bin b/macros/estimateUncalibratedRectification.bin
new file mode 100644
index 0000000..38765cf
--- /dev/null
+++ b/macros/estimateUncalibratedRectification.bin
Binary files differ
diff --git a/macros/estimateUncalibratedRectification.sci b/macros/estimateUncalibratedRectification.sci
new file mode 100644
index 0000000..50867e9
--- /dev/null
+++ b/macros/estimateUncalibratedRectification.sci
@@ -0,0 +1,35 @@
+function [T1,T2]=estimateUncalibratedRectification(fundamentalMatrix,inlierPoints1,inlierPoints2,imageSize)
+// It returns projective transformation for rectifying stereo images
+//
+// Calling Sequence
+// [T1,T2]=estimateUncalibratedRectification((fundamentalMatrix,inlierPoints1,inlierPoints2,imageSize);
+//
+// Parameters
+// fundamentalMatrix: 3-by-3 fundamental matrix.
+// inlierPoints1: M-by-2 matrix
+// inlierPoints2: M-by-2 matrix
+// imageSize: 2 element vector, indicating size of the second image.
+//
+// Description
+// estimateUncalibratedRectification gives transformation of both images as 3-by-3 matrices
+//
+// Examples
+// I=imread("lena_left.jpeg");
+// cornerPoints1=detectMinEigenFeatures(I);
+// I2=imread("lena_right.jpeg");
+// cornerPoints2=detectMinEigenFeatures(I2);
+// fundamentalMat=(cornerPoints1.Location,cornerPoints2.Location);
+// [T1, T2]=estimateUncalibratedRectification(fundamentalMat,cornerPoints1.Location,cornerPoints2.Location,size(I2));
+
+ [lhs rhs]=argn(0);
+ if lhs>2
+ error(msprintf(" Too many output arguments"));
+ elseif rhs<2
+ error(msprintf(" More input arguments required"));
+ elseif rhs>4
+ error(msprintf(" Too many input arguments"));
+ elseif modulo(rhs,2)==0
+ error(msprintf("Either Argument Name or its Value missing"));
+ end
+ [T1 T2]=opencv_estimateUncalibratedRectification(fundamentalMatrix,inlierPoints1,inlierPoints2,imageSize);
+endfunction
diff --git a/macros/evaluate.bin b/macros/evaluate.bin
new file mode 100644
index 0000000..64831d7
--- /dev/null
+++ b/macros/evaluate.bin
Binary files differ
diff --git a/macros/evaluate.sci b/macros/evaluate.sci
new file mode 100644
index 0000000..9ab7d28
--- /dev/null
+++ b/macros/evaluate.sci
@@ -0,0 +1,31 @@
+function confMat = evaluate(classifier, imageSet)
+// This function is used to evaluate an image classifier.
+//
+// Calling Sequence
+// confMat = evaluate(classifier, imgSet)
+//
+// Parameters
+// confMat: Confusion matrix as a result of the evaluation
+// classifier: Image category classifer
+// imgSet: An imageSet struct to be evaluated
+//
+// Description
+// This function evaluates an image category classifier on an input image set.
+//
+// Examples
+// imgSet = imageSet(directory,'recursive');
+// [trainingSet testSet] = partition(imgSet,[0.8]);
+// bag = bagOfFeatures(trainingSet);
+// categoryClassifier = trainImageCategoryClassifier(trainingSet, bag);
+// confMatrix = evaluate(categoryClassifer, testSet);
+//
+// Authors
+// Rohit Suri
+// Umang Agrawal
+
+ classifier_list = classifierToList(classifier)
+ imageSet_list = imageSetToList(imageSet)
+
+ confMat = opencv_evaluate(classifier_list, imageSet_list)
+
+endfunction
diff --git a/macros/evaluateImageRetrieval.bin b/macros/evaluateImageRetrieval.bin
new file mode 100644
index 0000000..6931451
--- /dev/null
+++ b/macros/evaluateImageRetrieval.bin
Binary files differ
diff --git a/macros/evaluateImageRetrieval.sci b/macros/evaluateImageRetrieval.sci
new file mode 100644
index 0000000..a8ac99d
--- /dev/null
+++ b/macros/evaluateImageRetrieval.sci
@@ -0,0 +1,104 @@
+function [varargout] = evaluateImageRetrieval(image, IndexImage, ExpectedID, varargin)
+// This function is used to evaluate the Image Search Results
+//
+// Calling Sequence
+// averagePrecision = evaluateImageRetrieval(queryImage, ImageIndex, expectedIDs, Name, Value... );
+// [averagePrecision imageID Scores] = evaluateImageRetrieval(queryImage, ImageIndex, expectedIDs);
+//
+// Parameters
+// queryImage: The query image, for which the similar image has to be found. Can be a grayscale or a RGB image
+// ImageIndex: imageIndex object that contains the data set of all the images to be compared
+// expectedIDs: A row or column vector containing the IDs of expected Similarity
+// NumResults [Optional Input Argument]: Maximum number of results to be returned. Value: any integer (20 default)
+// ROI [Optional Input Argument]: Query Image search region. Format [ x y width height ]. Default: [1 1 size(Image,2) size(Image,1)]
+// averagePrecision: Average Precision Metric. Value in the range [0 1]
+// imageID: M-by-1 vector consisting of Ranked Index of retrieved Images
+// Scores: M-by-1 vector containing the similarity metric in the range 0 to 1
+//
+// Description
+// It returns the average precision metric for measuring the accuracy of image search results for the queryImage.
+//
+// Examples
+// imgSet = imageSet(directory,'recursive');
+// [trainingSet testSet] = partition(imgSet,[0.8]);
+// bag = bagOfFeatures(trainingSet);
+// imageindex = indexImages(trainingSet, bag);
+// queryImage = imread('sample.jpg');
+// imageIDs = retrieveImages(queryImage, imageindex);
+// exp_id = [3 4 1 2]; /*For a 4 element image set*/
+// precision = evaluateImageRetreival(queryImage, imageindex, exp_id);
+//
+// Authors
+// Umang Agrawal
+// Rohit Suri
+
+ /// varargout(1) = average_precision
+ /// varargout(2) = index
+ /// varargout(3) = score
+ [ lhs rhs ] = argn(0)
+ if rhs > 7 then
+ error(msprintf("Too many input arguments"))
+ end
+
+ if lhs > 3 then
+ error(msprintf("Too many output arguments"))
+ end
+ image_list = mattolist(image)
+
+ if lhs == 1 then
+ select rhs
+ case 3 then
+
+ average_precision= opencv_evalutateImageRetrieval(image_list, IndexImage, ExpectedID)
+
+ case 5 then
+
+ average_precision = opencv_evaluateImageRetrieval(image_list, IndexImage, ExpectedID, varargin(1), varargin(2))
+
+ case 7 then
+
+ average_precision = opencv_evaluateImageRetrieval(image_list, IndexImage, ExpectedID, varargin(1), varargin(2), varargin(3), varargin(4))
+ end
+
+ varargout(1) = average_precision
+
+ elseif lhs == 2 then
+ select rhs
+ case 3 then
+
+ [average_precision, index] = opencv_evalutateImageRetrieval(image_list, IndexImage, ExpectedID)
+
+ case 5 then
+
+ [average_precision, index] = opencv_evaluateImageRetrieval(image_list, IndexImage, ExpectedID, varargin(1), varargin(2))
+
+ case 7 then
+
+ [average_precision, index] = opencv_evaluateImageRetrieval(image_list, IndexImage, ExpectedID, varargin(1), varargin(2), varargin(3), varargin(4))
+ end
+
+ varargout(1) = average_precision
+ varargout(2) = index
+
+ elseif lhs == 3 then
+ select rhs
+ case 3 then
+
+ [average_precision, index, score] = opencv_evalutateImageRetrieval(image_list, IndexImage, ExpectedID)
+
+ case 5 then
+
+ [average_precision, index, score] = opencv_evaluateImageRetrieval(image_list, IndexImage, ExpectedID, varargin(1), varargin(2))
+
+ case 7 then
+
+ [average_precision, index, score] = opencv_evaluateImageRetrieval(image_list, IndexImage, ExpectedID, varargin(1), varargin(2), varargin(3), varargin(4))
+ end
+
+ varargout(1) = average_precision
+ varargout(2) = index
+ varargout(3) = score
+
+ end
+
+endfunction
diff --git a/macros/extractFeatures.bin b/macros/extractFeatures.bin
new file mode 100644
index 0000000..efd8414
--- /dev/null
+++ b/macros/extractFeatures.bin
Binary files differ
diff --git a/macros/extractFeatures.sci b/macros/extractFeatures.sci
new file mode 100644
index 0000000..8147891
--- /dev/null
+++ b/macros/extractFeatures.sci
@@ -0,0 +1,168 @@
+function [featureVector, ValidPoints]=extractFeatures(image,points,class,varargin)
+// This function is used to extract interest point descriptors
+//
+// Calling Sequence
+// [features, validPoints] = 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] = extractFeatures(image, corners, "Class", "cornerPoints", "Metric", metric);
+//
+// Authors
+// Umang Agrawal
+// Sridhar Reddy
+
+ [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,count_scale,count_axes,count_signOfLaplacian;
+ count_method=0, count_block=0, count_surf=0, count_upright=0;
+
+ //Parsing input arguments
+ for i=1:rhs-3
+ if (varargin(i)=="Metric")
+ if(count_metric==0)
+ i=i+1;
+ metric=varargin(i);
+ else
+ error(msprintf(" Metric argument has been called twice"));
+ end
+ elseif (varargin(i)=="Orientation")
+ if(count_orientation==0)
+ i=i+1;
+ orientation=varargin(i);
+ else
+ error(msprintf(" Orientation argument has been called twice"));
+ end
+ elseif (varargin(i)=="Scale")
+ if(count_scale==0)
+ i=i+1;
+ scale=varargin(i);
+ else
+ error(msprintf(" Scale argument has been called twice"));
+ end
+ elseif (varargin(i)=="Axes")
+ if(count_axes==0)
+ i=i+1;
+ axes=varargin(i);
+ else
+ error(msprintf(" Axes argument has been called twice"));
+ end
+ elseif (varargin(i)=="SignOfLaplacian")
+ if(count_signOfLaplacian==0)
+ i=i+1;
+ signOfLaplacian=varargin(i);
+ else
+ error(msprintf("SignOfLaplacian argument has been called twice"));
+ end
+ elseif (varargin(i)=="Method")
+ if(count_method==0)
+ i=i+1;
+ method=varargin(i);
+ else
+ error(msprintf("Method argument has been called twice"));
+ end
+ elseif (varargin(i)=="BlockSize")
+ if(count_block==0)
+ i=i+1;
+ blockSize=varargin(i);
+ else
+ error(msprintf("BlockSize argument has been called twice"));
+ end
+ elseif (varargin(i)=="SurfSize")
+ if(count_surf==0)
+ i=i+1;
+ surfSize=varargin(i);
+ else
+ error(msprintf("SurfSize argument has been called twice"));
+ end
+ elseif (varargin(i)=="Upright")
+ if(count_upright==0)
+ i=i+1;
+ upright=varargin(i);
+ 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]=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]=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]=extractFeatures(imageList, points, "Class", class, "Method", method, "surfSize", surfSize, "blockSize", blockSize, "upright", upright, "Metric",metric,"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]=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]=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/extractHOGFeatures.bin b/macros/extractHOGFeatures.bin
new file mode 100644
index 0000000..df60285
--- /dev/null
+++ b/macros/extractHOGFeatures.bin
Binary files differ
diff --git a/macros/extractHOGFeatures.sci b/macros/extractHOGFeatures.sci
new file mode 100644
index 0000000..cf7aca6
--- /dev/null
+++ b/macros/extractHOGFeatures.sci
@@ -0,0 +1,24 @@
+function [featureVector] = extractHOGFeatuers(I, varargin)
+ img = mattolist(I);
+ [lhs rhs] = argn(0);
+ if rhs<1 then
+ error(msprintf("Not enough input arguments"));
+ end
+ if rhs>9 then
+ error(msprintf("Too many input arguments"));
+ end
+ l = rhs-1;
+ if(l==0) then
+ featureVector = opencv_extractHOGFeatures(img);
+ elseif (l==2) then
+ featureVector = opencv_extractHOGFeatures(img,varargin(0),varargin(1));
+ elseif (l==4) then
+ featureVector = opencv_extractHOGFeatures(img,varargin(0),varargin(1),varargin(2),varargin(3));
+ elseif (l==6) then
+ featureVector = opencv_extractHOGFeatures(img,varargin(0),varargin(1),varargin(2),varargin(3),varargin(4),varargin(5));
+ else
+ featureVector = opencv_extractHOGFeatures(img,varargin(0),varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6),varargin(7));
+ end
+
+endfunction
+
diff --git a/macros/extractLBPFeatures.bin b/macros/extractLBPFeatures.bin
new file mode 100644
index 0000000..d057c9b
--- /dev/null
+++ b/macros/extractLBPFeatures.bin
Binary files differ
diff --git a/macros/extractLBPFeatures.sci b/macros/extractLBPFeatures.sci
new file mode 100644
index 0000000..177e660
--- /dev/null
+++ b/macros/extractLBPFeatures.sci
@@ -0,0 +1,46 @@
+function [out]=extractLBPFeatures(input1,varargin)
+ [lhs rhs] = argn(0)
+ if rhs>13 then
+ error(msprintf("Too many input arguments"))
+ elseif rhs==13 then
+ a=opencv_extractLBPFeatures(input1,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6),varargin(7),varargin(8),varargin(9),varargin(10),varargin(11),varargin(12))
+ out(:,:,1)=a(1)
+ elseif rhs==12 then
+ a=opencv_extractLBPFeatures(input1,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6),varargin(7),varargin(8),varargin(9),varargin(10),varargin(11))
+ out(:,:,1)=a(1)
+ elseif rhs==11 then
+ a=opencv_extractLBPFeatures(input1,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6),varargin(7),varargin(8),varargin(9),varargin(10))
+ out(:,:,1)=a(1)
+ elseif rhs==10 then
+ a=opencv_extractLBPFeatures(input1,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6),varargin(7),varargin(8),varargin(9))
+ out(:,:,1)=a(1)
+ elseif rhs==9 then
+ a=opencv_extractLBPFeatures(input1,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6),varargin(7),varargin(8))
+ out(:,:,1)=a(1)
+ elseif rhs==8 then
+ a=opencv_extractLBPFeatures(input1,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6),varargin(7))
+ out(:,:,1)=a(1)
+ elseif rhs==7 then
+ a=opencv_extractLBPFeatures(input1,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6))
+ out(:,:,1)=a(1)
+ elseif rhs==6 then
+ a=opencv_extractLBPFeatures(input1,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5))
+ out(:,:,1)=a(1)
+ elseif rhs==5 then
+ a=opencv_extractLBPFeatures(input1,varargin(1),varargin(2),varargin(3),varargin(4))
+ out(:,:,1)=a(1)
+ elseif rhs==4 then
+ a=opencv_extractLBPFeatures(input1,varargin(1),varargin(2),varargin(3))
+ out(:,:,1)=a(1)
+ elseif rhs==3 then
+ a=opencv_extractLBPFeatures(input1,varargin(1),varargin(2))
+ out(:,:,1)=a(1)
+ elseif rhs==2 then
+ a=opencv_extractLBPFeatures(input1,varargin(1))
+ out(:,:,1)=a(1)
+ elseif rhs==1 then
+ a=opencv_extractLBPFeatures(input1)
+ out(:,:,1)=a(1)
+ end,
+
+endfunction;
diff --git a/macros/fftshift.bin b/macros/fftshift.bin
new file mode 100644
index 0000000..d9858da
--- /dev/null
+++ b/macros/fftshift.bin
Binary files differ
diff --git a/macros/fftshift.sci b/macros/fftshift.sci
new file mode 100644
index 0000000..48b242a
--- /dev/null
+++ b/macros/fftshift.sci
@@ -0,0 +1,9 @@
+function [out]=fftshift(image)
+ image1=mattolist(image);
+ a=opencv_fftshift(image1);
+ dimension=size(a)
+ for i = 1:dimension
+ out(:,:,i)=a(i);
+ end
+
+endfunction;
diff --git a/macros/fillconvexpoly.bin b/macros/fillconvexpoly.bin
new file mode 100644
index 0000000..c8ddae8
--- /dev/null
+++ b/macros/fillconvexpoly.bin
Binary files differ
diff --git a/macros/fillconvexpoly.sci b/macros/fillconvexpoly.sci
new file mode 100644
index 0000000..ac40c8c
--- /dev/null
+++ b/macros/fillconvexpoly.sci
@@ -0,0 +1,8 @@
+function [out] = fillconvexpoly(img,pstData,npts,r_value,g_value,b_value,linetype,shift)
+ image = mattolist(img);
+ a = opencv_fillconvexpoly(image,pstData,npts,r_value,g_value,b_value,linetype,shift)
+ d = size(a);
+ for i=1:d
+ out(:,:,i) = a(i);
+ end
+endfunction
diff --git a/macros/filter.bin b/macros/filter.bin
new file mode 100644
index 0000000..7c420be
--- /dev/null
+++ b/macros/filter.bin
Binary files differ
diff --git a/macros/filter.sci b/macros/filter.sci
new file mode 100644
index 0000000..e628942
--- /dev/null
+++ b/macros/filter.sci
@@ -0,0 +1,8 @@
+function [out]=filter(input_image,depth,kernel_matrix,anchor_x,anchor_y,delta)
+ input_image1=mattolist(input_image);
+ a=opencv_filter(input_image1,depth,kernel_matrix,anchor_x,anchor_y,delta);
+ dimension=size(a)
+ for i = 1:dimension
+ out(:,:,i)=a(i);
+ end
+endfunction;
diff --git a/macros/findcontours.bin b/macros/findcontours.bin
new file mode 100644
index 0000000..d331762
--- /dev/null
+++ b/macros/findcontours.bin
Binary files differ
diff --git a/macros/findcontours.sci b/macros/findcontours.sci
new file mode 100644
index 0000000..382aa88
--- /dev/null
+++ b/macros/findcontours.sci
@@ -0,0 +1,7 @@
+function [outputMat]= findcontours(inputImage, Mode, method, point_x, point_y)
+ inputList=mattolist(inputImage);
+ outputList=opencv_findcontours(inputList,Mode, method, point_x, point_y)
+ for i=1:size(outputList)
+ outputMat(:,:,i)=outputList(i)
+ end
+endfunction
diff --git a/macros/fitellipse.bin b/macros/fitellipse.bin
new file mode 100644
index 0000000..7a3510b
--- /dev/null
+++ b/macros/fitellipse.bin
Binary files differ
diff --git a/macros/fitellipse.sci b/macros/fitellipse.sci
new file mode 100644
index 0000000..cb0331f
--- /dev/null
+++ b/macros/fitellipse.sci
@@ -0,0 +1,4 @@
+function [out]=fitellipse(InputArraypoints)
+ [t1 t2 t3 t4 t5]= opencv_fitellipse(InputArraypoints);
+ out=struct("size1",t1,"size2",t2,"center1",t3,"center2",t4,"angle",t3);
+endfunction;
diff --git a/macros/fsamp2.bin b/macros/fsamp2.bin
new file mode 100644
index 0000000..c1a77e7
--- /dev/null
+++ b/macros/fsamp2.bin
Binary files differ
diff --git a/macros/fsamp2.sci b/macros/fsamp2.sci
new file mode 100644
index 0000000..4c3b97a
--- /dev/null
+++ b/macros/fsamp2.sci
@@ -0,0 +1,31 @@
+// Function Name = Frequency sampling
+
+// Inputs = Frequency response Hd; frequency vectors f1, f2; dimension [m n]
+
+// Output = matrix h of dimension m x n, stores the filter coeff
+
+function[h] = fsamp2(Hd, varargin)
+
+ [lhs, rhs] = argn(0)
+
+ select rhs
+ case 1 then
+ out = opencv_fsamp2(Hd)
+
+ case 2 then
+ out = opencv_fsamp2(Hd, varargin(1))
+
+ case 3 then
+ out = opencv_fsamp2(Hd, varargin(1), varargin(2))
+
+ case 4 then
+ out = opencv_fsamp2(Hd, varargin(1), varargin(2), varargin(3))
+ end
+
+ channel = size(out)
+
+ for i = 1: channel
+ h(:,:,i) = out(i)
+ end
+
+endfunction
diff --git a/macros/ftrans2.bin b/macros/ftrans2.bin
new file mode 100644
index 0000000..1fdf531
--- /dev/null
+++ b/macros/ftrans2.bin
Binary files differ
diff --git a/macros/ftrans2.sci b/macros/ftrans2.sci
new file mode 100644
index 0000000..233e9cc
--- /dev/null
+++ b/macros/ftrans2.sci
@@ -0,0 +1,25 @@
+// Function Name = Frequency Transformation
+
+// Inputs = 1-D FIR filter b; Transform t(varargin(1))
+
+// Output = 2-D FIR filter h
+
+function[h] = ftrans2(b, t)
+
+ [lhs, rhs] = argn(0)
+
+ select rhs
+ case 1 then
+ out = opencv_ftrans2(b)
+
+ case 2 then
+ out = opencv_ftrans2(b, varargin(1))
+ end
+
+ channel = size(out)
+
+ for i = 1: channel
+ h(:,:,i) = out(i)
+ end
+
+endfunction
diff --git a/macros/gabor.bin b/macros/gabor.bin
new file mode 100644
index 0000000..68a9800
--- /dev/null
+++ b/macros/gabor.bin
Binary files differ
diff --git a/macros/gabor.sci b/macros/gabor.sci
new file mode 100644
index 0000000..02e6ea9
--- /dev/null
+++ b/macros/gabor.sci
@@ -0,0 +1,6 @@
+function [outputImg]=gabor(wavelength,orientation)
+ outputList=opencv_gabor(wavelength,orientation);
+ for i=1:size(outputList)
+ outputImg(:,:,i)=outputList(i)
+ end
+endfunction
diff --git a/macros/gaussianblur.bin b/macros/gaussianblur.bin
new file mode 100644
index 0000000..50872a6
--- /dev/null
+++ b/macros/gaussianblur.bin
Binary files differ
diff --git a/macros/gaussianblur.sci b/macros/gaussianblur.sci
new file mode 100644
index 0000000..8b6b0c1
--- /dev/null
+++ b/macros/gaussianblur.sci
@@ -0,0 +1,7 @@
+function [outputImg]= gaussianblur(inputImage,ksize_height,ksize_width,sigmaX,sigmaY)
+ inputList=mattolist(inputImage);
+ outputList=opencv_gaussianblur(inputList,ksize_height,ksize_width,sigmaX,sigmaY);
+ for i=1:size(outputList)
+ outputImg(:,:,i)=outputList(i)
+ end
+endfunction
diff --git a/macros/genCheckerboardPoints.bin b/macros/genCheckerboardPoints.bin
new file mode 100644
index 0000000..e7a42a8
--- /dev/null
+++ b/macros/genCheckerboardPoints.bin
Binary files differ
diff --git a/macros/genCheckerboardPoints.sci b/macros/genCheckerboardPoints.sci
new file mode 100644
index 0000000..53528bc
--- /dev/null
+++ b/macros/genCheckerboardPoints.sci
@@ -0,0 +1,26 @@
+function [ worldPoints ] = genCheckerboardPoints(boardSize, squareSize)
+// This function returns list of checkerboard corner points.
+//
+// Calling Sequence
+// worldPoints = genCheckerboardPoints(boardSize, squareSize);
+//
+// Parameters
+// worldPoints: A list of size N-by-2 matrix containing x and y co-ordinates of the checkerboard corner points. The origin is set to lower-right corner of the top-left square.
+// boardSize: Size of the checkerboard.
+// squareSize: Size of each of square in the checkerboard.
+//
+// Description
+// Return a list of size N-by-2, which contains the corner points of all squares of a checkerboard.
+//
+// Examples
+// boardSize = [10 10];
+// squareSize = 8;
+// worldPoints = genCheckerboardPoints(boardSize, squareSize);
+//
+// Authors
+// Tanmay Chaudhari
+
+ a=opencv_genCheckerboardPoints(boardSize, squareSize);
+ worldPoints(:,:,1)=a(1);
+
+endfunction
diff --git a/macros/geometricshearer.bin b/macros/geometricshearer.bin
new file mode 100644
index 0000000..2da1efb
--- /dev/null
+++ b/macros/geometricshearer.bin
Binary files differ
diff --git a/macros/geometricshearer.sci b/macros/geometricshearer.sci
new file mode 100644
index 0000000..8d8e72a
--- /dev/null
+++ b/macros/geometricshearer.sci
@@ -0,0 +1,33 @@
+function [out] = GeometricShearer(inputimage,direction,value)
+// Shear the image
+//
+// Calling Sequence
+// output_image = GeometricShearer(inputimage,direction,value);
+//
+// Parameters
+//
+// inputimage : image matrix on which geometric shear has to be applied
+// direction : An input string that like. 'Horizontal' to shear the image in horizontal direction or 'Vertical' to shear the image in vertical direction
+// value : A scalar value i.e amount to want shift the pixel of image
+// output_image : sheared image
+//
+// Description
+// This function returns the sheared image.It shears the image by shifting the rows or columns of image.
+//
+// Examples
+// a = imread('lena.jpeg');
+// b = GeometricShearer(a,'Horzontal',5);
+// imshow(b);
+//
+// Authors:
+//
+//Diwakar Bhardwaj
+
+ inputimage1=mattolist(inputimage);
+ a = opencv_GeometricShearer(inputimage1,direction,value);
+ dimension=size(a)
+ for i = 1:dimension
+ out(:,:,i)=a(i);
+ end
+
+endfunction;
diff --git a/macros/getStructuringElement.bin b/macros/getStructuringElement.bin
new file mode 100644
index 0000000..e579a01
--- /dev/null
+++ b/macros/getStructuringElement.bin
Binary files differ
diff --git a/macros/getStructuringElement.sci b/macros/getStructuringElement.sci
new file mode 100644
index 0000000..23b384c
--- /dev/null
+++ b/macros/getStructuringElement.sci
@@ -0,0 +1,5 @@
+function structuring_element = getStructuringElement(gettype, cols, rows, anchorX, anchorY)
+
+ structuring_element = opencv_getStructuringElement(gettype, cols, rows, anchorX, anchorY)
+
+endfunction
diff --git a/macros/getTextSize.bin b/macros/getTextSize.bin
new file mode 100644
index 0000000..89bb3f6
--- /dev/null
+++ b/macros/getTextSize.bin
Binary files differ
diff --git a/macros/getTextSize.sci b/macros/getTextSize.sci
new file mode 100644
index 0000000..a8c911a
--- /dev/null
+++ b/macros/getTextSize.sci
@@ -0,0 +1,3 @@
+function [textSize,baseLine]= getTextSize(inputtext,fontface,fontscale,thickness)
+ [textSize,baseLine]=opencv_getTextSize(inputtext,fontface,fontscale,thickness)
+endfunction
diff --git a/macros/getgaussiankernel.bin b/macros/getgaussiankernel.bin
new file mode 100644
index 0000000..1845109
--- /dev/null
+++ b/macros/getgaussiankernel.bin
Binary files differ
diff --git a/macros/getgaussiankernel.sci b/macros/getgaussiankernel.sci
new file mode 100644
index 0000000..4fcf144
--- /dev/null
+++ b/macros/getgaussiankernel.sci
@@ -0,0 +1,5 @@
+function output = getGaussianKernel(ksize, sigma, ktype)
+
+ output = opencv_getGaussianKernel(ksize, sigma, ktype)
+
+endfunction
diff --git a/macros/getkerneltype.bin b/macros/getkerneltype.bin
new file mode 100644
index 0000000..c87cddf
--- /dev/null
+++ b/macros/getkerneltype.bin
Binary files differ
diff --git a/macros/getkerneltype.sci b/macros/getkerneltype.sci
new file mode 100644
index 0000000..fafe18d
--- /dev/null
+++ b/macros/getkerneltype.sci
@@ -0,0 +1,4 @@
+function [out]=getkerneltype(InputArray,pointpx,pointpy)
+ out=opencv_getkerneltype(InputArray,pointpx,pointpy);
+
+endfunction;
diff --git a/macros/getrectsubpix.bin b/macros/getrectsubpix.bin
new file mode 100644
index 0000000..9f533ec
--- /dev/null
+++ b/macros/getrectsubpix.bin
Binary files differ
diff --git a/macros/getrectsubpix.sci b/macros/getrectsubpix.sci
new file mode 100644
index 0000000..792be36
--- /dev/null
+++ b/macros/getrectsubpix.sci
@@ -0,0 +1,13 @@
+function new_image = getrectsubpix(image, alpha, beta, centerX, centerY, patchType)
+
+ image_list = mattolist(image)
+
+ out = opencv_getrectsubpix(image_list, alpha, beta, centerX, centerY, patchType)
+
+ sz = size(out)
+
+ for i = 1 : sz
+ new_image(:, :, i) = out(i)
+ end
+
+endfunction
diff --git a/macros/getrotationmatrix2d.bin b/macros/getrotationmatrix2d.bin
new file mode 100644
index 0000000..fe238e3
--- /dev/null
+++ b/macros/getrotationmatrix2d.bin
Binary files differ
diff --git a/macros/getrotationmatrix2d.sci b/macros/getrotationmatrix2d.sci
new file mode 100644
index 0000000..f1cc44f
--- /dev/null
+++ b/macros/getrotationmatrix2d.sci
@@ -0,0 +1,3 @@
+function [out]=getrotationmatrix2d(Point2fcenter, doubleangle, doublescale)
+ out=opencv_getrotationmatrix2d(Point2fcenter, doubleangle, doublescale);
+endfunction;
diff --git a/macros/goodfeaturestotrack.bin b/macros/goodfeaturestotrack.bin
new file mode 100644
index 0000000..0b21763
--- /dev/null
+++ b/macros/goodfeaturestotrack.bin
Binary files differ
diff --git a/macros/goodfeaturestotrack.sci b/macros/goodfeaturestotrack.sci
new file mode 100644
index 0000000..d8bb5bc
--- /dev/null
+++ b/macros/goodfeaturestotrack.sci
@@ -0,0 +1,7 @@
+function corner_points = goodfeaturestotrack(image, maxcorners, qualityLevel, minDistance, blocksize, usedetector, k)
+
+ image_list = mattolist(image)
+
+ corner_points = opencv_goodfeaturestotrack(image_list, maxcorners, qualityLevel, minDistance, blocksize, usedetector, k)
+
+endfunction
diff --git a/macros/grayconnected.bin b/macros/grayconnected.bin
new file mode 100644
index 0000000..839bdbd
--- /dev/null
+++ b/macros/grayconnected.bin
Binary files differ
diff --git a/macros/grayconnected.sci b/macros/grayconnected.sci
new file mode 100644
index 0000000..09a7289
--- /dev/null
+++ b/macros/grayconnected.sci
@@ -0,0 +1,21 @@
+function [out]=grayconnected(input1,input2,input3,varargin)
+ inputn=mattolist(input1);
+ [lhs rhs] = argn(0)
+ if rhs>4 then
+ error(msprintf("Too many input arguments"))
+ elseif rhs==4 then
+ a=opencv_grayconnected(inputn,input2,input3,varargin(1));
+ dimension=size(a)
+ for i = 1:dimension
+ out(:,:,i)=a(i);
+ end
+ else
+ a=opencv_grayconnected(inputn,input2,input3);
+ dimension=size(a)
+ for i = 1:dimension
+ out(:,:,i)=a(i);
+ end
+ end,
+
+endfunction;
+
diff --git a/macros/graycoprops.bin b/macros/graycoprops.bin
new file mode 100644
index 0000000..694912a
--- /dev/null
+++ b/macros/graycoprops.bin
Binary files differ
diff --git a/macros/graycoprops.sci b/macros/graycoprops.sci
new file mode 100644
index 0000000..d33c2a0
--- /dev/null
+++ b/macros/graycoprops.sci
@@ -0,0 +1,19 @@
+function[stats] = graycoprops(srcImg, varargin)
+
+ [lhs, rhs] = argn(0)
+
+ srcMat = mattolist(srcImg)
+
+ select rhs
+ case 1 then
+ out = graycoprops(srcMat)
+ case 2 then
+ out = graycoprops(srcMat, varargin(1))
+ end
+
+ channels = size(out)
+
+ for i = 1:channels
+ stats(:,:,1) = out(1)
+ end
+endfunction
diff --git a/macros/graydiffweight.bin b/macros/graydiffweight.bin
new file mode 100644
index 0000000..d809d37
--- /dev/null
+++ b/macros/graydiffweight.bin
Binary files differ
diff --git a/macros/graydiffweight.sci b/macros/graydiffweight.sci
new file mode 100644
index 0000000..443a79f
--- /dev/null
+++ b/macros/graydiffweight.sci
@@ -0,0 +1,9 @@
+function [out]=graydiffweight(image,refgrayval)
+ image1=mattolist(image);
+ a=opencv_graydiffweight(image1,refgrayval);
+ dimension=size(a)
+ for i = 1:dimension
+ out(:,:,i)=a(i);
+ end
+
+endfunction;
diff --git a/macros/graydist.bin b/macros/graydist.bin
new file mode 100644
index 0000000..bb5187d
--- /dev/null
+++ b/macros/graydist.bin
Binary files differ
diff --git a/macros/graydist.sci b/macros/graydist.sci
new file mode 100644
index 0000000..fc3c081
--- /dev/null
+++ b/macros/graydist.sci
@@ -0,0 +1,13 @@
+function[dstImg] = graydist(srcImg, mask)
+
+ srcMat = mattolist(srcImg)
+
+ out = opencv_graydist(srcMat, mask)
+
+ channels = size(out)
+
+ for i = 1:channels
+ dstImg(:,:,i) = out(i)
+ end
+
+endfunction
diff --git a/macros/has_frame.bin b/macros/has_frame.bin
new file mode 100644
index 0000000..92ca7ca
--- /dev/null
+++ b/macros/has_frame.bin
Binary files differ
diff --git a/macros/has_frame.sci b/macros/has_frame.sci
new file mode 100644
index 0000000..158fb73
--- /dev/null
+++ b/macros/has_frame.sci
@@ -0,0 +1,22 @@
+function [out]=hasFrame()
+// This function is used to check whether there is a frame to read in the current video, read through VideoReader.
+//
+// Calling Sequence
+// results = hasFrame();
+//
+// Parameters
+// results: A boolean. True if there is a frame to read and false if not.
+//
+// Description
+// This is a helper function for VideoReader and readFrame() function. It returns true if the video has a
+// frame to read, else it returns false.
+//
+// Examples
+// videoStr = VideoReader('sample.mp4');
+// hasFrame();
+//
+// Authors
+// Shashank Shekhar
+// Tanmay Chaudhari
+ out=ocv_hasFrame();
+endfunction;
diff --git a/macros/histeq.bin b/macros/histeq.bin
new file mode 100644
index 0000000..8b6c28b
--- /dev/null
+++ b/macros/histeq.bin
Binary files differ
diff --git a/macros/histeq.sci b/macros/histeq.sci
new file mode 100644
index 0000000..398facf
--- /dev/null
+++ b/macros/histeq.sci
@@ -0,0 +1,9 @@
+function [out]=histeq(image)
+ image1=mattolist(image);
+ a=opencv_histeq(image1);
+ dimension=size(a)
+ for i = 1:dimension
+ out(:,:,i)=a(i);
+ end
+
+endfunction;
diff --git a/macros/houghcircles.bin b/macros/houghcircles.bin
new file mode 100644
index 0000000..85a767c
--- /dev/null
+++ b/macros/houghcircles.bin
Binary files differ
diff --git a/macros/houghcircles.sci b/macros/houghcircles.sci
new file mode 100644
index 0000000..b5ada30
--- /dev/null
+++ b/macros/houghcircles.sci
@@ -0,0 +1,7 @@
+function outputImg= houghcircles(inputImage , dp , mindist , param1, param2 ,minradius, maxradius)
+ inputList=mattolist(inputImage)
+ outputList=opencv_houghcircles(inputList , dp , mindist , param1, param2 ,minradius, maxradius)
+ for i=1:size(outputList)
+ outputImg(:,:,i)=outputList(i)
+ end
+endfunction
diff --git a/macros/houghlines.bin b/macros/houghlines.bin
new file mode 100644
index 0000000..c74e2b8
--- /dev/null
+++ b/macros/houghlines.bin
Binary files differ
diff --git a/macros/houghlines.sci b/macros/houghlines.sci
new file mode 100644
index 0000000..ae9bc1c
--- /dev/null
+++ b/macros/houghlines.sci
@@ -0,0 +1,4 @@
+function [out]=houghlines(image,rho, theta, threshold, srn, stn)
+ image1=mattolist(image);
+ out=opencv_houghlines(image1,rho, theta, threshold, srn, stn);
+endfunction;
diff --git a/macros/houghlinesp.bin b/macros/houghlinesp.bin
new file mode 100644
index 0000000..5656868
--- /dev/null
+++ b/macros/houghlinesp.bin
Binary files differ
diff --git a/macros/houghlinesp.sci b/macros/houghlinesp.sci
new file mode 100644
index 0000000..81007aa
--- /dev/null
+++ b/macros/houghlinesp.sci
@@ -0,0 +1,7 @@
+function output = houghlinesp(image, rho, theta, threshold, minLineLength, maxLineGap)
+
+ image_list = mattolist(image)
+
+ output = opencv_houghlinesp(image_list, rho, theta, threshold, minLineLength, maxLineGap)
+
+endfunction
diff --git a/macros/ifftshift.bin b/macros/ifftshift.bin
new file mode 100644
index 0000000..db03f31
--- /dev/null
+++ b/macros/ifftshift.bin
Binary files differ
diff --git a/macros/ifftshift.sci b/macros/ifftshift.sci
new file mode 100644
index 0000000..0d79a51
--- /dev/null
+++ b/macros/ifftshift.sci
@@ -0,0 +1,12 @@
+function new_image = ifftshift(image)
+
+ image_list = mattolist(image)
+
+ out = opencv_ifftshift(image_list)
+
+ sz = size(out)
+ for i = 1 : sz
+ new_image(:, :, i) = out(i)
+ end
+
+endfunction
diff --git a/macros/im2double.bin b/macros/im2double.bin
new file mode 100644
index 0000000..79ad7f0
--- /dev/null
+++ b/macros/im2double.bin
Binary files differ
diff --git a/macros/im2double.sci b/macros/im2double.sci
new file mode 100644
index 0000000..7f8e585
--- /dev/null
+++ b/macros/im2double.sci
@@ -0,0 +1,13 @@
+function[doubleMat] = im2double(matA)
+
+ srcMat = mattolist(matA)
+
+ out = opencv_im2double(srcMat)
+
+ ch = size(out)
+
+ for i = 1:ch
+ doubleMat(:,:,i) = out(i)
+ end
+
+endfunction
diff --git a/macros/imadd.bin b/macros/imadd.bin
new file mode 100644
index 0000000..8c14b1a
--- /dev/null
+++ b/macros/imadd.bin
Binary files differ
diff --git a/macros/imadd.sci b/macros/imadd.sci
new file mode 100644
index 0000000..93e1273
--- /dev/null
+++ b/macros/imadd.sci
@@ -0,0 +1,7 @@
+function[sum] = imadd(matA, matB)
+
+ [lhs, rhs] = argn(0)
+
+ sum = opencv_imadd(matA, matB)
+
+endfunction
diff --git a/macros/imageSet.bin b/macros/imageSet.bin
new file mode 100644
index 0000000..aa7de86
--- /dev/null
+++ b/macros/imageSet.bin
Binary files differ
diff --git a/macros/imageSet.sci b/macros/imageSet.sci
new file mode 100644
index 0000000..55a4e03
--- /dev/null
+++ b/macros/imageSet.sci
@@ -0,0 +1,47 @@
+function [imgSet]=imageSet(imageFolder,varargin)
+// This function is used to create a collection of images.
+//
+// Calling Sequence
+// imgSet = imageSet(location)
+// imgSet = imageSet(location, 'recursive')
+//
+// Parameters
+// imgSet: Structure containing collection of images
+// location: Address of the folder from which collection is to be created
+//
+// Description
+// This function creates an imageSet structure with the following attributes- Description, ImageLocation, and Count.
+//
+// Examples
+// imgSet = imageSet(directory);
+//
+// imgSet = imageSet(directory,'recursive');
+//
+// Authors
+// Rohit Suri
+
+ [lhs rhs]=argn(0);
+ if lhs>1
+ error(msprintf(" Too many output arguments"));
+ elseif rhs<1
+ error(msprintf(" Not enough input arguments"));
+ elseif rhs>2
+ error(msprintf(" Too many input arguments"));
+ end
+ if rhs==1 then
+ imgSetList=opencv_imageSet(imageFolder);
+ for i=1:imgSetList(3)
+ imgLocations(i)=imgSetList(4)(1)(1,i);
+ end
+ imgSet=struct('Description',imgSetList(2),'ImageLocation',imgLocations,'Count',double(imgSetList(3)));
+ else
+ imgSetList=opencv_imageSet(imageFolder,varargin(1));
+ for i=1:length(imgSetList(3))
+ for j=1:imgSetList(3)(i)
+ imgLocations(j)=imgSetList(4)(i)(1,j);
+ end
+ imgSet(1,i)=struct('Description',imgSetList(2)(i),'ImageLocation',imgLocations,'Count',int32(imgSetList(3)(i)));
+ imgLocations=[];
+ end
+ end
+endfunction
diff --git a/macros/imageSetToList.bin b/macros/imageSetToList.bin
new file mode 100644
index 0000000..09d3aca
--- /dev/null
+++ b/macros/imageSetToList.bin
Binary files differ
diff --git a/macros/imageSetToList.sci b/macros/imageSetToList.sci
new file mode 100644
index 0000000..1e7a461
--- /dev/null
+++ b/macros/imageSetToList.sci
@@ -0,0 +1,30 @@
+function imgSetList=imageSetToList(imageSet)
+ if isstruct(imageSet)<> %T then
+ error(msprintf("Error: The input argument is not of type imageSet."));
+ end
+ fieldNamesActual=["Description";"ImageLocation";"Count"];
+ fieldNamesInput=fieldnames(imageSet);
+ if fieldNamesActual <> fieldNamesInput then
+ error(msprintf("Error: The input argument is not of type imageSet, Wrong field names"));
+ end
+ if size(imageSet) == [1 1] then
+ locationList=list();
+ Desc=imageSet.Description;
+ Count=int32(imageSet.Count);
+ for j=1:imageSet.Count
+ tempMat(1,j)=imageSet.ImageLocation(j);
+ end
+ locationList($+1)=tempMat;
+ else
+ locationList=list();
+ for i=1:size(imageSet.Count)
+ Desc(i)=imageSet(i).Description;
+ Count(i)=int32(imageSet(i).Count);
+ for j=1:imageSet(i).Count
+ tempMat(1,j)=imageSet(i).ImageLocation(j);
+ end
+ locationList($+1)=tempMat;
+ end
+ end
+ imgSetList=list("imageSet",Desc,Count,locationList);
+endfunction
diff --git a/macros/imboxfilt3.bin b/macros/imboxfilt3.bin
new file mode 100644
index 0000000..d464164
--- /dev/null
+++ b/macros/imboxfilt3.bin
Binary files differ
diff --git a/macros/imboxfilt3.sci b/macros/imboxfilt3.sci
new file mode 100644
index 0000000..cf27438
--- /dev/null
+++ b/macros/imboxfilt3.sci
@@ -0,0 +1,28 @@
+//1) box_filtered_image = imboxfilt3(input_img);
+ //In this usage, the default filter size of 3x3 is used.
+
+// 2) box_filtered_image = imboxfilt3(input_img, filter_height, filter_width);
+
+function[dstMat] = imboxfilt3(srcImg, varargin)
+
+ [lhs, rhs] = argn(0)
+
+ srcMat = mattolist(srcImg)
+
+ select rhs
+ case 1 then
+ out = opencv_imboxfilt3(srcMat)
+
+ case 2 then
+ out = opencv_imboxfilt3(srcMat, varargin(1))
+
+ case 3 then
+ out = opencv_imboxfilt3(srcMat, varargin(1), varargin(2))
+ end
+ channel = size(out)
+
+ for i = 1: channel
+ dstMat(:,:,i) = out(i)
+ end
+
+endfunction
diff --git a/macros/imcomplement.bin b/macros/imcomplement.bin
new file mode 100644
index 0000000..e01330a
--- /dev/null
+++ b/macros/imcomplement.bin
Binary files differ
diff --git a/macros/imcomplement.sci b/macros/imcomplement.sci
new file mode 100644
index 0000000..426e871
--- /dev/null
+++ b/macros/imcomplement.sci
@@ -0,0 +1,13 @@
+function[compMat] = imcomplement(srcImg)
+
+ srcMat = mattolist(srcImg)
+
+ out = opencv_imcomplement(srcMat)
+
+ ch = size(out)
+
+ for i=1:ch
+ compMat(:,:,i) = out(i)
+ end
+
+endfunction
diff --git a/macros/imcontour.bin b/macros/imcontour.bin
new file mode 100644
index 0000000..41999d6
--- /dev/null
+++ b/macros/imcontour.bin
Binary files differ
diff --git a/macros/imcontour.sci b/macros/imcontour.sci
new file mode 100644
index 0000000..df41b0f
--- /dev/null
+++ b/macros/imcontour.sci
@@ -0,0 +1,7 @@
+function[contourMat] = imcontour(matA)
+
+ srcMat = mattolist(matA)
+
+ contourMat = opencv_imcontour(srcMat)
+
+endfunction
diff --git a/macros/imcontrast.bin b/macros/imcontrast.bin
new file mode 100644
index 0000000..2ef7cb7
--- /dev/null
+++ b/macros/imcontrast.bin
Binary files differ
diff --git a/macros/imcontrast.sci b/macros/imcontrast.sci
new file mode 100644
index 0000000..2666c0f
--- /dev/null
+++ b/macros/imcontrast.sci
@@ -0,0 +1,7 @@
+function[contrastMat] = imcontrast(srcImg, alpha, beta)
+
+ srcMat = mattolist(srcImg)
+
+ contrastMat = opencv_imcontrast(srcMat, alpha, beta)
+
+endfunction
diff --git a/macros/imcrop.bin b/macros/imcrop.bin
new file mode 100644
index 0000000..71a459a
--- /dev/null
+++ b/macros/imcrop.bin
Binary files differ
diff --git a/macros/imcrop.sci b/macros/imcrop.sci
new file mode 100644
index 0000000..ac1cb5f
--- /dev/null
+++ b/macros/imcrop.sci
@@ -0,0 +1,5 @@
+function[cropImg] = imcrop(srcImg, xcoor, ycoor, width, height)
+ srcMat = mattolist(srcImg)
+// disp(srcMat)
+ cropImg = opencv_imcrop(srcMat, xcoor, ycoor, width, height)
+endfunction
diff --git a/macros/imcrop.sci~ b/macros/imcrop.sci~
new file mode 100644
index 0000000..7af043f
--- /dev/null
+++ b/macros/imcrop.sci~
@@ -0,0 +1,5 @@
+function[cropImg] = imcrop(srcImg, xcoor, ycoor, width, height)
+ srcMat = mattolist(srcImg)
+ disp(srcMat)
+ cropImg = opencv_imcrop(srcMat, xcoor, ycoor, width, height)
+endfunction
diff --git a/macros/imdivide.bin b/macros/imdivide.bin
new file mode 100644
index 0000000..b542bc6
--- /dev/null
+++ b/macros/imdivide.bin
Binary files differ
diff --git a/macros/imdivide.sci b/macros/imdivide.sci
new file mode 100644
index 0000000..11f8ca9
--- /dev/null
+++ b/macros/imdivide.sci
@@ -0,0 +1,5 @@
+function[divideMat] = imdivide(matA, matB)
+
+ divideMat = opencv_imdivide(matA, matB)
+
+endfunction
diff --git a/macros/imextendedmax.bin b/macros/imextendedmax.bin
new file mode 100644
index 0000000..9331ee3
--- /dev/null
+++ b/macros/imextendedmax.bin
Binary files differ
diff --git a/macros/imextendedmax.sci b/macros/imextendedmax.sci
new file mode 100644
index 0000000..450e290
--- /dev/null
+++ b/macros/imextendedmax.sci
@@ -0,0 +1,13 @@
+function[dstMat] = imextendedmax(srcImg, Hmax)
+
+ srcMat = mattolist(srcImg)
+
+ out = opencv_imfill(srcMat, Hmax)
+
+ channel = size(out)
+
+ for i = 1: channel
+ dstMat(:,:,i) = out(i)
+ end
+
+endfunction
diff --git a/macros/imextendedmin.bin b/macros/imextendedmin.bin
new file mode 100644
index 0000000..a7ef048
--- /dev/null
+++ b/macros/imextendedmin.bin
Binary files differ
diff --git a/macros/imextendedmin.sci b/macros/imextendedmin.sci
new file mode 100644
index 0000000..bd7ef80
--- /dev/null
+++ b/macros/imextendedmin.sci
@@ -0,0 +1,13 @@
+function[dstMat] = imextendedmin(srcImg, Hmin)
+
+ srcMat = mattolist(srcImg)
+
+ out = opencv_imextendedmin(srcMat, Hmin)
+
+ channel = size(out)
+
+ for i = 1: channel
+ dstMat(:,:,i) = out(i)
+ end
+
+endfunction
diff --git a/macros/imfill.bin b/macros/imfill.bin
new file mode 100644
index 0000000..f1dbb7e
--- /dev/null
+++ b/macros/imfill.bin
Binary files differ
diff --git a/macros/imfill.sci b/macros/imfill.sci
new file mode 100644
index 0000000..c8136fb
--- /dev/null
+++ b/macros/imfill.sci
@@ -0,0 +1,20 @@
+function[dstMat] = imfill(srcImg, varargin)
+
+ [lhs, rhs] = argn(0)
+
+ srcMat = mattolist(srcImg)
+
+ select rhs
+ case 1 then
+ out = opencv_imfill(srcMat)
+ case 2 then
+ out = opencv_imfill(srcMat, varargin(1))
+ end
+
+ channel = size(out)
+
+ for i = 1: channel
+ dstMat(:,:,i) = out(i)
+ end
+
+endfunction
diff --git a/macros/imfindcircles.bin b/macros/imfindcircles.bin
new file mode 100644
index 0000000..ac578cb
--- /dev/null
+++ b/macros/imfindcircles.bin
Binary files differ
diff --git a/macros/imfindcircles.sci b/macros/imfindcircles.sci
new file mode 100644
index 0000000..c8f7491
--- /dev/null
+++ b/macros/imfindcircles.sci
@@ -0,0 +1,25 @@
+function [points, varargout] = imfindcircles(image, Rmin, Rmax)
+
+ [lhs, rhs] = argn(0)
+
+ image_list = mattolist(image)
+
+ select lhs
+ case 1 then
+ out_centres = opencv_imfindcircles(image_list, Rmin, Rmax)
+
+ case 2 then
+ [out_centres radii] = opencv_imfindcircles(image_list, Rmin, Rmax)
+
+ varargout(1) = radii
+ end
+
+ total_points = size(out_centres(1),'c')
+
+
+ for i=1:total_points
+ points(i, 1) = out_centres(1)(1, i)
+ points(i, 2) = out_centres(2)(1, i)
+ end
+
+endfunction
diff --git a/macros/imfuse.bin b/macros/imfuse.bin
new file mode 100644
index 0000000..818c7ec
--- /dev/null
+++ b/macros/imfuse.bin
Binary files differ
diff --git a/macros/imfuse.sci b/macros/imfuse.sci
new file mode 100644
index 0000000..b86e8e3
--- /dev/null
+++ b/macros/imfuse.sci
@@ -0,0 +1,13 @@
+function new_image = imfuse(image1, image2, method, scaling)
+
+ image_list1 = mattolist(image1)
+ image_list2 = mattolist(image2)
+ out = opencv_imfuse(image_list1, image_list2, method, scaling)
+
+ sz = size(out)
+
+ for i=1:sz
+ new_image(:, :, i) = out(i)
+ end
+
+endfunction
diff --git a/macros/imgSetToList.bin b/macros/imgSetToList.bin
new file mode 100644
index 0000000..b3b7877
--- /dev/null
+++ b/macros/imgSetToList.bin
Binary files differ
diff --git a/macros/imgSetToList.sci b/macros/imgSetToList.sci
new file mode 100644
index 0000000..fcbc37c
--- /dev/null
+++ b/macros/imgSetToList.sci
@@ -0,0 +1,50 @@
+function imgSetList=imageSetToList(imageSet)
+ if isstruct(imageSet)<> %T then
+ error(msprintf("Error: The input argument is not of type imageSet."));
+ end
+ fieldNamesActual=["Description";"ImageLocation";"Count"];
+ fieldNamesInput=fieldnames(imageSet);
+ if fieldNamesActual <> fieldNamesInput then
+ error(msprintf("Error: The input argument is not of type imageSet, Wrong field names"));
+ end
+ if size(imageSet) == [1 1] then
+ if type(imageSet.Description)<> 10 | size(imageSet.Description) <> [1 1] then
+ error(msprintf("Error: The input argument is not of type imageSet, Description field must be string"));
+ end
+ if type(imageSet.Count)<> 1 | size(imageSet.Count) <> [1 1] then
+ error(msprintf("Error: The input argument is not of type imageSet, Count field must be integer"));
+ end
+ if type(imageSet.ImageLocation)<> 10 & size(imageSet.ImageLocation,'c') <> 1 then
+ error(msprintf("Error: The input argument is not of type imageSet, ImageLocation must be strings"));
+ end
+ locationList=list();
+ Desc=imageSet.Description;
+ Count=int32(imageSet.Count);
+ for j=1:imageSet.Count
+ tempMat(1,j)=imageSet.ImageLocation(j);
+ end
+ locationList($+1)=tempMat;
+ else
+ for i=1:size(imageSet.Count)
+ if type(imageSet(i).Description)<> 10 | size(imageSet(i).Description) <> [1 1] then
+ error(msprintf("Error: The input argument is not of type imageSet, Description field must be string"));
+ end
+ if type(imageSet(i).Count)<> 1 | size(imageSet(i).Count) <> [1 1] then
+ error(msprintf("Error: The input argument is not of type imageSet, Count field must be integer"));
+ end
+ if type(imageSet(i).ImageLocation)<> 10 & size(imageSet(i).ImageLocation,'c') <> 1 then
+ error(msprintf("Error: The input argument is not of type imageSet, ImageLocation must be strings"));
+ end
+ end
+ locationList=list();
+ for i=1:size(imageSet.Count)
+ Desc(i)=imageSet(i).Description;
+ Count(i)=int32(imageSet(i).Count);
+ for j=1:imageSet(i).Count
+ tempMat(1,j)=imageSet(i).ImageLocation(j);
+ end
+ locationList($+1)=tempMat;
+ end
+ end
+ imgSetList=list("imageSet",Desc,Count,locationList);
+endfunction
diff --git a/macros/imgaborfit.bin b/macros/imgaborfit.bin
new file mode 100644
index 0000000..0061f67
--- /dev/null
+++ b/macros/imgaborfit.bin
Binary files differ
diff --git a/macros/imgaborfit.sci b/macros/imgaborfit.sci
new file mode 100644
index 0000000..3adfbf8
--- /dev/null
+++ b/macros/imgaborfit.sci
@@ -0,0 +1,13 @@
+function new_image = imgaborfit(image, wavelength, orientation)
+
+ image_list = mattolist(image)
+
+ out = opencv_imgaborfit(image_list, wavelength, orientation)
+
+ sz = size(out)
+
+ for i=1:sz
+ new_image(:, :, i) = out(i)
+ end
+
+endfunction
diff --git a/macros/imgaussfilt3.bin b/macros/imgaussfilt3.bin
new file mode 100644
index 0000000..b21c402
--- /dev/null
+++ b/macros/imgaussfilt3.bin
Binary files differ
diff --git a/macros/imgaussfilt3.sci b/macros/imgaussfilt3.sci
new file mode 100644
index 0000000..7995f8e
--- /dev/null
+++ b/macros/imgaussfilt3.sci
@@ -0,0 +1,7 @@
+function [outputImg]=imgaussfilt3(inputImage, filter_height, filter_width, sigmaX, sigmaY)
+ inputList=mattolist(inputImage);
+ outputList=opencv_imgaussfilt3(inputList, filter_height, filter_width, sigmaX, sigmaY);
+ for i=1:size(outputList)
+ outputImg(:,:,i)=outputList(i)
+ end
+endfunction
diff --git a/macros/imguidedfilter.bin b/macros/imguidedfilter.bin
new file mode 100644
index 0000000..43e2bd6
--- /dev/null
+++ b/macros/imguidedfilter.bin
Binary files differ
diff --git a/macros/imguidedfilter.sci b/macros/imguidedfilter.sci
new file mode 100644
index 0000000..13f2236
--- /dev/null
+++ b/macros/imguidedfilter.sci
@@ -0,0 +1,26 @@
+function guidedFiltered_image = imguidedfilter(varargin)
+
+ [lhs, rhs] = argn(0)
+
+ image_list = mattolist(varargin(1))
+
+ select rhs
+ case 1
+ out = opencv_imguidedfilter(image_list)
+
+ case 2
+ out = opencv_imguidedfilter(image_list, varargin(2))
+
+ case 3
+ out = opencv_imguidedfilter(image_list, varargin(2), varargin(3))
+
+ case 4
+ out = opencv_imguidedfilter(image_list, varargin(2), varargin(3), varargin(4))
+ end
+
+ sz = size(out)
+ for i=1:sz
+ guidedFiltered_image(:, :, i) = out(i)
+ end
+
+endfunction
diff --git a/macros/imhistmatch.bin b/macros/imhistmatch.bin
new file mode 100644
index 0000000..5deb479
--- /dev/null
+++ b/macros/imhistmatch.bin
Binary files differ
diff --git a/macros/imhistmatch.sci b/macros/imhistmatch.sci
new file mode 100644
index 0000000..0792aef
--- /dev/null
+++ b/macros/imhistmatch.sci
@@ -0,0 +1,17 @@
+function [outputImg]=imhistmatch(inputImage,refImage,varargin)
+ [lhs rhs]=argn(0);
+ if rhs>3
+ error(msprintf(" Too many input arguments"));
+ end
+ inputList=mattolist(inputImage);
+ refList=mattolist(refImage);
+ select rhs
+ case 2 then
+ outputList=opencv_imhistmatch(inputList,refList);
+ case 3 then
+ outputList=opencv_imhistmatch(inputList,refList,varargin(1));
+ end
+ for i=1:size(outputList)
+ outputImg(:,:,i)=outputList(i)
+ end
+endfunction
diff --git a/macros/imhmin.bin b/macros/imhmin.bin
new file mode 100644
index 0000000..6d6bcf0
--- /dev/null
+++ b/macros/imhmin.bin
Binary files differ
diff --git a/macros/imhmin.sci b/macros/imhmin.sci
new file mode 100644
index 0000000..441efce
--- /dev/null
+++ b/macros/imhmin.sci
@@ -0,0 +1,15 @@
+function[dstMat] = imfill(srcImg, Hmin)
+
+ [lhs, rhs] = argn(0)
+
+ srcMat = mattolist(srcImg)
+
+ out = opencv_imfill(srcMat, Hmin)
+
+ channel = size(out)
+
+ for i = 1: channel
+ dstMat(:,:,i) = out(i)
+ end
+
+endfunction
diff --git a/macros/imhmin.sci~ b/macros/imhmin.sci~
new file mode 100644
index 0000000..d57e774
--- /dev/null
+++ b/macros/imhmin.sci~
@@ -0,0 +1,15 @@
+unction[dstMat] = imfill(srcImg, H-min)
+
+ [lhs, rhs] = argn(0)
+
+ srcMat = mattolist(srcImg)
+
+ out = opencv_imfill(srcMat, H-min)
+
+ channel = size(out)
+
+ for i = 1: channel
+ dstMat(:,:,i) = out(i)
+ end
+
+endfunction
diff --git a/macros/imimposemin.bin b/macros/imimposemin.bin
new file mode 100644
index 0000000..9fd4151
--- /dev/null
+++ b/macros/imimposemin.bin
Binary files differ
diff --git a/macros/imimposemin.sci b/macros/imimposemin.sci
new file mode 100644
index 0000000..1d0d582
--- /dev/null
+++ b/macros/imimposemin.sci
@@ -0,0 +1,11 @@
+function[dstMat] = imimposemin(maskImg, markerImg)
+
+ out = opencv_imimposemin(maskImg, markerImg)
+
+ channel = size(out)
+
+ for i = 1: channel
+ dstMat(:,:,i) = out(i)
+ end
+
+endfunction
diff --git a/macros/immultiply.bin b/macros/immultiply.bin
new file mode 100644
index 0000000..451d045
--- /dev/null
+++ b/macros/immultiply.bin
Binary files differ
diff --git a/macros/immultiply.sci b/macros/immultiply.sci
new file mode 100644
index 0000000..542d9d5
--- /dev/null
+++ b/macros/immultiply.sci
@@ -0,0 +1,10 @@
+function[multiplyMat] = immultiply(matA, matB)
+
+ out = opencv_immultiplyt(matA, matB)
+
+ channel = size(out)
+
+ for i = 1: channel
+ multiplyMat(:,:,i) = out(i)
+ end
+endfunction
diff --git a/macros/impixel.bin b/macros/impixel.bin
new file mode 100644
index 0000000..7bf530d
--- /dev/null
+++ b/macros/impixel.bin
Binary files differ
diff --git a/macros/impixel.sci b/macros/impixel.sci
new file mode 100644
index 0000000..64afe5f
--- /dev/null
+++ b/macros/impixel.sci
@@ -0,0 +1,5 @@
+function [out]=impixel(image,value1,value2)
+ image1=mattolist(image);
+ out=opencv_impixel(image1,value1,value2);
+
+endfunction;
diff --git a/macros/imread.bin b/macros/imread.bin
new file mode 100644
index 0000000..2394659
--- /dev/null
+++ b/macros/imread.bin
Binary files differ
diff --git a/macros/imread.sci b/macros/imread.sci
new file mode 100644
index 0000000..7770a58
--- /dev/null
+++ b/macros/imread.sci
@@ -0,0 +1,11 @@
+function[dstMat] = imread(matA)
+
+ out = opencv_imread(matA)
+
+ channel = size(out)
+
+ for i = 1: channel
+ dstMat(:,:,i) = (out(i))
+ end
+ dstMat=double(dstMat)
+endfunction
diff --git a/macros/imread.sci~ b/macros/imread.sci~
new file mode 100644
index 0000000..bfc3aae
--- /dev/null
+++ b/macros/imread.sci~
@@ -0,0 +1,11 @@
+function[dstMat] = imread(matA)
+
+ out = opencv_imread(matA)
+
+ channel = size(out)
+
+ for i = 1: channel
+ dstMat(:,:,i) = double(out(i))
+ end
+
+endfunction
diff --git a/macros/imrect.bin b/macros/imrect.bin
new file mode 100644
index 0000000..d02e8cd
--- /dev/null
+++ b/macros/imrect.bin
Binary files differ
diff --git a/macros/imrect.sci b/macros/imrect.sci
new file mode 100644
index 0000000..a1ed7fa
--- /dev/null
+++ b/macros/imrect.sci
@@ -0,0 +1,8 @@
+function [output] = imrect(img,pstDataX,pstDataY)
+ image = mattolist(img);
+ a = opencv_imrect(image,pstDataX,pstDataY)
+ d = size(a);
+ for i=1:size
+ output(:,:,i) = a(i);
+ end
+endfunction
diff --git a/macros/imresize.bin b/macros/imresize.bin
new file mode 100644
index 0000000..18dcdb9
--- /dev/null
+++ b/macros/imresize.bin
Binary files differ
diff --git a/macros/imresize.sci b/macros/imresize.sci
new file mode 100644
index 0000000..6570005
--- /dev/null
+++ b/macros/imresize.sci
@@ -0,0 +1,8 @@
+function [out]=imresize(image,alpha,beta)
+ image1=mattolist(image);
+ a=opencv_imresize(image1,alpha,beta);
+ dimension=size(a)
+ for i = 1:dimension
+ out(:,:,i)=a(i);
+ end
+endfunction;
diff --git a/macros/imsharpen.bin b/macros/imsharpen.bin
new file mode 100644
index 0000000..5f5f066
--- /dev/null
+++ b/macros/imsharpen.bin
Binary files differ
diff --git a/macros/imsharpen.sci b/macros/imsharpen.sci
new file mode 100644
index 0000000..4c4a4be
--- /dev/null
+++ b/macros/imsharpen.sci
@@ -0,0 +1,18 @@
+function[dstMat] = imsharpen(SrcImg)
+
+ srcMat = mattolist(SrcImg)
+// [rows cols channels]=size(SrcImg);
+// imgList=list();
+// for i=1:channels
+// imgList(i)=SrcImg(:,:,i);
+// end
+// disp(imgList(i))
+// out = opencv_imsharpen(imgList)
+ out = opencv_imsharpen(srcMat)
+ [rows cols channel] = size(out)
+
+ for i = 1: channel
+ dstMat(:,:,i) = out(i)
+ end
+
+endfunction
diff --git a/macros/imsharpen.sci~ b/macros/imsharpen.sci~
new file mode 100644
index 0000000..4c4a4be
--- /dev/null
+++ b/macros/imsharpen.sci~
@@ -0,0 +1,18 @@
+function[dstMat] = imsharpen(SrcImg)
+
+ srcMat = mattolist(SrcImg)
+// [rows cols channels]=size(SrcImg);
+// imgList=list();
+// for i=1:channels
+// imgList(i)=SrcImg(:,:,i);
+// end
+// disp(imgList(i))
+// out = opencv_imsharpen(imgList)
+ out = opencv_imsharpen(srcMat)
+ [rows cols channel] = size(out)
+
+ for i = 1: channel
+ dstMat(:,:,i) = out(i)
+ end
+
+endfunction
diff --git a/macros/imshow.bin b/macros/imshow.bin
new file mode 100644
index 0000000..fd6d82d
--- /dev/null
+++ b/macros/imshow.bin
Binary files differ
diff --git a/macros/imshow.sci b/macros/imshow.sci
new file mode 100644
index 0000000..ceedd8e
--- /dev/null
+++ b/macros/imshow.sci
@@ -0,0 +1,26 @@
+function[] =imshow(Image) //retrieving list and creating 3 dimensional matrix out of it
+ dimensions=size(Image)
+ if dimensions==3 then
+ [c d]=size(Image(1));
+ r=matrix(Image(1),c,d);
+ g=matrix(Image(2),c,d);
+ b=matrix(Image(3),c,d);
+ z(:,:,1)=r;
+ z(:,:,2)=g;
+ z(:,:,3)=b;
+ [NumberOfRows NumberOfColumns NumberOfChannels] = size(z);
+ NumberOfPixels = NumberOfRows * NumberOfColumns;
+ MaxGrayValue = 2 ^ 8 - 1;
+ ColorMap = double(matrix(z, NumberOfPixels, NumberOfChannels)) ...
+ / MaxGrayValue;
+ Img = matrix(1 : NumberOfPixels, NumberOfRows, NumberOfColumns);
+ elseif dimensions==1 then
+ [c d]=size(Image(1));
+ Img=matrix(Image(1),c,d);
+ //Img=Img';
+ MaxUInt8 = 2 ^ 8 - 1;
+ MaximumGrayValue = MaxUInt8;
+ ColorMap = graycolormap(double(MaximumGrayValue + 1));
+ end;
+ show(Img,ColorMap);
+endfunction
diff --git a/macros/imshowpair.bin b/macros/imshowpair.bin
new file mode 100644
index 0000000..39a70bd
--- /dev/null
+++ b/macros/imshowpair.bin
Binary files differ
diff --git a/macros/imshowpair.sci b/macros/imshowpair.sci
new file mode 100644
index 0000000..0df086a
--- /dev/null
+++ b/macros/imshowpair.sci
@@ -0,0 +1,8 @@
+function [outputImg]=imshowpair(inputImage1,inputImage2,method,scale)
+ inputList1=mattolist(inputImage1);
+ inputList2=mattolist(inputImage2);
+ outputList=opencv_imshowpair(inputList1,inputList2,method,scale);
+ for i=1:size(outputList)
+ outputImg(:,:,i)=outputList(i)
+ end
+endfunction
diff --git a/macros/imsubtract.bin b/macros/imsubtract.bin
new file mode 100644
index 0000000..22eb98f
--- /dev/null
+++ b/macros/imsubtract.bin
Binary files differ
diff --git a/macros/imsubtract.sci b/macros/imsubtract.sci
new file mode 100644
index 0000000..2edaa1f
--- /dev/null
+++ b/macros/imsubtract.sci
@@ -0,0 +1,5 @@
+function [matC] = imsubtract(matA, matB)
+
+ matC = opencv_imsubtract(matA, matB)
+
+endfunction
diff --git a/macros/imwarp.bin b/macros/imwarp.bin
new file mode 100644
index 0000000..92da630
--- /dev/null
+++ b/macros/imwarp.bin
Binary files differ
diff --git a/macros/imwarp.sci b/macros/imwarp.sci
new file mode 100644
index 0000000..a920ffa
--- /dev/null
+++ b/macros/imwarp.sci
@@ -0,0 +1,8 @@
+function [output] = imwarp(img,matrix)
+ image = mattolist(img);
+ a = imwarp(image,matrix)
+ d = size(a)
+ for i=1:d
+ output(:,:,i) = a(i);
+ end
+endfunction
diff --git a/macros/imwrite.bin b/macros/imwrite.bin
new file mode 100644
index 0000000..2315134
--- /dev/null
+++ b/macros/imwrite.bin
Binary files differ
diff --git a/macros/imwrite.sci b/macros/imwrite.sci
new file mode 100644
index 0000000..24e9100
--- /dev/null
+++ b/macros/imwrite.sci
@@ -0,0 +1,4 @@
+function imwrite(img,pstData)
+ image = mattolist(img)
+ opencv_imwrite(image,pstData)
+endfunction
diff --git a/macros/ind2gray.bin b/macros/ind2gray.bin
new file mode 100644
index 0000000..36816bd
--- /dev/null
+++ b/macros/ind2gray.bin
Binary files differ
diff --git a/macros/ind2gray.sci b/macros/ind2gray.sci
new file mode 100644
index 0000000..d2c8eee
--- /dev/null
+++ b/macros/ind2gray.sci
@@ -0,0 +1,8 @@
+function [output] = ind2gray(img,colormap)
+ image = mattolist(img);
+ a = opencv_ind2gray(image,colormap)
+ d = size(a);
+ for i=1:d
+ output(:,:,i) = a(i);
+ end
+endfunction
diff --git a/macros/indexImages.bin b/macros/indexImages.bin
new file mode 100644
index 0000000..c1622de
--- /dev/null
+++ b/macros/indexImages.bin
Binary files differ
diff --git a/macros/indexImages.sci b/macros/indexImages.sci
new file mode 100644
index 0000000..8a6dc8c
--- /dev/null
+++ b/macros/indexImages.sci
@@ -0,0 +1,54 @@
+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
+ imageSetList=imageSetStructToList(imageSet);
+ if modulo(lhs,2)==0
+ bagList=bagStructToList(varargin(1));
+ select rhs
+ case 1 then
+ [imageIndexList]=opencv_indexImages(imgSetList);
+ case 2 then
+ [imageIndexList]=opencv_indexImages(imgSetList,bagList);
+ case 3 then
+ [imageIndexList]=opencv_indexImages(imgSetList,varargin(1),varargin(2));
+ case 4 then
+ [imageIndexList]=opencv_indexImages(imgSetList,bagList,varargin(2),varargin(3));
+ case 5 then
+ [imageIndexList]=opencv_indexImages(imgSetList,varargin(1),varargin(2),varargin(3),varargin(4));
+ case 6 then
+ [imageIndexList]=opencv_indexImages(imgSetList,bagList,varargin(2),varargin(3),varargin(4),varargin(5));
+ end
+ end
+
+endfunction
diff --git a/macros/indexImages.sci~ b/macros/indexImages.sci~
new file mode 100644
index 0000000..567a90d
--- /dev/null
+++ b/macros/indexImages.sci~
@@ -0,0 +1,53 @@
+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
+ imageSetList=imageSetStructToList(imageSet);
+ if modulo(lhs,2)==0
+ bagList=bagStructToList(varargin(1));
+ select rhs
+ case 1 then
+ [imageIndexList]=opencv_indexImages(imgSetList);
+ case 2 then
+ [imageIndexList]=opencv_indexImages(imgSetList,bagList);
+ case 3 then
+ [imageIndexList]=opencv_indexImages(imgSetList,varargin(1),varargin(2));
+ case 4 then
+ [imageIndexList]=opencv_indexImages(imgSetList,bagList,varargin(2),varargin(3));
+ case 5 then
+ [imageIndexList]=opencv_indexImages(imgSetList,varargin(1),varargin(2),varargin(3),varargin(4));
+ case 6 then
+ [imageIndexList]=opencv_indexImages(imgSetList,bagList,varargin(2),varargin(3),varargin(4),varargin(5));
+ end
+
+endfunction
diff --git a/macros/integralFilter.bin b/macros/integralFilter.bin
new file mode 100644
index 0000000..e382416
--- /dev/null
+++ b/macros/integralFilter.bin
Binary files differ
diff --git a/macros/integralFilter.sci b/macros/integralFilter.sci
new file mode 100644
index 0000000..1e7e19f
--- /dev/null
+++ b/macros/integralFilter.sci
@@ -0,0 +1,29 @@
+function [out]=integralFilter(intimage,bbox,weights,filterSize)
+// Integral Image based Filter.
+//
+// Calling Sequence
+// filter = integralFilter(intimage,bbox,weights,filterSize);
+//
+// Parameters
+// intimage: Integral Image, which can be obtained from the function integralImage.
+// bbox: Bounding box of the filter object, which can be obtained from integralKernel function.
+// weight: Weights of the bounding box, which can be obtained from integralKernel function.
+// filterSize: Size of the filter, which can be obtained from integralKernel function.
+//
+// Description
+// This function filters image using box filters and integral images.
+//
+// Examples
+// i = imread("lena.jpg");
+// intImg = integralImage(i);
+// kernel = integralKernel([2 2 11 11], 1/51);
+// filter = integralKernel(intImg, kernel.bbox, kernel.weights, kernel.filterSize);
+//
+// Authors
+// Tanmay Chaudhari
+
+ inputimage1=mattolist(inputimage);
+ a=opencv_integralFilter(inputimage1,bbox,weights,filterSize);
+ out(:,:,1)=a(1);
+
+endfunction
diff --git a/macros/integralImage.bin b/macros/integralImage.bin
new file mode 100644
index 0000000..38b5e6c
--- /dev/null
+++ b/macros/integralImage.bin
Binary files differ
diff --git a/macros/integralImage.sci b/macros/integralImage.sci
new file mode 100644
index 0000000..00801cb
--- /dev/null
+++ b/macros/integralImage.sci
@@ -0,0 +1,20 @@
+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/integralImage.sci~ b/macros/integralImage.sci~
new file mode 100644
index 0000000..cc528a0
--- /dev/null
+++ b/macros/integralImage.sci~
@@ -0,0 +1,20 @@
+unction[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/integralKernel.bin b/macros/integralKernel.bin
new file mode 100644
index 0000000..e1ba577
--- /dev/null
+++ b/macros/integralKernel.bin
Binary files differ
diff --git a/macros/integralKernel.sci b/macros/integralKernel.sci
new file mode 100644
index 0000000..7276e27
--- /dev/null
+++ b/macros/integralKernel.sci
@@ -0,0 +1,27 @@
+function [ kernel ] = integralKernel(bbox, weights)
+// 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);
+//
+// Authors
+// Tanmay Chaudhari
+
+ [t1 t2 t3 t4 t5] = opencv_integralKernel(bbox, weights)
+
+ kernel = struct("bbox",t1(1),"weights",t2,"coefficients",t3(1),"centre",t4(1),"filterSize",t5)
+
+endfunction
diff --git a/macros/invertedIndexImages.bin b/macros/invertedIndexImages.bin
new file mode 100644
index 0000000..14a3ee8
--- /dev/null
+++ b/macros/invertedIndexImages.bin
Binary files differ
diff --git a/macros/invertedIndexImages.sci b/macros/invertedIndexImages.sci
new file mode 100644
index 0000000..a92b728
--- /dev/null
+++ b/macros/invertedIndexImages.sci
@@ -0,0 +1,32 @@
+function [invertedImageIndexStruct]=invertedIndexImages(imgSet,bagOfFeatures)
+// This function creates image search index
+//
+// Calling Sequence
+// imageIndex = invertedIndexImages(imgSet, bagOfFeatures );
+//
+// Parameters
+// imgSet: Collection of images with their location and labels
+// bagOfFeatures: Bag of Visual Words
+// SaveFeatureLocations [Optional Input Argument]: A boolean value inicating 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 = invertedIndexImages(trainingSet, bag);
+//
+// With Optional Arguments:
+// imageindex = invertedIndexImages(trainingSet, bag, "SaveFeatureLocations", 1);
+//
+// Authors
+// Umang Agrawal
+// Rohit Suri
+// Sridhar Reddy
+
+ invertedImageIndexList=indexImages(imgSet,bagOfFeatures);
+ invertedImageIndexStruct=struct('Type','invertedImageIndex','ImageLocation',invertedImageIndexList(5), 'ImageWords',invertedImageIndexList(2), 'WordFrequency',invertedImageIndexList(3),'BagOfFeatures',bagOfFeatures,)
+endfunction
diff --git a/macros/isEpipoleInImage.bin b/macros/isEpipoleInImage.bin
new file mode 100644
index 0000000..d9a3155
--- /dev/null
+++ b/macros/isEpipoleInImage.bin
Binary files differ
diff --git a/macros/isEpipoleInImage.sci b/macros/isEpipoleInImage.sci
new file mode 100644
index 0000000..b2d48d0
--- /dev/null
+++ b/macros/isEpipoleInImage.sci
@@ -0,0 +1,48 @@
+function [isepi, varargout ] = isEpipoleInImage(fundamental_matrix, imagesize)
+// Find whether image contains epipole.
+//
+// Calling Sequence
+// isepi = isEpipoleInImage(F, imagesize)
+// [isepi, epipole] = isEpipoleInImage(F, imagesize)
+//
+// Parameters
+// F : A 3 * 3 fundamental matrix computed from stereo images. It should be double or single
+// imagesize : The size of the image
+// isepi : Logical value true / false denoting whether the image contains epipole
+// epipole : Location of the epipole. It is 1 * 2 vector.
+//
+// Description
+// The function determines whether the image with fundamental matrix F contains the epipole or not. It also gives the position of the epipole.
+//
+// Examples
+// F = estimateFundamentalMatrix(matchedPoints1, matchedPoints2)
+// imageSize = [200 300]
+// isepi = isEpipoleInImage(F, imagesize)
+// [isepi, epipole] = isEpipoleInImage(F, imagesize)
+//
+// Authors
+// Suraj Prakash
+
+ [ lhs, rhs ] = argn(0)
+
+ if lhs > 2 then
+ error(msprintf("Too many output arguments"));
+ end
+ /// If there is more than one output parameter
+ [rows cols] = size(fundamental_matrix)
+ if rows ~= 3 | cols ~=3 then
+ error(msprintf("Invalid size of fundamental matrix\n"));
+ end
+ [rows1 col2] = size(imagesize)
+ if rows1 ~=1 | cols ~= 2 then
+ error(msprintf("Invalid image size matrix\n"));
+ end
+ if lhs == 2 then
+ [isepi, temp ] = opencv_isEpipoleInImage(fundamental_matrix, imagesize);
+ varargout(1) = temp;
+ /// if there is only one output parameter
+ else
+ isepi = opencv_isEpipoleInImage(fundamental_matrix, imagesize);
+ end
+
+endfunction
diff --git a/macros/lab2double.bin b/macros/lab2double.bin
new file mode 100644
index 0000000..7b4d0db
--- /dev/null
+++ b/macros/lab2double.bin
Binary files differ
diff --git a/macros/lab2double.sci b/macros/lab2double.sci
new file mode 100644
index 0000000..83203a3
--- /dev/null
+++ b/macros/lab2double.sci
@@ -0,0 +1,7 @@
+function [output] = lab2double(pstData)
+ a = opencv_lab2double(pstData);
+ d = size(a);
+ for i=1:d
+ output(:,:,i) = a(i);
+ end
+endfunction
diff --git a/macros/lab2rgb.bin b/macros/lab2rgb.bin
new file mode 100644
index 0000000..a837573
--- /dev/null
+++ b/macros/lab2rgb.bin
Binary files differ
diff --git a/macros/lab2rgb.sci b/macros/lab2rgb.sci
new file mode 100644
index 0000000..622d442
--- /dev/null
+++ b/macros/lab2rgb.sci
@@ -0,0 +1,7 @@
+function [output] = lab2rgb(pstData)
+ a = opencv_lab2rgb(pstData);
+ d = size(a);
+ for i=1:d
+ output(:,:,i) = a(i);
+ end
+endfunction
diff --git a/macros/lab2uint16.bin b/macros/lab2uint16.bin
new file mode 100644
index 0000000..04b6f9a
--- /dev/null
+++ b/macros/lab2uint16.bin
Binary files differ
diff --git a/macros/lab2uint16.sci b/macros/lab2uint16.sci
new file mode 100644
index 0000000..14cb352
--- /dev/null
+++ b/macros/lab2uint16.sci
@@ -0,0 +1,7 @@
+function [output] = lab2uint16(pstData)
+ a = opencv_lab2uint16(pstData);
+ d = size(a);
+ for i=1:d
+ output(:,:,i) = a(i);
+ end
+endfunction
diff --git a/macros/lab2uint8.bin b/macros/lab2uint8.bin
new file mode 100644
index 0000000..300e6b0
--- /dev/null
+++ b/macros/lab2uint8.bin
Binary files differ
diff --git a/macros/lab2uint8.sci b/macros/lab2uint8.sci
new file mode 100644
index 0000000..d0408b5
--- /dev/null
+++ b/macros/lab2uint8.sci
@@ -0,0 +1,7 @@
+function [output] = lab2uint8(pstData)
+ a = opencv_lab2uint8(pstData);
+ d = size(a);
+ for i=1:d
+ output(:,:,i) = a(i);
+ end
+endfunction
diff --git a/macros/lab2xyz.bin b/macros/lab2xyz.bin
new file mode 100644
index 0000000..b5a6e73
--- /dev/null
+++ b/macros/lab2xyz.bin
Binary files differ
diff --git a/macros/lab2xyz.sci b/macros/lab2xyz.sci
new file mode 100644
index 0000000..ae2cd7b
--- /dev/null
+++ b/macros/lab2xyz.sci
@@ -0,0 +1,20 @@
+function [output] = lab2xyz(vartype,varargin)
+ [lhs rhs] = argn(0);
+ if(rhs>3)
+ eror(msprintf("Too many input arguments"));
+ end
+ select rhs
+ case 1 then
+ a = opencv_lab2xyz(vartype);
+ case 2 then
+ a = opencv_lab2xyz(vartype,varargin(0));
+ case 3 then
+ a = opencv_lab2xyz(vartype,varargin(0),varargin(1));
+ end
+
+ d = size(a);
+ for i=1:d
+ output(:,:,i) = a(i);
+ end
+endfunction
+
diff --git a/macros/laplacian.bin b/macros/laplacian.bin
new file mode 100644
index 0000000..62a2bb8
--- /dev/null
+++ b/macros/laplacian.bin
Binary files differ
diff --git a/macros/laplacian.sci b/macros/laplacian.sci
new file mode 100644
index 0000000..5cd9b04
--- /dev/null
+++ b/macros/laplacian.sci
@@ -0,0 +1,7 @@
+function outputImg= laplacian(inputImage , depth , ksize , scale, delta)
+ inputList=mattolist(inputImage);
+ outputList=opencv_laplacian(inputList , depth , ksize , scale, delta)
+ for i=1:size(outputList)
+ outputImg(:,:,i)=outputList(i)
+ end
+endfunction
diff --git a/macros/lib b/macros/lib
new file mode 100644
index 0000000..29fe244
--- /dev/null
+++ b/macros/lib
Binary files differ
diff --git a/macros/line.bin b/macros/line.bin
new file mode 100644
index 0000000..cb709f1
--- /dev/null
+++ b/macros/line.bin
Binary files differ
diff --git a/macros/line.sci b/macros/line.sci
new file mode 100644
index 0000000..df1d19f
--- /dev/null
+++ b/macros/line.sci
@@ -0,0 +1,7 @@
+function outputImg= line(inputImage , x1 , y1 , x2,y2,r_value,g_value,b_value,thickness,linetype,shift)
+ inputList=mattolist(inputImage);
+ outputList=opencv_line(inputList , x1 , y1 , x2,y2,r_value,g_value,b_value,thickness,linetype,shift)
+ for i=1:size(outputList)
+ outputImg(:,:,i)=outputList(i)
+ end
+endfunction
diff --git a/macros/lineToBorderPoints.bin b/macros/lineToBorderPoints.bin
new file mode 100644
index 0000000..25b050b
--- /dev/null
+++ b/macros/lineToBorderPoints.bin
Binary files differ
diff --git a/macros/lineToBorderPoints.sci b/macros/lineToBorderPoints.sci
new file mode 100644
index 0000000..eab84ef
--- /dev/null
+++ b/macros/lineToBorderPoints.sci
@@ -0,0 +1,29 @@
+function [points] = lineToBorderPoints(lines,isize)
+
+// Points of intersection of line(s) with the image border
+//
+// Calling Sequence
+// points = lineToBorderPoints(lines,isize)
+//
+// Parameters
+// lines : It is a MX3 matrix. If a line is represented by A*x + B*y + C = 0, then each row is of the form [A B C] and M is the number of lines.
+// isize : It is the size of the image. It is of the form as that returned by the function size.
+// points : It is a MX4 matrix. It returns the points of intersection of the line with the image border. Each row is of the form [x1,y1,x2,y2] where (x1,y1) and (x2,y2) are the two points of intersection. If a given line does not intersect the image border, the function returns [-1 -1 -1 -1].
+//
+// Description
+// The function calculates the points of intersection of one or more lines with the image border.
+//
+// Examples
+// // Load an image
+// I = imread('rice.png');
+// // Define a line : 2*x + y = 300
+// line = [2 1 -300];
+// // Calculate the points of intersection
+// points = lineToBorderPoints(line,size(I(1)))
+//
+// Authors
+// Asmita Bhar
+//
+
+ points = opencv_lineToBorderPoints(lines,isize)
+endfunction
diff --git a/macros/localMaximaFinder.bin b/macros/localMaximaFinder.bin
new file mode 100644
index 0000000..7fff1fd
--- /dev/null
+++ b/macros/localMaximaFinder.bin
Binary files differ
diff --git a/macros/localMaximaFinder.sci b/macros/localMaximaFinder.sci
new file mode 100644
index 0000000..45e0806
--- /dev/null
+++ b/macros/localMaximaFinder.sci
@@ -0,0 +1,118 @@
+function [location]=localMaximaFinder(inputMatrix,neighborhood,maxNoOfMaxima,threshold)
+// Returns local maxima in input matrices
+//
+// Calling Sequence
+// location=localMaximaFinder(inputMatrix,neighborhood,maxNoOfMaxima,threshold)
+//
+// Parameters
+// inputMatrix: 2-D input matrix
+// neighborhood: It specifies the neighborhood around maxima, function zeros out the values inside the block. Neighborhood is a two element vector,first one indicates number of rows in neighborhood,second one indicates columns, of odd intergers.
+// maxNoOfMaxima: maximum number of local maxima you want to find.
+// threshold: It specifies minimum value of the local maxima.
+//
+// Description
+// localMaximaFinder returns the M-by-2 matrix where M is the number of local maxima and each row represents one local maximum
+//
+// Examples
+// I=imread("lena.jpeg");
+// grayImage=rgb2gray(I);
+// location=localMaximaFinder(grayImage);
+// mat=[1 6 3;4 8 2;9 7 5];
+// loc=localMaximaFinder(mat,[1 3],4,3);
+
+ [lhs,rhs]=argn(0)
+ if rhs<4 then
+ error(msprintf(" Not enough input arguments"))
+ elseif rhs>4 then
+ error(msprintf(" Too many input arguments to the function"))
+ elseif lhs>1 then
+ error(msprintf(" Too many output arguments"))
+ end
+
+ [iRows iCols]=size(inputMatrix)
+ [nRows nCols]=size(neighborhood)
+ if ~isreal(inputMatrix) | ~isreal(neighborhood)
+ error(msprintf(" Wrong input argument,complex matrix is not expected"))
+ elseif ~nRows==1 | ~nCols==2
+ error(msprintf("Neighborhood property must be a vector with 2 columns"))
+ end
+
+ nh_x=neighborhood(1,1);
+ nh_y=neighborhood(1,2);
+ if modulo(nh_x,2)==0 | modulo(nh_y,2)==0
+ error(msprintf("-Neighborhood property must be odd"))
+ elseif ~nh_x<=iRows | ~nh_y<=iCols
+ error(msprintf("Each dimension of the NeighborhoodSize property value must be less than or equal to the corresponding dimension of the input matrix"))
+ end
+
+ nh_x=floor(nh_x/2);
+ nh_y=floor(nh_y/2);
+ count=0;
+ index=1;
+ k=1;
+ while count<maxNoOfMaxima
+ max_data=-1;
+ //to find maximum in the input matrix
+ for i=1:iRows
+ for j=1:iCols
+ if inputMatrix(i,j)>max_data
+ max_data=inputMatrix(i,j);
+ max_xIn=i;
+ max_yIn=j;
+ end
+ end
+ end
+ if threshold<=max_data
+ location(k,1)=max_yIn;
+ location(k,2)=max_xIn;
+ k=k+1;
+
+ //to zero-out the values around the neighborhood
+ if max_xIn-nh_x<1 then
+ start_x=1
+ else
+ start_x=max_xIn-nh_x
+ end
+ if max_yIn-nh_y<1 then
+ start_y=1
+ else
+ start_y=max_yIn-nh_y
+ end
+ if max_xIn+nh_x>iRows then
+ end_x=iRows
+ else
+ end_x=max_xIn+nh_x
+ end
+ if max_yIn+nh_y>iCols then
+ end_y=iCols
+ else
+ end_y=max_yIn+nh_y
+ end
+ for i=start_x:end_x
+ for j=start_y:end_y
+ inputMatrix(i,j)=0;
+ end
+ end
+ //to check the existence of non-zero element
+ nonZeroCount=0;
+ for i=1:iRows
+ for j=1:iCols
+ if ~inputMatrix(i,j)==0 then
+ nonZeroCount=nonZeroCount+1;
+ break;
+ end
+ end
+ if nonZeroCount==1 then
+ break;
+ end
+ end
+ if nonZeroCount==0 then
+ break;
+ end
+ count=count+1;
+
+ else
+ break; //if maximum number in input matrix is less than threshold
+ end
+ end
+endfunction
diff --git a/macros/makecform.bin b/macros/makecform.bin
new file mode 100644
index 0000000..d12a095
--- /dev/null
+++ b/macros/makecform.bin
Binary files differ
diff --git a/macros/makecform.sci b/macros/makecform.sci
new file mode 100644
index 0000000..ac51464
--- /dev/null
+++ b/macros/makecform.sci
@@ -0,0 +1,4 @@
+function[out_string] = makecform(srcImg)
+ srcMat = mattolist(srcImg)
+ out_string = opencv_makecform(srcMat)
+endfunction
diff --git a/macros/matchFeatures.bin b/macros/matchFeatures.bin
new file mode 100644
index 0000000..c137e32
--- /dev/null
+++ b/macros/matchFeatures.bin
Binary files differ
diff --git a/macros/matchFeatures.sci b/macros/matchFeatures.sci
new file mode 100644
index 0000000..649e68a
--- /dev/null
+++ b/macros/matchFeatures.sci
@@ -0,0 +1,62 @@
+function [indexPairs,varargout]=matchFeatures(features1,features2,varargin)
+// This function is used to find the corresponding matches between two features sets
+//
+// Calling Sequence
+// [ indexPairs ] = matchFeatures( features1, features2, Name, Value... )
+// [ indexPairs matchMetric ] = matchFeatures( features1, features2, Name, Value... )
+//
+// Parameters
+// features1: Feature Set 1, a set of M1-by-N Matrix, M1 corresponding to number of features and N corresponds to length of each feature vector
+// features2: Feature Set 2, a set of M2-by-N Matrix, M2 corresponding to number of features and N corresponds to length of each feature vector
+// Method [Optional Input Argument]: Method of matching to be used. Values: ['Exhaustive' (default) | 'Approximate']
+// MatchThreshold [Optional Input Argument]: Matching Threshold for selecting the percentage of strongest matches. Values in range [0 100], default - 10.0
+// Unique [Optional Input Argument]: Boolean value for selecting only unique matches between features. Default-False(0)
+// Metric [Optional Input Argument]: Metric to be used for matching features. Values: ['SSD'(default)|'SAD'|'Hamming'|'Hamming_2']
+// indexPairs: P-by-2 matrix containing the indices of corresponding features matched between two input feature sets
+// matchMetric: P-by-1 Vector containing the distance metric between matched Features
+//
+// Description
+// MatchFeatures function takes in the Feature Descriptors value of two images as its input and finds the best match between each feature vector of the first image to that of the second image and returns the corresponding indices of each feature matrix
+//
+// Examples
+// image_1 = imread('sample1.jpg');
+// image_2 = imread('sample2.jpg');
+// points_1 = detectFASTFeatures(image_1);
+// points_2 = detectFASTFeatures(image_2);
+// [ f1 vpts_1 ] = extractFeatures(image_1, points_1);
+// [ f2 vpts_2 ] = extractFeatures(image_2, points_2);
+// indexPairs = matchFeatures(f1, f2);
+// matchedPoints_1 = vpts_1(indexPairs(:,1));
+// matchedPoints_2 = vpts_2(indexPairs(:,2));
+//
+// With Optional Arguments:
+// [indexPairs matchMetric] = matchFeatures(f1, f2, "Metric", "SAD");
+//
+// Authors
+// Umang Agrawal
+// Sridhar Reddy
+
+ [lhs rhs]=argn(0);
+ if lhs>2
+ error(msprintf(" Too many output arguments"));
+ elseif rhs>10
+ error(msprintf(" Too many input arguments"));
+ elseif modulo(rhs,2)<>0
+ error(msprintf("Either Argument Name or its Value missing"));
+ end
+ select rhs-2
+ case 0 then
+ [indexPairs, matchmetric]=opencv_matchFeatures(features1,features2);
+ case 2 then
+ [indexPairs, matchmetric]=opencv_matchFeatures(features1,features2,varargin(1),varargin(2));
+ case 4 then
+ [indexPairs, matchmetric]=opencv_matchFeatures(features1,features2,varargin(1),varargin(2),varargin(3),varargin(4));
+ case 6 then
+ [indexPairs, matchmetric]=opencv_matchFeatures(features1,features2,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6));
+ case 8 then
+ [indexPairs, matchmetric]=opencv_matchFeatures(features1,features2,varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6),varargin(7),varargin(8));
+ end
+ if lhs==2 then
+ varargout(1)=matchmetric;
+ end
+endfunction
diff --git a/macros/mattolist.bin b/macros/mattolist.bin
new file mode 100644
index 0000000..cc09fd5
--- /dev/null
+++ b/macros/mattolist.bin
Binary files differ
diff --git a/macros/mattolist.sci b/macros/mattolist.sci
new file mode 100644
index 0000000..8795ebd
--- /dev/null
+++ b/macros/mattolist.sci
@@ -0,0 +1,9 @@
+function [imgList]=mattolist(imgMat)
+ [rows cols channels]=size(imgMat);
+ imgList=list();
+ for i=1:channels
+ imgList($+1)=imgMat(:,:,i);
+// disp(imgList(i))
+ end
+
+endfunction
diff --git a/macros/mattolist.sci~ b/macros/mattolist.sci~
new file mode 100644
index 0000000..77a6b2c
--- /dev/null
+++ b/macros/mattolist.sci~
@@ -0,0 +1,9 @@
+function [imgList]=mattolist(imgMat)
+ [rows cols channels]=size(imgMat);
+ imgList=list();
+ for i=1:channels
+ imgList($+1)=imgMat(:,:,i);
+ disp(imgList(i))
+ end
+
+endfunction
diff --git a/macros/mean.bin b/macros/mean.bin
new file mode 100644
index 0000000..9d43669
--- /dev/null
+++ b/macros/mean.bin
Binary files differ
diff --git a/macros/mean.sci b/macros/mean.sci
new file mode 100644
index 0000000..0b3bdf9
--- /dev/null
+++ b/macros/mean.sci
@@ -0,0 +1,4 @@
+function [out]=mean1(image)
+ image1=mattolist(image);
+ out=opencv_mean1(image1);
+endfunction;
diff --git a/macros/medianblur.bin b/macros/medianblur.bin
new file mode 100644
index 0000000..85c2ccc
--- /dev/null
+++ b/macros/medianblur.bin
Binary files differ
diff --git a/macros/medianblur.sci b/macros/medianblur.sci
new file mode 100644
index 0000000..128edcd
--- /dev/null
+++ b/macros/medianblur.sci
@@ -0,0 +1,7 @@
+function outputImg= medianblur(inputImage,ksize)
+ inputList=mattolist(inputImage);
+ outputList=opencv_medianblur(inputList,ksize)
+ for i=1:size(outputList)
+ outputImg(:,:,i)=outputList(i)
+ end
+endfunction
diff --git a/macros/minAreaRect.bin b/macros/minAreaRect.bin
new file mode 100644
index 0000000..5216ab9
--- /dev/null
+++ b/macros/minAreaRect.bin
Binary files differ
diff --git a/macros/minAreaRect.sci b/macros/minAreaRect.sci
new file mode 100644
index 0000000..a0a48ad
--- /dev/null
+++ b/macros/minAreaRect.sci
@@ -0,0 +1,4 @@
+function [out]=integralKernel(InputArraypoints)
+ [t1 t2 t3 t4 t5]= opencv_integralKernel(InputArraypoints);
+ out=struct("size1",t1,"size2",t2,"center1",t3,"center2",t4,"angle",t5);
+endfunction;
diff --git a/macros/minimumenclosingcirlce.bin b/macros/minimumenclosingcirlce.bin
new file mode 100644
index 0000000..f11df6e
--- /dev/null
+++ b/macros/minimumenclosingcirlce.bin
Binary files differ
diff --git a/macros/minimumenclosingcirlce.sci b/macros/minimumenclosingcirlce.sci
new file mode 100644
index 0000000..61aee6b
--- /dev/null
+++ b/macros/minimumenclosingcirlce.sci
@@ -0,0 +1,4 @@
+function [out]=minimumenclosingcirlce(InputArraypoints)
+ [t1 t2 t3]= opencv_minimumenclosingcirlce(InputArraypoints);
+ out=struct("centerx",t1,"centery",t2,"radius",t3);
+endfunction;
diff --git a/macros/montage.bin b/macros/montage.bin
new file mode 100644
index 0000000..e653df7
--- /dev/null
+++ b/macros/montage.bin
Binary files differ
diff --git a/macros/montage.sci b/macros/montage.sci
new file mode 100644
index 0000000..dbed292
--- /dev/null
+++ b/macros/montage.sci
@@ -0,0 +1,8 @@
+function [out]=montage(DataR,DataB,DataG)
+ a=opencv_montage(DataR,DataB,DataG);
+ dimension=size(a)
+ for i = 1:dimension
+ out(:,:,i)=a(i);
+ end
+
+endfunction;
diff --git a/macros/morphologyEx.bin b/macros/morphologyEx.bin
new file mode 100644
index 0000000..a77b193
--- /dev/null
+++ b/macros/morphologyEx.bin
Binary files differ
diff --git a/macros/morphologyEx.sci b/macros/morphologyEx.sci
new file mode 100644
index 0000000..ef1a93b
--- /dev/null
+++ b/macros/morphologyEx.sci
@@ -0,0 +1,15 @@
+function new_image = morphologyEx(image, operation, kernel, anchorX, anchorY, iterations, borderType)
+
+
+ image_list = mattolist(image)
+
+
+ out = opencv_morphologyEx(image_list, operation, kernel, anchorX, anchorY, iterations, borderType)
+
+ sz = size(out)
+
+ for i=1:sz
+ new_image(:, :, i) = out(i)
+ end
+
+endfunction
diff --git a/macros/names b/macros/names
new file mode 100644
index 0000000..74f5605
--- /dev/null
+++ b/macros/names
@@ -0,0 +1,219 @@
+BRISKPoints
+CascadeObjectDetector
+DCT
+Deinterlacer
+FFT
+ForegroundDetector
+IDCT
+IFFT
+KalmanFilter
+SURFPoints
+TemplateMatcher
+VideoReader
+adapthisteq
+affine2d
+approxpolyDP
+arclength
+arrowedline
+autoCorrelator
+bagOfFeatures
+bagStructToList
+bbox2points
+bboxOverlapRatio
+bilateralFilter
+binaryFeatures
+blobAnalysis
+blur
+borderInterpolate
+boundingRect
+boxfilter
+bundleAdjustment
+bwlookup
+bwulterode
+cameraMatrix
+cameraParameters
+canny
+checkCCE
+checkCEE
+checkCIE
+checkSCE
+checkStereoParam
+circle
+classifierToList
+clipline
+contourarea
+convexhull
+convmtx2
+convolver
+copymakeborder
+corner
+cornerEigenValsAndVecs
+cornerHarris
+cornerMinEigenVal
+crossCorrelator
+cvHoughLines
+cvMaximum
+cvMean
+cvMedian
+cvMinimum
+cvStandardDeviation
+cvVariance
+cv_imread
+cvtColor
+dctmtx
+decorrstretch
+demosaic
+detectBRISKFeatures
+detectCheckerboardPoints
+detectFASTFeatures
+detectHarrisFeatures
+detectMSERFeatures
+detectMinEigenFeatures
+detectSURFFeatures
+dilate
+displayErrors
+ellipse2poly
+erode
+estimateFundamentalMatrix
+estimateGeometricTransform
+estimateUncalibratedRectification
+evaluate
+evaluateImageRetrieval
+extractFeatures
+extractHOGFeatures
+extractLBPFeatures
+fftshift
+fillconvexpoly
+filter
+findcontours
+fitellipse
+fsamp2
+ftrans2
+gabor
+gaussianblur
+genCheckerboardPoints
+geometricshearer
+getStructuringElement
+getTextSize
+getgaussiankernel
+getkerneltype
+getrectsubpix
+getrotationmatrix2d
+goodfeaturestotrack
+grayconnected
+graycoprops
+graydiffweight
+graydist
+has_frame
+histeq
+houghcircles
+houghlines
+houghlinesp
+ifftshift
+im2double
+imadd
+imageSet
+imageSetToList
+imboxfilt3
+imcomplement
+imcontour
+imcontrast
+imcrop
+imdivide
+imextendedmax
+imextendedmin
+imfill
+imfindcircles
+imfuse
+imgSetToList
+imgaborfit
+imgaussfilt3
+imguidedfilter
+imhistmatch
+imhmin
+imimposemin
+immultiply
+impixel
+imread
+imrect
+imresize
+imsharpen
+imshow
+imshowpair
+imsubtract
+imwarp
+imwrite
+ind2gray
+indexImages
+integralFilter
+integralImage
+integralKernel
+invertedIndexImages
+isEpipoleInImage
+lab2double
+lab2rgb
+lab2uint16
+lab2uint8
+lab2xyz
+laplacian
+line
+lineToBorderPoints
+localMaximaFinder
+makecform
+matchFeatures
+mattolist
+mean
+medianblur
+minAreaRect
+minimumenclosingcirlce
+montage
+morphologyEx
+ntsc2rgb
+ocr
+opencv_imread
+opticalFlowFarneback
+partition
+peopleDetector
+predict
+puttext
+pyrDown
+pyrMeanShiftFiltering
+pyrUp
+pyramid
+readForegroundMask
+readframe
+rectangle
+rectifyStereoImages
+regionfill
+retrieveImages
+rgb2lab
+rgb2ntsc
+rgb2xyz
+roifill
+roipoly
+rotationVectorToMatrix
+scharr
+selectStrongestBbox
+sepFilter2D
+show
+showMatchedFeatures
+showReprojectionErrors
+sobel
+ssim
+stereoParameters
+threshold
+trainCascadeObjectDetector
+trainImageCategoryClassifier
+triangulatePoints
+undistort
+undistortImage
+undistortPoints
+viscircle
+warpaffine
+watershed
+whitepoint
+wiener2
+xyz2double
+xyz2lab
+xyz2rgb
+xyz2uint16
diff --git a/macros/ntsc2rgb.bin b/macros/ntsc2rgb.bin
new file mode 100644
index 0000000..25404e6
--- /dev/null
+++ b/macros/ntsc2rgb.bin
Binary files differ
diff --git a/macros/ntsc2rgb.sci b/macros/ntsc2rgb.sci
new file mode 100644
index 0000000..9752bc7
--- /dev/null
+++ b/macros/ntsc2rgb.sci
@@ -0,0 +1,7 @@
+function [output] = ntsc2rgb(pstDataR,pstDataG,pstDataB)
+ a = opencv_ntsc2rgb(pstDataR,pstDataG,pstDataB);
+ d = size(a);
+ for i=1:d
+ output(:,:,i) = a(i);
+ end
+endfunction
diff --git a/macros/ocr.bin b/macros/ocr.bin
new file mode 100644
index 0000000..3675d04
--- /dev/null
+++ b/macros/ocr.bin
Binary files differ
diff --git a/macros/ocr.sci b/macros/ocr.sci
new file mode 100644
index 0000000..7e0ed5b
--- /dev/null
+++ b/macros/ocr.sci
@@ -0,0 +1,27 @@
+function [ txt ] = ocr(image)
+// This function is used to identify the text in an image.
+//
+// Calling Sequence
+// results = ocr(image);
+//
+// Parameters
+// results: OCR Text Struct which contains text, characterBoundingBoxes, words and wordConfidences
+// image: Input image to the OCR
+//
+// Description
+// OCR stands for Optical Character Recognition. It is used for scanning documents which contain text and to convert them into documents that can be edited.
+//
+// Examples
+// image = imread('sample.jpg');
+// results = ocr(image);
+//
+// Authors
+// Rohit Suri
+
+ image_list = mattolist(image)
+
+ [ text, characterBoundingBoxes, words, WordConfidences ] = opencv_ocr(image_list)
+
+ txt = struct("Text", text, "characterBoundingBoxes", characterBoundingBoxes, "Words", words, "WordConfidences", WordConfidences)
+
+endfunction
diff --git a/macros/opencv_imread.bin b/macros/opencv_imread.bin
new file mode 100644
index 0000000..5e5b482
--- /dev/null
+++ b/macros/opencv_imread.bin
Binary files differ
diff --git a/macros/opencv_imread.sci b/macros/opencv_imread.sci
new file mode 100644
index 0000000..3dd72d9
--- /dev/null
+++ b/macros/opencv_imread.sci
@@ -0,0 +1,11 @@
+function[dstMat] = opencv_imread(matA)
+
+ out = opencv_imread(matA)
+
+ channel = size(out)
+
+ for i = 1: channel
+ dstMat(:,:,i) = out(i)
+ end
+
+endfunction
diff --git a/macros/opticalFlowFarneback.bin b/macros/opticalFlowFarneback.bin
new file mode 100644
index 0000000..cfb63fd
--- /dev/null
+++ b/macros/opticalFlowFarneback.bin
Binary files differ
diff --git a/macros/opticalFlowFarneback.sci b/macros/opticalFlowFarneback.sci
new file mode 100644
index 0000000..1bc2ccf
--- /dev/null
+++ b/macros/opticalFlowFarneback.sci
@@ -0,0 +1,21 @@
+function opticalFlowFarneback(varargin)
+ [lhs rhs] = argn(0);
+ if(rhs>12)
+ error(msprintf("Too many input arguments"));
+ end
+ if(rhs==0) then
+ opencv_opticalFlowFarneback();
+ elseif (rhs==2) then
+ opencv_opticalFlowFarneback(varargin(0),varargin(1));
+ elseif(rhs==4) then
+ opencv_opticalFlowFarneback(varargin(0),varargin(1),varargin(2),varargin(3));
+ elseif(rhs==6) then
+ opencv_opticalFlowFarneback(varargin(0),varargin(1),varargin(2),varargin(3),varargin(4),varargin(5));
+ elseif(rhs==8) then
+ opencv_opticalFlowFarneback(varargin(0),varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6),varargin(7));
+ elseif(rhs==10) then
+ opencv_opticalFlowFarneback(varargin(0),varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6),varargin(7),varargin(8),varargin(9));
+ elseif(rhs==12) then
+ opencv_opticalFlowFarneback(varargin(0),varargin(1),varargin(2),varargin(3),varargin(4),varargin(5),varargin(6),varargin(7),varargin(8),varargin(9),varargin(10),varargin(11));
+ end
+endfunction
diff --git a/macros/partition.bin b/macros/partition.bin
new file mode 100644
index 0000000..83c9bbe
--- /dev/null
+++ b/macros/partition.bin
Binary files differ
diff --git a/macros/partition.sci b/macros/partition.sci
new file mode 100644
index 0000000..b830597
--- /dev/null
+++ b/macros/partition.sci
@@ -0,0 +1,52 @@
+function [varargout]=partition(imageSet,groupSizesOrPercentages,varargin)
+// This function is used to split an imageSet.
+//
+// Calling Sequence
+// [set1 set2 ... setN] = partition(imgSet, groupSizes)
+// [set1 set2 ... setN] = partition(imgSet, groupPercentages)
+// [set1 set2 ... setN] = partition(..., method)
+//
+// Parameters
+// set: Output imageSet structure
+// imgSet: Input imageSet to be split
+// groupSizes: Matrix that specifies size of output sets
+// groupPercentages: Matrix that specifies percentage content of each output set
+// method: (Optional) Determines whether split is 'sequential' or 'randomized' (Default: 'sequential')
+//
+// Description
+// This function splits an imageSet into two or more imageSets on the basis of the groupSizes or groupPercentages provided.
+//
+// Examples
+// imgSet = imageSet(directory,'recursive');
+// [trainingSet testSet] = partition(imgSet,[0.8]);
+//
+// imgSet = imageSet(directory,'recursive');
+// [trainingSet testSet] = partition(imgSet,[5], 'randomized');
+//
+// Authors
+// Rohit Suri
+
+ [lhs rhs]=argn(0);
+ if rhs>3
+ error(msprintf(" Too many input arguments"));
+ end
+ cols=size(groupSizesOrPercentages,'c');
+ if lhs>cols+1 then
+ error(msprintf(" Too many output arguments"));
+ end
+ imgSetList=imageSetToList(imageSet);
+ //sets=list();`
+ select rhs
+ case 2 then
+ sets=opencv_partition(imgSetList,groupSizesOrPercentages);
+ case 3 then
+ sets=opencv_partition(imgSetList,groupSizesOrPercentages,varargin(1));
+ end
+ for i=1:lhs
+ for j=1:size(sets(i)(4)(1),'r')
+ imgLocations(j)=sets(i)(4)(1)(j,1);
+ end
+ varargout(i)=struct('Description',sets(i)(2),'ImageLocation',imgLocations,'Count',int32(sets(i)(3)));
+ imgLocations=[]
+ end
+endfunction
diff --git a/macros/peopleDetector.bin b/macros/peopleDetector.bin
new file mode 100644
index 0000000..ed37ffb
--- /dev/null
+++ b/macros/peopleDetector.bin
Binary files differ
diff --git a/macros/peopleDetector.sci b/macros/peopleDetector.sci
new file mode 100644
index 0000000..1770ae3
--- /dev/null
+++ b/macros/peopleDetector.sci
@@ -0,0 +1,79 @@
+function bboxes = peopleDetector(image, varargin)
+// Detects people in an image
+//
+// Calling Sequence
+// [bboxes] = peopleDetector(image)
+// [bboxes] = peopleDetector(image, ["Parameter1", value1, ["Parameter2", value2 ... ]])
+//
+// Parameters
+// image : input image
+// hitThreshold : threshold for distance between features and SVM classifying plane. Default value is 0.
+// winStride : Window stride. Multiple of block stride. Default value (8, 8)
+// padding : Default value (16, 16).
+// scale : Coefficient of the detection window increase. Default value 1.05
+// finalThreshold : Coefficient to regulate the similarity threshold. Some people may cover more boxex. To regulate that it is used. Default value 2.
+// useMeanshiftGrouping : Default value false.
+// bboxes : M * 4 matrix denoting M bounding boxes for detected people
+//
+// Description
+// The peopleDetector function detects standing people in the image using the Histogram of Oriented Gradient (HOG) features and a trained Support Vector Machine
+// (SVM) classifier. It detects standing peole in the image. It returns M * 4 matrix having M detected people in the image. Each row of matrix contains
+// [x, y, width, height] field. x, y represent the upper left corner point of the bounding box. width and height represent the width and height of the bounding box
+// respectively.
+//
+// Examples
+// I = imread('standing.jpg')
+// [bboxes] = peopleDetector(I)
+// I = imread('standing.jpg')
+// [bboxes] = peopleDetector(I, "scale", 1.02)
+//
+// Authors
+// Suraj Prakash
+
+
+
+ [ lhs rhs ] = argn(0)
+
+ if lhs > 1 then
+ error(msprintf("Too many output arguments"))
+ end
+
+ if rhs > 13 then
+ error(msprintf("Too many input arguments"))
+ end
+
+ if modulo(rhs, 2) <> 1 then
+ error(msprintf("Wrong number of input arguments"))
+ end
+
+ image_list = mattolist(image)
+
+ if rhs == 1 then
+
+ bboxes = opencv_peopleDetector(image_list)
+
+ elseif rhs == 3 then
+
+ bboxes = opencv_peopleDetecotr(image_list, varargin(1), varargin(2))
+
+ elseif rhs == 5 then
+
+ bboxes = opencv_peopleDetector(image_list, varargin(1), varargin(2), varargin(3), varargin(4))
+
+ elseif rhs == 7 then
+
+ bboxes = opencv_peopleDetector(image_list, varargin(1), varargin(2), varargin(3), varargin(4), varargin(5), varargin(6))
+
+ elseif rhs == 9 then
+
+ bboxes = opencv_peopleDetector(image_list, varargin(1), varargin(2), varargin(3), varargin(4), varargin(5), varargin(6), varagin(7), varagin(8))
+
+ elseif rhs == 11 then
+
+ bboxes = opencv_peopleDetector(image_list, varargin(1), varargin(2), varargin(3), varargin(4), varargin(5), varargin(6), varargin(7), varargin(8), varargin(9), varargin(10))
+
+ elseif rhs == 13 then
+ bboxes = opencv_peopleDetector(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))
+ end
+
+endfunction
diff --git a/macros/predict.bin b/macros/predict.bin
new file mode 100644
index 0000000..5ebccdc
--- /dev/null
+++ b/macros/predict.bin
Binary files differ
diff --git a/macros/predict.sci b/macros/predict.sci
new file mode 100644
index 0000000..99a701e
--- /dev/null
+++ b/macros/predict.sci
@@ -0,0 +1,32 @@
+function classifierDescription = predict(Categoryclassifier, image)
+// This function is used to predict the category of an image using an image classifier.
+//
+// Calling Sequence
+// label = predict(classifier, image)
+//
+// Parameters
+// label: Evaluated label of the input image
+// classifier: Image category classifier
+// image: Input image
+//
+// Description
+// This function predicts the category of an image based on the category classifier provided.
+//
+// Examples
+// imgSet = imageSet(directory,'recursive');
+// [trainingSet testSet] = partition(imgSet,[0.8]);
+// bag = bagOfFeatures(trainingSet);
+// categoryClassifier = trainImageCategoryClassifier(trainingSet, bag);
+// image = imread('sample.jpg');
+// label = predict(categoryClassifier, image);
+//
+// Authors
+// Rohit Suri
+// Umang Agrawal
+
+ image_list = mattolist(image)
+ Categoryclassifier_list = classifierToList(Categoryclassifier);
+
+ classifierDescription = opencv_predict(Categoryclassifier_list, image_list)
+
+endfunction
diff --git a/macros/puttext.bin b/macros/puttext.bin
new file mode 100644
index 0000000..4658fc0
--- /dev/null
+++ b/macros/puttext.bin
Binary files differ
diff --git a/macros/puttext.sci b/macros/puttext.sci
new file mode 100644
index 0000000..06a0c2b
--- /dev/null
+++ b/macros/puttext.sci
@@ -0,0 +1,31 @@
+function new_image = puttext(image, x1, y1, fontscale, r_value, g_value, b_value, text, fontface, varargin)
+
+ /// varargin(1) = thickness = 1,
+ /// varargin(2) = linetype = 8,
+ /// varargin(3) = bottomleft = false
+
+ [ lhs, rhs ] = argn(0)
+
+ image_list = mattolist(image)
+
+ select rhs
+ case 9 then
+ out = opencv_puttext(image_list, x1, y1, fontscale, r_value, g_value, b_value, text, fontface)
+
+ case 10 then
+ out = opencv_puttext(image_list, x1, y1, fontscale, r_value, g_value, b_value, text, fontface, varargin(1))
+
+ case 11 then
+ out = opencv_puttext(image_list, x1, y1, fontscale, r_value, g_value, b_value, text, fontface, varargin(1), varargin(2))
+
+ case 12 then
+ out = opencv_puttext(image_list, x1, y1, fontscale, r_value, g_value, b_value, text, fontface, varargin(1), varargin(2), varargin(3))
+ end
+
+ sz = size(out)
+
+ for i = 1 : sz
+ new_image(:, :, i) = out(i)
+ end
+
+endfunction
diff --git a/macros/pyrDown.bin b/macros/pyrDown.bin
new file mode 100644
index 0000000..c6031e3
--- /dev/null
+++ b/macros/pyrDown.bin
Binary files differ
diff --git a/macros/pyrDown.sci b/macros/pyrDown.sci
new file mode 100644
index 0000000..999adb8
--- /dev/null
+++ b/macros/pyrDown.sci
@@ -0,0 +1,9 @@
+function [out]=pyrDown(input_image, dstsize_width, distsize_height, border)
+ input_image1=mattolist(input_image);
+ a=opencv_pyrDown(input_image1, dstsize_width, distsize_height, border);
+ dimension=size(a)
+ for i = 1:dimension
+ out(:,:,i)=a(i);
+ end
+
+endfunction;
diff --git a/macros/pyrMeanShiftFiltering.bin b/macros/pyrMeanShiftFiltering.bin
new file mode 100644
index 0000000..7edaf41
--- /dev/null
+++ b/macros/pyrMeanShiftFiltering.bin
Binary files differ
diff --git a/macros/pyrMeanShiftFiltering.sci b/macros/pyrMeanShiftFiltering.sci
new file mode 100644
index 0000000..63b6d8e
--- /dev/null
+++ b/macros/pyrMeanShiftFiltering.sci
@@ -0,0 +1,8 @@
+function [outputImg]=pyrMeanShiftFiltering(inputImage,sp,sr)
+ inputList=mattolist(inputImage);
+ outputList=opencv_pyrMeanShiftFiltering(inputList,sp,sr);
+
+ for i=1:size(outputList)
+ outputImg(:,:,i)=outputList(i)
+ end
+endfunction
diff --git a/macros/pyrMeanShiftFiltering.sci~ b/macros/pyrMeanShiftFiltering.sci~
new file mode 100644
index 0000000..02d6e7e
--- /dev/null
+++ b/macros/pyrMeanShiftFiltering.sci~
@@ -0,0 +1,8 @@
+function [outputImg]=pyrMeanShiftFiltering(inputImage,sp,sr)
+ inputList=mattolist(inputImage);
+ outputList=opencv_pyrMeanShiftFiltering(inputList,sp,sr);
+ end
+ for i=1:size(outputList)
+ outputImg(:,:,i)=outputList(i)
+ end
+endfunction
diff --git a/macros/pyrUp.bin b/macros/pyrUp.bin
new file mode 100644
index 0000000..41ad975
--- /dev/null
+++ b/macros/pyrUp.bin
Binary files differ
diff --git a/macros/pyrUp.sci b/macros/pyrUp.sci
new file mode 100644
index 0000000..b84b0b9
--- /dev/null
+++ b/macros/pyrUp.sci
@@ -0,0 +1,9 @@
+function [out]=pyrUp(input_image, dstsize_width, distsize_height, border)
+ input_image1=mattolist(input_image);
+ a=opencv_pyrUp(input_image1, dstsize_width, distsize_height, border);
+ dimension=size(a)
+ for i = 1:dimension
+ out(:,:,i)=a(i);
+ end
+
+endfunction;
diff --git a/macros/pyramid.bin b/macros/pyramid.bin
new file mode 100644
index 0000000..7615a51
--- /dev/null
+++ b/macros/pyramid.bin
Binary files differ
diff --git a/macros/pyramid.sci b/macros/pyramid.sci
new file mode 100644
index 0000000..29d6c1e
--- /dev/null
+++ b/macros/pyramid.sci
@@ -0,0 +1,35 @@
+function [out]=pyramid(inputimage,direction,level)
+// Computes the pyramid reduction or expansion of input_image
+//
+// Calling Sequence
+// output_image=pyramid(inputimage,direction,level);
+//
+// Parameters
+//
+// inputimage : image matrix on which pyramid reduction or expansion has to be applied
+// Direction : An input string 'expand' for expand or 'reduce' for reduce the image matrix
+// level : It is specify number of times want to expand or reduce the dimension of an image matrix.
+// output_image : Expanded or reduced form of image after pyramid reduction or expansion
+//
+// Description
+// This function computes the pyramid reduction or expansion of input image.It uses Gaussian pyramid to downsamples and upsamples the image pixels.In reduction it reduces the size of image (if m*n matrix image) by m/pow(2,level) and n/pow(2,level).In expansion it expands the size of image (if m*n matrix image) by m*pow(2,level) and n*pow(2,level).Where pow(x,y)=x^y.
+//
+// Examples
+// inputimage1 = imread('lena.jpeg');
+// a=opencv_pyramid(inputimage1,'expand',2);
+// imshow(a);
+//
+// Authors:
+//
+//Diwakar Bhardwaj
+
+
+
+ inputimage1=mattolist(inputimage);
+ a=opencv_pyramid(inputimage1,direction,level);
+ dimension=size(a)
+ for i = 1:dimension
+ out(:,:,i)=a(i);
+ end
+
+endfunction;
diff --git a/macros/readForegroundMask.bin b/macros/readForegroundMask.bin
new file mode 100644
index 0000000..a962df3
--- /dev/null
+++ b/macros/readForegroundMask.bin
Binary files differ
diff --git a/macros/readForegroundMask.sci b/macros/readForegroundMask.sci
new file mode 100644
index 0000000..12db37e
--- /dev/null
+++ b/macros/readForegroundMask.sci
@@ -0,0 +1,37 @@
+function varargout=readForegroundMask(varargin)
+// This function computes the foreground mask for the input image.
+//
+// Calling Sequence
+// mask = readForegroundMask(image)
+//
+// Parameters
+// mask: the computed foreground mask.
+// image : the input image
+//
+//
+// Description
+// This function returns the foreground mask for an image using Gaussian Mixed Models.
+//
+// Examples
+// myStr = ForegroundDetector()
+// myVideo = VideoReader('sample.mp4');
+// while hasFrame()
+// frame = readFrame();
+// mask = readForegroundMask(frame);
+// end
+//
+//
+// Authors
+// Shashank Shekhar
+[lhs,rhs]=argn(0)
+ if rhs<1 then
+ error(msprintf(" Not enough input arguments"))
+ end
+ if rhs>1 then
+ error(msprintf(" Too many input arguments to the function"))
+ end
+ if lhs>1 then
+ error(msprintf(" Too many output arguments"))
+ end
+ varargout(1) = ocv_readForegroundMask(varargin(1));
+endfunction
diff --git a/macros/readframe.bin b/macros/readframe.bin
new file mode 100644
index 0000000..1ae7401
--- /dev/null
+++ b/macros/readframe.bin
Binary files differ
diff --git a/macros/readframe.sci b/macros/readframe.sci
new file mode 100644
index 0000000..747c4de
--- /dev/null
+++ b/macros/readframe.sci
@@ -0,0 +1,23 @@
+function [out]=readFrame(input)
+// This function is used to return the next frame pointed to by the CurrentTime Property of A VideoReader Struct.
+//
+// Calling Sequence
+// results = readFrame();
+//
+// Parameters
+// results: Frame of video.
+//
+// Description
+// This function checks whether there is a next frame to grab in the video read through VideoReader and returns the frame.
+//
+// Examples
+// videoStr = VideoReader('sample.mp4');
+// if(hasFrame()) then
+// frame = readFrame()
+// end
+//
+// Authors
+// Shashank Shekhar
+// Tanmay Chaudhari
+ out=ocv_readFrame();
+endfunction;
diff --git a/macros/rectangle.bin b/macros/rectangle.bin
new file mode 100644
index 0000000..892d563
--- /dev/null
+++ b/macros/rectangle.bin
Binary files differ
diff --git a/macros/rectangle.sci b/macros/rectangle.sci
new file mode 100644
index 0000000..b8c6857
--- /dev/null
+++ b/macros/rectangle.sci
@@ -0,0 +1,9 @@
+function [out]=rectangle(input_image , x_coordinate_of_point1 , y_coordinate_point1, x_coordinate_of_point2 , y_coordinate_point2 , r_value,g_value,b_value,thickness,linetype,shift)
+ input_image1=mattolist(input_image);
+ a=opencv_rectangle(input_image , x_coordinate_of_point1 , y_coordinate_point1, x_coordinate_of_point2 , y_coordinate_point2 , r_value,g_value,b_value,thickness,linetype,shift);
+ dimension=size(a)
+ for i = 1:dimension
+ out(:,:,i)=a(i);
+ end
+
+endfunction;
diff --git a/macros/rectifyStereoImages.bin b/macros/rectifyStereoImages.bin
new file mode 100644
index 0000000..c96dc09
--- /dev/null
+++ b/macros/rectifyStereoImages.bin
Binary files differ
diff --git a/macros/rectifyStereoImages.sci b/macros/rectifyStereoImages.sci
new file mode 100644
index 0000000..a6f16fe
--- /dev/null
+++ b/macros/rectifyStereoImages.sci
@@ -0,0 +1,59 @@
+function [out]=rectifyStereoImages(input_image1,cameramatrix1,Distortion_coff1,input_image2,cameramatrix2,Distortioncoff2,Translationvector,Rotationvector)
+// Rectify the pair of image taken by stereo camera
+//
+// Calling Sequence
+// [left_image,right_image] = rectifyStereoImages (input_image1,cameramatrix1,Distortion_coff1,input_image2,cameramatrix2,Distortioncoff2,Translationvector,Rotationvector)
+// left_image = rectified input_image1
+// right_image = rectified input_image2
+//
+// Parameters
+//
+// input_image1 : First Stereo image on which rectification has to be performed
+// Cameramatrix1 : An input matrix of 3*3
+// Distortion_coff1 : A vector of size 4 ,5 or 8
+// input_image2 : Second Stereo image on which rectification has to be performed
+// Cameramatrix2 : An input matrix of 3*3
+// Distortion_coff2 : A vector of size 4 ,5 or 8
+// Translationvector : A vector of size 3
+// Rotationvector : An input matrix of 3*3
+// left_image : rectified input_image1
+// right_image : rectfied input_image2
+//
+// Description
+// This function first undistorted and then rectified the both image1 and image2.It uses camera parameters,respective rotation,translation of both camera.
+//
+// Examples
+// a = imread('lena.jpeg')
+// cameramatrix1 = [1 0 1;0 1 1;0 0 1];
+// Distortion_coff1 = [200 200 400 300];
+// b = imread('lena.jpeg')
+// cameramatrix2 = [2 0 1;0 1 1;0 0 1];
+// Distortion_coff2 = [205 240 410 370];
+// Translationvector = [1 2 3];
+// Rotationvector = [0 0 2;1 4 5;6 7 8];
+// [left_image,right_image] = rectifyStereoImages(a,cameramatrix1,Distortion_coff1,b,cameramatrix2,Distortioncoff2,Translationvector,Rotationvector);
+// imshow(left_image);
+// imshow(right_image);
+//
+// Authors.
+//
+//Diwakar Bhardwaj
+
+ input_image3=mattolist(input_image1);
+ input_image4=mattolist(input_image2);
+ [left_image right_image]=rectifyStereoImages(input_image3,cameramatrix1,Distortion_coff1,input_image4,cameramatrix2,Distortioncoff2,Translationvector,Rotationvector);
+
+ dimension1=size(left_image)
+ for i = 1:dimension1
+ left_out(:,:,i)=left_image(i);
+ end
+
+ dimension2=size(right_image)
+ for j = 1:dimension2
+ right_out(:,:,j)=right_image(j);
+ end
+
+
+ out=struct("left_rectifyimage",left_out,"right_rectifyimage",right_out);
+
+endfunction;
diff --git a/macros/rectifyStereoImages.sci~ b/macros/rectifyStereoImages.sci~
new file mode 100644
index 0000000..2cd9c54
--- /dev/null
+++ b/macros/rectifyStereoImages.sci~
@@ -0,0 +1,59 @@
+function [out]=rectifyStereoImages(input_image1,cameramatrix1,Distortion_coff1,input_image2,cameramatrix2,Distortioncoff2,Translationvector,Rotationvector)
+// Rectify the pair of image taken by stereo camera
+//
+// Calling Sequence
+// [left_image,right_image] = rectifyStereoImages (input_image1,cameramatrix1,Distortion_coff1,input_image2,cameramatrix2,Distortioncoff2,Translationvector,Rotationvector)
+// left_image = rectified input_image1
+// right_image = rectified input_image2
+//
+// Parameters
+//
+// input_image1 : First Stereo image on which rectification has to be performed
+// Cameramatrix1 : An input matrix of 3*3
+// Distortion_coff1 : A vector of size 4 ,5 or 8
+// input_image2 : Second Stereo image on which rectification has to be performed
+// Cameramatrix2 : An input matrix of 3*3
+// Distortion_coff2 : A vector of size 4 ,5 or 8
+// Translationvector : A vector of size 3
+// Rotationvector : An input matrix of 3*3
+// left_image : rectified input_image1
+// right_image : rectfied input_image2
+//
+// Description
+// This function first undistorted and then rectified the both image1 and image2.It uses camera parameters,respective rotation,translation of both camera.
+//
+// Examples
+// a = imread('lena.jpeg')
+// cameramatrix1 = [1 0 1;0 1 1;0 0 1];
+// Distortion_coff1 = [200 200 400 300];
+// b = imread('lena.jpeg')
+// cameramatrix2 = [2 0 1;0 1 1;0 0 1];
+// Distortion_coff2 = [205 240 410 370];
+// Translationvector = [1 2 3];
+// Rotationvector = [0 0 2;1 4 5;6 7 8];
+// [left_image,right_image] = rectifyStereoImages(a,cameramatrix1,Distortion_coff1,b,cameramatrix2,Distortioncoff2,Translationvector,Rotationvector);
+// imshow(left_image);
+// imshow(right_image);
+//
+// Authors.
+//
+//Diwakar Bhardwaj
+
+ input_image3=mattolist(input_image1);
+ input_image4=mattolist(input_image2);
+ [left_image right_image]=rectifyStereoImages(input_image3,cameramatrix1,Distortion_coff1,input_image4,cameramatrix2,Distortioncoff2,Translationvector,Rotationvector);
+
+ dimension1=size(left_image)
+ for i = 1:dimension1
+ left_out(:,:,i)=left_image(i);
+ end
+
+ dimension2=size(right_image)
+ for j = 1:dimension2
+ right_out(:,:,j)=right_image(j);
+ end
+
+
+ out=struct("left_rectifyimage",left_out,"right_rectifyimage",right_out);
+
+endfunction;*
diff --git a/macros/regionfill.bin b/macros/regionfill.bin
new file mode 100644
index 0000000..fa7e696
--- /dev/null
+++ b/macros/regionfill.bin
Binary files differ
diff --git a/macros/regionfill.sci b/macros/regionfill.sci
new file mode 100644
index 0000000..74c4779
--- /dev/null
+++ b/macros/regionfill.sci
@@ -0,0 +1,18 @@
+function[dstImg] = regionfill(srcImg, varargin)
+
+ [lhs, rhs] = argn(0)
+
+ srcMat = mattolist(srcImg)
+
+ if rhs == 2 then
+ out = opencv_regionfill(srcMat, varargin(1))
+ elseif rhs == 2 then
+ out = opencv_regionfill(srcMat, varargin(1), varargin(2))
+ end
+
+ channels = size(out)
+
+ for i = 1:channels
+ dstImg(:,:,i) = out(i)
+ end
+endfunction
diff --git a/macros/retrieveImages.bin b/macros/retrieveImages.bin
new file mode 100644
index 0000000..a0cd3bf
--- /dev/null
+++ b/macros/retrieveImages.bin
Binary files differ
diff --git a/macros/retrieveImages.sci b/macros/retrieveImages.sci
new file mode 100644
index 0000000..0c8f8a2
--- /dev/null
+++ b/macros/retrieveImages.sci
@@ -0,0 +1,103 @@
+function [varargout] = retrieveImages(QueryImage, IndexImage, varargin)
+// This function searches for similar image in a given image set
+//
+// Calling Sequence
+// [imageID Score ImageWord] = retrieveImage(QueryImage, IndexImage, Name, Value... )
+//
+// Parameters
+// QueryImage: The query image, for which the similar image has to be found. Can be a grayscale or a RGB image
+// IndexImage: imageIndex object that contains the data set of all the images to be compared
+// NumResults [Optional Input Argument]: Maximum number of results to be returned. Value: any integer (20 default)
+// ROI [Optional Input Argument]: Query Image search region. Format [ x y width height ]. Default: [1 1 size(Image,2) size(Image,1)]
+// imageID: M-by-1 vector consisting of Ranked Index of retrieved Images
+// Score: M-by-1 vector containing the similarity metric in the range 0 to 1
+// ImageWord: Visual Word mapped object for the Query Image
+//
+// Description
+// Returns the indices corresponding to Images within imageIndex that are visually similar to the query Image
+//
+// Examples
+// imgSet = imageSet(directory,'recursive');
+// [trainingSet testSet] = partition(imgSet,[0.8]);
+// bag = bagOfFeatures(trainingSet);
+// imageindex = indexImages(trainingSet, bag);
+// queryImage = imread('sample.jpg');
+// imageIDs = retrieveImages(queryImage, imageindex);
+//
+// With Optional Arguments:
+// imageIDs = retrieveImages(queryImage, imageindex, "NumResults", 10);
+//
+// Authors
+// Umang Agrawal
+// Rohit Suri
+
+ /// varargout(1) = index
+ /// varargout(2) = score
+ /// varargout(3) = Imageword
+
+ [ lhs rhs ] = argn(0)
+
+ if rhs > 6 then
+ error(msprintf("Too many input arguments"))
+ end
+
+ if lhs > 3 then
+ error(msprintf("Too many output arguments"))
+ end
+
+ QueryImage_list = mattolist(QueryImage)
+
+ if lhs == 1 then
+ select rhs
+ case 2 then
+
+ index = opencv_retrieveImages(QueryImage_list, IndexImage)
+
+ case 4 then
+
+ index = opencv_retrieveImages(QueryImage_list, IndexImage, varargin(1), varargin(2))
+
+ case 6 then
+ index = opencv_retrieveImages(QueryImage_list, IndexImage, varargin(1), varargin(2), varagin(3), varargin(4))
+ end
+
+ varargout(1) = index
+
+ elseif lhs == 2 then
+ select rhs
+ case 2 then
+
+ [index, score] = opencv_retrieveImages(QueryImage_list, IndexImage)
+
+ case 4 then
+
+ [index, score] = opencv_retrieveImages(QueryImage_list, IndexImage, varargin(1), varargin(2))
+
+ case 6 then
+ [index, score] = opencv_retrieveImages(QueryImage_list, IndexImage, varargin(1), varargin(2), varagin(3), varargin(4))
+ end
+
+ varargout(1) = temp
+ varargout(2) = score
+
+ elseif lhs == 3 then
+ select rhs
+ case 2 then
+
+ [index, score, Imageword] = opencv_retrieveImages(QueryImage_list, IndexImage)
+
+ case 4 then
+
+ [index, score, Imageword] = opencv_retrieveImages(QueryImage_list, IndexImage, varargin(1), varargin(2))
+
+ case 6 then
+ [index, score, Imageword] = opencv_retrieveImages(QueryImage_list, IndexImage, varargin(1), varargin(2), varagin(3), varargin(4))
+ end
+
+ varargout(1) = index
+ varargout(2) = score
+ del = struct("WordIndex", Imageword(1), "Location", Imageword(2), "Vocab_size", Imageword(3), "Count", Imageword(4))
+ varargout(3) = del
+ end
+
+endfunction
diff --git a/macros/rgb2lab.bin b/macros/rgb2lab.bin
new file mode 100644
index 0000000..9c4261a
--- /dev/null
+++ b/macros/rgb2lab.bin
Binary files differ
diff --git a/macros/rgb2lab.sci b/macros/rgb2lab.sci
new file mode 100644
index 0000000..0035bd5
--- /dev/null
+++ b/macros/rgb2lab.sci
@@ -0,0 +1,10 @@
+//Author- Sridhar Reddy
+//inputImage should be matrix
+function [outputImg]=rgb2lab(inputImage)
+ inputList=mattolist(inputImage);
+ outputList=opencv_rgb2lab(inputList);
+ disp(outputList(2));
+ for i=1:size(outputList)
+ outputImg(:,:,i)=outputList(i)
+ end
+endfunction
diff --git a/macros/rgb2ntsc.bin b/macros/rgb2ntsc.bin
new file mode 100644
index 0000000..9fd18dd
--- /dev/null
+++ b/macros/rgb2ntsc.bin
Binary files differ
diff --git a/macros/rgb2ntsc.sci b/macros/rgb2ntsc.sci
new file mode 100644
index 0000000..6fdcede
--- /dev/null
+++ b/macros/rgb2ntsc.sci
@@ -0,0 +1,8 @@
+function [output] = rgb2ntsc(img)
+ image = mattolist(img);
+ a = opencv_rgb2ntsc(image);
+ d = size(a);
+ for i=1:d
+ output(:,:,i) = a(i);
+ end
+endfunction
diff --git a/macros/rgb2xyz.bin b/macros/rgb2xyz.bin
new file mode 100644
index 0000000..9ab02d5
--- /dev/null
+++ b/macros/rgb2xyz.bin
Binary files differ
diff --git a/macros/rgb2xyz.sci b/macros/rgb2xyz.sci
new file mode 100644
index 0000000..b15d2ce
--- /dev/null
+++ b/macros/rgb2xyz.sci
@@ -0,0 +1,8 @@
+function [output] = rgb2xyz(img)
+ image = mattolist(img);
+ a = opencv_rgb2xyz(image);
+ d = size(a);
+ for i=1:d
+ output(:,:,i) = a(i);
+ end
+endfunction
diff --git a/macros/roifill.bin b/macros/roifill.bin
new file mode 100644
index 0000000..cf3fa1b
--- /dev/null
+++ b/macros/roifill.bin
Binary files differ
diff --git a/macros/roifill.sci b/macros/roifill.sci
new file mode 100644
index 0000000..b69288a
--- /dev/null
+++ b/macros/roifill.sci
@@ -0,0 +1,28 @@
+function new_image = roifill(image, mask_orig, varargin)
+
+ [ lhs, rhs ] = argn(0)
+
+ if rhs < 2 then
+ error(msprintf("Too less input arguments"))
+ elseif rhs > 3 then
+ error(msprintf("Too many input arguments"))
+ end
+
+
+ image_list = mattolist(image)
+
+
+ select rhs
+ case 2
+ out = opencv_roifill(image_list, mask_orig)
+
+ case 3
+ out = opencv_roifill(image_list, mask_orig, varargin(1))
+ end
+
+ sz = size(out)
+ for i=1 : sz
+ new_image(:, :, i) = out(i)
+ end
+
+endfunction
diff --git a/macros/roipoly.bin b/macros/roipoly.bin
new file mode 100644
index 0000000..770dca6
--- /dev/null
+++ b/macros/roipoly.bin
Binary files differ
diff --git a/macros/roipoly.sci b/macros/roipoly.sci
new file mode 100644
index 0000000..4323812
--- /dev/null
+++ b/macros/roipoly.sci
@@ -0,0 +1,13 @@
+function[dstImg] = roipoly(srcImg, col_list, row_list)
+
+ srcMat = mattolist(srcImg)
+
+ out = opencv_roipoly(srcMat, col_list, row_list)
+
+ channels = size(out)
+
+ for i = 1:channels
+ dstImg(:,:,i) = out(i)
+ end
+
+endfunction
diff --git a/macros/rotationVectorToMatrix.bin b/macros/rotationVectorToMatrix.bin
new file mode 100644
index 0000000..252c686
--- /dev/null
+++ b/macros/rotationVectorToMatrix.bin
Binary files differ
diff --git a/macros/rotationVectorToMatrix.sci b/macros/rotationVectorToMatrix.sci
new file mode 100644
index 0000000..abe97f9
--- /dev/null
+++ b/macros/rotationVectorToMatrix.sci
@@ -0,0 +1,24 @@
+function [ matrix ] = 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
+
+ a=opencv_rotationVectorToMatrix(vector);
+ matrix(:,:,1)=a(1);
+
+endfunction
diff --git a/macros/scharr.bin b/macros/scharr.bin
new file mode 100644
index 0000000..f803903
--- /dev/null
+++ b/macros/scharr.bin
Binary files differ
diff --git a/macros/scharr.sci b/macros/scharr.sci
new file mode 100644
index 0000000..53d1903
--- /dev/null
+++ b/macros/scharr.sci
@@ -0,0 +1,13 @@
+function new_image = scharr(image, ddepth, dx, dy, scale, delta)
+
+ image_list = mattolist(image)
+
+ out = opencv_scharr(image_list, ddepth, dx, dy, scale, delta)
+
+ sz = size(out)
+
+ for i=1:sz
+ new_image(:, :, i) = out(i)
+ end
+
+endfunction
diff --git a/macros/selectStrongestBbox.bin b/macros/selectStrongestBbox.bin
new file mode 100644
index 0000000..c9c3502
--- /dev/null
+++ b/macros/selectStrongestBbox.bin
Binary files differ
diff --git a/macros/selectStrongestBbox.sci b/macros/selectStrongestBbox.sci
new file mode 100644
index 0000000..57c3ac4
--- /dev/null
+++ b/macros/selectStrongestBbox.sci
@@ -0,0 +1,147 @@
+function [selectedBbox,selectedScore,varargout]=selectStrongestBbox(bBox,score,varargin)
+// Selecting strongest bounding boxes
+//
+// Calling Sequence
+// [selectedBbox, selectedScore]= selectStrongestBbox(bBox,score);
+// [selectedBbox, selectedScore]= selectStrongestBbox(bBox,score,Name,Value);
+// [selectedBbox, selectedScore, selectionIndex]= selectStrongestBbox(bBox,score,Name,Value);
+//
+// Parameters
+// bBox: Each row represents one bounding box specified as [x y width height];
+// score: Confidence Score of bounding box
+// varargin: optinal (Name,Value) pair arguments
+// Optional arguments can be
+// <itemizedlist>
+// <listitem><para>RatioType: method to compute the ratio of the intersection area between two boxes and it is specified as string, possile values are 'Union', 'Min' </para></listitem>
+// <listitem><para>overlapThreshold: It specifies maximum overlap ratio, if overlap ration is more than this corresponding bounding box will be removed, possible range is 0 to 1</para></listitem>
+// <itemizedlist>
+//
+// Description
+// Returns strongest bounding boxes as per the given RatioType and OverlapThreshold and additionally it returns the index of the selected boxes
+//
+// Examples
+// box(1)=[100 200 150 140];
+// box(2)=[100 180 140 160];
+// score(1)=0.03;
+// score(2)=0.05;
+// [sb ss]=selectStrongestBbox(box,score);
+
+ [lhs,rhs]=argn(0)
+
+ if rhs<2 then
+ error(msprintf(" Not enough input arguments"))
+ elseif rhs>6 then
+ error(msprintf(" Too many input arguments to the function"))
+ elseif lhs<2 then
+ error(msprintf(" Not enough output arguments"))
+ elseif lhs>3 then
+ error(msprintf(" Too many output arguments"))
+ end
+ [bBoxRows bBoxCols]=size(bBox);
+ [scoreRows scoreCols]=size(score);
+ if ~bBoxCols==4 then
+ error(msprintf("bounding box matrix must be M*4"))
+ elseif ~scoreCols==1 then
+ error(msprintf(" score matrix must be M*1"))
+ elseif ~bBoxRows==scoreRows then
+ error(msprintf(" The number of bounding boxes and scores should be same"))
+ elseif ~isreal(bBox)
+ error(msprintf(" Wrong input argument,complex matrix is not expected"))
+ end
+ for i=1:bBoxRows
+ if bBox(i,3)<0 | bBox(i,4)<0
+ error(msprintf(" The width and height of the bounded box must be positive"))
+ end
+ end
+
+ ratioType=1;
+ overlapThreshold=0.5;
+ for i=1:2:rhs-2
+ if strcmpi(varargin(i),"RatioType")==0 then
+ i=i+1;
+ if strcmpi(varargin(i),'union')== 0 then
+ ratioType=1;//1-union
+ elseif strcmpi(varargin(i),'min')==0 then
+ ratioType=0;//0-min
+ else
+ error(msprintf(" wrong value for the ratio type,it must be union or min"))
+ end
+ elseif strcmpi(varargin(i),'OverlapThreshold')==0 then
+ i=i+1;
+ if 0<=varargin(i) & varargin(i)<=1 then
+ overlapThreshold=varargin(i)
+ else
+ error(msprintf("wrong value for the overlapThreshold,it must be in between 0 and 1"))
+ end
+ else
+ error(msprintf(_(" Wrong value for input argument")));
+ end
+ end
+ for i=1:bBoxRows
+ index(i)=i;
+ end
+ score_temp=score(:,1);
+ for i=1:bBoxRows
+ for j=i+1:bBoxRows
+ if score_temp(i,1)<score_temp(j,1)
+ temp=score_temp(i,1);
+ score_temp(i,1)=score_temp(j,1);
+ score_temp(j,1)=temp;
+ temp=index(i);
+ index(i)=index(j);
+ index(j)=temp;
+ end
+ end
+ end
+ bBox_temp=bBox(index,:);
+ selection=ones(size(bBox_temp,1),1);
+ area = bBox_temp(:,3).*bBox_temp(:,4);
+ x1 = bBox_temp(:,1);
+ x2 = bBox_temp(:,1)+bBox_temp(:,3);
+ y1 = bBox_temp(:,2);
+ y2 = bBox_temp(:,2)+bBox_temp(:,4);
+ for i = 1:bBoxRows
+ if selection(i)
+ for j = (i+1):bBoxRows
+ if selection(j)
+ width = min(x2(i), x2(j)) - max(x1(i), x1(j));
+ height = min(y2(i), y2(j)) - max(y1(i), y1(j));
+ intersectionArea = width * height;
+ if ratioType
+ overlapRatio = intersectionArea/(area(i)+area(j)-intersectionArea);
+ else
+ overlapRatio = intersectionArea/min(area(i), area(j));
+ end
+
+ if overlapRatio > overlapThreshold
+ selection(j) = 0;
+ end
+ end
+ end
+ end
+ end
+ k=1;
+ for i=1:bBoxRows
+ if selection(i)
+ selectionIndex(k)=i;
+ indexOriginal(k)=index(i);
+ k=k+1;
+ end
+ end
+ //disp(indexOriginal);
+ [selectedIndexRows selectedIndexRows]=size(selectionIndex)
+ for i=1:selectedIndexRows
+ for j=i+1:selectedIndexRows
+ if indexOriginal(i)>indexOriginal(j)
+ temp=indexOriginal(i);
+ indexOriginal(i)=indexOriginal(j)
+ indexOriginal(j)=temp;
+ end
+ end
+ end
+ //disp("original indexes");
+ //disp(indexOriginal);
+ selectedBbox=bBox(indexOriginal,:);
+ selectedScore=score(indexOriginal,:);
+ varargout(1)=indexOriginal;
+endfunction
diff --git a/macros/sepFilter2D.bin b/macros/sepFilter2D.bin
new file mode 100644
index 0000000..b6fd319
--- /dev/null
+++ b/macros/sepFilter2D.bin
Binary files differ
diff --git a/macros/sepFilter2D.sci b/macros/sepFilter2D.sci
new file mode 100644
index 0000000..2edfee1
--- /dev/null
+++ b/macros/sepFilter2D.sci
@@ -0,0 +1,13 @@
+function new_image = sepFilter2D(image, ddepth, kernel_x, kernel_y, anchor_x, anchor_y, delta, border)
+
+ image_list = mattolist(image)
+
+ out = opencv_sepFilter2D(image_list, ddepth, kernel_x, kernel_y, anchor_x, anchor_y, delta, border)
+
+ sz = size(out)
+
+ for i = 1 : sz
+ new_image(:, :, i) = out(i)
+ end
+
+endfunction
diff --git a/macros/show.bin b/macros/show.bin
new file mode 100644
index 0000000..960ba2d
--- /dev/null
+++ b/macros/show.bin
Binary files differ
diff --git a/macros/show.sci b/macros/show.sci
new file mode 100644
index 0000000..aec4db8
--- /dev/null
+++ b/macros/show.sci
@@ -0,0 +1,18 @@
+ function[] =show(Img,ColorMap)
+ FigureHandle = gcf();
+ drawlater();
+ FigureHandle.color_map = ColorMap
+ FigureHandle.background = -2; // sets the background to white
+ FigureHandle.figure_name = "Title";
+ [NumberOfRows NumberOfColumns] = size(Img);
+ FigureHandle.axes_size = [NumberOfColumns NumberOfRows];
+ delete(gca()); // previous image is deleted
+ Diagram = gca();
+ [NumberOfRows NumberOfColumns] = size(Img);
+ Diagram.data_bounds = [1, 1; NumberOfColumns, NumberOfRows];
+ Diagram.axes_visible = ['off' 'off' 'off'];
+ Diagram.isoview = 'on';
+ Options = '082'; // Box is drawn around image.
+ Matplot(Img, Options);
+ drawnow();
+ endfunction
diff --git a/macros/showMatchedFeatures.bin b/macros/showMatchedFeatures.bin
new file mode 100644
index 0000000..edf37bc
--- /dev/null
+++ b/macros/showMatchedFeatures.bin
Binary files differ
diff --git a/macros/showMatchedFeatures.sci b/macros/showMatchedFeatures.sci
new file mode 100644
index 0000000..f1608f5
--- /dev/null
+++ b/macros/showMatchedFeatures.sci
@@ -0,0 +1,10 @@
+function [output] = showMatchedFeatuers(image1,image2)
+ img1 = mattolist(image1);
+ img2 = mattolist(image2);
+ a = opencv_showMatchedFeatures(img1,img2)
+ d = size(a);
+ for i = 1:d
+ output(:,:,i) = a(i);
+ end
+endfunction
+
diff --git a/macros/showReprojectionErrors.bin b/macros/showReprojectionErrors.bin
new file mode 100644
index 0000000..2652cc1
--- /dev/null
+++ b/macros/showReprojectionErrors.bin
Binary files differ
diff --git a/macros/showReprojectionErrors.sci b/macros/showReprojectionErrors.sci
new file mode 100644
index 0000000..94a77af
--- /dev/null
+++ b/macros/showReprojectionErrors.sci
@@ -0,0 +1,57 @@
+function showReprojectionErrors(cameraParameters)
+// It displays reprojection errors using bar graph
+//
+// Calling Sequence
+// showReprojectionErrors(cameraParameters)
+//
+// Parameters
+// cameraParameters: cameraParameters strucure
+//
+// Description
+// It visualizes reprojection errors for a single camera or stereo pair if cameras.
+//
+// Examples
+// showReprojectionErrors(cameraParameters);
+ [lhs rhs]=argn(0)
+ if rhs<1 then
+ error(msprintf("Need atleat one argument"));
+ elseif ~isstruct(cameraParameters) then
+ error(msprintf("Given input is not a valid cameraParameters structure"));
+ end
+
+ ReprojectionErrors=cameraParameters.ReprojectionErrors;
+ if ~isempty(ReprojectionErrors) then
+ ReprojectedPoints=cameraParameters.ReprojectedPoints;
+ ReprojectionErrors=cameraParameters.ReprojectionErrors;
+ ImagePoints=ReprojectedPoints-ReprojectionErrors;
+ totalErr=0;
+ rvRows=size(cameraParameters.RotationVectors,'r');
+ wpRows=size(cameraParameters.WorldPoints,'r');
+ for i=1:rvRows
+ err=0;
+ for j=1:wpRows
+ err=err+((ReprojectedPoints(j,1,i)-ImagePoints(j,1,i))+(ReprojectedPoints(j,2,i)-ImagePoints(j,2,i))).^2;
+ end
+ totalErr=totalErr+err;
+ errors(i)=sqrt(err/wpRows);
+ end
+ totalPoints=rvRows*wpRows;
+ meanReprojectionError=sqrt(totalErr/totalPoints);
+ end
+ da=gda();
+ da.title.text="Mean Reprojection Errors per Image"
+ da.title.foreground = 12;
+ da.title.font_size = 5;
+ da.x_label.text="Images";
+ da.x_label.font_style = 3;
+ da.x_label.font_size = 3;
+ da.x_label.foreground = 3;
+ da.x_location = "bottom";
+ da.y_label.text="Mean Reprojection Errors";
+ da.y_label.font_style = 3;
+ da.y_label.font_size = 3;
+ da.y_label.foreground = 3;
+ da.y_location = "left";
+ a=gca();
+ bar(a,errors,0.2); //0.2- width of each bar
+endfunction
diff --git a/macros/sobel.bin b/macros/sobel.bin
new file mode 100644
index 0000000..75cca5c
--- /dev/null
+++ b/macros/sobel.bin
Binary files differ
diff --git a/macros/sobel.sci b/macros/sobel.sci
new file mode 100644
index 0000000..17af909
--- /dev/null
+++ b/macros/sobel.sci
@@ -0,0 +1,13 @@
+function new_image = sobel(image, ddepth, dx, dy, ksize, scale, delta)
+
+ image_list = mattolist(image)
+
+ out = opencv_sobel(image_list, ddepth, dx, dy, ksize, scale, delta)
+
+ sz = size(out)
+
+ for i=1:sz
+ new_image(:, :, i) = out(i)
+ end
+
+endfunction
diff --git a/macros/ssim.bin b/macros/ssim.bin
new file mode 100644
index 0000000..698d61d
--- /dev/null
+++ b/macros/ssim.bin
Binary files differ
diff --git a/macros/ssim.sci b/macros/ssim.sci
new file mode 100644
index 0000000..5972816
--- /dev/null
+++ b/macros/ssim.sci
@@ -0,0 +1,7 @@
+function[ssim_val] = ssim(srcImg, reference)
+
+ srcMat = mattolist(srcImg)
+
+ ssim_val = opencv_ssim(srcMat, reference)
+
+endfunction
diff --git a/macros/stereoParameters.bin b/macros/stereoParameters.bin
new file mode 100644
index 0000000..48889dc
--- /dev/null
+++ b/macros/stereoParameters.bin
Binary files differ
diff --git a/macros/stereoParameters.sci b/macros/stereoParameters.sci
new file mode 100644
index 0000000..502217c
--- /dev/null
+++ b/macros/stereoParameters.sci
@@ -0,0 +1,85 @@
+function varargout=stereoParameters(varargin)
+ [lhs rhs]=argn(0);
+ if lhs<1 then
+ error(msprintf(" Not enough output arguments. One expected"))
+ elseif lhs>1 then
+ error(msprintf(" Too many onput arguments. One expected"))
+ end
+
+ if rhs~=4 then
+ error(msprintf(" Invalid number of input arguments"))
+ end
+
+ EssentialMatrix = [];
+ FundamentalMatrix = [];
+ MeanReprojectionError = 0;
+ NumPatterns = 0;
+ WorldPoints=[];
+ WorldUnits='mm';
+
+ cameraParam1 = varargin(1);
+ cameraParam2 = varargin(2);
+
+ if ~isstruct(cameraParam1) then
+ error(msprintf(" A Camera Parameter object expected"))
+ end
+
+ if ~isstruct(cameraParam2) then
+ error(msprintf(" A Camera Parameter object expected"))
+ end
+
+ xz = fieldnames(cameraParam1);
+ [size1 zz] = size(xz);
+ xz = fieldnames(cameraParam2);
+ [size2 zz] = size(xz);
+
+ if size1~=18 | size2~=18 then
+ error(msprintf(" Invalid Camera Parameter Object"))
+ end
+
+ checkCameraParam(cameraParam1);
+ checkCameraParam(cameraParam2);
+ // checking third input
+
+ rotationOfCam = varargin(3);
+ [type3] = type(rotationOfCam);
+
+ if type3~=1 | ~isreal(rotationOfCam) then
+ error(msprintf(" Invalid Input Argument. A real 3x3 Matrix expected."))
+ end
+
+ [rows cols] = size(rotationOfCam);
+
+ if rows*cols~=9 then
+ error(msprintf(" Invalid Input Argument. A 3x3 Matrix expected."))
+ end
+
+ // checking 4th input
+
+ translationOfCam = varargin(4);
+ [type4] = type(translationOfCam);
+
+ if type4~=1 | ~isreal(translationOfCam) then
+ error(msprintf(" Invalid Input Argument. A real list of 3 expected. "))
+ end
+
+ [rows cols] = size(translationOfCam);
+
+ if rows*cols~=3 then
+ error(msprintf(" Invalid Input Argument. A 3x3 Matrix expected."))
+ end
+
+
+ g = translationOfCam;
+ gx = [0 -g(3) g(2); g(3) 0 -g(1); -g(2) g(1) 0];
+ EssentialMatrix = rotationOfCam*gx;
+ FundamentalMatrix = cameraParam1.IntrinsicMatrix \ EssentialMatrix / (cameraParam2.IntrinsicMatrix)';
+ MeanReprojectionError = (cameraParam1.meanReprojectionError + cameraParam2.meanReprojectionError)/2;
+ NumPatterns = cameraParam1.NumPatterns;
+ WorldPoints = cameraParam1.WorldPoints;
+ WorldUnits = cameraParam1.WorldUnits;
+
+ varargout(1) = struct('CameraParameters1', cameraParam1, 'CameraParameters2', cameraParam2, 'RotationOfCamera2', rotationOfCam, 'TranslationOfCamera2', translationOfCam, 'FundamentalMatrix', FundamentalMatrix, 'EssentialMatrix', EssentialMatrix,'MeanReprojectionError', MeanReprojectionError, 'NumPatterns', NumPatterns, 'WorldPoints', WorldPoints, 'WorldUnits', WorldUnits);
+
+endfunction
+
diff --git a/macros/threshold.bin b/macros/threshold.bin
new file mode 100644
index 0000000..c62923a
--- /dev/null
+++ b/macros/threshold.bin
Binary files differ
diff --git a/macros/threshold.sci b/macros/threshold.sci
new file mode 100644
index 0000000..d9439d6
--- /dev/null
+++ b/macros/threshold.sci
@@ -0,0 +1,7 @@
+function [outputImg,res]= threshold(inputImage, threshold_value, max_value,thresholdType)
+ inputList=mattolist(inputImage);
+ [outputList,res]=opencv_threshold(inputList, threshold_value, max_value,thresholdType)
+ for i=1:size(outputList)
+ outputImg(:,:,i)=outputList(i)
+ end
+endfunction
diff --git a/macros/trainCascadeObjectDetector.bin b/macros/trainCascadeObjectDetector.bin
new file mode 100644
index 0000000..d103c5d
--- /dev/null
+++ b/macros/trainCascadeObjectDetector.bin
Binary files differ
diff --git a/macros/trainCascadeObjectDetector.sci b/macros/trainCascadeObjectDetector.sci
new file mode 100644
index 0000000..eb5369a
--- /dev/null
+++ b/macros/trainCascadeObjectDetector.sci
@@ -0,0 +1,163 @@
+function trainCascadeObjectDetector(outputFolder,positiveInstances,negativeImages,varargin)
+// It creates trained cascade XML file
+//
+// Calling Sequence
+// trainCascadeObjectDetector(outputFolder,positiveInstances,"negativeImages")
+//
+// Parameters
+// outputFolder: Folder name to store trained cascade (cascade.xml) and intermediate files
+// positiveInstances: Array of structure with image file names (including path) and an M-by-4 matrix of bounding box.
+// negativeImages: path to a negative images folder
+// numPos: number of positive samples. Default-30
+// numNeg: number of negative samples. Default- 20
+// nsplits: number of splits. Default- 2
+// numStages: number of cascade stages to be trained. Default- 30
+// featureType: Type of features to be used, possible types are HAAR, LBP, HOG. Default-HAAR
+// minHitRate: Minimal desired hit rate for each stage of the classifier and value in the range 0 and 1 inclusive. Default- 0.995
+// maxFalseAlarmRate: Maximal desired false alarm rate for each stage of the classifier and value in the range 0 and 1 inclusive. Default- 0.5
+// w: Width of training samples (in pixels). Default-25
+// h: Height of training samples (in pixels). Default-25
+//
+// Description
+// It produces dataset of positive samples in a file with .vec extension and negative samples are enumerated in a special text file in
+// which each line contains an image filename of negative sample image. Negative images must not contain detected objects.
+//
+// By using these two files trainCascade will create cascade.xml file inside the outputFolder which is used to detect objects in an image.
+//
+// Examples
+// positiveInstances(1)=struct("path",'image1.jpg',"bbox",[1 5 2 3]);
+// positiveInstances(2)=struct("path",'image2.jpg',"bbox",[2 7 4 2]);
+// trainCascadeObjectDetector("data",positiveInstances,"negativeImagesFolder");
+// trainCascadeObjectDetector("data",positiveInstances,"negativeImagesFolder","numStages",35,"featureType","HOG");
+// trainCascadeObjectDetector("data",positiveInstances,"negativeImagesFolder","minHitRate",0.9,"numPos",8,"numNeg",5);
+
+ [lhs rhs]=argn(0);
+ if rhs<3 then
+ error(msprintf(" Not enough input arguments"))
+ elseif rhs>21 then
+ error(msprintf(" Too many input arguments to the function"))
+ elseif modulo(rhs-3,2)
+ error(msprintf(" wrong number of input arguments,name-value pairs not macthed"))
+ end
+
+ //validating variables
+ if ~isdir(outputFolder) then
+ error(msprintf(" wrong input argument #1, existing directory expected"))
+ elseif ~isdir(negativeImages)
+ error(msprintf(" wrong input argument #3,existing directory expected"))
+ end
+
+ //default values
+ numPos=30;
+ numNeg=20;
+ numStages=30;
+ nsplits=2;
+ featureType="HAAR"
+ minHitRate=0.995
+ maxFalseAlarmRate=0.5
+ w=25
+ h=25
+
+ for i=1:2:rhs-3
+ if strcmpi(varargin(i),"numPos")==0 then
+ i=i+1;
+ numPos=varargin(i);
+ if numPos<0 then
+ error(msprintf(" numPos value must be positive"))
+ end
+ elseif strcmpi(varargin(i),'numNeg')==0 then
+ i=i+1;
+ numNeg=varargin(i);
+ if numNeg<0 then
+ error(msprintf(" numNeg value must be positive"))
+ end
+
+ elseif strcmpi(varargin(i),'numStages')==0 then
+ i=i+1;
+ numStages=varargin(i);
+ if numStages<0 then
+ error(msprintf(" numStages value must be positive"))
+ end
+
+ elseif strcmpi(varargin(i),'nslits')==0 then
+ i=i+1;
+ nsplits=varargin(i);
+ if nsplits<0 then
+ error(msprintf(" nsplits value must be positive"))
+ end
+
+ elseif strcmpi(varargin(i),'featureType')==0 then
+ i=i+1;
+ featureType=varargin(i);
+ if strcmpi(featureType,'haar') & strcmpi(featureType,'lbp') & strcmpi(featureType,'hog')
+ error(msprintf(" wrong input argument #%d,featureType not matched",i));
+ end
+
+ elseif strcmpi(varargin(i),'minHitRate')==0 then
+ i=i+1;
+ minHitRate=varargin(i);
+ if minHitRate<0 | minHitRate>1 then
+ error(msprintf(" minHitRate value must lie in between 0 and 1"))
+ end
+
+ elseif strcmpi(varargin(i),'maxFalseAlarmRate')==0 then
+ i=i+1;
+ maxFalseAlarmRate=varargin(i);
+ if maxFalseAlarmRate<0 | minFalseRate>1 then
+ error(msprintf(" maxFalseAlarmRate value must lie in between 0 and 1"))
+ end
+
+ elseif strcmpi(varargin(i),'w')==0 then
+ i=i+1;
+ w=varargin(i);
+ if h<0 then
+ error(msprintf(" w value must be positive"))
+ end
+
+ elseif strcmpi(varargin(i),'h')==0 then
+ i=i+1;
+ h=varargin(i);
+ if h<0 then
+ error(msprintf(" h value must be positive"))
+ end
+ else
+ error(msprintf(_(" Wrong value for input argument #%d",i)));
+ end
+ end
+
+ [nRows noOfPositiveInstances]=size(positiveInstances);
+ fields=fieldnames(positiveInstances);
+ fd = mopen('positive.txt','wt');
+ for i=1:noOfPositiveInstances
+ mfprintf(fd,'%s 1',getfield(fields(1),positiveInstances(i)));
+ boxVals=getfield(fields(2),positiveInstances(i));
+ for j=1:4
+ mfprintf(fd,' %d',boxVals(j));
+ end
+ mfprintf(fd,'\n');
+ end
+ mclose(fd);
+
+ disp("Creating positive samples:");
+ cmd=sprintf("opencv_createsamples -info positive.txt -num%d -vec positive.vec -w %d -h %d",numPos,w,h);
+ unix_w(cmd);
+ if isdir(negativeImages)
+ if getos()=="Linux"
+ temp=strcat(["ls ",negativeImages])
+ elseif getos()=="Windows"
+ temp=strcat(["dir ",negativeImages])
+ end
+ s=unix_g(temp);
+ [noOfFilesInFolder noOfCols]=size(s);
+ fd = mopen('negative.txt','wt');
+ for i=1:noOfFilesInFolder
+ [path,fname,extension]=fileparts(s(i))
+ if ~strcmp(extension,".jpg") | ~strcmp(extension,".jpeg") | ~strcmp(extension,".png") | ~strcmp(extension,".bmp") | ~strcmp(extension,".pgm") | ~strcmp(extension,".JPG") | ~strcmp(extension,".JPEG") | ~strcmp(extension,".PNG") | ~strcmp(extension,".BMP") | ~strcmp(extension,".PGM")
+ mfprintf(fd,'%s/%s\n',negativeImages,s(i));
+ end
+ end
+ end
+ disp("Training Cascade:");
+ cmd=sprintf("opencv_traincascade -data %s -vec positive.vec -bg negative.txt -numPos %d -numNeg %d -numStages %d -nsplits %d -featureType %s -minHitRate %d -maxFalseAlarmRate %d -w %d -h %d",outputFolder,numPos,numNeg,numStages,nsplits,featureType,minHitRate,maxFalseAlarmRate,w,h);
+ unix_w(cmd);
+endfunction;
diff --git a/macros/trainImageCategoryClassifier.bin b/macros/trainImageCategoryClassifier.bin
new file mode 100644
index 0000000..01ca87f
--- /dev/null
+++ b/macros/trainImageCategoryClassifier.bin
Binary files differ
diff --git a/macros/trainImageCategoryClassifier.sci b/macros/trainImageCategoryClassifier.sci
new file mode 100644
index 0000000..46ccce8
--- /dev/null
+++ b/macros/trainImageCategoryClassifier.sci
@@ -0,0 +1,31 @@
+function classifier = trainImageCategoryClassifier(imgSets, bag)
+// This function is used to train an image classifier.
+//
+// Calling Sequence
+// classifier = trainImageCategoryClassifier(imgSets, bag)
+//
+// Parameters
+// classifier: Image category classifier
+// imgSets: Input imageSet to train the classifier on
+// bag: The bagOfFeatures of the imageSet provided
+//
+// Description
+// This function trains an image category classifier which can be used to predict categories of images given to it as input using the predict() function.
+//
+// Examples
+// imgSet = imageSet(directory,'recursive');
+// [trainingSet testSet] = partition(imgSet,[0.8]);
+// bag = bagOfFeatures(trainingSet);
+// categoryClassifier = trainImageCategoryClassifier(trainingSet, bag);
+//
+// Authors
+// Rohit Suri
+// Umang Agrawal
+ bag_list = bagStructToList(bag);
+
+ imgSets_list = imageSetToList(imgSets);
+ temp = opencv_trainImageCategoryClassifier(imgSets_list, bag_list);
+
+ classifier = struct("ClassifierLocation", temp(2), "BagofFeaturesLocation", temp(3), "Description", temp(4))
+
+endfunction
diff --git a/macros/triangulatePoints.bin b/macros/triangulatePoints.bin
new file mode 100644
index 0000000..e7d3d33
--- /dev/null
+++ b/macros/triangulatePoints.bin
Binary files differ
diff --git a/macros/triangulatePoints.sci b/macros/triangulatePoints.sci
new file mode 100644
index 0000000..5b56061
--- /dev/null
+++ b/macros/triangulatePoints.sci
@@ -0,0 +1,40 @@
+function [worldPoints] = triangulatePoints(projMat1, projMat2, points1, points2)
+// Returns the worldPoint coordinates of the feature points.
+//
+// Calling Sequence
+// [worldPoints] = triangulatePoints(projMat1, projMat2, points1, points2)
+//
+// Parameters
+// projMat1: 3X4 projection matrix for the first Camera matrix
+// projMat2: 3X4 projection matrix for the second Camera matrix
+// points1: 2xN array of feature points in the 1st image. In case of c++ version it can be also a vector of feature points or two-channel matrix of size 1xN or Nx1
+// points2: 2xN array of feature points in the 2nd image. In case of c++ version it can be also a vector of feature points or two-channel matrix of size 1xN or Nx1
+// worldPoints: 4XN array or matrix of reconstructed points
+//
+// Description
+// Returns 4D location of the matched feature points from the two projected matrices. The 4D location of the feature points is reconstructed using triangulation.
+//
+// Examples
+// [projMat1] = [12 21 21 19; 34 12 0 2; 112 431 890 32.1]
+// [projMat2] = [16 17 32 1; 64 90 12 11; 123 43.5 895 9.8]
+// [points1] = [1 2 3 4;5 6 7 8]
+// [points2] = [32 1 3 5; 9 8 3 4]
+// [worldPoints] = triangulatePoints(projMat1, projMat2, points1, points2)
+//
+//
+// Authors
+// Deepshikha
+
+// code for the above function
+//
+
+ output = opencv_triangulatePoints(projMat1, projMat2, points1, points2)
+
+ channels = size(output)
+
+ for i = 1:channels
+ worldPoints(:,:,1) = output(1)
+ end
+
+endfunction
+
diff --git a/macros/undistort.bin b/macros/undistort.bin
new file mode 100644
index 0000000..83a9564
--- /dev/null
+++ b/macros/undistort.bin
Binary files differ
diff --git a/macros/undistort.sci b/macros/undistort.sci
new file mode 100644
index 0000000..53fc8c6
--- /dev/null
+++ b/macros/undistort.sci
@@ -0,0 +1,7 @@
+function [outputImg]=undistort(inputImage,cameraMatrix,distCoeffActual,newCameraMatrix)
+ inputList=mattolist(inputImage);
+ outputList=opencv_undistort(inputList,cameraMatrix,distCoeffActual,newCameraMatrix);
+ for i=1:size(outputList)
+ outputImg(:,:,i)=outputList(i)
+ end
+endfunction
diff --git a/macros/undistortImage.bin b/macros/undistortImage.bin
new file mode 100644
index 0000000..d315543
--- /dev/null
+++ b/macros/undistortImage.bin
Binary files differ
diff --git a/macros/undistortImage.sci b/macros/undistortImage.sci
new file mode 100644
index 0000000..9fccd42
--- /dev/null
+++ b/macros/undistortImage.sci
@@ -0,0 +1,68 @@
+function new_image = undistortImage(image, cameramatrix, varargin)
+// Transforms an image to compensate for lens distortion.
+//
+// Calling Sequence
+// newimage = undistortImage(image, cameramatrix)
+// newimage = undistortImage(image, cameramatrix, ["Parameter1", value1,["Parameter2", value2]])
+//
+// Parameters
+// image : Distorted input image
+// cameramatrix : Input 3 * 3 cameramatrix
+// distcoeffs : Input vector of distortion coefficients of 4, 5, or 8 elements. If the vector is empty, the zero distortion coefficients are assumed.
+// newCameraMatrix : Camera matrix of the distorted image. By default, it is same as cameramatrix.
+// newimage : Corrected image that has same size and type as original image
+//
+// Description
+// The function returns a newimage containing the input image with lens distortion removed.
+//
+// Examples
+// J = undistortImage(I, cameramatrix)
+// J = undistortImage(I, cameramatrix, "distcoeffs", distcoeffs)
+//
+// Authors
+// Suraj Prakash
+
+ [ lhs rhs ] = argn(0)
+
+ if lhs > 1 then
+ error(msprintf("Too many output arguments"))
+ end
+
+ if rhs > 6 then
+ error(msprintf("Too many input arguments"))
+ end
+
+ if rhs < 2 then
+ error(msprintf("Too less input arguments"))
+ end
+
+ if modulo(rhs, 2) <> 0
+ error(msprintf("Incorrect input arguments"))
+ end
+
+ image_list = mattolist(image)
+
+ if rhs == 2 then
+
+ temp = opencv_undistortImage(image_list, cameramatrix)
+
+ elseif rhs == 4 then
+
+ temp = opencv_undistortImage(image_list, cameramatrix, varargin(1), varargin(2))
+
+ elseif rhs == 6 then
+
+ temp = opencv_undistortImage(image_list, cameramatrix, varargin(1), varargin(2), varargin(3), varargin(4))
+
+ else
+ error(msprintf("Error in input arguments"))
+ end
+
+ sz = size(temp)
+
+ for i=1:sz
+ new_image(:, :, i) = temp(i)
+ end
+
+
+endfunction
diff --git a/macros/undistortPoints.bin b/macros/undistortPoints.bin
new file mode 100644
index 0000000..1c7f495
--- /dev/null
+++ b/macros/undistortPoints.bin
Binary files differ
diff --git a/macros/undistortPoints.sci b/macros/undistortPoints.sci
new file mode 100644
index 0000000..39b13d5
--- /dev/null
+++ b/macros/undistortPoints.sci
@@ -0,0 +1,37 @@
+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)
+//
+// Authors
+// Deepshikha
+
+ output = opencv_undistortPoints(srcMat, camMat, disCoefMat, rectMat, newCamMat)
+
+ channels = size(output)
+
+ for i = 1:channels // for i channel image
+ idealPoints(:,:,i) = output(i)
+ end
+
+endfunction
diff --git a/macros/viscircle.bin b/macros/viscircle.bin
new file mode 100644
index 0000000..e02aa39
--- /dev/null
+++ b/macros/viscircle.bin
Binary files differ
diff --git a/macros/viscircle.sci b/macros/viscircle.sci
new file mode 100644
index 0000000..b84e7e5
--- /dev/null
+++ b/macros/viscircle.sci
@@ -0,0 +1,27 @@
+function [out]=viscircles(input1,input2,input3,varargin)
+ inputn=mattolist(input1);
+ [lhs rhs] = argn(0)
+ if rhs>5 then
+ error(msprintf("Too many input arguments"))
+ elseif rhs==5 then
+ a=opencv_viscircles(inputn,input2,input3,varargin(1),varargin(2));
+ dimension=size(a)
+ for i = 1:dimension
+ out(:,:,i)=a(i);
+ end
+ elseif rhs==4 then
+ a=opencv_viscircles(inputn,input2,input3,varargin(1));
+ dimension=size(a)
+ for i = 1:dimension
+ out(:,:,i)=a(i);
+ end
+ else
+ a=opencv_viscircles(inputn,input2,input3);
+ dimension=size(a)
+ for i = 1:dimension
+ out(:,:,i)=a(i);
+ end
+ end,
+
+endfunction;
+
diff --git a/macros/warpaffine.bin b/macros/warpaffine.bin
new file mode 100644
index 0000000..b9a7aef
--- /dev/null
+++ b/macros/warpaffine.bin
Binary files differ
diff --git a/macros/warpaffine.sci b/macros/warpaffine.sci
new file mode 100644
index 0000000..9067959
--- /dev/null
+++ b/macros/warpaffine.sci
@@ -0,0 +1,8 @@
+function [out]=warpaffine(src,M,size_x,size_y ,flag,borderMode)
+ image1=mattolist(src);
+ a=opencv_warpaffine(image1,M,size_x,size_y ,flag, borderMode);
+ dimension=size(a)
+ for i = 1:dimension
+ out(:,:,i)=a(i);
+ end
+endfunction;
diff --git a/macros/watershed.bin b/macros/watershed.bin
new file mode 100644
index 0000000..8bdca62
--- /dev/null
+++ b/macros/watershed.bin
Binary files differ
diff --git a/macros/watershed.sci b/macros/watershed.sci
new file mode 100644
index 0000000..6291739
--- /dev/null
+++ b/macros/watershed.sci
@@ -0,0 +1,11 @@
+function[dstImg] = watershed(srcImg)
+
+ srcMat = mattolist(srcImg)
+ out = opencv_watershed(srcMat)
+
+ channels = size(out)
+
+ for i = 1 : channels
+ dstImg(:,:,i) = out(i)
+ end
+endfunction
diff --git a/macros/whitepoint.bin b/macros/whitepoint.bin
new file mode 100644
index 0000000..e312c99
--- /dev/null
+++ b/macros/whitepoint.bin
Binary files differ
diff --git a/macros/whitepoint.sci b/macros/whitepoint.sci
new file mode 100644
index 0000000..6f5d8af
--- /dev/null
+++ b/macros/whitepoint.sci
@@ -0,0 +1,10 @@
+function[xyz] = whitepoint(input_string)
+
+ out = whitepoint(input_string)
+
+ channels = size(out)
+
+ for i = 1:channels
+ xyz(:,:,1) = out(1)
+ end
+endfunction
diff --git a/macros/wiener2.bin b/macros/wiener2.bin
new file mode 100644
index 0000000..1ee5316
--- /dev/null
+++ b/macros/wiener2.bin
Binary files differ
diff --git a/macros/wiener2.sci b/macros/wiener2.sci
new file mode 100644
index 0000000..cde19cd
--- /dev/null
+++ b/macros/wiener2.sci
@@ -0,0 +1,7 @@
+function [outputImg]=wiener2(inputImage,filtsize,sigma)
+ inputList=mattolist(inputImage);
+ outputList=opencv_wiener2(inputList,filtsize,sigma);
+ for i=1:size(outputList)
+ outputImg(:,:,i)=outputList(i)
+ end
+endfunction
diff --git a/macros/xyz2double.bin b/macros/xyz2double.bin
new file mode 100644
index 0000000..c2ccf14
--- /dev/null
+++ b/macros/xyz2double.bin
Binary files differ
diff --git a/macros/xyz2double.sci b/macros/xyz2double.sci
new file mode 100644
index 0000000..d03c1e9
--- /dev/null
+++ b/macros/xyz2double.sci
@@ -0,0 +1,7 @@
+function [output] = xyz2double(pstData)
+ a = opencv_xyz2double(pstData);
+ d = size(a);
+ for i=1:d
+ output(:,:,i) = a(i);
+ end
+endfunction
diff --git a/macros/xyz2lab.bin b/macros/xyz2lab.bin
new file mode 100644
index 0000000..7a0780d
--- /dev/null
+++ b/macros/xyz2lab.bin
Binary files differ
diff --git a/macros/xyz2lab.sci b/macros/xyz2lab.sci
new file mode 100644
index 0000000..1654604
--- /dev/null
+++ b/macros/xyz2lab.sci
@@ -0,0 +1,21 @@
+function [output] = xyz2lab(vartype,varargin)
+ [lhs rhs] = argn(0);
+ if(rhs>3)
+ error(msprintf("Too many input argumnets"));
+ end
+
+ select rhs
+ case 1 then
+ a = opencv_xyz2lab(vartype);
+ case 2 then
+ a = opencv_xyz2lab(vartype,varargin(0));
+ case 3 then
+ a = opencv_xyz2lab(vartype,varargin(0),varargin(1));
+ end
+
+ d = size(a);
+ for i=1:d
+ output(:,:,i) = a(i);
+ end
+endfunction
+
diff --git a/macros/xyz2rgb.bin b/macros/xyz2rgb.bin
new file mode 100644
index 0000000..980d866
--- /dev/null
+++ b/macros/xyz2rgb.bin
Binary files differ
diff --git a/macros/xyz2rgb.sci b/macros/xyz2rgb.sci
new file mode 100644
index 0000000..d557939
--- /dev/null
+++ b/macros/xyz2rgb.sci
@@ -0,0 +1,8 @@
+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/macros/xyz2uint16.bin b/macros/xyz2uint16.bin
new file mode 100644
index 0000000..c9b3aee
--- /dev/null
+++ b/macros/xyz2uint16.bin
Binary files differ
diff --git a/macros/xyz2uint16.sci b/macros/xyz2uint16.sci
new file mode 100644
index 0000000..12e07b2
--- /dev/null
+++ b/macros/xyz2uint16.sci
@@ -0,0 +1,7 @@
+function [output] = xyz2uint16(pstData)
+ a = opencv_xyz2uint16(pstData);
+ d = size(a);
+ for i=1:d
+ output(:,:,i) = a(i);
+ end
+endfunction