Display depth using OpenCV in Orbbec

i recently got my Orbbec Astra Pro and i wanted to display the depth map using openni and opencv but i am unable to.I found that the laser is light,However no image.Please help me,Thanks

#include
#include “OpenNI.h”

#include “cv.h”
#include “opencv.hpp”
#include “imgproc.hpp”

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

int main( int argc, char** argv )
{

bool     end_while      = false;
OpenNI::initialize();
Device devAnyDevice;
devAnyDevice.open(ANY_DEVICE );

VideoStream streamDepth;
streamDepth.create( devAnyDevice, SENSOR_DEPTH );

VideoStream streamColor;
streamColor.create( devAnyDevice, SENSOR_COLOR );


VideoMode mModeDepth;
mModeDepth.setResolution( 320, 240 );
mModeDepth.setFps( 30 );
mModeDepth.setPixelFormat( PIXEL_FORMAT_DEPTH_1_MM );
streamDepth.setVideoMode( mModeDepth);


VideoMode mModeColor;
mModeColor.setResolution( 320, 240 );
mModeColor.setFps( 30 );
mModeColor.setPixelFormat( PIXEL_FORMAT_RGB888 );
streamColor.setVideoMode( mModeColor);


cvNamedWindow("Depth Image", CV_WINDOW_NORMAL);
cvResizeWindow("Depth Image", 320, 240);
cvMoveWindow("Depth Image", 200, 300);
namedWindow( "Color Image",  CV_WINDOW_NORMAL );//CV_WINDOW_AUTOSIZE
cvResizeWindow("Color Image", 320,240);
cvMoveWindow("Color Image", 200+320, 300);
cout << "Press 'q' 'Q' to exit" << endl;

if( devAnyDevice.isImageRegistrationModeSupported(
    IMAGE_REGISTRATION_DEPTH_TO_COLOR ) )
{
    devAnyDevice.setImageRegistrationMode( IMAGE_REGISTRATION_DEPTH_TO_COLOR );
}
    

streamDepth.start();
streamColor.start();



int iMaxDepth = streamDepth.getMaxPixelValue();


while( !end_while )
{
      VideoFrameRef  frameDepth;
      VideoFrameRef  frameColor;



    streamDepth.readFrame( &frameDepth );
    streamColor.readFrame( &frameColor );

    
    
    const cv::Mat mImageDepth( frameDepth.getHeight(), frameDepth.getWidth(), CV_16UC1, (void*)frameDepth.getData());
    
    cv::Mat mScaledDepth;
    mImageDepth.convertTo( mScaledDepth, CV_8U, 255.0 / iMaxDepth );
    
    cv::imshow( "Depth Image", mScaledDepth );

    if (frameColor.isValid()) 
    {
    const cv::Mat mImageRGB(frameColor.getHeight(), frameColor.getWidth(), CV_8UC3, (void*)frameColor.getData());
    cv::Mat cImageBGR;
    cv::cvtColor( mImageRGB, cImageBGR, CV_RGB2BGR );
    cv::imshow( "Color Image", cImageBGR );
   }
   char key = (char)cv::waitKey(1);
     	switch (key) {
        		case 'q':
        		case 'Q':
        		case 27:
           			//std::cout << "Exit key hit" << std::endl;
           			end_while = true;
           		break;
     	}
}


streamDepth.destroy();
streamColor.destroy();


devAnyDevice.close();


openni::OpenNI::shutdown();

return 0;

}

It works fine for me. Maybe you need to check out if opencv and openni are linked correctly.
Here is my platform info:

Ubuntu 16.04
OpenCV 3.1.0
OpenNI2(downloaded from orbbec website)