如何查看opencv里面函数的源代码??????比如setMouseCallback这个函数是怎么定义的?

2024-11-27 19:53:46
推荐回答(1个)
回答(1):

用CMake导出opencv 源码,生成VC++项目,然后用vs打开工程,去里面搜索整个工程
#define CV_EXTERN_C extern "C"
#define CV_IMPL void CV_EXTERN_C

CV_IMPL void
cvSetMouseCallback( const char* window_name, CvMouseCallback on_mouse, void* param )
{
CV_FUNCNAME( "cvSetMouseCallback" );

__BEGIN__;

CvWindow* window = 0;

if( !window_name )
CV_ERROR( CV_StsNullPtr, "NULL window name" );

window = icvFindWindowByName(window_name);
if( !window )
EXIT;

window->on_mouse = on_mouse;
window->on_mouse_param = param;

__END__;
}