Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

samples.findfile for loading photos

Hello, I've downloaded openCV for python and am using it on Microsoft Visual Studio and am trying to use the tutorials. Often, they fetch a picture,

src2 = cv.imread(cv.samples.findFile('LinuxLogo.jpg'))

The program runs, but gives an error:

  Message=OpenCV(4.1.1) C:\projects\opencv-python\opencv\modules\core\src\utils\samples.cpp:62: error: (-2:Unspecified error) OpenCV samples: Can't find required data file: LinuxLogo.jpg in function 'cv::samples::findFile'

  Source=C:\Users\tiern\source\repos\OpenCV-Dilation\OpenCV_Dilation.py
  StackTrace:
  File "C:\Users\tiern\source\repos\OpenCV-Dilation\OpenCV_Dilation.py", line 48, in <module>
    src = cv.imread(cv.samples.findFile(args.input))

If you could explain how I could load in pictures, I would greatly appreciate it.

Thank you!

click to hide/show revision 2
retagged

updated 2019-11-12 02:13:22 -0600

berak gravatar image

samples.findfile for loading photos

Hello, I've downloaded openCV for python and am using it on Microsoft Visual Studio and am trying to use the tutorials. Often, they fetch a picture,

src2 = cv.imread(cv.samples.findFile('LinuxLogo.jpg'))

The program runs, but gives an error:

  Message=OpenCV(4.1.1) C:\projects\opencv-python\opencv\modules\core\src\utils\samples.cpp:62: error: (-2:Unspecified error) OpenCV samples: Can't find required data file: LinuxLogo.jpg in function 'cv::samples::findFile'

  Source=C:\Users\tiern\source\repos\OpenCV-Dilation\OpenCV_Dilation.py
  StackTrace:
  File "C:\Users\tiern\source\repos\OpenCV-Dilation\OpenCV_Dilation.py", line 48, in <module>
    src = cv.imread(cv.samples.findFile(args.input))

If you could explain how I could load in pictures, I would greatly appreciate it.

Thank you!