Agisoft Metashape

Agisoft Metashape => Python and Java API => Topic started by: SK12345 on May 16, 2018, 02:56:12 PM

Title: Using Stereo Cameras with Photoscan
Post by: SK12345 on May 16, 2018, 02:56:12 PM
Hello,

I am new to Photoscan and I'm looking for a way to use stereo image pairs in Photoscan. I am using a Stereolabs ZED camera with a baseline of 120mm. I am hoping for a way to create a scaled point cloud with the use of the known baseline.

I have found some suggestions for manually using scale bars, however I'm not sure how I can do this efficiently for a large data set.

I have a few hundred pairs of images named as "left_000XXX.png" and "right_000XXX.png" where XXX is the image number.

Any suggestions would be greatly appreciated!

Thanks!
Title: Re: Using Stereo Cameras with Photoscan
Post by: Alexey Pasumansky on May 16, 2018, 06:35:58 PM
Hello SK12345,

In the nearby thread there are some examples of the automatic scale bar creation using Python:
http://www.agisoft.com/forum/index.php?topic=9012.0

For your case you can try the following script:
Code: [Select]
import PhotoScan
chunk = PhotoScan.app.document.chunk
cameras = list(chunk.cameras)
while cameras:
    camera1 = cameras.pop(0)
    for camera2 in cameras:
        if camera1.label.rsplit("_", 1)[1] == camera2.label.rsplit("_", 1)[1]:
            cameras.remove(camera2)
            scalebar = chunk.addScalebar(camera1, camera2)
            scalebar.reference.distance = 0.12
            break
print("script finished")

Title: Re: Using Stereo Cameras with Photoscan
Post by: SK12345 on May 17, 2018, 05:15:54 AM
Thank you for the help Alexey, much appreciated! The Python script worked perfectly.

One other question if you don't mind, I have potentially 10000 image pairs from each flight, however I usually cut it down to every Nth image for processing. Is there any better way to use Photoscan to choose the most suitable/good quality image pairs from a large set rather than taking every 20th image pair for example?

Thanks again!
Title: Re: Using Stereo Cameras with Photoscan
Post by: l.chrobak on January 28, 2019, 07:28:50 PM
Is there a way to set the baseline for a large number of images in the the GUI (without using a script)?