Monday, February 9, 2015

OpenCV - No such file or directory

Today was the first time I tried using openCV to perform some image processing.
But everytime I tried to load an image it kept displaying

'Error 2 : No such file or directory'

Obviously I thought it might have been a path problem, but checking it repeatedly I realized that path was correct and for some reason it wasn't reading.

Searching online, I saw many users complaining about the same error but no solutions were really given.

After toying around, I found that it could open png files but couldn't open jpeg not gif images.

So the simple work around was, opening the image with paint and saving it as a png.

I don't know why this works, but it's a quick work around.

If anyone understands why, please do leave a comment below.