Editing OpenCV source code

How would one go about editing either the C++ opencv functions and/or the python opencv functions in Ubuntu? Where is the source code located? For C++ how would one go about recompiling the source code?

Thank you.

1 Answer

Since Ubuntu is primarily a binary package based distribution, the source code isn't "located" anywhere on your system unless you explicitly download it; either:

  1. by enabling the appropriate source repositories, and then using apt-get source e.g.

    apt-get source opencv

    Note that this will download the source into the current directory - hence does not need sudo if you are downloading into a location within your home directory. It should also apply any relevant Ubuntu-specific patches such that the built code is equivalent to that of the corresponding binary package.

  2. by downloading a source tarball or checking out from the maintainer's git (or similar) source code repository. Note that this may get you a more up-to-date version of the software; however it also won't necessarily have been tested or patched for your current system.

In either case, you will likely need to install additional build dependencies before you are able to recompile the package from source, regardless of any changes you may have made to it.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like