From the course: Code Clinic: C++

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Load images with OpenCV

Load images with OpenCV - C++ Tutorial

From the course: Code Clinic: C++

Start my 1-month free trial

Load images with OpenCV

- My solution requires the user to include the file path of the image when calling the executable. This is done by modifying the main function to take in arguments, as seen on line eleven. Instead of the usual void, I've added two arguments. The first one, ARGC will tell the main function how many arguments have been passed to the program. The second one, ARGV are the inputs being passed into the program. For my solution, the input I'm accepting is the file path to the image to load and analyze. After checking that the correct number of arguments were passed in, at line thirteen, and instantiating my face detector class, I load the image by calling the method load image on line twenty two. In my face detector class, I've defined the load image method starting on line twenty one. It takes in the file path and in the first IF statement block at line twenty six, I determined the file extension of the image by looking at…

Contents