简体   繁体   English

移动设备上的 HTML5 javascript 图像识别

[英]HTML5 javascript image recognition on mobile

I am starting a new project where i need to have image recognition in a browser application that runs on desktop browsers, iOS and Android.我正在开始一个新项目,我需要在桌面浏览器、iOS 和 Android 上运行的浏览器应用程序中进行图像识别。 The images should be scanned by using either the webcam or the device camere.应使用网络摄像头或设备摄像头扫描图像。 So i assume using HTML5 with javascript is the way to go.所以我假设使用带有javascript的HTML5是要走的路。 The only problem is that i cannot find a decent library for this.唯一的问题是我找不到合适的图书馆。 I did find libraries that compare images by pixelarrays, and libs that can do face tracking and stuff, but none that suits my needs at first sight.我确实找到了按像素阵列比较图像的库,以及可以进行面部跟踪和其他东西的库,但没有一个能满足我的需求。

Anyone know how i can best approach this problem?有谁知道我怎样才能最好地解决这个问题?

Thank you.谢谢你。

You will first need to find a solution on how to import your local pictures into a canvas element on your website.您首先需要找到如何将本地图片导入网站上的画布元素的解决方案。 Either you upload them to the server first, or (if you want to use live pictures from webcams), you could use this jQuery plugin: http://www.xarg.org/project/jquery-webcam-plugin/ It uses some Flash, but as far as I know, there's no other way to get webcam pictures into the browser easily.您可以先将它们上传到服务器,或者(如果您想使用来自网络摄像头的实时图片),您可以使用这个 jQuery 插件: http ://www.xarg.org/project/jquery-webcam-plugin/ 它使用了一些Flash,但据我所知,没有其他方法可以轻松地将网络摄像头图片输入浏览器。

From canvas element you can read the pictures into pixel arrays and then use existing libraries (maybe transcode them into javascript) to do whatever you like.从画布元素中,您可以将图片读入像素数组,然后使用现有库(可能将它们转码为 javascript)来做任何您喜欢的事情。

There is another more recent (without JQuery) Library available to stream webcam content into canvas.还有另一个更新的(没有 JQuery)库可用于将网络摄像头内容流式传输到画布中。

http://cbrandolino.github.io/camvas/ http://cbrandolino.github.io/camvas/

In HTML5 you can definitely do it through JavaScript with a bit of browser detection, here are some useful links:在 HTML5 中,您绝对可以通过 JavaScript 进行一些浏览器检测,这里有一些有用的链接:

http://www.html5rocks.com/en/tutorials/getusermedia/intro/ http://www.html5rocks.com/en/tutorials/getusermedia/intro/

This little javascript project used google images to recognize the content of the image: https://github.com/xc0d3rz/npm-imagerecognition这个小的 javascript 项目使用 google 图像来识别图像的内容: https ://github.com/xc0d3rz/npm-imagerecognition

Probably could be helpful to solve part of your problem.可能有助于解决您的部分问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM