如何从highgui模块(opencv)提取函数并将其放置在代码文件中 [英] How to extract a function from highgui module(opencv)and place in the code file

查看:70
本文介绍了如何从highgui模块(opencv)提取函数并将其放置在代码文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个愚蠢的问题,但是我需要知道下面的代码是否可以从highgui.lib中提取cvCaptureFromCAM()函数并将其粘贴到我的代码中,以便将其重命名为camcapture(),然后在我的程序中调用它,而不仅仅是在代码文件的开头包含highgui库文件:

Hi, this might be a silly question, but I need to know if for the code below, if i can extract the cvCaptureFromCAM() function from the highgui.lib and paste it in my code so that I can rename it to camcapture() and then call that within my program without just including the highgui library file at the beginning of the code file:

<br />
CvCapture * pCapture = 0;<br />
<br />
<br />
//Initialize video capture<br />
pCapture = cvCaptureFromCAM( CV_CAP_ANY );




非常感谢




Many Thanks

推荐答案

库已编译,因此您将无法从一个函数中获取函数的源代码.

我不知道您要尝试做什么,为什么不知道,但是有效重命名功能的一种方法是实现一个功能不大的小型shim函数-它只是调用另一个函数.但是,您还需要将返回的所有类型包装在其他类或抽象数据类型中,否则将花费余下的时间进行铸造.

因此,我的建议会很糟糕-仅包含标题和与库的链接,从长远来看,它的痛苦就减小了.

Ash
Libraries are compiled so you won''t be able to get the source code for a function out of one.

I have no idea what you''re trying to do and why but one way of effectively renamining a function is to implement a small shim function that doesn''t do a lot - it just calls another function. However you''ll also need to wrap any types it returns in other classes or abstract data types otherwise you''ll spend the rest of your life casting.

So my advice would be suck it up - just include the header and link with the library, it''s less pain in the long run.

Ash


请注意, OpenCV 出生于 Intel ,但现已发布到开源 >社区.

话虽如此,从技术上讲,您可以简单地获取源代码并提取您想要的内容,但是您应该考虑侵犯许可证的问题!
Note that OpenCV was born in Intel, but now has been released to the open-source community.

Said that, technically you can simply get the source code and extract what you want, but you should think about license infringements!


这篇关于如何从highgui模块(opencv)提取函数并将其放置在代码文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