JS-OCR-demo
JS-OCR-demo copied to clipboard
MediaStreamTrack.getSources is deprecated, update it to MediaDevices.enumerateDevices()
Hi,
i am building this as Cordova Project and copies all html and js files to my Project and camera is not opening when i am trying to take the picture. when i look at the logs it says "MediaStreamTrack.getSources is deprecated", Could you please let me know the alter native to this,
Hi! AFAIK the replacement for this deprecated method is: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/enumerateDevices . I'd appreciate PR if you'd be able to fix it in my project.
Sorry for the confusion. i am building it as android app using cordova, i was missed to add some camera permissions. Now it is working fine but the text from image is not capturing correctly.
well, the OCR library I'm using is not in the latest version - you can try updating it. You can also try using other, more promising, library - tesseract.projectnaptha.com . Also, note that using camera via web platform doesn't support focus AFAIK, so images may be blurred.
Maybe this issue is the same. https://github.com/kdzwinel/JS-OCR-demo/issues/8