Forum

Author Topic: Importing Masks for For Workspace errors (Some photos do not have/need a mask)  (Read 9364 times)

TobyFunt

  • Newbie
  • *
  • Posts: 3
    • View Profile
Hello,

I am having issues with importing masks into my workspace. I have a folder of masks I created for all my photos with water.

When I attempt to import the masks for the whole workspace, I receive an error, "Can't load image: ...Image_mask.png".

I am choosing the 'From file' method, 'replacement' option, and I have also tried to use the apply to all cameras option.

The import does work when the images actually have a mask associated to the file, but as soon as it hits a photo that does not have an associated mask in the folder, the tool stops rather than skips over it.

I am confused because I have used this tool for this exact dataset in the past, and I have not run into this problem. However, I do see that the tool was updated, so perhaps I am not using it correctly?

Any help you can lend would be appreciated!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14816
    • View Profile
Hello TobyFunt,

What are the names of the original photos and corresponding mask images? Can you give an example?

If you are using Image_mask.png - if means that PhotoScan will search for the file with the exactly the same filename and will apply the mask to all the images. So if you have individual mask for each photo, you should use marcos, like {filename}_mask.png, for example.
Best regards,
Alexey Pasumansky,
Agisoft LLC

bigben

  • Sr. Member
  • ****
  • Posts: 406
    • View Profile
If you're using TIF you can store the mask in the alpha channel.  Doesn't stop if the image has no alpha.

TobyFunt

  • Newbie
  • *
  • Posts: 3
    • View Profile
Hello Alexey,

Thank you for your very prompt reply. I apologize for the delay in responding back!

My images are named  DSC0001, DSC0002, etc. The masks are named: DSC0001_Mask, DSC0002_Mask, etc.

When I Import the masks, I do use the macro {filename}_Mask.png as you have noted.

I reverted to an earlier version of photoscan (1.0.4) and  the import worked okay for me there.

I reinstalled the latest version (1.2.3.2331) and it no longer worked.

As I mentioned in the first post; the import will work correctly until it comes to an image that does not have a mask. When it comes across an image that does not have a mask, it will end the process, and not continue with the rest of the workspace even if there are more images that require a mask.

Example:

There are ten Images in the workspace. Images 1,2,3, and 7,8,9,10 have a mask which was created. Images 4,5,6 have no masks.

When the import tool is ran, it will correctly import masks for 1,2,3. Since 4 does not have a mask the process ends with an error. The masks for images 7,8,9,10 will not be imported.

Thanks again for your help in this matter.

Toby
« Last Edit: March 05, 2016, 04:18:42 AM by TobyFunt »

bigben

  • Sr. Member
  • ****
  • Posts: 406
    • View Profile
Just create a blank white PNG (won't take up much space) and copy it to create masks for the images that don't need masking

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14816
    • View Profile
Alternatively you can select the images you wish to import masks to and apply the import only to the selection.
Best regards,
Alexey Pasumansky,
Agisoft LLC

TobyFunt

  • Newbie
  • *
  • Posts: 3
    • View Profile
Alexy and BigBen, Thank you for your replies. I ended up using Alexy's work around and selected the images that needed the mask, but this is a very lengthy process, as I have over 4000 images which were a part of an aerial survey. Water bodies, were masked out of ~ 5% spread out over the dataset. This meant that I had to scroll through the 4000+ images and manually select the images that had water in them. It took me a pretty long time to do so.

Next time, I will try out the blank mask and alpha channel ideas of BigBen, but I was really hoping to hear that there is indeed a bug in the latest version that could be fixed. Like I said, in past versions I was able to just click import for entire workspace and the program would import all masks which were available. It used to take seconds to complete rather than the nearly hour it took me to manually go through and select for only the images I needed.

Thanks again for your responses, and for the countless other responses in the forum that has really helped me over the years.

Cheers,

Toby

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14816
    • View Profile
Hello Toby,

Without error message you never know, whether the masks have been applied or not.

In case you are using PhotoScan Professional, it's possible to mask via script with implemented checks for the presence of the corresponding mask image.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14816
    • View Profile
I think that in the next update we'll slightly change the behavior and let PhotoScan to load all available masks first and display the warning after that, notifying that some masks cannot be loaded (are missing).
Best regards,
Alexey Pasumansky,
Agisoft LLC

Davis

  • Newbie
  • *
  • Posts: 17
    • View Profile
Importing masks
« Reply #9 on: May 07, 2016, 07:29:40 AM »
Hi,

When I try to import masks, I receive a message "cant load image"
Once the software  imports a picture that dont have a mask, its stopping the import of the other masks.

Please help in solving the problem
Thanks

bisenberger

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • Digital Mapping & Graphics
Import mask for All cameras or Entire workspace fails
« Reply #10 on: June 07, 2016, 03:22:59 PM »
Import mask for  All cameras or Entire workspace fails if there is not a mask for each image. I created mask for several images in a project, many of the images did not need to be masked. I exported the mask. I created a new project using the same images. When I try to import the mask using the all cameras or entire workspace options it fails as soon it gets to image that doesn't have a mask.
Digital Mapping & Graphics LLC
https://digital-mapping.net/

Gelisob

  • Newbie
  • *
  • Posts: 4
    • View Profile
I think that in the next update we'll slightly change the behavior and let PhotoScan to load all available masks first and display the warning after that, notifying that some masks cannot be loaded (are missing).

Wow, this silly issue still havent been changed back to normal. Have hundreds of pictures, mask out tens of them and then you cant import mask for those having a mask because in the first break it still gives you "cant open file" for the one that didnt have.
Please up the reminder for the solution you proposed Alexey, the information on what didnt have masks can indeed be shown later in console with one popup reminder that "some of your selected pictures didnt have a mask file".
Right now users need to be scripting or doing tedious selection work around this missing functionality that you already had implemented before.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14816
    • View Profile
Hello Gelisob,

The issue has been fixed in some 1.2 updates, but it seems that in latest 1.3 it returned back due to some changes in the error messages handling. We'll try to fix it as soon as possible and release 1.3 update.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Gelisob

  • Newbie
  • *
  • Posts: 4
    • View Profile
Hello Gelisob,

The issue has been fixed in some 1.2 updates, but it seems that in latest 1.3 it returned back due to some changes in the error messages handling. We'll try to fix it as soon as possible and release 1.3 update.

Thank you for explaining and responding