How can I find opencv functions source code?

2020-03-01 08:10发布

I am new to opencv and I am using opencv for windows. How can I see the source code for a specific function of an opencv library ? I just one want to get an idea of how that specific machine vision algorithm is implemented.

标签: opencv
3条回答
▲ chillily
2楼-- · 2020-03-01 08:50

You can get the OpenCV source code from https://github.com/opencv. An easy way to find the header for a function is to open an explorer window in OPENCV_HOME\build\include (where is the location where you chose to install OpenCV) and use the search box to find the header file that contains your function - this will help you know what module it is in. Then you can search in OPENCV_HOME\modules\MODULE_NAME\src to find the source of the the function. This is even easier if you install a search tool like grepWin.

Looking at the source is almost essential for finding out why those pesky OpenCV exceptions are thrown. It also means that you can answer most things about OpenCV yourself without having to ask here.

查看更多
闹够了就滚
3楼-- · 2020-03-01 08:59

All the source is now on github:

https://github.com/opencv/opencv and you can use it's search functionalities as well.

查看更多
萌系小妹纸
4楼-- · 2020-03-01 09:13

Here is a direct link to an excellent source code search, courtesy of Github. This is a very straightforward way to find the implementation and internal usages of a function or type.

查看更多
登录 后发表回答