(-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

前端 未结 5 820
逝去的感伤
逝去的感伤 2020-12-19 00:54

I am trying to recognize text from an image to then have the text outputted; however, this error spits out:

Traceback (most recent call last):

5条回答
  •  南笙
    南笙 (楼主)
    2020-12-19 01:19

    The problems are this one

    src_path = "C:/Users/Benji's Beast/Desktop/image.PNG"
    

    and this one

    print(get_string(src_path + "cont.jpg") )
    

    You are appending the image input file name from image.PNG to image.PNG.cont.jpg

    If your input image filename is cont.jpg and it is located on your Desktop, then try to replace your code with :

    src_path = "C:\Users\Benji's Beast\Desktop\"
    

    and

    print(get_string(src_path + "cont.jpg") )
    

提交回复
热议问题