Forum

Poll

Automatic mask in photoshop

usefull
7 (77.8%)
useless
2 (22.2%)

Total Members Voted: 9

Author Topic: Automatic mask in PhotoShop  (Read 37556 times)

AcademiaBA

  • Newbie
  • *
  • Posts: 14
    • View Profile
Automatic mask in PhotoShop
« on: December 09, 2013, 06:25:17 PM »
Hello everyone;

As I heard many time here if the forum, you need to make a photo taking the object from bakcgroun to use for automati masking in ps, does anybody know how do I have to make an automatic mas in photoshop with a empty background photo and rest of the photos?

Thank you!

admir

  • Jr. Member
  • **
  • Posts: 93
    • View Profile
Re: Automatic mask in PhotoShop
« Reply #1 on: December 09, 2013, 07:04:44 PM »
You can try putting image with object on top layer of background and use Difference blend mode. Add image adjuster (levels, curves, brightness/contrast) on that layer to mask out.

However if you have your background image why dont you simply use in Photoscan in masking options.

Admir

AcademiaBA

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Automatic mask in PhotoShop
« Reply #2 on: December 10, 2013, 02:08:35 AM »
I did not know that I do it also with PhotoScan. thanks !

another question, do you know how the option "mask by a model" works? What model exactly it refers and in which cases is more handy ?

thanks a lot  :D

admir

  • Jr. Member
  • **
  • Posts: 93
    • View Profile
Re: Automatic mask in PhotoShop
« Reply #3 on: December 10, 2013, 11:36:42 AM »
I did not know that I do it also with PhotoScan. thanks !

another question, do you know how the option "mask by a model" works? What model exactly it refers and in which cases is more handy ?

thanks a lot  :D

For mask by model to work, you need to reconstruct 3d model, export it (can edit in external app) and use it as mask. With new build dense meshes option, for me it is better option then mask by a model.

If you have static cameras (turntable for example) i used to make background image by hand in Photoshop ,painting similar colors over subject. and it worked well. It is usefull if you forget to take background image or it is faulty for some reason.

AcademiaBA

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Automatic mask in PhotoShop
« Reply #4 on: December 10, 2013, 12:30:14 PM »
Thank you Admir!

Do you think it?s better to mask in PhotoShop or in PhotoScan, with the mask from background option?

Actully I did it in photoscan and I did not get the result I expected. I just works masking from background in current image, not in current chunk!

I hvae at least 3 different camera positions, so I have to have 3 photos of background without image.
1- I load them along with others photos in the chunk
2- Clicking on one of them, I choose Export mask for Active Chunk , file type: single channel mask image, and give it a name and save it. I go through these steps for the rest two photos of background, but in different chunks.
3- Then I Import the mask by option from background and choosing its folder.
4- Then I?ll move all photos in one chunk.
5- For photos of details, I mask them manually.

Am I doing wrong? Coz for some chunk the mask does not work!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14765
    • View Profile
Re: Automatic mask in PhotoShop
« Reply #5 on: December 10, 2013, 05:25:24 PM »
Hello AcademiaBA,

The procedure should be the following:
- open empty PhotoScan project,
- create separate chunk for each camera position (three in your case),
- make the first chunk active by double-clicking on its label in the Workspace pane,
- go to Tools -> Import Masks dialog, choose from background option and indicate that it should be applied to the active chunk,
- specify background image filename in the "mask file names" field,
- adjust tolerance value,
- click OK,
- in the opened dialog browse for the folder background image is present,
- click OK.
- repeat for each chunk (don't forget to change background image filename in the Import Masks dialog).
Best regards,
Alexey Pasumansky,
Agisoft LLC

AcademiaBA

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Automatic mask in PhotoShop
« Reply #6 on: December 16, 2013, 03:31:36 PM »
Thank you so Much y sorry for delay!

Marcel

  • Sr. Member
  • ****
  • Posts: 309
    • View Profile
Re: Automatic mask in PhotoShop
« Reply #7 on: February 04, 2014, 11:43:37 AM »
The method of importing a mask from a file and apply it to all photos is a bit confusing.

Instead of a 'filename' field and a separate dialog box to select the folder, it would be much clearer if we could just select a file directly with a dialog box.

David Cockey

  • Full Member
  • ***
  • Posts: 209
    • View Profile
Re: Automatic mask in PhotoShop
« Reply #8 on: February 05, 2014, 07:12:09 AM »
I did not know that I do it also with PhotoScan. thanks !

another question, do you know how the option "mask by a model" works? What model exactly it refers and in which cases is more handy ?

thanks a lot  :D

For mask by model to work, you need to reconstruct 3d model, export it (can edit in external app) and use it as mask. With new build dense meshes option, for me it is better option then mask by a model.

If you have static cameras (turntable for example) i used to make background image by hand in Photoshop ,painting similar colors over subject. and it worked well. It is usefull if you forget to take background image or it is faulty for some reason.
No need to export the 3D model to use it in "mask by model". Build the mesh in PhotoScan and trim as desired. Then right click on a photo, select Import Mask, select "From Model" as method, select what masks should be applied in "Import masks for", and click okay. Masks will be created based on the mesh. Areas outside of the model will be masked in the photos.

I frequently use Mask from Model in situations where the background is moving relative to the object by a small amount, such as a boat tied to a dock or an object which was bumped while being photographed. I align photos, create a dense point cloud and build an initial mesh without masking. Masks are then created using the initial mesh. The masked photos are re-aligned. The masks are then removed and a new dense point cloud is created and mesh built.

Steve003

  • Full Member
  • ***
  • Posts: 169
    • View Profile
Re: Automatic mask in PhotoShop
« Reply #9 on: June 24, 2019, 09:55:10 PM »
Hi David,
Is there not going to be a catch22 situation, unable to use the model to chop away accurately at the baseboard where the model touches it, due to a snowdrift effect going on, because the photos needed masking prior to use to deter Agisoft from creating a poor definition at that object/baseboard junction ?

in other words or maybe saying it just as badly, to get a model  with well defined object/baseboard junction so as to edit mesh away and create the masks, one needs well masked photos and to use agisoft to mask all the photos in one fell swoop with this method we need the model already created from well masked photos.


I have several chunks, each one where the object was repositioned on the gridded table beyond which is a concrete floor and buildings, flor and buildings which appear occasionally in some of the shots, gridded table in all.

I am wondering how I remove all those backgrounds as fast as possible.

If I generate model first, surely the existence of the backgrounds will cause inaccuracies, poor edges where it touches grid etc, but to do as your method and delete background away from model  which I also saw on youtube and liked the idea of, I have to create an accurate model, so catch22.

Steve


« Last Edit: June 24, 2019, 10:05:36 PM by Steve003 »