RVC  1.10.0
a product by RVBUST.
RVC quick start

Start your first program

This is a simple example to help you started with RVC 3D camera.

// Include files to use the RVC API.
#include <RVC/RVC.h>
// Namespace for using RVC object.
using namespace RVC;
int main(int argc, char *argv[]) {
// Before using any RVC methods, the RVC system must be initialized.
// The parameter d_num is the maximum number of avaliable Device which user desire to list.
const int d_num = 10;
// Create Device array.
RVC::Device devices[10];
// The parameter actual_size can be used to record the actual avaliable Devices number.
size_t actual_size = 0;
// List avaliable GigE Devices.
SystemListDevices(devices, d_num, &actual_size, RVC::SystemListDeviceType::GigE);
// Check the number of Devices actually searched. If no device is found, terminate the program.
if (actual_size == 0) {
return -1;
}
// Create X1 object which choose the first Device and the right camera.
RVC::X1 x1 = RVC::X1::Create(devices[0], RVC::CameraID_Right);
// Open X1.
x1.Open();
// If X1 is not open, Destroy X1 and shutdown the system.
if (!x1.IsOpen()) {
return 1;
}
// Capture with default capture setting to get 3D point map and 2D image.
bool cap_state = x1.Capture();
// If Capture success, get the data.
if (cap_state) {
// Get 3D point map.
// Get 2D image.
RVC::Image img = x1.GetImage();
}
// Close X1.
x1.Close();
// Destroy X1.
// Releases all RVC resources.
return 0;
}

It contains five part, which are described as bellow.

System initialize

Initialize the RVC system

// Before using any RVC methods, the RVC system must be initialized.

List devices

Find device of given SystemListDeviceType

// The parameter d_num is the maximum number of avaliable Device which user desire to list.
const int d_num = 10;
// Create Device array.
RVC::Device devices[10];
// The parameter actual_size can be used to record the actual avaliable Devices number.
size_t actual_size = 0;
// List avaliable GigE Devices.
SystemListDevices(devices, d_num, &actual_size, RVC::SystemListDeviceType::GigE);

Check the number of cameras actually searched. If no device is found, terminate the program.

// Check the number of Devices actually searched. If no device is found, terminate the program.
if (actual_size == 0) {
return -1;
}

Create X1 object

Select one device from the avaliable devices and select CameraID_Left or CameraID_Right camera to create X1 object.

// Create X1 object which choose the first Device and the right camera.
RVC::X1 x1 = RVC::X1::Create(devices[0], RVC::CameraID_Right);

Open X1 and check whether it has been opened.

// Open X1.
x1.Open();
// If X1 is not open, Destroy X1 and shutdown the system.
if (!x1.IsOpen()) {
return 1;
}

X1 Capture

Capture with default setting to get 3D point map and 2D image

// Capture with default capture setting to get 3D point map and 2D image.
bool cap_state = x1.Capture();

Get 3D point map and 2D image data

// If Capture success, get the data.
if (cap_state) {
// Get 3D point map.
// Get 2D image.
RVC::Image img = x1.GetImage();
}

Destroy X1 object

Close X1 and destroy this object.

// Close X1.
x1.Close();
// Destroy X1.

Shutdown RVC system

Shutdown the RVC system

// Releases all RVC resources.
RVC::X1::GetPointMap
PointMap GetPointMap()
Get the Point Map object.
RVC::X1::GetImage
Image GetImage()
Get the Image object.
RVC
RVC namespace.
Definition: QuickStart.dox:1
RVC::X1::IsOpen
bool IsOpen()
Check X1 is open or not.
RVC::X1::Open
bool Open()
Open X1 before you use it.
RVC::X1::Close
void Close()
Close X1 after you Open it.
RVC::SystemListDevices
RVC_EXPORT int SystemListDevices(Device *pdevices, size_t size, size_t *actual_size, SystemListDeviceType::Enum opt=SystemListDeviceType::All)
List the fix number devices.
RVC::X1::Destroy
static void Destroy(X1 &x)
Release all X1 resources after you use X1.
RVC::X1::Create
static X1 Create(const Device &d, enum CameraID camid=CameraID_Left)
Create a RVC X Camera and choose the CameraID which you desire before you use X1.
RVC::SystemShutdown
RVC_EXPORT void SystemShutdown()
SystemShutdown.
RVC::Image
RVC X Image object.
Definition: RVC.h:303
RVC::PointMap
RVC X PointMap.
Definition: RVC.h:536
RVC::SystemInit
RVC_EXPORT bool SystemInit()
SystemInit.
RVC::Device
Device struct.
Definition: RVC.h:811
RVC::X1
X1 struct.
Definition: RVC.h:964
RVC::X1::Capture
bool Capture(const CaptureOptions &opts)
Capture one point map and one image. This function will save capture options into camera.