0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【StereoDepth】PytorchでLR consistency lossを計算してみる

Posted at

背景

stereo cameraの特性を活かしDisparityの推定精度を確かめる方法として広く使われているので、実際に動かしてみようと思った。

入力

Disparity推定に使用した左の画像 ![img.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/482094/46684ddc-bbec-28fd-3d24-3b14b99de614.png)

左のDisparity
disp_left.png

右のDisparity
disp_right.png

結果

lr_left_loss ![torch.abs(RtoL - disp_left).png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/482094/c9ef1b84-b21a-6e00-50d8-1ec43480668c.png)

lr_right_loss
torch.abs(LtoR - disp_right).png

Reconstructionした画像を見てみると、フェンスの所と車の周囲の推定がうまく行っていない所が、Lossとして正確に認識される事がわかる
estLeft.png

ソースコード

``` LtoR = self.bilinear_sampler_1d_h(disp_left, disp_right) RtoL = self.bilinear_sampler_1d_h(disp_right, -1 * disp_left) lr_left_loss = torch.mean(torch.abs(RtoL - disp_left)) lr_right_loss = torch.mean(torch.abs(LtoR - disp_right)) lr_loss = lr_left_loss + lr_right_loss ```

参考文献

monodepth https://github.com/mrharicot/monodepth
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?