无法使用cv2和PIL Python 2.7编写Image

时间:2016-05-15 17:57:57

标签: python python-2.7 opencv image-processing python-imaging-library

我在Windows 10上使用带有OpenCV和PIL的python 2.7

我正在尝试使用var t = document.getElementById('app'); t.addEventListener('dom-change', function() { t.message = 'Hello world!'; }); 编写一个图像,例如按照代码:

<head>
  <base href="https://polygit.org/polymer+:master/components/">
  <script src="webcomponentsjs/webcomponents-lite.min.js"></script>
  <link rel="import" href="polymer/polymer.html">
</head>

<body>
  <template is="dom-bind" id="app">
    {{message}}
  </template>

  <script>
    var t = document.getElementById('app');

    // The dom-change event signifies when the template has stamped its DOM.
    t.addEventListener('dom-change', function() {
      // auto-binding template is ready.
      t.message = 'Hello world!';
    });
  </script>
</body>

现在我正试图通过cv2.imwrite()从同一张图片中获取文字 并需要打开图像 使用另一个calss中的 x={{"Some Process On an Image "}} #now saving the effects on real image cv2.imwrite("temp.png", x) 库,可以pytesseract 不处理PIL图片

pytesseract

并给我这个错误:

cv2

为什么我无法获得图像? 有任何访问权限或什么? 可以使用此代码显示:

from PIL import Image
import pytesseract
import cv2

if __name__ == '__main__':

     url= Image.open("temp.png")
     cv2.waitKey(200)
     text=pytesseract.image_to_string(url)
     print text
     cv2.waitKey(0)

我想知道为什么 Traceback (most recent call last): File "C:\Users\Elie MA\Documents\NetBeansProjects\tesser\src\new_module.py", line 9, in <module> text=pytesseract.image_to_string(url) File "build\bdist.win32\egg\pytesseract\pytesseract.py", line 161, in image_to_string File "build\bdist.win32\egg\pytesseract\pytesseract.py", line 94, in run_tesseract File "c:\Python27\lib\subprocess.py", line 711, in __init__ errread, errwrite) File "c:\Python27\lib\subprocess.py", line 948, in _execute_child startupinfo) WindowsError: [Error 2] The system cannot find the file specified 无法获取图片?

了解此图像也可以使用照片查看器打开 那么任何人都可以帮助我吗?

0 个答案:

没有答案