|
OvrvisionSDK
2.00
|
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... | |
OvrvisionPro class.
| void OVR::OvrvisionPro::Capture | ( | OVR::Camqt | qt | ) |
Capture frame and hold it in GPU for image processing(Grayscale, Skin color extraction etc.)
| qt | Set an image processing method. |
|
static |
Check GPU specification.
| int OVR::OvrvisionPro::ColorHistgram | ( | unsigned char * | histgram | ) |
Get color histgram in HSV space.
| HSV | histgram (256S x 180H) |
| void OVR::OvrvisionPro::CreateSkinTextures | ( | int | width, |
| int | height, | ||
| unsigned int | left, | ||
| unsigned int | right | ||
| ) |
Create Skin textures.
| width | of texture |
| height | of texture |
| left | texture |
| right | texure |
/////////////////////////////////////////////////////////////////////////////////// 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.
| frames | sampling frame |
| int OVR::OvrvisionPro::GetCamBuffersize | ( | ) |
Get the buffer size of the Ovrvision image.
| int OVR::OvrvisionPro::GetCameraBLC | ( | ) |
Set backlight compensation(BLC) value of the Ovrvision.
| int OVR::OvrvisionPro::GetCameraExposure | ( | ) |
Get exposure value of the Ovrvision.
| int OVR::OvrvisionPro::GetCameraGain | ( | ) |
Get gain value of the Ovrvision.
| bool OVR::OvrvisionPro::GetCameraWhiteBalanceAuto | ( | ) |
Get automatic mode of the Ovrvision White Balance.
| int OVR::OvrvisionPro::GetCameraWhiteBalanceB | ( | ) |
Get white balance B gain value of the Ovrvision.
| int OVR::OvrvisionPro::GetCameraWhiteBalanceG | ( | ) |
Get white balance G gain value of the Ovrvision.
| int OVR::OvrvisionPro::GetCameraWhiteBalanceR | ( | ) |
Get white balance R gain value of the Ovrvision.
| float OVR::OvrvisionPro::GetCamFocalPoint | ( | ) |
Get the focal point of the Ovrvision image.
| int OVR::OvrvisionPro::GetCamFramerate | ( | ) |
Get the framerate of the Ovrvision.
| int OVR::OvrvisionPro::GetCamHeight | ( | ) |
Get the height of the Ovrvision image.
| unsigned char* OVR::OvrvisionPro::GetCamImageBGRA | ( | OVR::Cameye | eye | ) |
Gets the image data of 32 bits of BGRA form.
| eye | OV_CAMEYE_LEFT or OV_CAMEYE_RIGHT |
| void OVR::OvrvisionPro::GetCamImageBGRA | ( | unsigned char * | pImageBuf, |
| OVR::Cameye | eye | ||
| ) |
This function gets data from OvrvisionPro inside.
| pImageBuf | Image buffer pointer |
| eye | OV_CAMEYE_LEFT or OV_CAMEYE_RIGHT |
| int OVR::OvrvisionPro::GetCamPixelsize | ( | ) |
Get the pixel data size. default is BGRA 4 byte.
| int OVR::OvrvisionPro::GetCamWidth | ( | ) |
Get the width of the Ovrvision image.
| float OVR::OvrvisionPro::GetHMDRightGap | ( | int | at | ) |
Get the gap between images for HMD.
| bool OVR::OvrvisionPro::GetScaledImageRGBA | ( | unsigned char * | left, |
| unsigned char * | right | ||
| ) |
Get scaled images while calibration.
| left | ptr to buffer |
| right | ptr to buffer |
| void OVR::OvrvisionPro::GetSkinImage | ( | unsigned char * | pLeft, |
| unsigned char * | pRight | ||
| ) |
Get Skin images.
| pLeft | Image buffer pointer (RGBA IMAGE) |
| pRight | Image buffer pointer (RGBA IMAGE) |
| void OVR::OvrvisionPro::GetStereoImageBGRA | ( | unsigned char * | pLeft, |
| unsigned char * | pRight, | ||
| ROI | roi | ||
| ) |
Get camera image region of interest.
| pLeft | Image buffer pointer for left eye |
| pRight | Image buffer pointer for right eye |
| roi | ROI |
| bool OVR::OvrvisionPro::isOpen | ( | ) |
Check whether OvrvisionPro is open.
| int OVR::OvrvisionPro::Open | ( | int | locationID, |
| OVR::Camprop | prop, | ||
| const char * | pVendorName = NULL, |
||
| int | deviceType = -1, |
||
| void * | pD3D11Device = NULL |
||
| ) |
Open the Ovrvision Pro.
| locationID | Connection number |
| prop | Camera property |
| pVendorName | c style string with the vendor name ("NVIDIA Corporation", "Intel(R) Corporation", ) |
| deviceType | (2:D3D11, 0:OpenGL, -1:Dont share) |
| pD3D11Device | ptr to D3D11 device when deviceType == 2 |
| void OVR::OvrvisionPro::PreStoreCamData | ( | OVR::Camqt | qt | ) |
This function gets data from OvrvisionPro inside.
| qt | Set an image processing method. |
| void OVR::OvrvisionPro::SetCameraBLC | ( | int | value | ) |
Set backlight compensation(BLC) of the Ovrvision.
| value | BLC. Range of 0 - 255 |
| void OVR::OvrvisionPro::SetCameraExposure | ( | int | value | ) |
Set exposure of the Ovrvision.
| value | Exposure time. Range of 0 - 32767 |
| bool OVR::OvrvisionPro::SetCameraExposurePerSec | ( | float | fps | ) |
Set exposure of the Ovrvision.
| value | Exposure time per Sec. 60Hz Range of 30 - 240 frame, 50Hz Range of 25 - 200 frame |
| void OVR::OvrvisionPro::SetCameraGain | ( | int | value | ) |
Set gain of the Ovrvision.
| value | gain. Range of 0 - 47 |
| void OVR::OvrvisionPro::SetCameraSyncMode | ( | bool | value | ) |
Set sync mode for the Ovrvision.
| value | True is sync mode. |
| void OVR::OvrvisionPro::SetCameraWhiteBalanceAuto | ( | bool | value | ) |
Set automatic mode of the Ovrvision White Balance.
| value | Mode. |
| void OVR::OvrvisionPro::SetCameraWhiteBalanceB | ( | int | value | ) |
Set white balance B gain of the Ovrvision.
| value | B gain. Range of 0 - 4095 |
| void OVR::OvrvisionPro::SetCameraWhiteBalanceG | ( | int | value | ) |
Set white balance G gain of the Ovrvision.
| value | G gain. Range of 0 - 4095 |
| void OVR::OvrvisionPro::SetCameraWhiteBalanceR | ( | int | value | ) |
Set white balance R gain of the Ovrvision.
| value | R 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
| 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
| 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.
| scale | (2, 4, 8) of scale dominant |
| int OVR::OvrvisionPro::SetSkinThreshold | ( | int | threshold | ) |
set skin threshold to extract region
| threshold | (0..255) |
| int OVR::OvrvisionPro::SkinRegion | ( | unsigned char * | left, |
| unsigned char * | right | ||
| ) |
Get skin color region.
| left | image (MONOCHROME MASK) |
| right | image (MONOCHROME MASK) |
| void OVR::OvrvisionPro::UpdateSkinTextures | ( | unsigned int | left, |
| unsigned int | right | ||
| ) |
Update skin textures.
| n | count 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]); ///////////////////////////////////////////////////////////////////////////////////