openMVS icon indicating copy to clipboard operation
openMVS copied to clipboard

Using image masks in openMVS

Open Jhfelectric opened this issue 8 years ago • 18 comments

Bonjour Pierre & Cdc

Continuing my journey down the pipeline :)

Looking at various mesh-reconstructing programs, I found out that PMVS v2 could use image masks to accelerate the process. Is this something possible with openMVS ? Or did I miss something and masks applied in openMVG_main_ComputeMatches make their way to the end (in the bin or mvs file) ?

Thanks again for your help. Julien

Jhfelectric avatar Nov 16 '16 14:11 Jhfelectric

Mask is not supported in OpenMVS. They can only be used in OpenMVG to filter out some keypoints (keypoints in black mask regions are removed).

pmoulon avatar Nov 16 '16 21:11 pmoulon

Actually masks are supported only in point-cloud densification module of OpenMVS, but are not enabled (there is no interface for setting them). Please feel free to add the missing interface (a way to load and set masks for each image).

cdcseacave avatar Nov 16 '16 21:11 cdcseacave

Thank you Cdc. As far as I can follow and understand, masks are used in MapMatrix2ZigzagIdx. As a BitMatrix, zeros are used to exclude the relevant coords (right ?). So I need to get that BitMatrix in there. Fine :) First issue I am facing now is to recompile it all. I spent a few hours already gathering all prerequisites to openMVS. There are quite a lot... Would you happen to have (a link to) compiled binaries for all those dependencies ? Thanks, Julien

Jhfelectric avatar Nov 17 '16 03:11 Jhfelectric

if you use linux or mac, there is a detailed build step by step in the wiki, if you use windows, just compile all libraries as described on their website

Yes, that is the mask

cdcseacave avatar Nov 17 '16 04:11 cdcseacave

Hi I am trying to add this interface for masks and I wonder if you could help me understand ? :D

What I think it is necessary to wake this monster :

  1. Implement reading Mask from file and converting them to BitMatrix
  2. Passing those masks to the function -> EstimateDepthMap(uint32_t idxImage)

Please correct me if I am wrong or you have some notes to this process :D

Rixikso avatar Aug 12 '17 17:08 Rixikso

Indeed, those are the steps. In function EstimateDepthMap() you have to pass the mask that you read to DepthEstimator::MapMatrix2ZigzagIdx(), which already supports a mask as input but right now it is empty.

cdcseacave avatar Aug 12 '17 18:08 cdcseacave

Okey. So I guess I will try to do this :)

Rixikso avatar Aug 12 '17 18:08 Rixikso

Hello, could mask be useful using turntable ( or other photo set) and changing position of the same object ( 2 dataset ) and then using a single masked dataset to cover all sides ?

For now i have to use two separate dataset and merge manually the two 3D resulting objects.

AndreaMonzini avatar May 19 '18 10:05 AndreaMonzini

@cdcseacave @Rixikso has there been any work for supporting mask yet?

tompollok avatar Jan 17 '20 12:01 tompollok

no

cdcseacave avatar Jan 17 '20 14:01 cdcseacave

Hello, I am able to load the masks before calling DepthEstimator::MapMatrix2ZigzagIdx(), but the problem is that this function seems to be called just on the first image, hence the mask of the first image is applied to all the other images. How can I apply different masks on different images?

roby23 avatar Jul 03 '20 11:07 roby23

I just added mask support in c618f43

cdcseacave avatar Jul 06 '20 12:07 cdcseacave

Hello, I am able to load the masks before calling DepthEstimator::MapMatrix2ZigzagIdx(), but the problem is that this function seems to be called just on the first image, hence the mask of the first image is applied to all the other images. How can I apply different masks on different images?

Have you solved this problem? Only the mask of the first image is applied.

w080707 avatar Sep 15 '20 05:09 w080707

Hello, I have tested the lastest patch-match code implemented in CUDA, and found that it does not support the function of image mask as in c618f43. I am wondering whether the image mask support would be available in the CUDA version patch-match?

wuge1880 avatar Oct 24 '21 12:10 wuge1880

I do not have time now for adding mask support; as a fast way to add such support is to simply mask out the estimated depth-maps before fusion

cdcseacave avatar Oct 25 '21 11:10 cdcseacave

I do not have time now for adding mask support; as a fast way to add such support is to simply mask out the estimated depth-maps before fusion

OK, I will try it. Thank you!

wuge1880 avatar Oct 25 '21 12:10 wuge1880

Hi @cdcseacave, thank you for the great library! I was just wondering whether there might be some progress on this masking feature. Do you have any plans on integrating this feature at some time? Thank you in advance!

jzenn avatar Apr 26 '22 11:04 jzenn

yes, I plan adding it, but I do not have time right now, pls help if in hurry, either by directly coding it or making a donation to hire some help

cdcseacave avatar Apr 26 '22 13:04 cdcseacave

Thanks, that would a very very helpful feature!

apurvazaveri avatar Nov 12 '22 17:11 apurvazaveri

Does the mask feature work on CPU? If so how does one provide the mask to point cloud densification?

apurvazaveri avatar Nov 23 '22 03:11 apurvazaveri