Image masks not working

61 views
Skip to first unread message

Yiyang Chen

unread,
Jul 20, 2022, 8:19:55 AM7/20/22
to COLMAP
Hi,
I met a problem about per-image masking. I created per-image masks accordingly to ignore unimportant keypoints, but the sfm result shows that they didn't work. The "database management" part in GUI also shows that the keypoints I expected to ignore are still detected and matched. I've checked many times and don't know what I'm doing wrong, hoping to get some advice.
My images are named as '0000.jpg' under image_path, masks are named as '0000.jpg.png' under mask_path, where image_path and mask_path are correspondingly given to 'image folder' and 'mask folder' under 'automatic reconstruction'. Other settings are mentioned in the screenshot attached below.
Each mask file uses 0 for ignored pixels and 255 for the rest. I tried using 3-channel or single channel, neither works. Neither command line tool nor GUI works for me.
I found a very similar problem in github issue (Image masks not working? · Issue #1460 · colmap/colmap (github.com)) but I think I use the correct filenames and don't know what I do wrong.

Would appreciate any advice!
Thanks a lot!
屏幕截图 2022-07-20 201210.png


Wayne Cochran

unread,
Jul 26, 2022, 11:37:53 AM7/26/22
to COLMAP
I am not sure this is the problem you are experiencing, but mask images fail if they are soft links (e.g. created via ln -s in MacOS or Linux). 
The code that loads images masks tries to interpret soft link filenames and expand them into a fully qualified path -- but it
does so incorrectly. I use hard links or image originals for both images and masks.

Yiyang Chen

unread,
Jul 29, 2022, 4:19:38 AM7/29/22
to COLMAP
Thanks for answering! 
Actually I didn't use links, just giving the path of folders where images and masks are stored to GUI. Like the screenshot shows, my original images are under <Image folder> as '0000.jpg', and masks are under <Mask folder> as '0000.jpg.png'.
Still wondering what's going wrong.

Reply all
Reply to author
Forward
0 new messages