OvrvisionSDK  2.00
OVR::OvrvisionPro Class Reference

OvrvisionPro class. More...

#include <ovrvision_pro.h>

Public Member Functions

 OvrvisionPro ()
 Constructor.
 
 ~OvrvisionPro ()
 Destructor.
 
int Open (int locationID, OVR::Camprop prop, const char *pVendorName=NULL, int deviceType=-1, void *pD3D11Device=NULL)
 Open the Ovrvision Pro. More...
 
void Close ()
 Close the Ovrvision Pro.
 
void PreStoreCamData (OVR::Camqt qt)
 This function gets data from OvrvisionPro inside. More...
 
unsigned char * GetCamImageBGRA (OVR::Cameye eye)
 Gets the image data of 32 bits of BGRA form. More...
 
void GetCamImageBGRA (unsigned char *pImageBuf, OVR::Cameye eye)
 This function gets data from OvrvisionPro inside. More...
 
void SetCallbackImageFunction (void(*func)())
 
void GetStereoImageBGRA (unsigned char *pLeft, unsigned char *pRight, ROI roi)
 Get camera image region of interest. More...
 
bool isOpen ()
 Check whether OvrvisionPro is open. More...
 
int GetCamWidth ()
 Get the width of the Ovrvision image. More...
 
int GetCamHeight ()
 Get the height of the Ovrvision image. More...
 
int GetCamFramerate ()
 Get the framerate of the Ovrvision. More...
 
float GetCamFocalPoint ()
 Get the focal point of the Ovrvision image. More...
 
float GetHMDRightGap (int at)
 Get the gap between images for HMD. More...
 
int GetCamBuffersize ()
 Get the buffer size of the Ovrvision image. More...
 
int GetCamPixelsize ()
 Get the pixel data size. default is BGRA 4 byte. More...
 
int GetCameraExposure ()
 Get exposure value of the Ovrvision. More...
 
void SetCameraExposure (int value)
 Set exposure of the Ovrvision. More...
 
bool SetCameraExposurePerSec (float fps)
 Set exposure of the Ovrvision. More...
 
int GetCameraGain ()
 Get gain value of the Ovrvision. More...
 
void SetCameraGain (int value)
 Set gain of the Ovrvision. More...
 
int GetCameraWhiteBalanceR ()
 Get white balance R gain value of the Ovrvision. More...
 
void SetCameraWhiteBalanceR (int value)
 Set white balance R gain of the Ovrvision. More...
 
int GetCameraWhiteBalanceG ()
 Get white balance G gain value of the Ovrvision. More...
 
void SetCameraWhiteBalanceG (int value)
 Set white balance G gain of the Ovrvision. More...
 
int GetCameraWhiteBalanceB ()
 Get white balance B gain value of the Ovrvision. More...
 
void SetCameraWhiteBalanceB (int value)
 Set white balance B gain of the Ovrvision. More...
 
int GetCameraBLC ()
 Set backlight compensation(BLC) value of the Ovrvision. More...
 
void SetCameraBLC (int value)
 Set backlight compensation(BLC) of the Ovrvision. More...
 
bool GetCameraWhiteBalanceAuto ()
 Get automatic mode of the Ovrvision White Balance. More...
 
void SetCameraWhiteBalanceAuto (bool value)
 Set automatic mode of the Ovrvision White Balance. More...
 
void SetCameraSyncMode (bool value)
 Set sync mode for the Ovrvision. More...
 
int OpenCLExtensions (int(*callback)(void *, const char *), void *item)
 Get OpenCL extensions of GPU.
 
void Grayscale (unsigned char *left, unsigned char *right)
 Grayscaled image of 1/2 scaled.
 
void GrayscaleHalf (unsigned char *left, unsigned char *right)
 Grayscaled image of 1/2 scaled.
 
void GrayscaleFourth (unsigned char *left, unsigned char *right)
 Grayscaled image of 1/4 scaled.
 
