<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[SC535M设置默认相机参数画面显示不正常的问题]]></title><description><![CDATA[<p dir="auto"><a href="/assets/uploads/files/1730699509054-5wb-cam.py.txt">5wb-cam .py.txt</a><br />
<a class="plugin-mentions-user plugin-mentions-a" href="/user/veye_xumm" aria-label="Profile: veye_xumm">@<bdi>veye_xumm</bdi></a> 你好，这是我根据你们给出的python例程写的一拖五的python例程，其中参数都是按照sensor的实际尺寸来，同时也按照wiki设置了preferred_stride,但是在jetson tx2 预览出的画面不正常 表现为有花纹，我初步判断是内存没对齐的问题，因为jetson需要256位对齐，但我已经设置了preferred_stride,请帮忙看下是什么问题，我写的源码已上传，python版本为3.6.9，opencv版本为4.1.1</p>
]]></description><link>http://forum.veye.cc/topic/647/sc535m设置默认相机参数画面显示不正常的问题</link><generator>RSS for Node</generator><lastBuildDate>Mon, 05 Oct 2026 12:48:29 GMT</lastBuildDate><atom:link href="http://forum.veye.cc/topic/647.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 04 Nov 2024 05:54:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to SC535M设置默认相机参数画面显示不正常的问题 on Fri, 08 Nov 2024 01:38:33 GMT]]></title><description><![CDATA[<p dir="auto">经过验证，xavier平台可以通过设置配置prefer_stride为64，分辨率是2432x2048的大小。但是tx2平台不行，还是得要求256的整数倍。</p>
]]></description><link>http://forum.veye.cc/post/4570</link><guid isPermaLink="true">http://forum.veye.cc/post/4570</guid><dc:creator><![CDATA[veye_xumm]]></dc:creator><pubDate>Fri, 08 Nov 2024 01:38:33 GMT</pubDate></item><item><title><![CDATA[Reply to SC535M设置默认相机参数画面显示不正常的问题 on Wed, 06 Nov 2024 05:39:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/veye_xumm" aria-label="Profile: veye_xumm">@<bdi>veye_xumm</bdi></a><br />
哦 这样是不行的 刚刚是我忘记把args.width从2304改回默认值了，2432的内存还是撕裂的<br />
<img src="/assets/uploads/files/1730869473258-c9ba0cdf-cad6-44a8-8625-3436d0611e89-image.png" alt="c9ba0cdf-cad6-44a8-8625-3436d0611e89-image.png" class=" img-fluid img-markdown" /><br />
<img src="/assets/uploads/files/1730871550501-3f390221-61ed-4a3c-87de-e2db20910401-image.png" alt="3f390221-61ed-4a3c-87de-e2db20910401-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>http://forum.veye.cc/post/4565</link><guid isPermaLink="true">http://forum.veye.cc/post/4565</guid><dc:creator><![CDATA[Dangal]]></dc:creator><pubDate>Wed, 06 Nov 2024 05:39:18 GMT</pubDate></item><item><title><![CDATA[Reply to SC535M设置默认相机参数画面显示不正常的问题 on Wed, 06 Nov 2024 03:39:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dangal" aria-label="Profile: dangal">@<bdi>dangal</bdi></a><br />
还是用sc535,你测试一下配置prefer_stride为64，分辨率是2432x2048的大小。</p>
<pre><code>v4l2-ctl --set-ctrl preferred_stride=64
python ./v4l2dev_2_opencv_show_grey.py --width 2432--height 2048
</code></pre>
]]></description><link>http://forum.veye.cc/post/4564</link><guid isPermaLink="true">http://forum.veye.cc/post/4564</guid><dc:creator><![CDATA[veye_xumm]]></dc:creator><pubDate>Wed, 06 Nov 2024 03:39:39 GMT</pubDate></item><item><title><![CDATA[Reply to SC535M设置默认相机参数画面显示不正常的问题 on Wed, 06 Nov 2024 02:18:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/veye_xumm" aria-label="Profile: veye_xumm">@<bdi>veye_xumm</bdi></a><br />
rolling shutter 我可以理解为滑动窗口吗 我其实只关注这个镜头能不能摄制出大于500w像素的黑白原始照片 还有就是能不能同样适配到jetson tx2上，只要重新更新dtbs和img就能在我不改变我代码的基础上直接用  其他的方面我不是很关心</p>
]]></description><link>http://forum.veye.cc/post/4562</link><guid isPermaLink="true">http://forum.veye.cc/post/4562</guid><dc:creator><![CDATA[Dangal]]></dc:creator><pubDate>Wed, 06 Nov 2024 02:18:03 GMT</pubDate></item><item><title><![CDATA[Reply to SC535M设置默认相机参数画面显示不正常的问题 on Wed, 06 Nov 2024 01:55:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dangal" aria-label="Profile: dangal">@<bdi>dangal</bdi></a> 这款是rolling shutter的。不能直接用到ADP-N5上，这个适配ADP-N4</p>
]]></description><link>http://forum.veye.cc/post/4561</link><guid isPermaLink="true">http://forum.veye.cc/post/4561</guid><dc:creator><![CDATA[veye_xumm]]></dc:creator><pubDate>Wed, 06 Nov 2024 01:55:16 GMT</pubDate></item><item><title><![CDATA[Reply to SC535M设置默认相机参数画面显示不正常的问题 on Wed, 06 Nov 2024 01:42:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/veye_xumm" aria-label="Profile: veye_xumm">@<bdi>veye_xumm</bdi></a><br />
我并不打算折腾更改linux源码，因为这样存在风险。除非你们已经试验过，请确认一下这样做不会导致后续有潜在的内存问题。<br />
我现在正在考虑要不要换更好的图像传感器代替535M，比如我问你家客服的这款<br />
<img src="/assets/uploads/files/1730856807573-3686f838-1ca7-4c9d-8361-089c25eecf71-image.png" alt="3686f838-1ca7-4c9d-8361-089c25eecf71-image.png" class=" img-fluid img-markdown" /><br />
这款能不能同样用ADP-N5转接板呢？ 如果能，我就把535退了，换这个型号的传感器</p>
<p dir="auto">我刚刚找了linux代码仓库 发现没有preferred_stride 的关键字相关搜索结果<br />
<img src="/assets/uploads/files/1730857319777-441e9e88-7b75-4768-921d-a08053345d51-image.png" alt="441e9e88-7b75-4768-921d-a08053345d51-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>http://forum.veye.cc/post/4560</link><guid isPermaLink="true">http://forum.veye.cc/post/4560</guid><dc:creator><![CDATA[Dangal]]></dc:creator><pubDate>Wed, 06 Nov 2024 01:42:04 GMT</pubDate></item><item><title><![CDATA[Reply to SC535M设置默认相机参数画面显示不正常的问题 on Wed, 06 Nov 2024 01:08:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dangal" aria-label="Profile: dangal">@<bdi>dangal</bdi></a><br />
我意思是到kernel源码里面找一下preferred_stride关键字。</p>
]]></description><link>http://forum.veye.cc/post/4559</link><guid isPermaLink="true">http://forum.veye.cc/post/4559</guid><dc:creator><![CDATA[veye_xumm]]></dc:creator><pubDate>Wed, 06 Nov 2024 01:08:19 GMT</pubDate></item><item><title><![CDATA[Reply to SC535M设置默认相机参数画面显示不正常的问题 on Tue, 05 Nov 2024 10:44:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/veye_xumm" aria-label="Profile: veye_xumm">@<bdi>veye_xumm</bdi></a> <img src="/assets/uploads/files/1730803280136-091d578c-8097-4d9e-91e9-ebca030b84ca-image.png" alt="091d578c-8097-4d9e-91e9-ebca030b84ca-image.png" class=" img-fluid img-markdown" /><br />
你好 能否给出相关的keyword，nVidia的官方doc体量太大了 搜索stride就找到这两个东西 看起来都不相关</p>
<p dir="auto">如果在Google和baidu bing等上搜索stride的话，出来的全是深度学习的步长stride</p>
]]></description><link>http://forum.veye.cc/post/4556</link><guid isPermaLink="true">http://forum.veye.cc/post/4556</guid><dc:creator><![CDATA[Dangal]]></dc:creator><pubDate>Tue, 05 Nov 2024 10:44:46 GMT</pubDate></item><item><title><![CDATA[Reply to SC535M设置默认相机参数画面显示不正常的问题 on Tue, 05 Nov 2024 08:32:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dangal" aria-label="Profile: dangal">@<bdi>dangal</bdi></a><br />
设置stride之后，实际底层是按照stride的设置值分配buffer，一路回调上来。但是python库和qv4l2依然按照上层设置的width去理解这个图片，因此造成了问题。<br />
stride这个参数如果重新编译内核，应该是可以缩小的。具体英伟达的官网上我印象中是有写。 或者直接查找一下kernel源码更改也可以。<br />
比如改成64</p>
]]></description><link>http://forum.veye.cc/post/4553</link><guid isPermaLink="true">http://forum.veye.cc/post/4553</guid><dc:creator><![CDATA[veye_xumm]]></dc:creator><pubDate>Tue, 05 Nov 2024 08:32:13 GMT</pubDate></item><item><title><![CDATA[Reply to SC535M设置默认相机参数画面显示不正常的问题 on Tue, 05 Nov 2024 08:12:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/veye_xumm" aria-label="Profile: veye_xumm">@<bdi>veye_xumm</bdi></a> 我有一个猜想，不知道对不对，那就是实际预览的时候 程序只会按照你设置的width和height去分配内存大小去展示图片，preferred_stride 这个参数只适用于硬件层面去分配图片内存大小？</p>
<p dir="auto">但是，这样的话，虽然一张图片被分配了2560<em>2048个字节，但其实像素还是只有2448</em>2048？</p>
]]></description><link>http://forum.veye.cc/post/4552</link><guid isPermaLink="true">http://forum.veye.cc/post/4552</guid><dc:creator><![CDATA[Dangal]]></dc:creator><pubDate>Tue, 05 Nov 2024 08:12:57 GMT</pubDate></item><item><title><![CDATA[Reply to SC535M设置默认相机参数画面显示不正常的问题 on Tue, 05 Nov 2024 08:10:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/veye_xumm" aria-label="Profile: veye_xumm">@<bdi>veye_xumm</bdi></a><br />
got it！<br />
但是，要怎么解释我上面那个代码设置preferred_stride之后，/dev/video0的成像还是不正常呢？<br />
我按照你的说法指定了每个设备，即每个命令 --set-ctrl preferred_stride=2560 之前都加了指定的 -d /dev/video*, 但是，当这样设置后，我opencv imshow的全部都不正常了，而且qv4l2也全部不正常，在没有指定-d的情况下 仅/dev/video0 第一路不正常</p>
]]></description><link>http://forum.veye.cc/post/4551</link><guid isPermaLink="true">http://forum.veye.cc/post/4551</guid><dc:creator><![CDATA[Dangal]]></dc:creator><pubDate>Tue, 05 Nov 2024 08:10:01 GMT</pubDate></item><item><title><![CDATA[Reply to SC535M设置默认相机参数画面显示不正常的问题 on Tue, 05 Nov 2024 08:02:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dangal" aria-label="Profile: dangal">@<bdi>dangal</bdi></a><br />
你还是没有理解stride的意思。<br />
preferred_stride指一行图像数据需要的内存大小。为了硬件处理图像数据速度考虑，jetson平台设计了stride这个参数。换句话说，2448的width，实际给按照2560分配的内存大小，右侧补数据0。</p>
<p dir="auto">你需要按照2560<em>2048来预览。2560</em>2048=5242880字节</p>
]]></description><link>http://forum.veye.cc/post/4550</link><guid isPermaLink="true">http://forum.veye.cc/post/4550</guid><dc:creator><![CDATA[veye_xumm]]></dc:creator><pubDate>Tue, 05 Nov 2024 08:02:23 GMT</pubDate></item><item><title><![CDATA[Reply to SC535M设置默认相机参数画面显示不正常的问题 on Tue, 05 Nov 2024 07:59:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/veye_xumm" aria-label="Profile: veye_xumm">@<bdi>veye_xumm</bdi></a> 我按照2448*2048预览的<br />
<img src="/assets/uploads/files/1730793403297-dce0db06-e46c-4ad9-9825-3449f3c504f8-image.png" alt="dce0db06-e46c-4ad9-9825-3449f3c504f8-image.png" class=" img-fluid img-markdown" /><br />
文件大小一共150M 我抓了30帧 所以一张是5M<br />
<img src="/assets/uploads/files/1730793439090-1369e23e-eb5a-4f47-a23b-c64fa615d972-image.png" alt="1369e23e-eb5a-4f47-a23b-c64fa615d972-image.png" class=" img-fluid img-markdown" /><br />
一张是5242880字节<br />
<img src="/assets/uploads/files/1730793564563-cdd1d63a-8598-4e97-a2dd-94912a9a2cbe-image.png" alt="cdd1d63a-8598-4e97-a2dd-94912a9a2cbe-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>http://forum.veye.cc/post/4548</link><guid isPermaLink="true">http://forum.veye.cc/post/4548</guid><dc:creator><![CDATA[Dangal]]></dc:creator><pubDate>Tue, 05 Nov 2024 07:59:27 GMT</pubDate></item><item><title><![CDATA[Reply to SC535M设置默认相机参数画面显示不正常的问题 on Tue, 05 Nov 2024 07:55:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dangal" aria-label="Profile: dangal">@<bdi>dangal</bdi></a> 这个文件你按照多大分辨率播放预览的？你可以抓一张，然后看看文件大小是多少字节？</p>
]]></description><link>http://forum.veye.cc/post/4547</link><guid isPermaLink="true">http://forum.veye.cc/post/4547</guid><dc:creator><![CDATA[veye_xumm]]></dc:creator><pubDate>Tue, 05 Nov 2024 07:55:48 GMT</pubDate></item><item><title><![CDATA[Reply to SC535M设置默认相机参数画面显示不正常的问题 on Tue, 05 Nov 2024 07:53:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/veye_xumm" aria-label="Profile: veye_xumm">@<bdi>veye_xumm</bdi></a></p>
<p dir="auto"><img src="/assets/uploads/files/1730792982068-a0f5ac24-fb5e-44e5-acfa-334c4c4864ef-image.png" alt="a0f5ac24-fb5e-44e5-acfa-334c4c4864ef-image.png" class=" img-fluid img-markdown" /><br />
你好 在使用了</p>
<pre><code>v4l2-ctl -d /dev/video3 --set-ctrl preferred_stride=2560 --set-fmt-video=width=2448,height=2048,pixelformat=GREY --stream-mmap --stream-count=30 --stream-to=v3.raw
</code></pre>
<p dir="auto">之后，我得到了v3.raw，然后我发现效果像是preferred_stride设置并没有生效</p>
]]></description><link>http://forum.veye.cc/post/4546</link><guid isPermaLink="true">http://forum.veye.cc/post/4546</guid><dc:creator><![CDATA[Dangal]]></dc:creator><pubDate>Tue, 05 Nov 2024 07:53:28 GMT</pubDate></item><item><title><![CDATA[Reply to SC535M设置默认相机参数画面显示不正常的问题 on Tue, 05 Nov 2024 02:41:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dangal" aria-label="Profile: dangal">@<bdi>dangal</bdi></a> 参考一下8.1和8.2 <a href="https://wiki.veye.cc/index.php/Mv_series_camera_appnotes_4_jetson/zh#Application_demo" rel="nofollow ugc">https://wiki.veye.cc/index.php/Mv_series_camera_appnotes_4_jetson/zh#Application_demo</a></p>
]]></description><link>http://forum.veye.cc/post/4540</link><guid isPermaLink="true">http://forum.veye.cc/post/4540</guid><dc:creator><![CDATA[veye_xumm]]></dc:creator><pubDate>Tue, 05 Nov 2024 02:41:27 GMT</pubDate></item><item><title><![CDATA[Reply to SC535M设置默认相机参数画面显示不正常的问题 on Tue, 05 Nov 2024 02:40:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dangal" aria-label="Profile: dangal">@<bdi>dangal</bdi></a> 注意下你的v4l2-ctl 需使用 -d /dev/video* 参数来指明配置到哪个摄像头。</p>
]]></description><link>http://forum.veye.cc/post/4539</link><guid isPermaLink="true">http://forum.veye.cc/post/4539</guid><dc:creator><![CDATA[veye_xumm]]></dc:creator><pubDate>Tue, 05 Nov 2024 02:40:13 GMT</pubDate></item><item><title><![CDATA[Reply to SC535M设置默认相机参数画面显示不正常的问题 on Mon, 04 Nov 2024 10:49:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/veye_xumm" aria-label="Profile: veye_xumm">@<bdi>veye_xumm</bdi></a><br />
现在有一个问题就是opencv无法设置到2560，我试过了 如果v4l2设置了2448，但是opencv宽度改成2304，那么用qv4l2打开发现，最后的宽度还是2304，现在有个问题是我这边需要大于500w像素，2448<em>2048=5013504，但是这个在jetson系列上显示不正常，如果用v4l2-ctl的话，则它只能抓一帧存到本地文件里，无法达到实时预览的效果，2304虽然正常，但是2304</em>2048=4718592，和我想要达到大于500w还是有一定的差距.<br />
如果用c++开发，能不能提供c++的例程或者是相关SDK?</p>
]]></description><link>http://forum.veye.cc/post/4538</link><guid isPermaLink="true">http://forum.veye.cc/post/4538</guid><dc:creator><![CDATA[Dangal]]></dc:creator><pubDate>Mon, 04 Nov 2024 10:49:20 GMT</pubDate></item><item><title><![CDATA[Reply to SC535M设置默认相机参数画面显示不正常的问题 on Mon, 04 Nov 2024 09:03:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/veye_xumm" aria-label="Profile: veye_xumm">@<bdi>veye_xumm</bdi></a><br />
在测量过程中，还存在一个问题，即设置了v4l2-ctl的这些参数后 只有第一路/dev/video0 是不正常的，其他路都是正常的，开始怀疑是摄像头的问题，但是发现对调后仍然是/dev/video0 显示不正常，看起来就像是参数设置没有生效一样 但实际用opencv的show_grey.py例程 /dev/video0是显示正常的 是这些参数有什么先后顺序的问题吗？我也调整过参数的设置顺序，但还是会出现问题</p>
]]></description><link>http://forum.veye.cc/post/4537</link><guid isPermaLink="true">http://forum.veye.cc/post/4537</guid><dc:creator><![CDATA[Dangal]]></dc:creator><pubDate>Mon, 04 Nov 2024 09:03:07 GMT</pubDate></item><item><title><![CDATA[Reply to SC535M设置默认相机参数画面显示不正常的问题 on Mon, 04 Nov 2024 08:27:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dangal" aria-label="Profile: dangal">@<bdi>dangal</bdi></a><br />
opencv库对于这种内存对齐的特殊处理不完善。建议你如果想使用opencv开发，就用256的整数倍作为width。<br />
使用c/c++可以结合prefer stride，不受此限制。</p>
]]></description><link>http://forum.veye.cc/post/4535</link><guid isPermaLink="true">http://forum.veye.cc/post/4535</guid><dc:creator><![CDATA[veye_xumm]]></dc:creator><pubDate>Mon, 04 Nov 2024 08:27:44 GMT</pubDate></item><item><title><![CDATA[Reply to SC535M设置默认相机参数画面显示不正常的问题 on Mon, 04 Nov 2024 06:32:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/veye_xumm" aria-label="Profile: veye_xumm">@<bdi>veye_xumm</bdi></a> 我猜，应该是 opencv它获取了sensor的最大宽度，你不能设置比它传感器更大的宽度，因为2448是可以设置的，但是显示不正常，我把width设置成2304，也是可以的</p>
]]></description><link>http://forum.veye.cc/post/4532</link><guid isPermaLink="true">http://forum.veye.cc/post/4532</guid><dc:creator><![CDATA[Dangal]]></dc:creator><pubDate>Mon, 04 Nov 2024 06:32:26 GMT</pubDate></item><item><title><![CDATA[Reply to SC535M设置默认相机参数画面显示不正常的问题 on Mon, 04 Nov 2024 06:28:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/veye_xumm" aria-label="Profile: veye_xumm">@<bdi>veye_xumm</bdi></a></p>
<pre><code>jetson-tx2@ubuntu:/usr/local/src/nvidia_jetson_veye_bsp/samples/opencv/raw_camera$ cat 5wb-cam.py
import cv2
import argparse
import subprocess

