Ask Your Question
0

OpenCV in C++ Builder (RAD Studio XE7)

asked 2015-02-08 10:45:01 -0600

alper gravatar image

updated 2015-02-08 11:05:46 -0600

berak gravatar image

Hi all,

Would you kindly give some information on if it is possible to use OpenCV with Embarcadero RAD Studio XE7 C++ Builder or not, I will be pleased.

Sincerely yours,

edit retag flag offensive close merge delete

Comments

I'm interested too

pklab gravatar imagepklab ( 2015-02-10 12:09:30 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-07-17 17:35:46 -0600

boaz001 gravatar image

updated 2015-09-22 09:08:41 -0600

It is possible, but since Embarcadero's compiler is sometimes confused or more strict than others it requires some adjustment to the source code and therefor you must recompile it.

I am currently working on this for OpenCV's 3.0.0 release. You're welcome to and can follow my progress and fork/contribute/discuss here.

At the moment most opencv/modules build and tests can be run (not all tests pass) and there are some dirty hacks that break functionality. Most 3rdparty libs aren't done (build) yet as well as the performance tests. I expect to have everything to compile next month or so.

Similar work had been done before, for example by; davyw

EDIT: Current status:

  • builds in RelWithDebInfo or Debug (but not Release - see thinks to fix below)
  • all modules except world compile/link including tests
  • most tests pass
  • perf tests don't compile

Things to fix:

  • perf tests
  • Error E2357 Reference initialized with 'cv::Mat', needs lvalue of type 'cv::Mat'

when doing something like:

cv::Mat A;
cv::Mat B;
A.copyTo(B(cv::Rect()));

which can be worked around by casting B to (const cv::Mat&) inside copyTo

  • 3rdparty libs (openexr, libwebp)

To compile I use: cmake.exe -G"Borland Makefiles" -DCMAKE_BUILD_TYPE=Debug -DBUILD_OPENEXR=OFF -DBUILD_opencv_world=OFF -DBUILD_PERF_TESTS=OFF -DWITH_WEBP=OFF -DWITH_OPENCL=OFF -DWITH_OPENEXR=OFF .. to generate makefiles and use make or make install to build/install.

edit flag offensive delete link more

Comments

Some news with CBuilder ? have you try with RadStudio 10 Seattle ? It claims to be C++11 and CLANG compliant ?!?

pklab gravatar imagepklab ( 2015-09-15 13:10:55 -0600 )edit

I don't use RAD Studio 10, but if you have it you can try to build my XE7 branch (link above) with:

cmake.exe -G"Borland Makefiles" -DCMAKE_BUILD_TYPE=Debug -DBUILD_OPENEXR=OFF -DBUILD_opencv_world=OFF -DBUILD_PERF_TESTS=OFF -DWITH_WEBP=OFF -DWITH_OPENCL=OFF -DWITH_OPENEXR=OFF ..
make
boaz001 gravatar imageboaz001 ( 2015-09-21 08:55:56 -0600 )edit

I'm doing some test with XE10 but some trouble still exist. Till now I can link as DLL all modules except of features2d,ts and superres due to some obscure error on link may be related to OpenCL. Some strict check by CLang requires a lot of casting of int to size_t. CUDA is out because it requires visual studio.

pklab gravatar imagepklab ( 2015-10-15 12:50:06 -0600 )edit

Nice to hear. I have not tried to build with OpenCL enabled. Can you post the linker error you encounter?

boaz001 gravatar imageboaz001 ( 2015-10-19 08:16:10 -0600 )edit

I think that as 1st step we have to wait (or to make) support for bcc32c/bcc64 in CMake because it currently uses too many bcc32 compiler/linker flags.

pklab gravatar imagepklab ( 2015-11-02 09:03:46 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2015-02-08 10:45:01 -0600

Seen: 8,365 times

Last updated: Sep 22 '15

Related questions