Need suggestion for running modified source code

asked 2016-09-24 11:56:57 -0600

spacegoing gravatar image

updated 2016-09-25 03:57:23 -0600

I am new to opencv and cmake. I really need some instructions on building modified source code. I cloned master branch from github.

I modified opencv/modules/imgproc/src/grabcut.cpp and wants to write another class lets say class run_grabcut in opencv/test.cpp using the modified version. Would you please give me 2 examples:

  1. what files should I include in the source code opencv/test.cpp?

  2. Which CMakeList should I modify to build a test.cpp target so that I can only run this file? Would you please give me an example of this CMakeList?

Thanks so much for your help!

edit retag flag offensive close merge delete

Comments

1

you're trying to reduce a car to the driver seat, and still expect it to move ...

berak gravatar imageberak ( 2016-09-25 01:58:30 -0600 )edit

@berak lol. Would you please see the updated question? I really need your help:D Thanks!

spacegoing gravatar imagespacegoing ( 2016-09-25 03:51:05 -0600 )edit
1
  • imho, there's no way at all without building at least imgproc & core modules. for any test making sense, you'll need highgui and (3.x) imgcodecs, too.

  • try to make a new buildfolder (save your working one for later), and try to disable any modules you don't need (in cmake(-gui)). build a minimal version of opencv, experiment with that, later, when it works, build your original setup with the changes.

  • idk, what your "test" is, but a real unit test would also require opencv_ts module.

berak gravatar imageberak ( 2016-09-25 04:38:34 -0600 )edit