vcpkg, OpenCV, and Visual Studio

Several years ago I was playing around with a Logitech C920 webcam using OpenCV on Linux.

Recently I decided I wanted to get the same basic functionality under windows with minimal effort, so looked into what it would take to get OpenCV running on windows. I was amazed to come across a YouTube video showing the use of vcpkg as a library package manager under windows that allowed downloading, building, and installing many common libraries quite easily.

I was nicely amazed at how it worked..  Issuing just a few commands in powershell I was able to quickly download and build both vcpkg and OpenCV.

cd .\Source\Repos\
git clone https://github.com/Microsoft/vcpkg.git
cd .\vcpkg\
.\bootstrap-vcpkg.bat
.\vcpkg.exe integrate install
.\vcpkg.exe install opencv
.\vcpkg.exe install opencv:x64-windows

The one thing that bothers me the most is that I now have used over 7GB of space on my local drive on my 256GB SSD. That estimate is according to a quick change directory into the vcpkg directory and running the command dir /s /w it returned:

     Total Files Listed:
36549 File(s)  7,296,147,088 bytes
21911 Dir(s)  79,514,853,376 bytes free

My old program from Linux was able to run in my current Windows 10 environment with the only code change required being replacing the unix sleep() command with an appropriate windows command.

Here’s what the entire install process looked like in the shell:

vcpkg-1vcpkg-2vcpkg-3vcpkg-4vcpkg-5vcpkg-6

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s