uvcstill.py 文件源码

python
阅读 72 收藏 0 点赞 0 评论 0

项目:OverviewOne 作者: SpaceVR-O1 项目源码 文件源码
def test_all_cameras(numCams, width, height):
    for i in range(0, numCams):

        print("  cam %d : " % i, end="")
        p = subprocess.Popen(
            ["sudo", "./snapshot", "/dev/null", "--dev", ("/dev/still%d" % i), "--format", "none", "--size", str(width), str(height), "--suspend", "--resume"],
            stdout=subprocess.PIPE)
        try:
            (output, err) = p.communicate(timeout=30)
            output_str = output.decode("utf-8")

            if re.search(r"\*FULL\*", output_str, flags=re.MULTILINE):
                print("OK")
            elif re.search(r"\*INCOMPLETE\*", output_str, flags=re.MULTILINE):
                print("INCOMPLETE")
            else:
                print("*** FAILED ***")
                print("Kernel log:")
                print(get_kern_log(10))

        except subprocess.TimeoutExpired:
            print("TIMEOUT")


# Read an image from each camera and save it to disk.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号