- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用带有流网址的 AI Thinker ESP32-CAM http://192.168.8.100:81/stream
.
我已经尝试过这个和其他技术,但对我没有任何作用
import numpy as np
cap = cv2.VideoCapture("rtsp://192.168.8.100:81/stream")
while(True):
ret, frame = cap.read()
cv2.imshow('frame',frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
http
以及代替
rstp
但根本没有结果
最佳答案
我用过这个arduino代码
#include <esp32cam.h>
#include <WebServer.h>
#include <WiFi.h>
const char* WIFI_SSID = "ZONG MBB-E5573-AE26";
const char* WIFI_PASS = "58688303";
WebServer server(80);
static auto loRes = esp32cam::Resolution::find(320, 240);
static auto hiRes = esp32cam::Resolution::find(800, 600);
void handleBmp()
{
if (!esp32cam::Camera.changeResolution(loRes)) {
Serial.println("SET-LO-RES FAIL");
}
auto frame = esp32cam::capture();
if (frame == nullptr) {
Serial.println("CAPTURE FAIL");
server.send(503, "", "");
return;
}
Serial.printf("CAPTURE OK %dx%d %db\n", frame->getWidth(), frame->getHeight(),
static_cast<int>(frame->size()));
if (!frame->toBmp()) {
Serial.println("CONVERT FAIL");
server.send(503, "", "");
return;
}
Serial.printf("CONVERT OK %dx%d %db\n", frame->getWidth(), frame->getHeight(),
static_cast<int>(frame->size()));
server.setContentLength(frame->size());
server.send(200, "image/bmp");
WiFiClient client = server.client();
frame->writeTo(client);
}
void serveJpg()
{
auto frame = esp32cam::capture();
if (frame == nullptr) {
Serial.println("CAPTURE FAIL");
server.send(503, "", "");
return;
}
Serial.printf("CAPTURE OK %dx%d %db\n", frame->getWidth(), frame->getHeight(),
static_cast<int>(frame->size()));
server.setContentLength(frame->size());
server.send(200, "image/jpeg");
WiFiClient client = server.client();
frame->writeTo(client);
}
void handleJpgLo()
{
if (!esp32cam::Camera.changeResolution(loRes)) {
Serial.println("SET-LO-RES FAIL");
}
serveJpg();
}
void handleJpgHi()
{
if (!esp32cam::Camera.changeResolution(hiRes)) {
Serial.println("SET-HI-RES FAIL");
}
serveJpg();
}
void handleJpg()
{
server.sendHeader("Location", "/cam-hi.jpg");
server.send(302, "", "");
}
void handleMjpeg()
{
if (!esp32cam::Camera.changeResolution(hiRes)) {
Serial.println("SET-HI-RES FAIL");
}
Serial.println("STREAM BEGIN");
WiFiClient client = server.client();
auto startTime = millis();
int res = esp32cam::Camera.streamMjpeg(client);
if (res <= 0) {
Serial.printf("STREAM ERROR %d\n", res);
return;
}
auto duration = millis() - startTime;
Serial.printf("STREAM END %dfrm %0.2ffps\n", res, 1000.0 * res / duration);
}
void setup()
{
Serial.begin(115200);
Serial.println();
{
using namespace esp32cam;
Config cfg;
cfg.setPins(pins::AiThinker);
cfg.setResolution(hiRes);
cfg.setBufferCount(2);
cfg.setJpeg(80);
bool ok = Camera.begin(cfg);
Serial.println(ok ? "CAMERA OK" : "CAMERA FAIL");
}
WiFi.persistent(false);
WiFi.mode(WIFI_STA);
WiFi.begin(WIFI_SSID, WIFI_PASS);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
}
Serial.print("http://");
Serial.println(WiFi.localIP());
Serial.println(" /cam.bmp");
Serial.println(" /cam-lo.jpg");
Serial.println(" /cam-hi.jpg");
Serial.println(" /cam.mjpeg");
server.on("/cam.bmp", handleBmp);
server.on("/cam-lo.jpg", handleJpgLo);
server.on("/cam-hi.jpg", handleJpgHi);
server.on("/cam.jpg", handleJpg);
server.on("/cam.mjpeg", handleMjpeg);
server.begin();
}
void loop()
{
server.handleClient();
}
import urllib
import cv2
import numpy as np
url='http://192.168.8.100/cam-hi.jpg'
while True:
imgResp=urllib.request.urlopen(url)
imgNp=np.array(bytearray(imgResp.read()),dtype=np.uint8)
img=cv2.imdecode(imgNp,-1)
# all the opencv processing is done here
cv2.imshow('test',img)
if ord('q')==cv2.waitKey(10):
exit(0)
关于python - OpenCV Python 中的 ESP32-CAM 流,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60029614/
所以,我的网站上有一个视频流。我有一个默认的 Cam 1,这是代码: CCTV + add camera
我想在我的 iPhone/iPad 上获取 ip-cam 的流,并想在屏幕上显示它。通过研发,我发现 ffmpeg 是实现它的唯一方法,但我在 ffmpeg 上什么也没发现。有没有其他方法可以实现它或
我正在学习和从事人脸识别大学项目。 人脸识别.py from imutils.video import VideoStream import face_recognition import argpa
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
我已经训练了一个网络,并以 mynetwork.model 的形式保存了它。我想使用我自己的模型而不是 VGG16 或 ResNet 等应用 gradcam。 apply_gradcam.py # i
iphone 相机拍的照片有将近2.5Mb,怎么缩小,我试过了UIJPEG Representation(image,0.1f),但不影响大小? 最佳答案 你真的不能减少图像在内存中占用的大小。 加载
我正在尝试使用nodejs中的探测功能来发现ONVIF cam,但它不起作用。当我查看wireshark时,我找不到从我的计算机发送的任何广播消息。这是代码: var onvif = require(
我正在做一个视频处理项目,它需要对主题进行识别。但是我发现当主体移开或移向CAM时无法准确识别。我目前正在使用具有阈值的LBP识别器模型......我是图像处理的新手,如果有人可以建议,我会很高兴一些
#Importing necessary libraries, mainly the OpenCV, and PyQt libraries import cv2 import numpy as np
我正在使用 opencv 和 Python3 读取网络摄像头。 即使我松开网络摄像头,网络摄像头灯仍然亮着。 我在做: webcam = cv2.VideoCapture(0) webcam.rele
我有一个 ESP32 摄像头,想控制一个伺服系统。我的代码编译没有错误,但不起作用。涉及两个文件,一个.ino 和一个.cpp。 .ino 似乎工作正常,因为伺服在启动时有助于他的起始位置 90°,但
代码: p.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {
我正在关注this tutorial here我复制粘贴了第一个代码示例: from scipy import misc l = misc.lena() misc.imsave('lena.png',
我正在寻找有关如何将 IP 摄像头的视频转发到 Google talk 的工作想法和技巧。 这是关于我想做的事情的 C# 方法框架: /// /// This method makes it pos
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 5 年前。 Improve this qu
我正在使用来自 http://tmhare.mvps.org/downloads.htm 的“捕获源过滤器” .注册 ax 驱动程序后,我试图了解它在使用视频源的应用程序之间的兼容性。 例如,Skyp
我是名为 Feather (featherapp.co) 的综合性 Apple TV 应用程序的开发者。我遇到的一个问题是用户希望能够查看他们相机的实时画面。 有没有人确定访问摄像头实时画面的方法?我
我的以下代码无法正常工作。如果我从我的摄像头加载到 Firefox 和流,我的 camUrl 链接有效,但在运行时我的图片框中没有显示任何内容。有什么想法吗? public Threa
我在理解我的应用程序崩溃的 logcat 时遇到了问题。 (我是初学者,我的应用程序只是拍照,然后将其保存在特定文件夹中,但是当我按下应该允许我拍照的按钮时,它崩溃了,我收到了著名的消息( MY_AP
String caminhoFoto = getExternalFilesDir(null) + "/"+ System.currentTimeMillis() +".jpg";
我是一名优秀的程序员,十分优秀!