SDK Function Reference:C++ Language

Ovrvision Class

Ovrvision() constructor

Returns
Ovrvision classCreate Ovrvision class
Description
This class is for operating the camera of Ovrvision.

int Open(int locationID, OVR::Camprop flag)

Parameters
int locationIDConnection number
OVR::Camprop flagCamera property
OV_CAMVGA_FULL:640x480 @60fps x2 High(Default)
OV_CAMVGA_SVGA:800x600 @30fps x2 Slow
Returns
intIf successful, the return value is OV_RESULT_OK(0)
Description
Open the Ovrvision of specified number by locationID.
If two or more Ovrvision are connected to the computer, the locationID is need to specify.
Camera property sets how to start the camera.

void Close()

Description
Close the Ovrvision of camera. Please close always at the application end.

void PreStoreCamData()

Description
This method takes the same time the image from both Ovrvision of camera.
Examples
g_pOvrvision->PreStoreCamData();
unsigned char* p = g_pOvrvision->GetCamImage(OVR::OV_CAMEYE_LEFT, OV_PSQT_HIGH);
unsigned char* p2 = g_pOvrvision->GetCamImage(OVR::OV_CAMEYE_RIGHT, OV_PSQT_HIGH);

unsigned char* GetCamImage(OVR::Cameye eye, OvPSQuality processing)

Parameters
OVR::Cameye eyeCamera specification
OV_CAMEYE_LEFT:The left-eye camera
OV_CAMEYE_RIGHT:The right-eye camera
OvPSQuality processingSet an image processing method.
OV_PSQT_NONE:Unedited
OV_PSQT_LOW:Rough processing(high
OV_PSQT_HIGH:Beautiful processing(slow)
OV_PSQT_REFSET:The process of only reversal for DK2
Returns
unsigned char*Camera of RGB data is returned.
There is data in the SDK inside.
Description
Get the image from the camera, and returns a pointer to the data with the internal class that image has entered.
Image has the number of pixels in the RGB data composed of 8 bits. e.g.) 640x480x3(RGB)=921,600 bytes
OvPSQuality set what happens to the image processing such as distortion correction.
Examples
g_pOvrvision->PreStoreCamData();
unsigned char* p = g_pOvrvision->GetCamImage(OVR::OV_CAMEYE_LEFT, OV_PSQT_HIGH);
unsigned char* p2 = g_pOvrvision->GetCamImage(OVR::OV_CAMEYE_RIGHT, OV_PSQT_HIGH);
if(p!=NULL){/*Process*/}
if(p2!=NULL){/*Process*/}

void GetCamImage(unsigned char* pImageBuf, OVR::Cameye eye, OvPSQuality processing)

Parameters
unsigned char* pImageBufDestination pointer of image
OVR::Cameye eyeCamera specification
OV_CAMEYE_LEFT:The left-eye camera
OV_CAMEYE_RIGHT:The right-eye camera
OvPSQuality processingSet an image processing method.
OV_PSQT_NONE:Unedited
OV_PSQT_LOW:Rough processing(high
OV_PSQT_HIGH:Beautiful processing(slow)
OV_PSQT_REFSET:The process of only reversal for DK2
Returns
unsigned char*Camera of RGB data is returned.
There is data in the SDK inside.
Description
Get the image of the camera, and return the data buffer to "unsigned char* pImage".
Image has the number of pixels in the RGB data composed of 8 bits. e.g.) 640x480x3(RGB)=921,600 bytes
OvPSQuality set what happens to the image processing such as distortion correction.

void GetCamImageMJPEG(unsigned char* pImageBuf, int* pSize, OVR::Cameye eye)

Parameters
unsigned char* pImageBufDestination pointer of JPEG image.
int* pSizeReturns the JPEG image size.
OVR::Cameye eyeCamera specification
OV_CAMEYE_LEFT:The left-eye camera
OV_CAMEYE_RIGHT:The right-eye camera
Description
Get the JPEG image data of the camera, and return the data buffer to "unsigned char* pImage".
The camera data is not RGB data, It is JPEG data.

bool PutHandInFrontOfCamera(unsigned char thres_less, unsigned char* pImageBuf)

Parameters
unsigned char thres_lessThe threshold value of darkness
char* pImageBufThe image buffer got by GetCamImage()
Returns
boolWhen less than a threshold value, true returns.
Description
If a camera has a hand covered, true will be returned to it.
This is used for changing into a game at camera mode etc.

bool SetParamXMLfromFile(char* filename)

Parameters
char* filenameRead destination full path
When you set a NULL, it is the default fixed path.
Returns
boolTrue is returned on success .
Description
Reads the config file from the XML file, and set to Ovrvision.

bool SaveParamXMLtoFile(char* savefilename)

Parameters
char* savefilenameDestination full path
When you set a NULL, it is the default fixed path.
Returns
boolTrue is returned on success .
Description
Config of the Ovrvision, and then saved in XML format to the specified file path.

void SetExposure(int value)

Parameters
int valueValue
OV_SET_AUTOMODE:Automatic(Default)
Range of 0 - 5 value:The lower the value, the exposure is large.
Description
Set exposure of the Ovrvision.

void SetWhiteBalance(int value)

Parameters
int valueValue
OV_SET_AUTOMODE:Automatic(Default)
Range of 2800 - 6500 value:Specified in the color temperature.
Description
Set color temperature of the Ovrvision.

void SetContrast(int value)