def main():
    # Set up command-line argument parser
    parser = argparse.ArgumentParser(description='Real-time display of GREY image from /dev/video0')
    parser.add_argument('--roix', type=int, default=0, help='roi start x (default: 0)')
    parser.add_argument('--roiy', type=int, default=0, help='roi start y (default: 0)')
    parser.add_argument('--width', type=int, default=2448, help='image width (default: 1280)')
    parser.add_argument('--height', type=int, default=2048, help='image height (default: 960)')
    parser.add_argument('--fps', type=int, default=30, help='frame rate (default: 30)')
    parser.add_argument('--preferred_stride', type=int, default=2560,help='preferred stride(default: 2560)')
    args = parser.parse_args()

    v4l2_cmd = "v4l2-ctl -d /dev/video0 --set-ctrl roi_x=%d" % args.roix
    subprocess.call(v4l2_cmd, shell=True)

    v4l2_cmd = "v4l2-ctl -d /dev/video0 --set-ctrl roi_y=%d" % args.roiy
    subprocess.call(v4l2_cmd, shell=True)

    v4l2_cmd = "v4l2-ctl -d /dev/video0 --set-fmt-video=width=%d,height=%d,pixelformat=GREY" % (args.width,args.height)
    subprocess.call(v4l2_cmd, shell=True)

    v4l2_cmd = "v4l2-ctl -d /dev/video0 --set-ctrl frame_rate=%d" % args.fps
    subprocess.call(v4l2_cmd, shell=True)

    v4l2_cmd = "v4l2-ctl --set-ctrl preferred_stride=%d " % args.preferred_stride
    subprocess.call(v4l2_cmd, shell=True)


    v4l2_cmd = "v4l2-ctl -d /dev/video1 --set-ctrl roi_x=%d" % args.roix
    subprocess.call(v4l2_cmd, shell=True)

    v4l2_cmd = "v4l2-ctl -d /dev/video1 --set-ctrl roi_y=%d" % args.roiy
    subprocess.call(v4l2_cmd, shell=True)

    v4l2_cmd = "v4l2-ctl -d /dev/video1 --set-fmt-video=width=%d,height=%d,pixelformat=GREY" % (args.width,args.height)
    subprocess.call(v4l2_cmd, shell=True)

    v4l2_cmd = "v4l2-ctl -d /dev/video1 --set-ctrl frame_rate=%d" % args.fps
    subprocess.call(v4l2_cmd, shell=True)

    v4l2_cmd = "v4l2-ctl --set-ctrl preferred_stride=%d " % args.preferred_stride
    subprocess.call(v4l2_cmd, shell=True)

    v4l2_cmd = "v4l2-ctl -d /dev/video2 --set-ctrl roi_x=%d" % args.roix
    subprocess.call(v4l2_cmd, shell=True)

    v4l2_cmd = "v4l2-ctl -d /dev/video2 --set-ctrl roi_y=%d" % args.roiy
    subprocess.call(v4l2_cmd, shell=True)

    v4l2_cmd = "v4l2-ctl -d /dev/video2 --set-fmt-video=width=%d,height=%d,pixelformat=GREY" % (args.width,args.height)
    subprocess.call(v4l2_cmd, shell=True)

    v4l2_cmd = "v4l2-ctl -d /dev/video2 --set-ctrl frame_rate=%d" % args.fps
    subprocess.call(v4l2_cmd, shell=True)

    v4l2_cmd = "v4l2-ctl --set-ctrl preferred_stride=%d " % args.preferred_stride
    subprocess.call(v4l2_cmd, shell=True)

    v4l2_cmd = "v4l2-ctl -d /dev/video3 --set-ctrl roi_x=%d" % args.roix
    subprocess.call(v4l2_cmd, shell=True)

    v4l2_cmd = "v4l2-ctl -d /dev/video3 --set-ctrl roi_y=%d" % args.roiy
    subprocess.call(v4l2_cmd, shell=True)

    v4l2_cmd = "v4l2-ctl -d /dev/video3 --set-fmt-video=width=%d,height=%d,pixelformat=GREY" % (args.width,args.height)
    subprocess.call(v4l2_cmd, shell=True)

    v4l2_cmd = "v4l2-ctl -d /dev/video3 --set-ctrl frame_rate=%d" % args.fps
    subprocess.call(v4l2_cmd, shell=True)

    v4l2_cmd = "v4l2-ctl --set-ctrl preferred_stride=%d " % args.preferred_stride
    subprocess.call(v4l2_cmd, shell=True)

    v4l2_cmd = "v4l2-ctl -d /dev/video4 --set-ctrl roi_x=%d" % args.roix
    subprocess.call(v4l2_cmd, shell=True)

    v4l2_cmd = "v4l2-ctl -d /dev/video4 --set-ctrl roi_y=%d" % args.roiy
    subprocess.call(v4l2_cmd, shell=True)

    v4l2_cmd = "v4l2-ctl -d /dev/video4 --set-fmt-video=width=%d,height=%d,pixelformat=GREY" % (args.width,args.height)
    subprocess.call(v4l2_cmd, shell=True)

    v4l2_cmd = "v4l2-ctl -d /dev/video4 --set-ctrl frame_rate=%d" % args.fps
    subprocess.call(v4l2_cmd, shell=True)

    v4l2_cmd = "v4l2-ctl --set-ctrl preferred_stride=%d " % args.preferred_stride
    subprocess.call(v4l2_cmd, shell=True)


    # Open the /dev/video0 device
    cap0 = cv2.VideoCapture('/dev/video0',cv2.CAP_V4L)
    cap1 = cv2.VideoCapture('/dev/video1',cv2.CAP_V4L)
    cap2 = cv2.VideoCapture('/dev/video2',cv2.CAP_V4L)
    cap3 = cv2.VideoCapture('/dev/video3',cv2.CAP_V4L)
    cap4 = cv2.VideoCapture('/dev/video4',cv2.CAP_V4L)
    if not cap0.isOpened():
        print("Failed to open /dev/video0")
        return

    if not cap1.isOpened():
        print("Failed to open /dev/video1")
        return


    if not cap2.isOpened():
        print("Failed to open /dev/video2")
        return


    if not cap3.isOpened():
        print("Failed to open /dev/video3")
        return

    if not cap3.isOpened():
        print("Failed to open /dev/video4")
        return
    # Set the image size
    cap0.set(cv2.CAP_PROP_FRAME_WIDTH, 2560)
    cap0.set(cv2.CAP_PROP_FRAME_HEIGHT, args.height)

    cap1.set(cv2.CAP_PROP_FRAME_WIDTH, 2560)
    cap1.set(cv2.CAP_PROP_FRAME_HEIGHT, args.height)

    cap2.set(cv2.CAP_PROP_FRAME_WIDTH, 2560)
    cap2.set(cv2.CAP_PROP_FRAME_HEIGHT, args.height)

    cap3.set(cv2.CAP_PROP_FRAME_WIDTH, 2560)
    cap3.set(cv2.CAP_PROP_FRAME_HEIGHT, args.height)

    cap4.set(cv2.CAP_PROP_FRAME_WIDTH, 2560)
    cap4.set(cv2.CAP_PROP_FRAME_HEIGHT, args.height)

    # Calculate the aligned width
    #aligned_width = (args.width + 3)&amp; ~3

    # Loop over frames and display them
    while True:
        # Read a frame
        ret0, frame0   = cap0.read()
        ret1, frame1   = cap1.read()
        ret2, frame2   = cap2.read()
        ret3, frame3   = cap3.read()
        ret4, frame4   = cap4.read()
        # Check if reading was successful
        if not ret0:
            print("Failed to read frame from /dev/video0")
            break

        if not ret1:
            print("Failed to read frame from /dev/video1")
            break

        if not ret2:
            print("Failed to read frame from /dev/video2")
            break

        if not ret3:
            print("Failed to read frame from /dev/video3")
            break

        if not ret4:
            print("Failed to read frame from /dev/video4")
            break
        #if frame.shape[1]!= aligned_width:
        #    aligned_frame = np.zeros((args.height, aligned_width), dtype=np.uint8)
        #    aligned_frame[:, args.width] = frame
        #    frame = aligned_frame
        # Display the frame
        cv2.imshow('preview (video0)', frame0)
        cv2.imshow('preview (video1)', frame1)
        cv2.imshow('preview (video2)', frame2)
        cv2.imshow('preview (video3)', frame3)
        cv2.imshow('preview (video4)', frame4)
        # Exit if 'q' key is pressed
        if cv2.waitKey(1) &amp; 0xFF == ord('q'):
            break

    # Release resources
    cap0.release()
    cap1.release()
    cap2.release()
    cap3.release()
    cap4.release()
    cv2.destroyAllWindows()

