{"id":33190842,"url":"https://github.com/kyamagu/mexopencv","last_synced_at":"2025-11-21T00:02:17.161Z","repository":{"id":2108234,"uuid":"3049878","full_name":"kyamagu/mexopencv","owner":"kyamagu","description":"Collection and a development kit of matlab mex functions for OpenCV library","archived":true,"fork":false,"pushed_at":"2020-10-23T01:25:05.000Z","size":24502,"stargazers_count":663,"open_issues_count":39,"forks_count":317,"subscribers_count":62,"default_branch":"master","last_synced_at":"2025-11-13T07:04:09.335Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://kyamagu.github.io/mexopencv","language":"Matlab","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kyamagu.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-12-26T01:59:48.000Z","updated_at":"2025-11-10T08:35:39.000Z","dependencies_parsed_at":"2022-08-06T12:00:51.501Z","dependency_job_id":null,"html_url":"https://github.com/kyamagu/mexopencv","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/kyamagu/mexopencv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyamagu%2Fmexopencv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyamagu%2Fmexopencv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyamagu%2Fmexopencv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyamagu%2Fmexopencv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kyamagu","download_url":"https://codeload.github.com/kyamagu/mexopencv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyamagu%2Fmexopencv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284421958,"owners_count":27002367,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-14T02:00:06.101Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-11-16T06:00:40.184Z","updated_at":"2025-11-21T00:02:17.141Z","avatar_url":"https://github.com/kyamagu.png","language":"Matlab","funding_links":[],"categories":["Image Processing and Computer Vision"],"sub_categories":[],"readme":"mexopencv\n=========\n[![Travis](https://img.shields.io/travis/kyamagu/mexopencv/master.svg)][1]\n[![AppVeyor](https://img.shields.io/appveyor/ci/kyamagu/mexopencv/master.svg)][2]\n[![License](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg)](LICENSE)\n\nCollection and development kit of MATLAB MEX functions for OpenCV library.\n\nThe package provides MATLAB MEX functions that interface with hundreds of\nOpenCV APIs. Also the package contains a C++ class that converts between\nMATLAB's native data type and OpenCV data types. The package is suitable for\nfast prototyping of OpenCV application in MATLAB, use of OpenCV as an external\ntoolbox in MATLAB, and development of custom MEX functions.\n\nThe current version of mexopencv is compatible with OpenCV 3.4.1.\n\nFor previous OpenCV 3.x versions, checkout the corresponding tags:\n\n- [v3.4.0][24]\n- [v3.3.1][23]\n- [v3.3.0][22]\n- [v3.2.0][21]\n- [v3.1.0][20]\n- [v3.0.0][19]\n\nFor OpenCV 2.x, checkout these older branches:\n\n- [v2.4][18] (last tested with OpenCV v2.4.11)\n- [v2.3][17]\n- [v2.1][16]\n\nConsult the [wiki][3] for help.\n\nTable of Contents\n=================\n\n- [Structure](#structure)\n- [Build](#build)\n    - [Linux](#linux)\n    - [OS X](#os-x)\n    - [Windows](#windows)\n- [Usage](#usage)\n    - [Documentation](#documentation)\n    - [Unit Testing](#unit-testing)\n- [License](#license)\n\nStructure\n=========\n\nThe project tree is organized as follows:\n\n    +cv/             OpenCV or custom API directory\n    +mexopencv/      mexopencv utility API directory\n    doc/             directory for documentation\n    include/         header files\n    lib/             directory for compiled C++ library files\n    samples/         directory for sample application codes\n    src/             directory for C++ source files\n    src/+cv/         directory for MEX source files\n    src/+cv/private/ directory for private MEX source files\n    test/            directory for test scripts and resources\n    opencv_contrib/  directory for sources/samples/tests of additional modules\n    utils/           directory for utilities\n    Doxyfile         config file for doxygen\n    Makefile         make script\n    README.markdown  this file\n\nBuild\n=====\n\nPrerequisite\n\n- [MATLAB][4] or [Octave][5] (\u003e= 4.0.0)\n- [OpenCV][6] (3.4.1)\n\nDepending on your platform, you also need the required build tools:\n\n- Linux: g++, make, pkg-config\n- OS X: Xcode Command Line Tools, pkg-config\n- Windows: Visual Studio\n\nRefer to the `Makefile` and `make.m` scripts for a complete list of\noptions accepted for building mexopencv across supported platforms.\n\nRefer to the [wiki][3] for detailed build instructions.\n\nOpenCV\n------\n\nCurrently, mexopencv targets the final **3.4.1** stable version of OpenCV. You\nmust build it against this exact version, rather than using the bleeding-edge\ndev-version of `opencv` and `opencv_contrib`. UNIX users should consider using\na package manager to install OpenCV if available.\n\n- [OpenCV][7]\n- [OpenCV contributed modules][8]\n\n**DO NOT use the \"master\" branch of `opencv` and `opencv_contrib`!**\n**Only the 3.4.1 release is supported by mexopencv.**\n\nLinux\n-----\n\nFirst make sure you have OpenCV 3.4.1 installed in the system:\n\n- if applicable, install OpenCV 3 package available in your package manager\n  (e.g., `libopencv-dev` in Debian/Ubuntu, `opencv-devel` in Fedora).\n  Note that these packages are not always up-to-date, so you might need to use\n  older mexopencv versions to match their [opencv package][9] version.\n- otherwise, you can always build and install OpenCV from [source][7]:\n\n        $ cd \u003copencv_build_dir\u003e\n        $ cmake \u003coptions\u003e \u003copencv_src_dir\u003e\n        $ make\n        $ sudo make install\n\nAt this point, you should make sure that the [`pkg-config`][10] command can\nidentify and locate OpenCV libraries (if needed, set the `PKG_CONFIG_PATH`\nenvironment variable to help it find the `opencv.pc` file):\n\n    $ pkg-config --cflags --libs opencv\n\nIf you have all the prerequisites, go to the mexopencv directory and type:\n\n    $ make\n\nThis will build and place all MEX functions inside `+cv/`. Specify your MATLAB\ndirectory if you installed MATLAB to a non-default location:\n\n    $ make MATLABDIR=/opt/local/MATLAB/R2017a\n\nYou can also work with [Octave][5] instead of MATLAB by specifying:\n\n    $ make WITH_OCTAVE=true\n\nTo enable support for contributed modules, you must build OpenCV from both\n[`opencv`][7] and [`opencv_contrib`][8] sources. You can then compile\nmexopencv as:\n\n    $ make all contrib\n\nFinally you can test mexopencv functionality:\n\n    $ make test\n\nDeveloper documentation can be generated with Doxygen if installed:\n\n    $ make doc\n\nThis will create HTML files under `doc/`.\n\nRefer to the wiki for detailed instructions on how to compile OpenCV for both\n[MATLAB][14] and [Octave][15].\n\nOS X\n----\n\nCurrently, the recommended approach to install OpenCV in OS X is\n[Homebrew][11]. Install Homebrew first, and do the following to install\nOpenCV 3:\n\n    $ brew install pkg-config homebrew/science/opencv3\n    $ brew link opencv3\n\nOtherwise, you can build OpenCV from [source][7], similar to the Linux case.\n\nIf you have all the prerequisites, go to the mexopencv directory and run\n(modifying the options as needed):\n\n    $ make MATLABDIR=/Applications/MATLAB_R2016a.app PKG_CONFIG_MATLAB=opencv3 LDFLAGS=-L/usr/local/share/OpenCV/3rdparty/lib -j2\n\nReplace the path to MATLAB with your version. This will build and place all\nMEX functions inside `+cv/`.\n\nWindows\n-------\n\nRefer to [the wiki][13] for detailed instructions on how to compile OpenCV\non Windows, and build mexopencv against it.\n\nIn a nutshell, execute the following in MATLAB to compile mexopencv:\n\n    \u003e\u003e addpath('C:\\path\\to\\mexopencv')\n    \u003e\u003e mexopencv.make('opencv_path','C:\\OpenCV\\build')\n\nReplace the path above with the location where OpenCV binaries are installed\n(i.e location specified in `CMAKE_INSTALL_PREFIX` while building OpenCV).\n\nContrib modules are enabled as:\n\n    \u003e\u003e addpath('C:\\path\\to\\mexopencv')\n    \u003e\u003e addpath('C:\\path\\to\\mexopencv\\opencv_contrib')\n    \u003e\u003e mexopencv.make('opencv_path','C:\\OpenCV\\build', 'opencv_contrib',true)\n\nIf you have previously compiled mexopencv with a different configuration,\ndon't forget to clean old artifacts before building:\n\n    \u003e\u003e mexopencv.make('clean',true, 'opencv_contrib',true)\n\nUsage\n=====\n\nOnce MEX functions are compiled, you can add path to the project directory and\ncall MEX functions within MATLAB using package name `cv`.\n\n``` matlab\naddpath('/path/to/mexopencv');\naddpath('/path/to/mexopencv/opencv_contrib');\n\n% recommended\nout = cv.filter2D(img, kern);  % with package name 'cv'\n\n% not recommended\nimport cv.*;\nout = filter2D(img, kern);     % no need to specify 'cv' after imported\n```\n\nNote that some functions such as `cv.imread` will overload MATLAB's built-in\n`imread` function when imported. Use the scoped name when you need to avoid\nname collision. It is also possible to import individual functions. Check\n`help import` in MATLAB.\n\nCheck a list of functions available by `help` command in MATLAB.\n\n``` matlab\n\u003e\u003e help cv;              % shows list of functions in package 'cv'\n\n\u003e\u003e help cv.VideoCapture; % shows documentation of VideoCapture\n```\n\nLook at the `samples/` directory for examples.\n\nDocumentation\n-------------\n\nmexopencv includes a simple documentation utility that generates HTML help\nfiles for MATLAB. The following command creates HTML user documentation\nunder `doc/matlab/` directory.\n\n``` matlab\naddpath('/path/to/mexopencv/utils');\nMDoc;\n```\n\nOn-line documentation is [available][12].\n\nUnit Testing\n------------\n\nYou can test the functionality of compiled files by `UnitTest` class located\ninside `test` directory.\n\n``` matlab\naddpath('/path/to/mexopencv/test');\nUnitTest;\n```\n\nLook at the `test/unit_tests/` directory for all unit-tests.\n\nLicense\n=======\n\nThe code may be redistributed under the [BSD 3-Clause license](LICENSE).\n\n\n[1]: https://travis-ci.org/kyamagu/mexopencv\n[2]: https://ci.appveyor.com/project/kyamagu/mexopencv\n[3]: https://github.com/kyamagu/mexopencv/wiki\n[4]: https://www.mathworks.com/products/matlab.html\n[5]: https://www.gnu.org/software/octave/\n[6]: https://opencv.org/\n[7]: https://github.com/opencv/opencv/releases/tag/3.4.1\n[8]: https://github.com/opencv/opencv_contrib/releases/tag/3.4.1\n[9]: https://packages.ubuntu.com/bionic/libopencv-dev\n[10]: https://people.freedesktop.org/~dbn/pkg-config-guide.html\n[11]: https://brew.sh/\n[12]: http://kyamagu.github.io/mexopencv/matlab\n[13]: https://github.com/kyamagu/mexopencv/wiki/Installation-%28Windows%2C-MATLAB%2C-OpenCV-3%29\n[14]: https://github.com/kyamagu/mexopencv/wiki/Installation-%28Linux%2C-MATLAB%2C-OpenCV-3%29\n[15]: https://github.com/kyamagu/mexopencv/wiki/Installation-%28Linux%2C-Octave%2C-OpenCV-3%29\n[16]: https://github.com/kyamagu/mexopencv/tree/v2.1\n[17]: https://github.com/kyamagu/mexopencv/tree/v2.3\n[18]: https://github.com/kyamagu/mexopencv/tree/v2.4\n[19]: https://github.com/kyamagu/mexopencv/tree/v3.0.0\n[20]: https://github.com/kyamagu/mexopencv/tree/v3.1.0.1\n[21]: https://github.com/kyamagu/mexopencv/tree/v3.2.0\n[22]: https://github.com/kyamagu/mexopencv/tree/v3.3.0\n[23]: https://github.com/kyamagu/mexopencv/tree/v3.3.1\n[24]: https://github.com/kyamagu/mexopencv/tree/v3.4.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyamagu%2Fmexopencv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkyamagu%2Fmexopencv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyamagu%2Fmexopencv/lists"}