Forum

Author Topic: Problem with processing equirectangular photos from a spherical camera  (Read 6451 times)

kalevj

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

I have a dataset of equirectangular photos taken with Ladybug 5 spherical camera after every three meters. I also have a coordinate file with the WGS84 coordinates and pitch, roll, heading values.

I set the camera type in camera calibration to 'spherical'. I mask off the car on the bottom of the photo. I import the camera coordinate file and set all the coordinate systems to WGS84.

However, when aligning photos, it does not align the photospheres in the correct locations. I've attached screenshots of the alignment result and the correct camera locations. As you can see, they do not match at all.

I've tried placing markers manually on different photos to road markings and edges of buildings but this made the results even worse.

Any ideas why this is happening? Should I just use frame photos from each individual camera instead? Is the quality of photos not sufficient? The quality is lowered to keep the filesizes more managable in long mapping campaigns.

Thanks for the help. Agisoft is a great program. Keep up the good work!

Kalev
« Last Edit: November 06, 2018, 03:51:44 PM by kalevj »

Paulo

  • Hero Member
  • *****
  • Posts: 1303
    • View Profile
Hello Kalev,

for street level spherical images, you must mask the sky as it is not possible to correctly define tie points with software in such uniform textureless areas ...

I have rapidly manually masked sky in 7 first photos of your data set and got good results... see screen shot...

It would be great to be able to automate sky masking in PS but I don' t know if it is possible...
Best Regards,
Paul Pelletier,
Surveyor

kalevj

  • Newbie
  • *
  • Posts: 4
    • View Profile
Thanks! Masking off the sky worked. :)

Masking the sky automatically would be great. Would it be possible to automatically mask areas of the images by color ranges? Because the sky is usually quite contrasting compared to trees and buildings.

Right now, I used the "Magic wand" tool. On small datasets, it's great. You have to click on all the sky areas but don't actually have to draw the mask yourself. But on larger datasets, this method would become quite time-consuming.

Kalev

Paulo

  • Hero Member
  • *****
  • Posts: 1303
    • View Profile
Have a look at https://github.com/agisoft-llc/photoscan-scripts/blob/master/src/masking_by_color_dialog.py

P tried tjis script on your image set and it masks al the image!
Best Regards,
Paul Pelletier,
Surveyor

kaaiinn

  • Newbie
  • *
  • Posts: 11
    • View Profile
Thanks! Masking off the sky worked. :)

Masking the sky automatically would be great. Would it be possible to automatically mask areas of the images by color ranges? Because the sky is usually quite contrasting compared to trees and buildings.

Right now, I used the "Magic wand" tool. On small datasets, it's great. You have to click on all the sky areas but don't actually have to draw the mask yourself. But on larger datasets, this method would become quite time-consuming.

Kalev

It is definitely possible to automate masking the sky in other software (we personally use Photoshop to do this for 360 equirectangular images). We basically set up an action and do this:
1. Cut the top 50% of the image into a new layer (along the horizon) - this means anything that happens to have the same colour as the sky in the bottom of the image is not masked out)
2. Open up the layer styles dialogue and then adjust the blending option sliders on grey (since I am in Scotland!) or blue to remove the sky.
3. set the background of the image to be black and the front image to be white (black parts work as the mask).
4. Merge layers back together.


Unfortunately this relies on a lot of factors (images taken with a straight orientation i.e. no squint horizons, and a consistent sky in all of your images). there are probably better ways to do this, I am currently investigating myself! You can also use colour selection tool in Photoshop - however again this relies on you having a very consistently coloured sky.

An addition in Photoscan to be able to do this would be hugely beneficial.. Even just a colour selection mask would be great. It would make Photoscan an all in one application for this process which would be incredible.

Will definitely have to try out the script.
Have a look at https://github.com/agisoft-llc/photoscan-scripts/blob/master/src/masking_by_color_dialog.py

P tried tjis script on your image set and it masks al the image!

kalevj

  • Newbie
  • *
  • Posts: 4
    • View Profile
I used the script in Paulo's post to mask off the sky. Sorry, that I forgot to reply earlier. Many thanks! :)

Overall, it worked well. Some mistakes here or there but for the most part, the automatic masking was correct. Very easy to use as well.

kaaiinn

  • Newbie
  • *
  • Posts: 11
    • View Profile
Yes, I also have just tried the script, and once you find the 'sweet spot' for the sky it works superbly well. Currently trying to adapt the script to give me back the option of only masking out that colour in the top 50% of the image. Would you be interested in having this option also? I can post it here if wanted.

kalevj

  • Newbie
  • *
  • Posts: 4
    • View Profile
Hey cmckain, yes, I would be interested in that option. :)

James

  • Hero Member
  • *****
  • Posts: 748
    • View Profile
Nice dataset! I enjoyed playing with it. I got good alignment straight away using the following settings/method.

import photos/coordinates and set spherical camera type as you already did.

mask the car and sky in the first photo only.

align images on high with reference preselection mode, and use "apply masks to tie points" settings. (they all align correctly on first attempt) see here about new background suppression technique http://www.agisoft.com/forum/index.php?topic=8491.0

then i used gradual selection to delete 10% worst points based on reprojection error and projection accuracy (although i don't know what that second one is....)

then optimise, and then build a dense cloud at low just to show the result, attached.
« Last Edit: April 27, 2018, 02:26:14 PM by James »

kaaiinn

  • Newbie
  • *
  • Posts: 11
    • View Profile
By chance, I was playing around with this dataset and had almost the exact same workflow as kalevj.

Seemed to work reasonably well.

Not done an alignment of 360 degree equirectangular images along a transect before, only in a grid format - I believe that it does turn out a lot better in a grid format due to the increased chance of overlap.

Anyway, screenshot attached of my results.

Thanks for the dataset!

ojedaramirezs

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Problem with processing equirectangular photos from a spherical camera
« Reply #10 on: December 02, 2019, 05:53:36 PM »
Hello Kalevj,

Could you please tell me how to get the pitch, roll, heading values of the spherical camera, I have a RICOH Theta Z1 and what was your final result? Which was the value for accuracy and error?

Thanks! :)

Kiesel

  • Sr. Member
  • ****
  • Posts: 332
    • View Profile
Re: Problem with processing equirectangular photos from a spherical camera
« Reply #11 on: December 11, 2019, 05:29:03 PM »
Hello ojedaramirezs,

normally you don't need pitch, roll and heading of the spherical images to align them. Just choose spherical as camera  type in Tools/Camera Calibration and then hit align.
You can also try to work instead with the fisheyes of the Ricoh Theta Z1 to avoid errors introduces by stitching errors to spherical (panoramic) images.

Best regards,

Kiesel