Forum

Author Topic: Street View Image masking  (Read 7173 times)

Paulo

  • Hero Member
  • *****
  • Posts: 1362
    • View Profile
Street View Image masking
« on: January 12, 2016, 08:32:48 PM »
Hi all,

I have street view images taken from a Garmin Virb camera on top of a car. In the image matching process, I would like to apply a mask to images to eliminate all blue sky. Is there a quick way to apply a quick mask to photos from blue color value?

I am not very familiar with masking and any help will be welcome  :)

Thanks in advance and here is sample image,
Best Regards,
Paul Pelletier,
Surveyor

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15177
    • View Profile
Re: Street View Image masking
« Reply #1 on: January 12, 2016, 08:42:49 PM »
Hello  pap1956@gmail.com,

You can create the image of the same size as the originals and fill it with the blue color. Then use Background masking option in the Import Masks dialog.

Also you can use the following script that works in a similar way:
http://wiki.agisoft.com/wiki/Masks_From_Color.py
But here you are allowed to choose the desired color, for example, using screen color picking.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Paulo

  • Hero Member
  • *****
  • Posts: 1362
    • View Profile
Re: Street View Image masking
« Reply #2 on: January 12, 2016, 09:38:10 PM »
Thanks Alexei,

I am using the script and it helps. As the blue tone varies quite a bit, I guess I should use a bigger tolerance to catch more of the sky background....
Best Regards,
Paul Pelletier,
Surveyor

Paulo

  • Hero Member
  • *****
  • Posts: 1362
    • View Profile
Re: Street View Image masking
« Reply #3 on: January 12, 2016, 11:46:37 PM »
Hello Alexei,

I would like to be able to import masks from background applying to all cameras different tints of blue from various background imeges in an additive operation so as to get best possible selection of blue sky.

See attached screen copy of various blue tints background I would like to import secuentially to get best masked sky...

Can this be done thru Import masks tool?



Best Regards,
Paul Pelletier,
Surveyor

bigben

  • Sr. Member
  • ****
  • Posts: 406
    • View Profile
Re: Street View Image masking
« Reply #4 on: January 13, 2016, 08:54:18 AM »
I usually do this sort of thing externally using a Photoshop action using a colour range selection to create an alpha. Depending on your scene this may also mask out areas of interest. If there's a lot of variation I set the colour range selection to manual input so it sets up the selection but gives you an opportunity to tweak it.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15177
    • View Profile
Re: Street View Image masking
« Reply #5 on: January 13, 2016, 12:03:33 PM »
Hello pap1956,

If the proposed method with masking in Photoshop with import from alpha is not more convenient, you can use the following filename template option in the Import Masks dialog to get "background" masking from individual images:
Best regards,
Alexey Pasumansky,
Agisoft LLC

Paulo

  • Hero Member
  • *****
  • Posts: 1362
    • View Profile
Re: Street View Image masking
« Reply #6 on: January 13, 2016, 08:45:19 PM »
Thanks,

but if I use Filenum template, the software expects to have as many background images as photos in my chunk. What I want is to apply let's say some 4 background images, each containing a diffrenet tone of blue (like in previous screen shot).

So I tried using {frame} template in Import masks dialog. And then I navigate to folder Mask1/ containing file 1_mask.jpg.

It runs but after, the selected images show no dark areas as being masked....  ??

Attached are 2 screen copies of Import masks dialog and result

Any idea?

Best Regards,
Paul Pelletier,
Surveyor

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15177
    • View Profile
Re: Street View Image masking
« Reply #7 on: January 13, 2016, 09:10:57 PM »
Hello pap1956,

You can use then same approach like in the first reply, but apply the mask import from one image to the selected cameras and repeat it manually four times.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Paulo

  • Hero Member
  • *****
  • Posts: 1362
    • View Profile
Re: Street View Image masking
« Reply #8 on: January 14, 2016, 04:21:14 AM »
It seems I don't get something. I run import masks with:

- from Background method;
- with union operation (as I want succesive image background blue tints to add to masked sky);
- with {filenum}_mask.jpg template;
- tolerance greater than 0;
- and apply to selected cameras.

I select the folder containing my 4 background images named 1_mask.jpg,2_mask.jpg,3_mask.jpg and 4_mask.jpg.

The process runs and my selected images appear with no dark areas.

However If I run the same process but with tolerance set to 0 than all selected images show completely dark, ie completely masked...

Could you explain what is happening?
Best Regards,
Paul Pelletier,
Surveyor