ToughStoneX / Self-Supervised-MVS

Pytorch codes for "Self-supervised Multi-view Stereo via Effective Co-Segmentation and Data-Augmentation"
152 stars 15 forks source link

MASK generation #10

Open Qianqian3764 opened 2 years ago

Qianqian3764 commented 2 years ago

Thanks for this great work! I have one questions Why can this code generate a mask? Could you explain the principle? mask = (x0 >= 0) & (x1 <= max_x) & (y0 >= 0) & (y0 <= max_y) mask = mask.float()

Many thanks.

ToughStoneX commented 2 years ago

For example, you have one reference image and one source image. And you know that pixel (x', y') in the reference image is matched with pixel (x, y) in the source image. It is easy to know that pixel (x', y') is never out of the range of the reference image. The same principle also exists between pixel (x, y) and the source image. Although the tomography warping function determine the correspondence between different images, not all regions in the source image has a corresponding pixel in the reference image. As a result, we have to find out which pixel has corresponding pixels and which not, and handle them differently.