SDK and Examples for Nvidia Jetson
1. Overview
Arducam USB camera shield works on different hardware platforms including the Nvidia Jetson boards. Unlike the UVC camera, the USB camera shield requires a proprietary camera SDK for Jetson Linux system. Both C/C++ and Python SDK are supported, and there are ready to go OpenCV examples and configuration files for a given camera breakout board.
2. Install the library and OpenCV Environment
2.1 Build and install arducam_config_parser
- Build
git clone https://github.com/ArduCAM/arducam_config_parser.git
cd arducam_config_parser/src
make clean && make
- Install
make install
2.2 Downlaod and install the latest libusb
- Download the libusb
- Copy the libusb-xxx.tar.bz to the Pi then run the following command to unzip it.[xxx:version number]
tar -jxvf libusb-xxx.tar.bz2
- Before compilation, Run the following commands to config it
cd libusb-xxx
./configure --disable-udev
- Install the libusb library
sudo make install
3. C++ SDK and example
3.1 Install Opencv and g++ compiler
- Install opencv
sudo apt-get install libopencv-dev
- Install g++ compiler[the version number of g++ should more than 4.8]
sudo apt-get install g++-4.8
3.2 Install the SDK
- Run the following command to install SDK
make install-sdk
3.3 Compile the example source code
- Run the following command to compile the source code
make
3.4 Streaming example
sudo ./ArduCam_Demo <path/config-file-name>
example:
cd ArduCAM_USB_Camera_Shield/RaspberryPi/Cpp/Streaming_demo
sudo ./ArduCam_Demo ../../../Config/USB2.0_UC-391_Rev.D/AR0134_RAW_8b_1280x964_31fps.cfg
While the program is running, you can press the following buttons in the terminal:
1.’s’:Save the image to the images folder. 2.’c’:Stop saving images. 3.’q’:Stop running the program.
3.5 External trigger example
sudo ./ArduCam_Ext_Trigger_Demo <path/config-file-name
example:
cd ArduCAM_USB_Camera_Shield/RaspberryPi/Cpp/External_trigger_demo
sudo ./ArduCam_Ext_Trigger_Demo ../../../Config/USB2.0_UC-391_Rev.D/AR0134_RAW_8b_1280x964_31fps.cfg
press Ctrl+C exit
4. Python SDK and examples
4.1 Install Python 2.7 and python-opencv
Notice: On raspberry Pi platform we advise use Python 2.7
sudo apt-get install python2.7-dev
- For Python3
sudo apt-get install python3.x-dev
- Install opencv
sudo apt-get install python-opencv
4.2 Example Usuage
4.2.1 Streaming demo
cd ArduCAM_USB_Camera_Shield/RaspberryPi/Python/Streaming_demo/
sudo python ArduCam_Py_Demo.py <path/config-file-name>
example:
sudo python ArduCam_Py_Demo.py ../../../Config/USB2.0_UC-391_Rev.D/AR0134_RAW_8b_1280x964_31fps.cfg
While the program is running, you can press the following buttons in the terminal:
- ‘s’ + Enter:Save the image to the images folder.
- ‘c’ + Enter:Stop saving images.
- ‘q’ + Enter:Stop running the program.
4.2.2 External trigger demo
cd ArduCAM_USB_Camera_Shield/RaspberryPi/Python/External_trigger_demo.py/
sudo python ArduCam_Ext_Trigger_Demo.py <path/config-file-name>
example:
sudo python ArduCam_Ext_Trigger_Demo.py ../../../Config/USB2.0_UC-391_Rev.D/AR0134_RAW_8b_1280x964_31fps.cfg
Press Ctrl+C to exit the demo.