if __name__ == '__main__':
    main()
jetson-tx2@ubuntu:/usr/local/src/nvidia_jetson_veye_bsp/samples/opencv/raw_camera$ python 5wb-cam.py
VIDEOIO ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV
VIDEOIO ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV
VIDEOIO ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV
VIDEOIO ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV
VIDEOIO ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV
VIDIOC_STREAMON: Invalid argument
VIDIOC_STREAMON: Invalid argument
VIDIOC_STREAMON: Invalid argument
VIDIOC_STREAMON: Invalid argument
VIDIOC_STREAMON: Invalid argument
Failed to read frame from /dev/video0
jetson-tx2@ubuntu:/usr/local/src/nvidia_jetson_veye_bsp/samples/opencv/raw_camera$

</code></pre>
<p dir="auto">这样修改之后 opencv就报错了 它不支持2560这样一个比较大的参数</p>
]]></description><link>http://forum.veye.cc/post/4531</link><guid isPermaLink="true">http://forum.veye.cc/post/4531</guid><dc:creator><![CDATA[Dangal]]></dc:creator><pubDate>Mon, 04 Nov 2024 06:28:10 GMT</pubDate></item><item><title><![CDATA[Reply to SC535M设置默认相机参数画面显示不正常的问题 on Mon, 04 Nov 2024 06:14:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dangal" aria-label="Profile: dangal">@<bdi>dangal</bdi></a><br />
你好，盲猜一个，你把下面这个函数的width变量也写作2560试一下。<br />
cap0.set(cv2.CAP_PROP_FRAME_WIDTH, args.width)</p>
]]></description><link>http://forum.veye.cc/post/4530</link><guid isPermaLink="true">http://forum.veye.cc/post/4530</guid><dc:creator><![CDATA[veye_xumm]]></dc:creator><pubDate>Mon, 04 Nov 2024 06:14:33 GMT</pubDate></item></channel></rss>