void GrayscaleEighth (unsigned char *left, unsigned char *right)
 Grayscaled image of 1/8 scaled.
 
void UserDataAccessUnlock ()
 
void UserDataAccessLock ()
 
void UserDataAccessSelectAddress (unsigned int addr)
 
unsigned char UserDataAccessGetData ()
 
void UserDataAccessSetData (unsigned char value)
 
void UserDataAccessSave ()
 
void UserDataAccessCheckSumAddress ()
 
bool CameraParamSaveEEPROM ()
 
bool CameraParamResetEEPROM ()
 
void CreateSkinTextures (int width, int height, unsigned int left, unsigned int right)
 Create Skin textures. More...
 
void Capture (OVR::Camqt qt)
 Capture frame and hold it in GPU for image processing(Grayscale, Skin color extraction etc.) More...
 
void UpdateSkinTextures (unsigned int left, unsigned int right)
 Update skin textures. More...
 
void UpdateImageTextures (unsigned int left, unsigned int right)
 
ROI SetSkinScale (unsigned int scale)
 Set Skin image scale. More...
 
bool GetScaledImageRGBA (unsigned char *left, unsigned char *right)
 Get scaled images while calibration. More...
 
void GetSkinImage (unsigned char *pLeft, unsigned char *pRight)
 Get Skin images. More...
 
void DetectHand (int frames)
 Detect color range. More...
 
int SkinRegion (unsigned char *left, unsigned char *right)
 Get skin color region. More...
 
void SetSkinHSV (int h_low, int h_high, int s_low, int s_high)
 set HSV region for SkinRegion More...
 
void SetSkinHSV (int range[4])
 set HSV region for SkinRegion More...
 
int SetSkinThreshold (int threshold)
 set skin threshold to extract region More...
 
int ColorHistgram (unsigned char *histgram)
 Get color histgram in HSV space. More...
 
void GetStereoImageHSV (unsigned char *pLeft, unsigned char *pRight)
 UNDER CONSTRUCTION.
 
void InspectTextures (unsigned char *left, unsigned char *right, unsigned int type=0)
 

Static Public Member Functions

static bool CheckGPU ()
 Check GPU specification. More...
 

Detailed Description

OvrvisionPro class.

Member Function Documentation

void OVR::OvrvisionPro::Capture ( OVR::Camqt  qt)

Capture frame and hold it in GPU for image processing(Grayscale, Skin color extraction etc.)

Parameters
qtSet an image processing method.
static bool OVR::OvrvisionPro::CheckGPU ( )
static

Check GPU specification.

Returns
true if satisfaied for OrvisionPro
int OVR::OvrvisionPro::ColorHistgram ( unsigned char *  histgram)

Get color histgram in HSV space.

Parameters
HSVhistgram (256S x 180H)
Returns
scale (2, 4)
void OVR::OvrvisionPro::CreateSkinTextures ( int  width,
int  height,
unsigned int  left,
unsigned int  right 
)

Create Skin textures.

Parameters
widthof texture
heightof texture
lefttexture
righttexure

/////////////////////////////////////////////////////////////////////////////////// How to Create GPU texture and Update texture

Set scale 1/2 and get its size OVR::ROI size = ovrvision.SetSkinScale(2);

