[Beginner] Building the release and debug binaries taking a lot of time

I am trying to build OpenCV (from source) by making own Libraries from the Source Files (A beginner in open source contributions). I am using Windows OS and referring the official documentation. Visual Studio 2022 was taking too long (around 659 projects in solution explorer)for building the release and debug binaries.
I had selected all packages which were present in the above tutorial and also those which were preselected in CMake. Then, I started to build the binaries.

So, will you please tell me which packages are necessarily required for building the release and debug binaries in CMake GUI. Should I uncheck the preselected checkboxes in BUILD and WITH group and then only select those which are present in the documentation?
Thank you and sorry for the inconvenience.

maybe you’d like to start with Python instead. no beginner should choose C++.


there are official builds of OpenCV, without contrib, for Visual Studio. download one of those. make sure it fits your version of Visual Studio. VS 2022 is “vc17”.


if you really want to build OpenCV yourself, you can include/exclude modules as you see fit.

in the cmake GUI you can select what you want. browse the options. they appear after you’ve run an initial “configure”.

  • core is vital
  • imgcodecs if you want to read/write images
  • imgproc for many image processing operations, also drawing
  • videoio if you want to read/write videos or use a camera
  • highgui if you want to show a picture in a GUI window

the rest you could enable as needed.

if you did set the build up to use extra (contrib) modules, you could leave those disabled for now.

especially the CUDA modules in contrib take a lot of time to build.

you don’t need to build any

  • samples
  • tests, performance tests
  • “applications”

you should also look into “parallel build”.

1 Like

Okay I’ll do as directed. Thank you for the reply.
I also had another newbie doubt (Apologies for the same) that while contributing to open source:
should I directly pick up an issue on github and start working on the issue.
or
I am going in the right direction that first building the library by myself to understand the dependencies and then move to solving the issues
Thank you so much!

that’s not an OR but an AND :wink:

1 Like

Okay so both things can be done simultaneously right? Thanksđź‘Ť

1 Like
1 Like