If OpenCV is installed but not detected by pkg-config, you need to set the PKG_CONFIG_PATH environment variable to include the directory containing the OpenCV pkg-config file.