/*
* Coffeeright (c) 2002-2007 by J. Luis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Contact info: w3.ualg.pt/~jluis
*--------------------------------------------------------------------*/
/* Program: cvlib_mex.c
* Purpose: matlab callable routine to interface with some OpenCV library functions
*
* Revision 15.0 28/03/2008 JL Finally finished the approxPoly (Douglas-Peucker) function
* Revision 14.0 21/03/2008 JL Added cvPow, cvLog, cvExp and hypot. Also replaced a couple of mxCalloc by mxMalloc
* Revision 13.0 01/01/2008 Chuong Nguyen added MatchTemplate
* Revision 12.0 12/10/2007 JL Added cvCvtScale (need to include in help)
* Revision 11.0 30/04/2007 JL corrected memory leaks as kindly pointed by James Hays
* Revision 10.0 27/04/2007 JL Added AbsDiff, finished PutText and fixed fix of JfindContours
* Revision 9.0 04/03/2007 JL Fixed JfindContours (well I thought I did - 28-4-07)
* Revision 8.0 14/02/2007 JL In Floodfill convert fill color to [0 255] if it was [0 1]
* Revision 7.0 26/01/2007 JL Fixed crash when individual cell were empty with the polygon option
* Revision 6.0 02/12/2006 JL Added FillPoly and FillConvexPoly
* Revision 5.0 29/11/2006 JL Added half a dozen of functions more (line, rect, circ, poly, ellip, inpaint)
* Revision 4.0 07/11/2006 JL Erode & Diltate in cvHoughCircles (almost the same shit)
* Revision 3.0 27/10/2006 JL Updated cvHoughCircles call to 1.0
* Revision 2.0 19/10/2006 JL Edge 'laplace' needed exlicit kernel input
* Revision 1.0 31/08/2006 Joaquim Luis
*
*/
#include <math.h>
#include "mex.h"
/*#include <opencv/cv.h> */
#include <cv.h>
#include "opencv2/photo/photo_c.h"
#include "opencv2/photo/photo.hpp"
#define TRUE 1
#define FALSE 0
void JapproxPoly(int n_out, mxArray *plhs[], int n_in, const mxArray *prhs[]);
void Jresize(int n_out, mxArray *plhs[], int n_in, const mxArray *prhs[]);
void Jfloodfill(int n_out, mxArray *plhs[], int n_in, const mxArray *prhs[]);
void JgoodFeatures(int n_out, mxArray *plhs[], int n_in, const mxArray *prhs[]);
void JhoughLines2(int n_out, mxArray *plhs[], int n_in, const mxArray *prhs[]);
void JhoughCircles(int n_out, mxArray *plhs[], int n_in, const mxArray *prhs[]);
void Jedge(int n_out, mxArray *plhs[], int n_in, const mxArray *prhs[], const char *method);
void JerodeDilate(int n_out, mxArray *plhs[], int n_in, const mxArray *prhs[], const char *method);
void JmorphologyEx(int n_out, mxArray *plhs[], int n_in, const mxArray *prhs[]);
void Jcolor(int n_out, mxArray *plhs[], int n_in, const mxArray *prhs[]);
void Jarithm(int n_out, mxArray *plhs[], int n_in, const mxArray *prhs[], const char *op);
void JaddWeighted(int n_out, mxArray *plhs[], int n_in, const mxArray *prhs[]);
void Jflip(int n_out, mxArray *plhs[], int n_in, const mxArray *prhs[]);
void JGetQuadrangleSubPix(int n_out, mxArray *plhs[], int n_in, const mxArray *prhs[]);
void Jfilter(int n_out, mxArray *plhs[], int n_in, const mxArray *prhs[]);
void Jsmooth(int n_out, mxArray *plhs[], int n_in, const mxArray *prhs[]);
void Jegipt(int n_out, mxArray *plhs[], int n_in, const mxArray *prhs[], const char *op);
void Jshapes(int n_out, mxArray *plhs[], int n_in, const mxArray *prhs[], const char *op);
void Jinpaint(int n_out, mxArray *plhs[], int n_in, const mxArray *prhs[]);
void Jpolyline(int n_out, mxArray *plhs[], int n_in, const mxArray *prhs[], const char *op);
void JfindContours(int n_out, mxArray *plhs[], int n_in, const mxArray *prhs[]);
void Jtext(int n_out, mxArray *plhs[], int n_in, const mxArray *prhs[]);
void JMatchTemplate(int n_out, mxArray *plhs[], int n_in, const mxArray *prhs[]);
void Set_pt_Ctrl_in (struct CV_CTRL *Ctrl, const mxArray *pi , mxArray *pit, int interl);
void Set_pt_Ctrl_out1 ( struct CV_CTRL *Ctrl, mxArray *pi );
void Set_pt_Ctrl_out2 (struct CV_CTRL *Ctrl, mxArray *po, int interl);
int getNK(const mxArray *p, int which);
void interleave(struct CV_CTRL *Ctrl, int nx, int ny, int nBands, int dir);
void interleaveUI8(struct CV_CTRL *Ctrl, int nx, int ny, int nBands, int dir);
void interleaveI8(struct CV_CTRL *Ctrl, int nx, int ny, int nBands, int dir);
void interleaveUI16(struct CV_CTRL *Ctrl, int nx, int ny, int nBands, int dir);
void interleaveI16(struct CV_CTRL *Ctrl, int nx, int ny, int nBands, int dir);
void interleaveI32(struct CV_CTRL *Ctrl, int nx, int ny, int nBands, int dir);
void interleaveF32(struct CV_CTRL *Ctrl, int nx, int ny, int nBands, int dir);
void interleaveF64(struct CV_CTRL *Ctrl, int nx, int ny, int nBands, int dir);
void interleaveBlind(unsigned char in[], unsigned char out[], int nx, int ny, int nBands, int dir);
void interleaveDouble(double in[], double out[], int nx, int ny);
void localSetData(struct CV_CTRL *Ctrl, IplImage* img, int dir, int step);
void getDataType(struct CV_CTRL *Ctrl, const mxArray *prhs[], int *nBytes, int *img_depth);
void cvResizeUsage(), floodFillUsage(), goodFeaturesUsage(), houghLines2Usage();
void cannyUsage(), sobelUsage(), laplaceUsage(), erodeUsage(), dilateUsage();
void morphologyexUsage(), colorUsage(), flipUsage(), filterUsage(), findContoursUsage();
void arithmUsage(), addWeightedUsage(), pyrDUsage(), pyrUUsage(), houghCirclesUsage();
void smoothUsage(), lineUsage(), plineUsage(), rectUsage(), circUsage(), eBoxUsage();
void inpaintUsage(), fillConvUsage(), fillPlineUsage(), textUsage(), powUsage();
void logUsage(), expUsage(), hypotUsage();
void approxPolyUsage();
void MatchTemplateUsage();
struct CV_CTRL {
/* active is TRUE if the option has been activated */
struct UInt8 { /* Declare byte pointers */
int active;
unsigned char *img_out, *img_in, *tmp_img_in, *tmp_img_out;
} UInt8;
struct Int8 { /* Declare byte pointers */
int active;
char *img_out, *img_in, *tmp_img_in, *tmp_img_out;
} Int8;
struct UInt16 { /* Declare short int pointers */
int active;
unsigned short int *img_out, *img_in, *tmp_img_in, *tmp_img_out;
} UInt16;
struct Int16 { /* Declare unsigned short int pointers */
int active;
short int *img_out, *img_in, *tmp_img_in, *tmp_img_out;
} Int16;
struct Int32 { /* Declare unsigned int pointers */
int active;
int *img_out, *img_in, *tmp_img_in, *tmp_img_out;
} Int32;
struct Float { /* Declare float pointers */
int active;
float *img_out, *img_in, *tmp_img_in, *tmp_img_out;
} Float;
struct Double { /* Declare double pointers */
int active;
double *img_out, *img_in, *tmp_img_in, *tmp_img_out;
} Double;
};
/* --------------------------------------------------------------------------- */
/* Matlab Gateway routine */
void mexFunction(int n_out, mxArray *plhs[], int n_in, const mxArray *prhs[]) {
const char *funName;
if (n_in == 0) {
mexPrintf("List of currently coded OPENCV functions (original name in parentesis):\n");
mexPrintf("To get a short online help type cvlib_mex(funname)\n");
mexPrintf("E.G. cvlib_mex('resize')\n\n");
mexPrintf("\tabsDiff (cvAbsDiff)\n");
mexPrintf("\tadd (cvAdd)\n");
mexPrintf("\taddS (cvAddS)\n");
mexPrintf("\taddweighted (cvAddWeighted)\n");
/*mexPrintf("\taffine2 (cvWarpAffine)\n"); No help yet*/
mexPrintf("\tcanny (cvCanny)\n");
mexPrintf("\tcircle (cvCircle)\n");
mexPrintf("\tcolor (cvCvtColor)\n");
mexPrintf("\tcontours (cvFindContours)\n");
mexPrintf("\tCvtScale (cvCvtScale)\n");
mexPrintf("\tdilate (cvDilate)\n");
mexPrintf("\tdiv (cvDiv)\n");
mexPrintf("\tdp (cvApproxPoly)\n");
mexPrintf("\teBox (cvEllipseBox)\n");
mexPrintf("\terode (cvErode)\n");
mexPrintf("\texp (cvExp)\n");
mexPrintf("
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
cvlib_mex.zip (4个子文件)
cvlib_mex.exp 630B
cvlib_mex.c 151KB
cvlib_mex.mexw64 90KB
cvlib_mex.lib 2KB
共 4 条
- 1
bingobingobingo
- 粉丝: 0
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页