2732 views|5 replies

364

Posts

0

Resources
The OP
 

RV1106 hand-in-hand teaching you: 4 lines of code use the Linux v4l2 interface to call the USB camera to take pictures and save them continuously [Copy link]

 

邀请:@常见泽1   @jinglixixi   @hujj   @kiverin   参与回复

This post was last edited by LitchiCheng on 2024-3-9 21:21

The C++ library is encapsulated for v4l2, which is convenient for integration with other tests later. The warehouse address is as follows. If you are interested, you can clone it. Please give it a star.

LitchiCheng/RV1106_Linux: Linux test for RV1106 dev board (github.com)

The following is the test code for calling the USB camera and saving continuous photos

#include <iostream>
#include "v4l2CapPicTool.h"
#include "timecost.h"

int main(int argc, char const *argv[])
{
    v4l2CapPicTool vt("/dev/video0", 1080, 960, "jpg");
    vt.init();
    while (1){
        usleep(100000);
        {
            timecost tmp("capture");
            vt.capture();
        }  
        {
            timecost tmp("save");
            vt.save("./test.jpg"); 
        }
    }
    return 0;
}

Simultaneous testing, capture time

pico@luckfox:~$ sudo ./captureJpgApp
init success
capturetime spent:0.382155sec
savetime spent:0.003527sec
capturetime spent:0.073295sec
savetime spent:0.001937sec
capturetime spent:0.030448sec
savetime spent:0.003411sec
capturetime spent:0.025701sec
savetime spent:0.001992sec
capturetime spent:0.031095sec
savetime spent:0.003586sec
capturetime spent:0.025089sec
savetime spent:0.004171sec
capturetime spent:0.02678sec
savetime spent:0.001836sec
capturetime spent:0.031064sec
savetime spent:0.001938sec

As you can see, the capture time is about 0.03s, which is 30ms per frame, corresponding to 30fps.


This post is from Domestic Chip Exchange

Latest reply

How to connect to CSI camera?   Details Published on 2024-9-18 23:13
 
 

6063

Posts

4

Resources
2
 

Thanks for sharing!

This post is from Domestic Chip Exchange

Comments

Thank you for your support  Details Published on 2024-3-10 11:20
 
 
 

364

Posts

0

Resources
3
 
damiaa posted on 2024-3-10 10:25 Thank you for sharing!

Thank you for your support

This post is from Domestic Chip Exchange
 
 
 

7171

Posts

195

Resources
4
 

Does this thing look similar to opencv?

This post is from Domestic Chip Exchange

Comments

It is not a concept. Opencv calls the camera through v4l2, but Opencv is more important for image processing.  Details Published on 2024-3-10 17:38
 
 
 

364

Posts

0

Resources
5
 
Common Ze 1 posted on 2024-3-10 11:38 Does this thing look similar to opencv?

It's not the same concept. Opencv calls the camera through v4l2, but Opencv is more important for image processing.

This post is from Domestic Chip Exchange
 
 
 

2

Posts

0

Resources
6
 

How to connect to CSI camera?

This post is from Domestic Chip Exchange
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list