在 Heroku 中访问用户的网络摄像头 [英] Accessing a user's webcam in Heroku

查看:67
本文介绍了在 Heroku 中访问用户的网络摄像头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对收集眼动追踪数据感兴趣,并想创建一个使用此 GazeTracking 包的 Heroku 应用程序(或类似的),所以我可以捕获、捕获和存储人们在屏幕上查看给定图像的位置的数据.在 Stack Overflow 和其他地方浏览了数十个相关答案后,我仍然无法正常工作,因为我无法弄清楚如何访问用户的网络摄像头.这里是我现在要使用的 GitHub 存储库.有没有办法访问该项目的用户网络摄像头?谢谢.

I am interested in gathering eye tracking data and would like to create a Heroku app that uses this GazeTracking package (or similar) so I can capture and capture and store data for where people are looking on their screen for given images. After going through dozens of related answers on Stack Overflow and elsewhere, I am still unable to get this working correctly since I can't figure out how to access the user's web camera. Here is the GitHub repo I've got going right now. Is there a way to access the user's webcam for this project? Thanks.

我正在使用 buildpack https://github.com/heroku/heroku-buildpack-apt.git

I am using the buildpack https://github.com/heroku/heroku-buildpack-apt.git

推荐答案

Heroku 应用程序在服务器端运行.它们是网络应用程序.用户通过浏览器与他们互动.

Heroku apps run server-side. they're web apps. users interact with them through browsers.

如果您想访问用户的网络摄像头,则必须通过浏览器进行.这需要 WebRTC 或类似的 API.这意味着提供一个包含客户端 JavaScript(或其他)代码的网页,该代码通过浏览器访问用户的网络摄像头,然后将视频源(或单张图片)发送回服务器.

if you wanted to access a user's webcam, that would have to happen through the browser. that requires WebRTC or similar APIs. that means serving a web page that contains client-side javascript (or other) code which accesses the user's webcam through the browser, and then sends a video feed (or single pictures) of that back to the server.

您只能直接访问 Web 应用程序内部的服务器资源,不能访问客户端资源.

you can only directly access server resources inside the web app, not client-side resources.

如果您想在浏览器端进行眼动追踪,可以使用完全在浏览器中运行的 OpenCV.js.我不知道眼动追踪所需的程序是否已移植到 OpenCV.js 中,但值得一看.您可以在客户端进行分析,然后发送回热图或坐标列表.

if you wanted to do eye tracking browser-side, there's OpenCV.js which runs completely in the browser. I don't know if the required procedures for eye tracking have been ported to OpenCV.js but it's worth a look. you could do the analysis client-side and just send back heatmaps or lists of coordinates.

这篇关于在 Heroku 中访问用户的网络摄像头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