I'm currently trying to compute use Kinect For Windows SDK with C++ to remove the background extracting only the player from a scene. For this I'm using the provided sample from the developer toolkit and I'm currently stucked with a problem.
While analyzing the sample, I found this line of code: NuiCreateBackgroundRemovedColorStream(_sensor, &m_pBackgroundRemovalStream);
This line of code starts the background removal and belongs to the KinectBackgroundRemoval.h. When trying to use this line of code, Visual Studio does not underline it with the error but as soon as I press run, it says that I have a problem with my code:
Error 25 error LNK2019: unresolved external symbol __imp__NuiCreateBackgroundRemovedColorStream@8 referenced in function "public: __thiscall Kinect::Kinect(void)" (??0Kinect@@QAE@XZ) C:\Users\Ricardo\documents\visual studio 2013\Projects\OpenCVSample\OpenCVSample\Kinect.obj OpenCVSample
my code is as follow:
NuiCreateSensorByIndex(0, &_sensor);
_sensor->NuiInitializationFlags();
_sensor->NuiInitialize(NUI_INITIALIZE_FLAG_USES_DEPTH_AND_PLAYER_INDEX | NUI_INITIALIZE_FLAG_USES_COLOR);
_sensor->NuiImageStreamOpen(NUI_IMAGE_TYPE_DEPTH_AND_PLAYER_INDEX, DEPTH_RESOLUTION, 0, 2, _depthEvent, &_depthStreamHandle);
_sensor->NuiImageStreamOpen(NUI_IMAGE_TYPE_COLOR, RGB_RESOLUTION, 0, 2, _rgbEvent, &_rgbStreamHandle);
_sensor->NuiSkeletonTrackingEnable(_skeletonEvent, NUI_SKELETON_TRACKING_FLAG_ENABLE_IN_NEAR_RANGE);
NuiCreateBackgroundRemovedColorStream(_sensor, &m_pBackgroundRemovalStream);
m_pBackgroundRemovalStream->Enable(RGB_RESOLUTION, DEPTH_RESOLUTION, _backgroundRemoveEvent);
note that I have already configured the include file and it does not underlined it with any error. I'm not realy used to C++ so it might be a really simple error.
Many thanks!