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 - Zim240

Pages: [1]
1
Bug Reports / MatchPhotos.prematch: Invalid data type
« on: November 08, 2019, 08:26:30 AM »
Good day,

I am trying to match some images using the network processing.

I am getting the following error in each line of the log:
2019-11-08 07:21:17 [10.0.3.147:57321] failed #0 MatchPhotos.prematch (64/100): Invalid data type
2019-11-08 07:22:28 [10.0.3.147:57321] failed #0 MatchPhotos.prematch (65/100): Invalid data type
2019-11-08 07:23:38 [10.0.3.147:57321] failed #0 MatchPhotos.prematch (68/100): Invalid data type

What could be causing this problem?

Thanks

2
General / Import Cameras - Issues
« on: February 24, 2018, 12:44:00 AM »
Good day,

I am importing cameras from external sources using the import camera function.

I am using bingo.dat format.

Below is the file content:

*   <____Photo_ID__><___Easting__><__Northing__><__Height_><___Phi__><__Omega_><__Kappa_><____Camera_ID_>
ORIA    07044634.jpg    374281.163    863977.346   1036.290    3.1500    0.1307   -3.0353         S000000
ORIA    07045014.jpg    374476.399    873007.337   1054.190    0.0515   -2.2880  121.6280         S000000
ORIA    07045017.jpg    374302.955    872910.869   1052.826    3.8781   -0.6670  120.1826         S000000

Also the camera information in bingo.dat

file_version: 1

begin gridgroup "Image deformation grids"
    enabled:     yes
    order_index: 0
    camera_name: "iXU1000-R (50mm)"
    description: "Calibration grid"

    begin grid "Image deformation grid 1"
        enabled:       yes
        inverse_scale: 1.000000
        columns:          27
        rows:             21
        description:   " "

        begin gridpoints
               -26.3040    -20.2381    -26.0000    -20.0000
               -24.2631    -20.2235    -24.0000    -20.0000
               -22.2250    -20.2087    -22.0000    -20.0000
               -20.1899    -20.1942    -20.0000    -20.0000
               -18.1582    -20.1801    -18.0000    -20.0000
               -16.1298    -20.1667    -16.0000    -20.0000
               -14.1048    -20.1543    -14.0000    -20.0000
               -12.0829    -20.1431    -12.0000    -20.0000
               -10.0640    -20.1333    -10.0000    -20.0000
                -8.0476    -20.1250     -8.0000    -20.0000
                -6.0334    -20.1185     -6.0000    -20.0000
                -4.0209    -20.1137     -4.0000    -20.0000

When I am done importing, I import the orientation details into the reference pane also.

For some reason the orientations give large errors on the reference pane. (See screenshot)

Why is this happening?

After I import cameras, I import an mesh and produce an orthomosaic with planer XY projection. With the current state of affairs I see large mismatches on the seamlines as photoscan has changed the exteriors somehow.

Thank you in advance for your help.

3
Python and Java API / Generate camera transformation matrix from OPK data
« on: February 24, 2018, 12:20:08 AM »
I am trying to get the below script working to use either the loaded OPK information in the reference tab or load from an external file. The script should function as import cameras function.

This will allow exterior orientations to be assigned to the cameras and Photoscan image alignment will not be needed.

The exteriors needs to be assigned to a specific chunk only.

The idea is to use exterior orientations from a (Image X Y Z Omega Phi Kappa) file and assign them to a specific chunk of photos. I do not want to align the photos with Photoscan.

Your help will be greatly appreciated.

Could you please provide a full script?
I managed to add at the beginning:
import math, PhotoScan

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

but there is still problem with line 16:
sina = math.sin(0 - omega)
2016-04-11 12:08:39 NameError: name 'omega' is not defined

 


Hello dellagiu,

Using the following script you should be able to generate camera transformation matrix from OPK data:


Code: [Select]
import math, PhotoScan

#omega, phi, kappa - in radians
#X, Y, Z - coordinate information about camera position in units of the corresponding coordinate system


T = chunk.transform.matrix
v_t = T * PhotoScan.Vector( [0, 0, 0, 1] )
v_t.size = 3
m = chunk.crs.localframe(v_t)
m = m * T
s = math.sqrt(m[0, 0] **2 + m[0,1] **2 + m[0,2] **2) #scale factor

sina = math.sin(0 - omega)
cosa = math.cos(0 - omega)
Rx = PhotoScan.Matrix([[1, 0, 0], [0, cosa, -sina], [0, sina, cosa]])
sina = math.sin(0 - phi)
cosa = math.cos(0 - phi)
Ry = PhotoScan.Matrix([[cosa, 0, sina], [0, 1, 0], [-sina, 0, cosa]])
sina = math.sin(0 - kappa)
cosa = math.cos(0 - kappa)
Rz = PhotoScan.Matrix([[cosa, -sina, 0], [sina, cosa, 0], [0, 0, 1]])
 

t = PhotoScan.Vector([X, Y, Z])
t = chunk.crs.unproject(t)

m = chunk.crs.localframe(t)
m = PhotoScan.Matrix([ [m[0,0], m[0,1], m[0,2]], [m[1,0], m[1,1], m[1,2]], [m[2,0], m[2,1], m[2,2]] ])


R = m.inv() * (Rz * Ry * Rx).t()  * PhotoScan.Matrix().diag([1, -1, -1])

Tr = PhotoScan.Matrix([ [R[0,0], R[0,1], R[0,2], t.x], [R[1,0], R[1,1], R[1,2], t.y], [R[2,0], R[2,1], R[2,2], t.z], [0, 0, 0, 1]])

camera.transform = chunk.transform.matrix.inv() * Tr * (1. / s)

Pages: [1]