OpenNI2.dll is missing from your computer

asked 2014-11-06 08:54:32 -0600

pulungpurwo gravatar image

I have source code like this:

#include "stdafx.h"
#include "opencv2\highgui\highgui.hpp"
#include "cv.h"
#include "OpenNI.h"
#include <stdio.h>
#include <iostream>


using namespace std;
using namespace cv;
using namespace openni;

int main()
{
 openni::Device device;
 openni::VideoStream depth, color,ir;

 openni::OpenNI::initialize();
 device.open(openni::ANY_DEVICE);

 ir.create(device,openni::SENSOR_IR);
 depth.create(device, openni::SENSOR_DEPTH);
 color.create(device, openni::SENSOR_COLOR);

 openni::VideoMode vm=depth.getVideoMode();

 int cols,rows;
 cols=vm.getResolutionX();
 rows=vm.getResolutionY();

 VideoStream* streams[]={&depth,&color,&ir};

 openni::VideoFrameRef frame;
 depth.readFrame(&frame);
 depth.start();
 color.readFrame(&frame);
 color.start();
 ir.readFrame(&frame); 
 ir.start();

 depth.stop();
 color.stop();
 ir.stop();

 openni::DepthPixel* dData = (openni::DepthPixel*)frame.getData();
 cv::Mat depthImage(rows, cols, CV_16UC1, dData);

 openni::OpenNI::shutdown();
  }

when i was compilling there's openNI2.dll is missing from your computer i haved configured propertyies directory in visual studio 2012 image description

i use openNI2, NiTE2, opencv249, visual studio 2012 c++

please help me to fix this problem,, thanks :)

edit retag flag offensive close merge delete

Comments

Try to copy the OpenNI redist folder near the source code (and later the executable).

kbarni gravatar imagekbarni ( 2014-11-07 11:14:32 -0600 )edit

Copy OpenNI2.dll to the output folder (the same folder as your .exe)

nik33 gravatar imagenik33 ( 2014-11-09 14:06:59 -0600 )edit