Ask Your Question
0

how to use open cv in visual studio 2017

asked 2017-03-07 09:22:13 -0600

vickydmitri123 gravatar image

i want to use open cv with vb 17. and i m new to open cv. is there any code which helps to code for face detection? a simple and easy steps.

edit retag flag offensive close merge delete

Comments

opencv does not support basic at all .

berak gravatar imageberak ( 2017-03-07 09:49:30 -0600 )edit

2 answers

Sort by ยป oldest newest most voted
1

answered 2017-03-08 06:17:06 -0600

PetterS gravatar image

updated 2017-03-08 06:22:11 -0600

2015 and 2017 should be binary compatible (can not post link :-( ), so you can use the compiled Windows version available from the OpenCV web page. But you have to edit the .cmake file to allow 2017.

Change these lines in OpenCVConfig.cmake

elseif(MSVC_VERSION EQUAL 1910)
  set(OpenCV_RUNTIME vc15)
endif()

to

elseif(MSVC_VERSION EQUAL 1910)
  message("-- Using OpenCV vc14 for VisualStudio 2017.")
  set(OpenCV_RUNTIME vc14)
endif()

I just tried this and it works.

edit flag offensive delete link more

Comments

I tried making this change in .cmake file but I am still getting errors when I 'build' the 'ALL_BUILD' file in 'CMakeTargets' folder in VS 2017. Any suggestions?

NewUser gravatar imageNewUser ( 2017-05-12 01:52:58 -0600 )edit
1

answered 2017-03-07 09:56:21 -0600

elliotwoods gravatar image

updated 2017-03-07 10:04:43 -0600

please clarify which language you are using with Visual Studio, e.g. C++, VB, C#, etc.

Visual Basic As @berak notes, OpenCV does not support Visual Basic (although there are unofficial .NET wrapping for OpenCV which you could use to employ OCV in VB). Due to the nature of .NET, you wouldn't need libraries which were specifically built for Visual Basic .NET 2017, you could use older libraries also.

Visual C++ If you're referring to VC (Visual C++), then you will need c++ libraries (and binaries) built with/for Visual C++ 2017. These are not available officially yet, but you could try using a recent version of cmake and a recent version of opencv from github to generate and build your own VC 2017 projects and solution. But you likely will hit many issues.

Since it sounds like you might be new to OpenCV, it's strongly suggested that you use a well supported platform e.g. Visual C++ 2015. If you want to avoid C++, then please consider using OpenCV with Python as it is quite easy to setup and is well documented.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-03-07 09:22:13 -0600

Seen: 14,026 times

Last updated: Mar 08 '17