技术专栏
nvidia tx2平台 Allied vision Alvium相机调试1
1. 前言
2. v4l2-ctl 中断采集
3. v4l2-ctl查询
4. pipeline问题
1. 前言
最近购买了一个allied vision alvium相机,
并通过CSI2连接到板
想用OpenCV写一个简单的c++代码。
cv::VideoCapture capvid ;
cv::Mat frame;
std::string pipeline = “v4l2-ctl -d /dev/video0 --set-fmt-video=width=720,height=544, --set-ctrl bypass_mode=0 --stream-mmap --stream-count=600”;
capvid.open(pipeline, cv::CAP_V4L2);
capvid>>frame;
cv::imshow(“input”,frame);
输出帧的高度和宽度为0
2. v4l2-ctl 终端采集
当在终端中运行
v4l2-ctl -d /dev/video0——set-fmt-video=width=720,height=544,
——stream-mmap——stream-count=600
得到了这个输出
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 184.00 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<<<<<<<<<<<<<<<<<< 183.50 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 183.33 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
这是对gst-inspect-1.0的输出
**libav: avenc_nellymoser: libav Nellymoser Asao encoder**
**libav: avenc_mp2fixed: libav MP2 fixed point (MPEG audio layer 2) encoder**
**libav: avenc_mp2: libav MP2 (MPEG audio layer 2) encoder**
**libav: avenc_mlp: libav MLP (Meridian Lossless Packing) encoder**
**libav: avenc_g723_1: libav G.723.1 encoder**
**libav: avenc_eac3: libav ATSC A/52 E-AC-3 encoder**
**libav: avenc_dca: libav DCA (DTS Coherent Acoustics) encoder**
**libav: avenc_alac: libav ALAC (Apple Lossless Audio Codec) encoder**
**libav: avenc_ac3_fixed: libav ATSC A/52A (AC-3) encoder**
**libav: avenc_ac3: libav ATSC A/52A (AC-3) encoder**
**libav: avenc_aac: libav AAC (Advanced Audio Coding) encoder**
**libav: avenc_s302m: libav SMPTE 302M encoder**
**libav: avenc_comfortnoise: libav RFC 3389 comfort noise generator encoder**
**pcapparse: irtspparse: IRTSPParse**
**pcapparse: pcapparse: PCapParse**
**faceoverlay: faceoverlay: faceoverlay**
**asf: rtpasfdepay: RTP ASF packet depayloader**
**asf: rtspwms: WMS RTSP Extension**
**asf: asfdemux: ASF Demuxer**
**a52dec: a52dec: ATSC A/52 audio decoder**
**faad: faad: AAC audio decoder**
**x265: x265enc: x265enc**
**curl: curlhttpsrc: HTTP Client Source using libcURL**
**curl: curlsmtpsink: Curl smtp sink**
**curl: curlftpsink: Curl ftp sink**
**curl: curlfilesink: Curl file sink**
**curl: curlhttpsink: Curl http sink**
**audiolatency: audiolatency: AudioLatency**
**realmedia: pnmsrc: PNM packet receiver**
**realmedia: rtspreal: RealMedia RTSP Extension**
**realmedia: rdtmanager: RTP Decoder**
**realmedia: rdtdepay: RDT packet parser**
**realmedia: rademux: RealAudio Demuxer**
**realmedia: rmdemux: RealMedia Demuxer**
**hls: hlssink2: HTTP Live Streaming sink**
**hls: hlssink: HTTP Live Streaming sink**
**hls: hlsdemux: HLS Demuxer**
**amrwbdec: amrwbdec: AMR-WB audio decoder**
**gdp: gdppay: GDP Payloader**
**gdp: gdpdepay: GDP Depayloader**
**openexr: openexrdec: OpenEXR decoder**
**coloreffects: chromahold: Chroma hold filter**
**coloreffects: coloreffects: Color Look-up Table filter**
**mpegtsdemux: tsdemux: MPEG transport stream demuxer**
**mpegtsdemux: tsparse: MPEG transport stream parser**
**openglmixers: glstereomix: OpenGL stereo video combiner**
**openglmixers: glvideomixerelement: OpenGL video_mixer**
**openglmixers: glvideomixer: OpenGL video_mixer bin**
**openglmixers: glmixerbin: OpenGL video_mixer empty bin**
**rtmp: rtmpsink: RTMP output sink**
**rtmp: rtmpsrc: RTMP Source**
**waylandsink: waylandsink: wayland video sink**
**mpeg2dec: mpeg2dec: mpeg1 and mpeg2 video decoder**
**sid: siddec: Sid decoder**
**videosignal: simplevideomark: Video marker**
**videosignal: simplevideomarkdetect: Video detecter**
**videosignal: videoanalyse: Video analyser**
**ipcpipeline: ipcslavepipeline: Inter-process slave pipeline**
**ipcpipeline: ipcpipelinesink: Inter-process Pipeline Sink**
**ipcpipeline: ipcpipelinesrc: Inter-process Pipeline Source**
**audiomixmatrix: audiomixmatrix: Matrix audio mix**
**fbdevsink: fbdevsink: fbdev video sink**
**bs2b: bs2b: Crossfeed effect**
**kms: kmssink: KMS video sink**
**dashdemux: dashdemux: DASH Demuxer**
**bluez: avdtpsrc: Bluetooth AVDTP Source**
**bluez: avdtpsink: Bluetooth AVDTP sink**
**bluez: a2dpsink: Bluetooth A2DP sink**
**webrtcdsp: webrtcechoprobe: Accoustic Echo Canceller probe**
**webrtcdsp: webrtcdsp: Voice Processor (AGC, AEC, filters, etc.)**
**stereo: stereo: Stereo effect**
**bayer: rgb2bayer: RGB to Bayer converter**
**bayer: bayer2rgb: Bayer to RGB decoder for cameras**
**webrtc: webrtcbin: WebRTC Bin**
**interlace: interlace: Interlace filter**
**rfbsrc: rfbsrc: Rfb source**
**ofa: ofa: OFA**
**ivfparse: ivfparse: IVF parser**
**staticelements: bin: Generic bin**
**staticelements: pipeline: Pipeline object**
**Total count: 260 plugins, 1424 features**
3. v4l2-ctl查询
v4l2-ctl --list-formats-ext -d /dev/video0 returned the following output
ioctl: VIDIOC_ENUM_FMT
** Index : 0**
** Type : Video Capture**
** Pixel Format: ‘TP31’**
** Name : 0x31 MIPI DATATYPE**
** Size: Discrete 720x544**
** Interval: Discrete 0.005s (183.831 fps)**
** Index : 1**
** Type : Video Capture**
** Pixel Format: ‘GREY’**
** Name : 8-bit Greyscale**
** Size: Discrete 720x544**
** Interval: Discrete 0.005s (183.831 fps)**
** Index : 2**
** Type : Video Capture**
** Pixel Format: ‘J2Y0’**
** Name : 10-bit/16-bit Greyscale**
** Size: Discrete 720x544**
** Interval: Discrete 0.005s (183.831 fps)**
** Index : 3**
** Type : Video Capture**
** Pixel Format: ‘J2Y2’**
** Name : 12-bit/16-bit Greyscale**
** Size: Discrete 720x544**
** Interval: Discrete 0.005s (183.831 fps)**
** Index : 4**
** Type : Video Capture**
** Pixel Format: ‘BX24’**
** Name : 32-bit XRGB 8-8-8-8**
** Size: Discrete 720x544**
** Interval: Discrete 0.005s (183.831 fps)**
** Index : 5**
** Type : Video Capture**
** Pixel Format: ‘XR24’**
** Name : 32-bit BGRX 8-8-8-8**
** Size: Discrete 720x544**
** Interval: Discrete 0.005s (183.831 fps)**
** Index : 6**
** Type : Video Capture**
** Pixel Format: ‘VYUY’**
** Name : VYUY 4:2:2**
** Size: Discrete 720x544**
** Interval: Discrete 0.005s (183.831 fps)**
4. pipeline问题
接收帧的管道应该是什么样的?
知道在为Gstreamer定义管道时,需要定义内存和格式。
对于V4L2管道,是否也需要做一些类似的事情?
管道仅用于gstreamer后端。
如果使用V4L后端,只需提供视频节点索引:
# Open /dev/video0
cap = cv2.VideoCapture(0, cv2.CAP_V4L2);
w = cap.get (cv2.CAP_PROP_FRAME_WIDTH)
h = cap.get (cv2.CAP_PROP_FRAME_HEIGHT)
fps = cap.get (cv2.CAP_PROP_FPS)
当我帧从cap转移到opencv Mat时,高度和宽度仍然是0
此外,相机有以下设置
有些在CAP_PROP中是不可用的
有办法改变这些参数吗?
理想情况下,需要使用低延迟模式
用户控件
brightness 0x00980900 (int) : min=0 max=255 step=1 default=0 value=0 flags=slider
gamma 0x00980910 (int) : min=40 max=240 step=5 default=100 value=100 flags=slider
exposure 0x00980911 (int) : min=164263 max=2147483647 step=16667 default=4997596 value=4897691 flags=slider
auto_gain 0x00980912 (bool) : default=0 value=0
gain 0x00980913 (int) : min=0 max=2400 step=10 default=0 value=0 flags=slider
reverse_x 0x00980914 (bool) : default=0 value=0
reverse_y 0x00980915 (bool) : default=0 value=0
frame_timeout_enabled 0x009809c8 (bool) : default=1 value=1
frame_timeout 0x009809c9 (int) : min=100 max=12000 step=1 default=12000 value=12000
stride_alignment_enabled 0x009809ca (bool) : default=1 value=1
crop_alignment_enabled 0x009809cb (bool) : default=1 value=1
相机控件
exposure_auto 0x009a0901 (menu) : min=0 max=1 default=1 value=1
exposure_absolute 0x009a0902 (int64) : min=1 max=100000 step=1 default=1 value=49
auto_gain_min 0x009a092a (int) : min=0 max=0 step=10 default=0 value=0 flags=slider
auto_gain_max 0x009a092b (int) : min=0 max=2400 step=10 default=2400 value=2400 flags=slider
bypass_mode 0x009a2064 (intmenu): min=0 max=1 default=0 value=0
override_enable 0x009a2065 (intmenu): min=0 max=1 default=0 value=0
height_align 0x009a2066 (int) : min=1 max=16 step=1 default=1 value=1
size_align 0x009a2067 (intmenu): min=0 max=2 default=0 value=0
write_isp_format 0x009a2068 (int) : min=1 max=1 step=1 default=1 value=1
sensor_signal_properties 0x009a2069 (u32) : min=0 max=4294967295 step=1 default=0 [30][18] flags=read-only, has-payload
sensor_image_properties 0x009a206a (u32) : min=0 max=4294967295 step=1 default=0 [30][16] flags=read-only, has-payload
sensor_control_properties 0x009a206b (u32) : min=0 max=4294967295 step=1 default=0 [30][36] flags=read-only, has-payload
sensor_dv_timings 0x009a206c (u32) : min=0 max=4294967295 step=1 default=0 [30][16] flags=read-only, has-payload
low_latency_mode 0x009a206d (bool) : default=0 value=0
preferred_stride 0x009a206e (int) : min=0 max=65535 step=1 default=0 value=0
sensor_modes 0x009a2082 (int) : min=0 max=30 step=1 default=30 value=1 flags=read-only
声明:本文内容由易百纳平台入驻作者撰写,文章观点仅代表作者本人,不代表易百纳立场。如有内容侵权或者其他问题,请联系本站进行删除。
红包
93
收藏
评论
打赏
- 分享
- 举报
评论
0个
手气红包
暂无数据
相关专栏
-
浏览量:4623次2021-08-04 11:20:41
-
浏览量:7183次2021-08-04 17:14:53
-
2021-07-30 17:04:37
-
浏览量:6984次2020-09-10 09:46:52
-
浏览量:5565次2021-08-05 13:55:51
-
2021-05-06 16:03:00
-
浏览量:8664次2020-09-08 19:26:12
-
浏览量:10796次2021-05-06 16:22:01
-
2021-07-30 17:20:54
-
浏览量:9179次2021-05-19 17:32:00
-
浏览量:7051次2021-05-20 16:37:42
-
浏览量:5289次2021-08-05 13:59:50
-
浏览量:1109次2022-05-28 10:31:03
-
2021-01-16 14:38:27
-
浏览量:7128次2021-07-31 15:26:23
-
浏览量:4279次2021-07-22 14:48:32
-
浏览量:8542次2021-05-14 14:43:43
-
浏览量:5349次2021-04-06 14:54:49
-
浏览量:8674次2021-01-15 16:31:31
切换马甲
上一页
下一页
打赏用户
共 1 位
我要创作
分享技术经验,可获取创作收益
分类专栏
-
178篇
热门专栏
- 【全新玩法】使用NVIDIA SHIELD玩笔记本里面的游戏大作
- AI为推荐系统“加料”, 实现个性化消费者服务
- 新品发布 | NVIDIA AI Enterprise 软件现已全球上市,各行业获取AI变得触手可及
- Nvidia Jetson 平台 DeepStream-6.0.1 部署 YoloV5-6.0 实现目标检测
- 最新发布 | NVIDIA扩大AI推理性能领先优势,首次在Arm服务器上取得佳绩
- nvidia xavier平台lan7800网卡驱动调试记录(2)网卡硬件& patch验证
- 游戏、奖品爽翻天!NGF 2014最后一轮招募开始!
- NVIDIA知识小讲堂:如何认识一款显卡
- AI 艺术画廊 —— 用 AI 诠释艺术与音乐 十一
- 让战斗更爽快!《泰坦天降:远征》全新地图预览
置顶时间设置
结束时间
删除原因
-
广告/SPAM
-
恶意灌水
-
违规内容
-
文不对题
-
重复发帖
打赏作者
free-jdx
您的支持将鼓励我继续创作!
打赏金额:
¥1
¥5
¥10
¥50
¥100
支付方式:
微信支付
打赏成功!
感谢您的打赏,如若您也想被打赏,可前往 发表专栏 哦~
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
审核成功
发布时间设置
发布时间:
请选择发布时间设置
是否关联周任务-专栏模块
审核失败
失败原因
请选择失败原因
备注
请输入备注