Forum

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - gchaprnka

Pages: [1]
1
I've been working on a short script to process a batch of photo sets taken with a small camera rig (15 cameras). Manually, the process works fine, but I'm noticing a difference when writing the script. First, the manual process:

1) Add Photos
2) Import markers (exported from a photoset of a calibration object with a set of known markers)
3) Align photos

The process continues, but at this point I have a sparse point butt of the subject, aligned to my coordinate system and scaled appropriately.

The code that I'm using to replicate this process (I've set the cwd to the directory with the pics in it already):
Code: [Select]
pics = ["1.jpg","2.jpg","3.jpg","4.jpg","5.jpg","6.jpg","7.jpg","8.jpg","9.jpg","10.jpg","11.jpg","12.jpg","13.jpg","14.jpg","15.jpg"]
chunk = doc.addChunk()
chunk.importMarkers(markerPath)
chunk.addPhotos(pics)
chunk.matchPhotos(accuracy=Metashape.HighAccuracy, generic_preselection=True,reference_preselection=False)
chunk.alignCameras()

When running the script, I get a sparse butt and the targets exist, but are not where I'd expect them to be (relative to the cameras) based on the manual process. I've attached a pair of screenshots showing the different results from manual vs. script. As a side note - manually, it does not matter if markers are imported before or after cameras are aligned, it works either way. Neither way works in the script.

2
Python and Java API / How to split calibration groups in python?
« on: January 05, 2016, 03:25:30 AM »
In some instances I've noticed improved processing by splitting cameras into individual calibration groups (1 per camera) instead of the default grouping (based on a non-exact focal length). I've been looking through the documentation, and the only thing that stands out as being similar is cameraGroups, but it does not seem to be separating them. Is there a way to "split camera calibration"?

In the GUI, Tools>Camera Calibration>right click on a group and "Split Groups" is what I'm looking to do.

3
Python and Java API / Error in 1.2.0 addChunk
« on: December 11, 2015, 09:17:33 PM »
Script was running well in 1.1.6, but now crashes in 1.2.0. I updated other calls as shown in http://www.agisoft.com/forum/index.php?topic=4588, but this fails too.


2015-12-11 11:59:34     doc2.addChunk(chunk.copy())
2015-12-11 11:59:34 TypeError: addChunk() takes no arguments (1 given)

4
Python and Java API / Import Cameras/Build Points?
« on: April 04, 2015, 01:12:01 AM »
I'm trying to automate the processing of data from a small camera array, and take advantage of the import cameras feature. heres the code I'm using:

Code: [Select]
import sys
import operator
import os
import PhotoScan
import math

label = "Scan 010"
workingPath = "C:\\Test Shots\\Scan 010" + "\\"
cameraPath = "C:\\Test Shots\\cameras.xml"

doc = PhotoScan.app.document
chunk = PhotoScan.Chunk()
chunk.label = label #"My Chunk"
doc.addChunk(chunk)

files = os.listdir(workingPath)
file_list=[]
for file in files:
if file.endswith("JPG"):
filePath = workingPath + file
file_list.append(filePath)

chunk.addPhotos(file_list)

chunk.importCameras(cameraPath)
chunk.buildPoints()

and it goes on to do the processing. I previously had it working with:
Code: [Select]
chunk.detectMarkers()
chunk.matchPhotos(accuracy=PhotoScan.MediumAccuracy, preselection=PhotoScan.Preselection.NoPreselection)
chunk.alignCameras()

It doesn't seem that the BuildPoints step is happening. If I stop the script at that point, I have aligned cameras but no points. Did the syntax change in the latest version? (I updated today to 1.1.4 build 2021(64bit))

Pages: [1]