- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我用最新的 Jetpack (Linux For Tegra R23.2) 刷新了我的 Jetson TX1,并且以下命令完美运行:
gst-launch-1.0 nvcamerasrc fpsRange="30.0 30.0" ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! nvtee ! nvvidconv flip-method=2 ! 'video/x-raw(memory:NVMM), format=(string)I420' ! nvoverlaysink -e
我尝试使用以下 python 程序从网络摄像头接收图像:
import numpy as np
import cv2
cap = cv2.VideoCapture(0)
while(True):
# Capture frame-by-frame
ret, frame = cap.read()
# Our operations on the frame come here
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
# Display the resulting frame
cv2.imshow('frame',gray)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()
我收到以下错误:
OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /hdd/buildbot/slave_jetson_tx_2/35-O4T-L4T-Jetson-L/opencv/modules/imgproc/src/color.cpp, line 3739
Traceback (most recent call last):
File "webcam.py", line 11, in <module>
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.error: /hdd/buildbot/slave_jetson_tx_2/35-O4T-L4T-Jetson-L/opencv/modules/imgproc/src/color.cpp:3739: error: (-215) scn == 3 || scn == 4 in function cvtColor
我知道问题是它无法从网络摄像头接收图像。我还更改了代码以仅显示从网络摄像头接收到的图像,但它给了我错误,这意味着它没有从摄像头获取图像。
我还尝试通过以下代码使用 C++:
#include "opencv2/opencv.hpp"
using namespace cv;
int main(int argc, char** argv)
{
VideoCapture cap;
// open the default camera, use something different from 0 otherwise;
// Check VideoCapture documentation.
if(!cap.open(0))
return 0;
for(;;)
{
Mat frame;
cap >> frame;
if( frame.empty() ) break; // end of video stream
imshow("this is you, smile! :)", frame);
if( waitKey(1) == 27 ) break; // stop capturing by pressing ESC
}
// the camera will be closed automatically upon exit
// cap.close();
return 0;
}
使用
编译没有任何错误g++ webcam.cpp -o webcam `pkg-config --cflags --libs opencv`
但同样,当我运行程序时,我收到此错误:
$ ./webcam
Unable to stop the stream.: Device or resource busy
Unable to stop the stream.: Bad file descriptor
VIDIOC_STREAMON: Bad file descriptor
Unable to stop the stream.: Bad file descriptor
我错过了什么?在运行此程序之前,我应该运行任何命令来激活网络摄像头吗?
最佳答案
根据 nvidia 论坛,您需要正确设置 gstreamer 管道。目前 opencv 无法自动检测 nvcamera 的流。
我让它工作的唯一方法是使用 Opencv3 和这行代码来获取视频:
cap = cv2.VideoCapture("nvcamerasrc !video/x-raw(memory:NVMM), width=(int)640, height=(int)480, format=(string)I420, framerate=( fraction)30/1 !nvvidconv flip-method=2 !video/x-raw, format=(string)I420 !videoconvert !video/x-raw, format=(string)BGR !appsink")
/p>
关于opencv - 如何从 Jetson TX1 嵌入式摄像头接收图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36659151/
根据 https://elinux.org/Jetson,我目前正在尝试将 Jetson TX1 与 jetson NANO 进行基准测试。 ,它们都具有 maxwell 架构,NANO 有 128
我正在Jetson TK1上开发OpenCV应用程序。我正在使用NVIDIA提供的OpenCV4Tegra软件包。 dpkg -l输出: ii libopencv4tegra
我正在尝试从我的 mac 远程访问 Jetson Nano。到目前为止,我已经完成了以下工作: 我在我的 Mac 上安装了 microsoft Remote Desktop 我通过 Micro-usb
昨天收到了我的 Jetson TK1。将其拆箱并配置 Linux GUI 后,使用连接到其 USB 3.0 端口的鼠标(无绳)重新启动设备会将其带到某种命令行页面,它可能会在其中加载一些文件,然后屏幕
这个问题在这里已经有了答案: QT can't find openCV's libs (2 个答案) 关闭 8 年前。 我有一个程序可以在我的机器上正常编译/运行。我刚拿起一个 Nvidia Jet
我正在使用 gcc arm 交叉编译器 (arm-eabi-g++) 编译应用程序。我想在 jetson tk1 目标上执行代码。当我复制可执行文件并在目标上运行它时。我收到一条错误消息 -bash:
我用最新的 Jetpack (Linux For Tegra R23.2) 刷新了我的 Jetson TX1,并且以下命令完美运行: gst-launch-1.0 nvcamerasrc fpsRan
在我的 Arduino Due 上工作了很长时间之后,我需要一个更好、更强大的原型(prototype)设计平台来用于我 future 的项目。为此,我已经订购了 NVIDIA Jetson Tegr
我不是很熟悉 ARM 处理器的内部细节,但我不明白我的 Nvidia Jetson Nano 开发板上的以下行为。 C 代码示例 ... //main.c #include int main() {
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许在 Stack Overflow 上提出有关专业服务器或网络相关基础设施管理的问题。您可以编辑问
我想在本地网络中为 Jetson Nano 设置一个静态 IP。我试过的: -- 更改路由器上的 DHCP。 -- 使用以下内容编辑/etc/network/interfaces: auto eth0
对不起,如果我的描述冗长乏味,但我想给你最重要的细节来解决我的问题。 最近,我终于买了一个 Jetson Nano 开发工具包,它有 4Gb 的 RAM,为了获得我认为的对象检测的最佳配置,我遵循了
有人在任何 Nvidia Jetson 产品上使用过 Tensorflow Lite 吗?我想使用我的 Jetson Nano 进行推理,并希望通过使用 GPU 的 tf-lite 进行推理。 令人困
我想在NVIDIA Jetson Nano上运行Google AutoML Vision的导出模型。由于很容易,我想使用预构建的容器根据官方Edge containers tutorial进行预测。
我正在设置一个 nvidia jetson nano 来运行 docker 容器。我正在使用我已经在我的 x86_64 Ubuntu 16.04 机器上使用的安装过程,docker 运行顺畅。尽管如此
Linux 4 Tegra随附的OpenCv for Tegra设备是否在下面使用了NPP和OpenVX?还是我必须自己进行此类优化? 对指向证明的链接的任何引用将不胜感激。 最佳答案 您可以查找op
我正在尝试为Python 3 PyTorch创建一个简单的Yocto Python食谱。目标是Yocto从meta-tegra层为NVIDIA Jetson Nano制作的SD卡镜像。没有这些配方,我
The official webpage for the Jetson TK1对于新用户来说相当复杂,我找不到文档/网页/书籍/类(class)来开始研究 Jetson TK1 的 API,重点是 G
我正在使用 Jetson TX2 和 Arduino Uno 尝试通过 USB 串口进行通信,前提是我正在使用 Arduino 与一些激光 ToF 传感器和热电堆进行通信。 Jetson 正在运行 U
我想在 Jetson-nano 上运行 ZoneMinder 作为 IP CAM 服务器,但 Jetson nano 似乎无法处理许多使用 ffmpeg 的摄像头用于解码。 如果我在 ZoneMind
我是一名优秀的程序员,十分优秀!