D3D11_TEXTURE2D_DESC desc = { size.width, // Width size.height, // Height 1, // MipLevels 1, // ArraySize DXGI_FORMAT_R8G8B8A8_UINT, // Format, BE CAREFUL { 1 }, // SampleDesc.Count D3D11_USAGE_DEFAULT, // Usage };

Create Textures ID3D11Texture2D *pTextures[2]; res = DIRECTX.Device->CreateTexture2D(&desc, NULL, &pTextures[0]); res = DIRECTX.Device->CreateTexture2D(&desc, NULL, &pTextures[1]);

Create GPU sharing textures ovrvision.CreateSkinTextures(size.width, size.height, pTextures[0], pTextures[1]); ///////////////////////////////////////////////////////////////////////////////////

void OVR::OvrvisionPro::DetectHand ( int  frames)

Detect color range.

Parameters
framessampling frame
int OVR::OvrvisionPro::GetCamBuffersize ( )

Get the buffer size of the Ovrvision image.

Returns
size
int OVR::OvrvisionPro::GetCameraBLC ( )

Set backlight compensation(BLC) value of the Ovrvision.

Returns
blc value.
int OVR::OvrvisionPro::GetCameraExposure ( )

Get exposure value of the Ovrvision.

Returns
Exposure time.
int OVR::OvrvisionPro::GetCameraGain ( )

Get gain value of the Ovrvision.

Returns
gain value.
bool OVR::OvrvisionPro::GetCameraWhiteBalanceAuto ( )

Get automatic mode of the Ovrvision White Balance.

Returns
It is true or false.
int OVR::OvrvisionPro::GetCameraWhiteBalanceB ( )

Get white balance B gain value of the Ovrvision.

Returns
B gain value.
int OVR::OvrvisionPro::GetCameraWhiteBalanceG ( )

Get white balance G gain value of the Ovrvision.

Returns
G gain value.
int OVR::OvrvisionPro::GetCameraWhiteBalanceR ( )

Get white balance R gain value of the Ovrvision.

Returns
R gain value.
float OVR::OvrvisionPro::GetCamFocalPoint ( )

Get the focal point of the Ovrvision image.

Returns
focal point
int OVR::OvrvisionPro::GetCamFramerate ( )

Get the framerate of the Ovrvision.

Returns
fps
int OVR::OvrvisionPro::GetCamHeight ( )

Get the height of the Ovrvision image.

Returns
pixel size.
unsigned char* OVR::OvrvisionPro::GetCamImageBGRA ( OVR::Cameye  eye)

Gets the image data of 32 bits of BGRA form.

Parameters
eyeOV_CAMEYE_LEFT or OV_CAMEYE_RIGHT
void OVR::OvrvisionPro::GetCamImageBGRA ( unsigned char *  pImageBuf,
OVR::Cameye  eye 
)

This function gets data from OvrvisionPro inside.

Parameters
pImageBufImage buffer pointer
eyeOV_CAMEYE_LEFT or OV_CAMEYE_RIGHT
int OVR::OvrvisionPro::GetCamPixelsize ( )

Get the pixel data size. default is BGRA 4 byte.

Returns
size
int OVR::OvrvisionPro::GetCamWidth ( )

Get the width of the Ovrvision image.

Returns
pixel size.
float OVR::OvrvisionPro::GetHMDRightGap ( int  at)

Get the gap between images for HMD.

Returns
value
bool OVR::OvrvisionPro::GetScaledImageRGBA ( unsigned char *  left,
unsigned char *  right 
)

Get scaled images while calibration.

Parameters
leftptr to buffer
rightptr to buffer
Returns
true when calibration done
void OVR::OvrvisionPro::GetSkinImage ( unsigned char *  pLeft,
unsigned char *  pRight 
)

Get Skin images.

Parameters
pLeftImage buffer pointer (RGBA IMAGE)
pRightImage buffer pointer (RGBA IMAGE)
void OVR::OvrvisionPro::GetStereoImageBGRA ( unsigned char *  pLeft,
unsigned char *  pRight,
ROI  roi 
)

Get camera image region of interest.

Parameters
pLeftImage buffer pointer for left eye
pRightImage buffer pointer for right eye
roiROI
bool OVR::OvrvisionPro::isOpen ( )

Check whether OvrvisionPro is open.

Returns
If open, It is true
int OVR::OvrvisionPro::Open ( int  locationID,
OVR::Camprop  prop,
const char *  pVendorName = NULL,
int  deviceType = -1,
void *  pD3D11Device = NULL 
)

Open the Ovrvision Pro.

Parameters
locationIDConnection number
propCamera property
pVendorNamec style string with the vendor name ("NVIDIA Corporation", "Intel(R) Corporation", )
deviceType(2:D3D11, 0:OpenGL, -1:Dont share)
pD3D11Deviceptr to D3D11 device when deviceType == 2
Returns
If successful, the return value is 0<
void OVR::OvrvisionPro::PreStoreCamData ( OVR::Camqt  qt)

This function gets data from OvrvisionPro inside.

Parameters
qtSet an image processing method.
void OVR::OvrvisionPro::SetCameraBLC ( int  value)

Set backlight compensation(BLC) of the Ovrvision.

Parameters
valueBLC. Range of 0 - 255
void OVR::OvrvisionPro::SetCameraExposure ( int  value)

Set exposure of the Ovrvision.

Parameters
valueExposure time. Range of 0 - 32767
bool OVR::OvrvisionPro::SetCameraExposurePerSec ( float  fps)

Set exposure of the Ovrvision.

Parameters
valueExposure time per Sec. 60Hz Range of 30 - 240 frame, 50Hz Range of 25 - 200 frame
Returns
error, true or false
void OVR::OvrvisionPro::SetCameraGain ( int  value)

Set gain of the Ovrvision.

Parameters
valuegain. Range of 0 - 47
void OVR::OvrvisionPro::SetCameraSyncMode ( bool  value)

Set sync mode for the Ovrvision.

Parameters
valueTrue is sync mode.
void OVR::OvrvisionPro::SetCameraWhiteBalanceAuto ( bool  value)

Set automatic mode of the Ovrvision White Balance.

Parameters
valueMode.
void OVR::OvrvisionPro::SetCameraWhiteBalanceB ( int  value)

Set white balance B gain of the Ovrvision.

Parameters
valueB gain. Range of 0 - 4095
void OVR::OvrvisionPro::SetCameraWhiteBalanceG ( int  value)

Set white balance G gain of the Ovrvision.

Parameters
valueG gain. Range of 0 - 4095
void OVR::OvrvisionPro::SetCameraWhiteBalanceR ( int  value)

Set white balance R gain of the Ovrvision.

Parameters
valueR gain. Range of 0 - 4095
void OVR::OvrvisionPro::SetSkinHSV ( int  h_low,
int  h_high,
int  s_low,
int  s_high 
)

set HSV region for SkinRegion

Parameters
h_low(0 < h_low < h_high)
h_high(h_low < h_high < 180)
s_low(0 < s_low < s_high)
s_high(s_low < s_high < 256)
void OVR::OvrvisionPro::SetSkinHSV ( int  range[4])

set HSV region for SkinRegion

Parameters
range[0]:h_low(0 < h_low < h_high)
range[1]:h_high(h_low < h_high < 180)
range[2]:s_low(0 < s_low < s_high)
range[3]:s_high(s_low < s_high < 256)
ROI OVR::OvrvisionPro::SetSkinScale ( unsigned int  scale)

Set Skin image scale.

Parameters
scale(2, 4, 8) of scale dominant
Returns
size of scaled image
int OVR::OvrvisionPro::SetSkinThreshold ( int  threshold)

set skin threshold to extract region

Parameters
threshold(0..255)
Returns
previous threshold
int OVR::OvrvisionPro::SkinRegion ( unsigned char *  left,
unsigned char *  right 
)

Get skin color region.

Parameters
leftimage (MONOCHROME MASK)
rightimage (MONOCHROME MASK)
Returns
scale (2, 4)
void OVR::OvrvisionPro::UpdateSkinTextures ( unsigned int  left,
unsigned int  right 
)

Update skin textures.

Parameters
ncount of onjects
textureObjects

/////////////////////////////////////////////////////////////////////////////////// Capture image and hold it only in GPU ovrvision.Capture(OVR::Camqt::OV_CAMQT_DMSRMP); Update textures ovrvision.UpdateSkinTextures(pTextures[0], pTextures[1]); ///////////////////////////////////////////////////////////////////////////////////


The documentation for this class was generated from the following file: