Ask Your Question

drvrh's profile - activity

2017-07-05 00:24:31 -0600 received badge  Enthusiast
2017-07-03 03:58:38 -0600 commented answer Selection depth area

I am using this settings for treshold threshold(depth8u, dst2, 110, 255, cv::THRESH_OTSU); after threshold I would like run inpaint between original depth image and return value from threshold function. Resulst is equal. Inpaint diameter value has 5.

2017-06-30 00:34:39 -0600 commented answer Selection depth area

Thanks for reply, but I have one problem. In my show image are displaying white spots, because camera detect reflection of light. How eliminate this spots?

2017-06-30 00:31:33 -0600 commented answer Selection depth area

Yes, I'am trying but has no good results. I am using this settings for treshold threshold(depth8u, dst2, 110, 255, cv::THRESH_OTSU); after threshold I would like run inpaint between original depth image and return value from threshold function. Resulst is equal. Inpaint diameter value has 5.

2017-06-30 00:30:51 -0600 received badge  Scholar (source)
2017-06-27 05:57:48 -0600 asked a question Selection depth area

For later object detection it is necessary to remove the background and other information from a depth picture. The idea is based on examining individual pixels on the picture, getting the depth value and, based on the depth, painting the pixels in another color. Two for loops run to the picture size through an individual pixel in an x and y direction. In this frame we can acquire information about the pixel depth, following is the condition execution. The condition is to keep the depth information in the range from 0.4 to 2 m.

The problem in my algorithm is, that the opencv core crashes, writes core dumped (Segmentation fault (core dumped)) and in addition reports that the variables are out of the given area.

Print: .... X: 6 Y: 1 Depth: 2896 X: 7 Y: 1 Depth: 2884 X: 8 Y: 1 Depth: 2896 X: 1 Y: 1 Depth: 3351 X: 2 Y: 1 Depth: 3401 X: 1 Y: 1 Depth: 2921 X: 2 Y: 1 Depth: 2872 X: 3 Y: 1 Depth: 2860 X: 4 Y: 1 Depth: 2848 X: 5 Y: 1 Depth: 2860 X: 1 Y: 1 Depth: 3165 X: 2 Y: 1 Depth: 3093 X: 3 Y: 1 Depth: 2946 X: 4 Y: 1 Depth: 2946 X: 5 Y: 1 Depth: 2884 X: 6 Y: 1 Depth: 2860 X: 7 Y: 1 Depth: 2884 (stay in this forever loop) Segmentation fault (core dumped)

My code is:

   for(uint16_t y = 1; y <= _depth_intrin.height; y++){
     for(uint16_t x = 1; x <= _depth_intrin.width; x++){
       depth_value = depth16.at<uint16_t>(x, y);
       if(depth_value == NULL){
         return 0;
       }

       if(depth_value >= 2000){
         depth16.at<cv::Vec3b>(cv::Point(x, y)) = 255;
       }
       if(depth_value <= 300){
         depth16.at<cv::Vec3b>(cv::Point(x, y)) = 255;
       }
       cout << "X: " << x << " Y: " << y << endl;
       cout << "Depth: " << depth_value << endl;
       depth_value = 0;
     }
   }

Where I have a problem ?