Parameters
int valueValue
Range of 0 - 127 value:The lower the value, the contrast is weak.(Default:32)
Description
Set contrast of the Ovrvision.

void SetSaturation(int value)

Parameters
int valueValue
Range of 0 - 127 value:The lower the value, the saturation is weak.(Default:40)
Description
Set saturation of the Ovrvision.

void SetBrightness(int value)

Parameters
int valueValue
Range of 0 - 255 value:The lower the value, the color becomes dark(Default:100)
Description
Set brightness of the Ovrvision.

void SetSharpness(int value)

Parameters
int valueValue
Range of 0 - 15 value:The lower the value, the sharp is weak.(Default:2)
Description
Set image edge of the Ovrvision.

void SetGamma(int value)

Parameters
int valueValue
Range of 0 - 15 value:The lower the value, the gamma is weak(Default:7)
Description
Set gamma of the Ovrvision.

int GetExposure()

Returns
intValue
Description
Get exposure value of the Ovrvision.

int GetWhiteBalance()

Returns
intValue
Description
Get color temperature value of the Ovrvision.

int GetContrast()

Returns
intValue
Description
Get contrast value of the Ovrvision.

int GetSaturation()

Returns
intValue
Description
Get saturation value of the Ovrvision.

int GetBrightness()

Returns
intValue
Description
Get brightness value of the Ovrvision.

int GetSharpness()

Returns
intValue
Description
Get image edge value of the Ovrvision.

int GetGamma()

Returns
intValue
Description
Get gamma value of the Ovrvision.

float GetFocalPoint()

Returns
floatfocalpoint
Description
Get focalpoint value of the Ovrvision.
This is necessary in the AR config.

Camprop GetCameraProperty()

Returns
OVR::CampropCamera specification
OV_CAMEYE_LEFT:The left-eye camera
OV_CAMEYE_RIGHT:The right-eye camera
Description
Returns the ovrvision property.

CamStatus GetCameraStatus()

Returns
OVR::CamStatusCamera status
OV_CAMCLOSED:Ovrvision is stop.
OV_CAMOPENED:Ovrvision is runnnig.
Description
Returns the ovrvision status.

int GetPixelSize()

Returns
intPixel size
Description
Returns the Pixel size.
Default value is [3].

int GetImageWidth()

Returns
intWidth resolution of the camera
Description
Returns the width resolution of the Ovrvision.

int GetImageHeight()

Returns
intHeight resolution of the camera
Description
Returns the height resolution of the Ovrvision.

int GetImageRate()

Returns
intFramerate of the camera
Description
Returns the framerate of the Ovrvision.

int GetBufferSize()

Returns
intBuffer size
Description
Returns the buffer size of the Ovrvision.
e.g.) 640x480x3 = [921,600] byte

int GetOculusRightGap()

Returns
intGap value
Description
Get gap value of the right eye in order to set in the Oculus Rift SDK side.
This is necessary in the AR config.

OvrvisionAR Class

OvrvisionAR(float markersize_meter, int w, int h, float focalPoint) Constractor

Parameters
float markersize_meterThe size of the marker (Meters specified)
int wWidth resolution of the camera
int hHeight resolution of the camera
float focalPointFocal point of the camera
Returns
OvrvisionAR classCreate OvrvisionAR class
Description
This class is for the marker AR in Ovrvision.
Examples
g_pOvrvision = new OVR::Ovrvision();
g_pOvrvision->Open(0,OVR::OV_CAMVGA_FULL);
g_pOvrvisionAR = new OVR::OvrvisionAR(0.15f,CAM_WIDTH,CAM_HEIGHT,g_pOvrvision->GetFocalPoint());

void SetImageRGB(unsigned char* pImage)

Parameters
unsigned char* pImageImage data already stored pointer
Description
Set the pointer of the RGB image buffer.

void Render()

Description
Referring to set images to detect the AR marker. If you have set a new image , it is always necessary before you call the GetMarkerData.
Examples
g_pOvrvisionAR->SetImageRGB(pImage);
g_pOvrvisionAR->Render();
OVR::OvMarkerData* dt = g_pOvrvisionAR->GetMarkerData();
for(int i=0; i < g_pOvrvisionAR->GetMarkerDataSize(); i++){/*Process*/}

int GetMarkerDataSize()

Returns
intMarkers
Description
Get the number of detection can be markers .

OVR::OvMarkerData* GetMarkerData();

Returns
OvMarkerData*Marker data
Description
Datas that has been detected in the Render() method is stored.
Examples
g_pOvrvisionAR->SetImageRGB(pImage);
g_pOvrvisionAR->Render();
OVR::OvMarkerData* dt = g_pOvrvisionAR->GetMarkerData();
for(int i=0; i < g_pOvrvisionAR->GetMarkerDataSize(); i++){/*Process*/}

OVR::OvMarkerData* GetMarkerData(int idx)

Parameters
int idxIndex of marker data
Returns
OvMarkerData*The detected marker data
Description
One data that has been detected in the Render() method is stored.

void SetMarkerSizeMeter(float value)

Parameters
float valueThe size of the marker (Meters specified)
Description
Set the marker size in metric.

float GetMarkerSizeMeter()

Returns
floatThe size of the marker (Meters specified)
Description
Get the marker size.

Front page   Edit Freeze Diff Backup Upload Copy Rename Reload   New List of pages Search Recent changes   Help   RSS of recent changes
Last-modified: 2015-02-12 (Thu) 08:00:40 (1530d)