OpenCV Python not opening images with imread()

后端 未结 6 477
长发绾君心
长发绾君心 2020-12-17 00:14

I\'m not entirely sure why this is happening but I am in the process of making a program and I am having tons of issues trying to get opencv to open images using imread. I k

6条回答
  •  一整个雨季
    2020-12-17 01:13

    Probably you have problem with special meaning of \ in text - like \t or \n

    Use \\ in place of \

    imgloc = "F:\\Kyle\\Desktop\\Coinjar\\Test images\\ten.png"
    

    or r''

    imgloc = r"F:\Kyle\Desktop\Coinjar\Test images\ten.png"
    

    EDIT:

    Some modules accept even / - like in Linux path

    imgloc = "F:/Kyle/Desktop/Coinjar/Test images/ten.png"
    

提交回复
热议问题