How to delete masks using command line ?

58 views
Skip to first unread message

Noveguy

unread,
Apr 14, 2022, 1:13:12 AM4/14/22
to hugin and other free panoramic software
Hi all,

I need to mask some regions to prevent cpfind from getting CPs in that regions but I still want those masked regions to appear in the final panorama.

I suspect that I might need to "enable" those masked regions before running cpfind then "disable"/delete them after cpfind. This action is easily done with GUI but I have no idea how to do that with command line. I already looked at Hugin's Help and found "pto_mask " but that does not support deleting masks in pto project.

Did I overlook something ? Please help.

Thanks!

Bruno Postle

unread,
Apr 14, 2022, 4:32:04 AM4/14/22
to hugin and other free panoramic software
Masks in a Hugin PTO project are stored in lines of text that begin with the letter 'k'. So, make a copy of the file without any lines beginning with 'k' like this:


  grep -v '^k' project.pto > new_project.pto

-- 
Bruno

Noveguy

unread,
Apr 14, 2022, 6:25:53 AM4/14/22
to hugin and other free panoramic software
Thank Bruno for the tip. Unfortunately, I am using Windows now. But I think I could write some C# code to do that.

johnfi...@gmail.com

unread,
Apr 14, 2022, 7:35:20 AM4/14/22
to hugin and other free panoramic software
On Thursday, April 14, 2022 at 6:25:53 AM UTC-4 Noveguy wrote:
Thank Bruno for the tip. Unfortunately, I am using Windows now. But I think I could write some C# code to do that.

There are many different sources for linux tools (with or without including and depending on a copy of bash) that you can install on Windows.

I'm guessing your "now" meant you have some previous Linux experience, which is even more reason to install some linux tools on Windows.  This won't be the last time that you will have a use for grep on windows.
 

David Benes

unread,
Apr 14, 2022, 7:45:12 AM4/14/22
to hugi...@googlegroups.com
čt 14. 4. 2022 v 12:25 odesílatel Noveguy <xuanho...@gmail.com> napsal:
Thank Bruno for the tip. Unfortunately, I am using Windows now. But I think I could write some C# code to do that.

On Thursday, April 14, 2022 at 3:32:04 PM UTC+7 bruno...@gmail.com wrote:
Masks in a Hugin PTO project are stored in lines of text that begin with the letter 'k'. So, make a copy of the file without any lines beginning with 'k' like this:


  grep -v '^k' project.pto > new_project.pto

On Windows, you can do the same with following command:

findstr /V /R "^k" project.pto > new_project.pto

T. Modes

unread,
Apr 14, 2022, 12:01:08 PM4/14/22
to hugin and other free panoramic software
I added a new option to pto_mask which allows now to delete masks from the pto file.

Reply all
Reply to author
Forward
0 new messages