RAW-MIPI-AR0234M配置为4lane模式
-
怎样在Jetson平台配置RAW-MIPI-AR0234M为4lane模式,并修改驱动和dts?
-
-
您好,我想问一下这个60帧和120帧是基于raw格式下的吗?我用opencv去获取。就是我用opencv去获取frame,只能拿到640* 480分辨率下的60帧,如果设置为1920*1200就只有大概20帧。ar0234
-
@lizi

试一下这个命令,显示的帧率是多少?export WIDTH=1920 export HEIGHT=1200 export FPS=60 v4l2-ctl --set-fmt-video=width=$WIDTH,height=$HEIGHT,pixelformat=GREY --stream-mmap --stream-count=-1 --stream-to=/dev/null -
@veye_xumm said in RAW-MIPI-AR0234M配置为4lane模式:
export WIDTH=1920
export HEIGHT=1200
export FPS=60
v4l2-ctl --set-fmt-video=width=$WIDTH,height=$HEIGHT,pixelformat=GREY --stream-mmap --stream-count=-1 --stream-to=/dev/null60帧
-
@lizi 说明相机配置没问题,还是程序效率的问题。
-
@veye_xumm

这是我的捕获代码,那就是opencv效率的问题吗 -
-
刚刚在我的代码之前加了v4l2的cmd最后还是只有大概20张
-
@lizi 什么意思?
-
@veye_xumm 就是把demo里最后循环里的cv2.imshow改成了计数。因为显示图片没法判断帧数。所以我改成了1s的计数。最后只有20

把上面demo里的代码改成了下面的计数 -
@lizi 如此说来确实有这个问题。我们主要提供好驱动,opencv不是很熟。
你用jetson平台,最好还是用带jetson的硬件加速的开发包去开发。比如CUDA之类。
我们应用层和算法都不太熟悉。你可以到英伟达的开发者网站上找找资料。 -
@veye_xumm 那有没有办法用v4l2-ctl --set-fmt-video=width=$WIDTH,height=$HEIGHT,pixelformat=GREY --stream-mmap --stream-count=-1 --stream-to=/dev/null这个捕获帧的方法去捕获图片啊,这个获取的图片是raw格式的吗?
-
@lizi
我测了一下orin nano上面,实际采集数据的帧率是没有问题的。 你可以延长你的代码的统计时间到10秒,100秒,可以发现帧率会趋近于接近60fps。那么为何出现你只统计1秒的时候,帧率只有20帧的结果呢? 我进行了一下简单的时间分析,发现是第一次调用cap.read()函数的时候,耗时大约半秒左右。(估计是底层进行buffer的初始化之类的操作。)
可以参考我贴上来这个代码:
import cv2 import argparse import subprocess import time 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=1920, help='image width (default: 640)') parser.add_argument('--height', type=int, default=1200, help='image height (default: 480)') parser.add_argument('--fps', type=int, default=60, help='frame rate (default: 30)') args = parser.parse_args() v4l2_cmd = f"v4l2-ctl --set-ctrl roi_x={args.roix}" subprocess.run(v4l2_cmd, shell=True) v4l2_cmd = f"v4l2-ctl --set-ctrl roi_y={args.roiy}" subprocess.run(v4l2_cmd, shell=True) v4l2_cmd = f"v4l2-ctl --set-fmt-video=width={args.width},height={args.height}" subprocess.run(v4l2_cmd, shell=True) v4l2_cmd = f"v4l2-ctl --set-ctrl frame_rate={args.fps}" subprocess.run(v4l2_cmd, shell=True) # Open the /dev/video0 device cap = cv2.VideoCapture('/dev/video0') if not cap.isOpened(): print("Failed to open video device") return # Set the image size cap.set(cv2.CAP_PROP_FRAME_WIDTH, args.width) cap.set(cv2.CAP_PROP_FRAME_HEIGHT, args.height) frame_num = 0 # Loop over frames and display them while True: # Read a frame ret, frame = cap.read() # Check if reading was successful if ret: if frame_num == 0: time_start = time.perf_counter() frame_num += 1 # Display the frame # cv2.imshow('VEYE MV camera GREY image preview', frame) print(f"Success save , {frame_num}") else: print("Failed to read frame") #break time_end = time.perf_counter() time_ms = (time_end - time_start)*1000 print(time_ms) if time_ms > 1000: print(frame_num) break # Exit if 'q' key is pressed if cv2.waitKey(1) & 0xFF == ord('q'): break # Release resources cap.release() cv2.destroyAllWindows() if __name__ == '__main__': main() -
@veye_xumm 好的
-
@veye_xumm 想问一下这里的曝光时间只有读取,没有写入的吗?设置曝光时间的命令是在哪里呢?在i2c.sh里
已经找到了 -
-
This post is deleted! -
@veye_xumm

安装驱动出现这个错是为什么。板子是orin-nano 8gb ,然后mipi是ar0234 -
@lizi i2c不通,你查查硬件连接,比如fpc排线方向。
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login