fixstars / libSGM

Stereo Semi Global Matching by cuda
Apache License 2.0
623 stars 189 forks source link

Why is it incorrect when it comes to SUBPixel Mode? #40

Closed NiuKeke closed 5 years ago

NiuKeke commented 5 years ago

Why is it incorrect when it comes to SUBPixel Mode? When the SUBPIXEL Parameter was set to true,the result disparity image value is incorrect .Did I miss something?

sotsuka-fixstars commented 5 years ago

@NiuKeke
Thank you for letting us know this issue.

We tested sub-pixel function via sample/reprojection (https://github.com/fixstars/libSGM/issues/21#issuecomment-437252144) and KITTI benchmark. Could you provide a case that cause a result incorrect?

Notice that disparity value will be multiplied StereoSGM::SUBPIXEL_SCALE if sub-pixel parameter is set true (i.e. disparity value is going to have 4 fixed point fractional bits). https://github.com/fixstars/libSGM/blob/707e28b3ee013851abc5220bcb303cccceb88ee5/include/libsgm.h#L122-L125

Sincerely,

NiuKeke commented 5 years ago

@NiuKeke Thank you for letting us know this issue. We tested sub-pixel function via sample/reprojection (#21 (comment)) and KITTI benchmark. Could you provide a case that cause a result incorrect? Notice that disparity value will be multiplied StereoSGM::SUBPIXEL_SCALE if sub-pixel parameter is set true (i.e. disparity value is going to have 4 fixed point fractional bits).

  libSGM/include/libsgm.h

    Lines 122 to 125
  in
  707e28b

              * @attention 

              * You need to allocate dst memory at least width x height x sizeof(element_type) bytes. 

              * The element_type is uint8_t for output_depth_bits == 8 and uint16_t for output_depth_bits == 16. 

              * Note that dst element value would be multiplied StereoSGM::SUBPIXEL_SCALE if subpixel option was enabled. 

Sincerely,

I got it .Sorry,I just missed the StereoSGM::SUBPIXEL_SCALE.

sotsuka-fixstars commented 5 years ago

Congrats.

I will close this issue. If you are faced with anything related this issue, reopen it.

NiuKeke commented 5 years ago

Congrats. I will close this issue. If you are faced with anything related this issue, reopen it.

Ok,thank you very much.