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.


Messages - oto

Pages: [1]
1
Agisoft Viewer / Re: [Contextcapture 3mx] Can't open layer
« on: October 08, 2024, 11:45:06 PM »
Still happens on latest Viewer. Model produced in iTwin capture modeler(a.k.a. Contextcapture). Sent an email.

2
Feature Requests / Contextcapture 3MX
« on: September 10, 2024, 11:28:51 PM »
Improve 3MX format:
  • Add multiple layer support
  • Add support geometryFile to external OBJ file
  • Add support for extended 3mx format. XYZ resource


3
Feature Requests / Re: ECW export
« on: September 10, 2024, 10:38:58 PM »
ECW is gone open as patents has expired so no more need stick to JPEG2000.

4
Agisoft Viewer / [Contextcapture 3mx] Can't open layer
« on: September 10, 2024, 10:33:58 PM »
Not all 3MX productions can be opened in Viewer. Some files gives error "Can't open layer". Seems related to not able to find GTX geoid but it shouldn't cause such critical error.
Also ENU coordinate system is not supported.

5
Python and Java API / Re: more on Import and Export Cameras python commands
« on: November 08, 2016, 12:24:49 PM »
This script worked and result is correct, thanks. Why the exported files are not identical from both scripts?

Code: [Select]
#export cameras coordinates and orientation as omega,phi,kappa (OPK) using exportCameras function
#compatibility: Agisoft PhotoScan Professional 1.2.6

# Define: Cameras output file
CamerasOPKFile = PhotoScan.app.getSaveFileName("Please specify export path and filename/opk:")

# Define: Coordinate system
CoordinateSystemEPSG = "EPSG::32632"

# DEFINE PROCESSING SETTINGS
print("---Defining processing settings...")

# INIT ENVIRONMENT
import PhotoScan
import math

doc = PhotoScan.app.document
chunk = doc.chunk

# SET COORDINATE SYSTEM
print("---Settings coordinate system...")
# init coordinate system object
#CoordinateSystem = PhotoScan.CoordinateSystem()
#chunk.crs = PhotoScan.CoordinateSystem( CoordinateSystemEPSG)

if not(CoordinateSystem.init(CoordinateSystemEPSG)):
   app.messageBox("Coordinate system EPSG code not recognized!")
# define coordinate system in chunk
#chunk.crs = CoordinateSystem
#chunk.projection = CoordinateSystem

# EXPORT DATA:

# EXPORT CAMERAS
print("---Exporting camera positions...")
if not(chunk.exportCameras(CamerasOPKFile, "opk")):
   app.messageBox("Exporting Cameras OPK failed!")

print("exported cameras to",CamerasOPKFile)


6
Python and Java API / Re: more on Import and Export Cameras python commands
« on: November 08, 2016, 09:50:52 AM »
I would like to export camera positions and rotation to CSV file. Problem is that script works but for some reason the rotation for some cameras is wrong. Will try exportCameras function but still interesting why the rotation is wrong when imported in other software.  ???

7
Python and Java API / Re: more on Import and Export Cameras python commands
« on: November 03, 2016, 10:57:28 AM »
Hello!

I updated the example code to also export orientation in OPK. Unfortunately after importing the exported cameras in other software the orientation is not correct for some cameras. Compared rotation matrix and it matches in both softwares. Could it be that orientation is wrong related to fact that photos in chunk are not made with same camera model?

Code: [Select]
#export cameras coordinates and orientation as omega,phi,kappa (OPK)
#compatibility: Agisoft PhotoScan Professional 1.2.6

import PhotoScan
import math

path = PhotoScan.app.getSaveFileName("Please specify export path and filename:")

file = open(path, "wt")
#chunk = PhotoScan.app.document.activeChunk
doc = PhotoScan.app.document
chunk = doc.chunk


if chunk.transform:
#T = chunk.transform
T = chunk.transform.matrix
else:
T = PhotoScan.Matrix().diag([1,1,1,1])


print("Script started")

for camera in chunk.cameras:
if camera.transform:

coords = T.mulp(camera.center)
#x, y, z = T.mulp(camera.center)

#omega, phi, kappa = PhotoScan.utils.mat2opk(T.rotation)
m = chunk.transform.matrix * camera.transform * PhotoScan.Matrix().diag([1,-1,-1,1]) #camera transformation matrix has been multiplied by 180-degree rotation matrix, since the direction of Z axis in camera system is inverted compared to the world coordinate system.
rotation = m.rotation()
omega, phi, kappa = PhotoScan.utils.mat2opk(rotation)
print(camera.label)
print(rotation)
#print(omega, phi, kappa)
#print(x)

file.write(camera.label + "\t{:.5f}".format(coords[0]) + "\t{:.5f}".format(coords[1]) + "\t{:.5f}".format(coords[2]) + "\t{:.5f}".format(omega)+"\t{:.5f}".format(phi)+"\t{:.5f}".format(kappa)+"\n")
#yaw, pitch, roll = PhotoScan.utils.mat2ypr(PhotoScan.utils.opk2mat(PhotoScan.Vector((omega, phi, kappa))).t())

file.close()
print("Script finished")

Pages: [1]