Forum

Author Topic: Importing LIDAR Data  (Read 22855 times)

craigbauer

  • Newbie
  • *
  • Posts: 1
    • View Profile
Importing LIDAR Data
« on: January 25, 2018, 10:20:35 AM »
I'm wondering if there is a way to import a dense point cloud from LIDAR and merge it with the PhotoScan photogrammetry data (possibly to even use it as a reference for the photogrammetry alignment).

I can import a dense cloud, but can't seem to get it to display or merge with my existing data.

Thanks!
-c

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15282
    • View Profile
Re: Importing LIDAR Data
« Reply #1 on: January 26, 2018, 06:47:55 PM »
Hello craigbauer,

Currently imported dense cloud overwrites the existing one, so at the moment the option is to export the original cloud from PhotoScan, merge it externally with LiDAR data and import back.

Meanwhile we are considering the merging functionality for the imported clouds.
Best regards,
Alexey Pasumansky,
Agisoft LLC

tuffi

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Importing LIDAR Data
« Reply #2 on: February 05, 2018, 07:36:39 PM »
One info:

if I co register my PS cloud with an external cloud (eg. LIDAR with ICP) when I reiport the cloud on PS the camera location are recalculated based on new coordinate and the orthomosaic will be generate with new coordinate?

Emanuele

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15282
    • View Profile
Re: Importing LIDAR Data
« Reply #3 on: February 05, 2018, 07:47:43 PM »
Hello Emanuele,

The model in PhotoScan is georeferenced based on the coordinate information available in the Reference pane, so the imported dense cloud or DEM wouldn't have any effect on the camera positions estimated by PhotoScan.
Best regards,
Alexey Pasumansky,
Agisoft LLC

obw

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: Importing LIDAR Data
« Reply #4 on: February 07, 2018, 03:12:56 PM »
When you re-import a merged pointcloud, and create a mesh from this, will you be able to create textures from the original images to this new mesh since they are already in the project? And will this have any effect whatsoever, compared to just using the raw pointcloud from AS?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15282
    • View Profile
Re: Importing LIDAR Data
« Reply #5 on: February 07, 2018, 03:38:58 PM »
Hello obw,

Currently the imported dense cloud substitutes the existing dense cloud in the chunk (if available), so later there wouldn't be any difference in how the cloud is treated during the later processing stages - mesh or DEM can be generated from this cloud and texture/ orthomosaic can be generated based on the reconstructed surface. But for the position of the imported cloud it's necessary to fit the camera alignment properly, otherwise the projected texture/orthomosaic would be affected.
Best regards,
Alexey Pasumansky,
Agisoft LLC

flydrones

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Importing LIDAR Data
« Reply #6 on: March 27, 2018, 04:32:26 PM »
Hello,

Another case, but what if I just want to use the LiDAR point cloud, then use the with the photo to do the Ortho? Can I import the point cloud, the images (with camera calibration parameters and precise position/orientation), and start the process from there?

Basically, bypassing completelty the sparse/dense point clould generation from photo, and starting the workflow after that.

Thanks

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15282
    • View Profile
Re: Importing LIDAR Data
« Reply #7 on: March 27, 2018, 05:12:23 PM »
Hello flydrones,

In principle it is possible to assign the exterior orientation data to the cameras using Python script, then import DEM or dense cloud referenced in the same coordinate system and build orthomosaic according to this information (of course, calibration parameters should be also loaded).
Best regards,
Alexey Pasumansky,
Agisoft LLC

flydrones

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Importing LIDAR Data
« Reply #8 on: March 27, 2018, 08:48:27 PM »
OK, that sounds tricky, but we'll try and revert back here. I'll have to find out of to do a python script, but I look on the forum to see if someone has done that before.
Thanks for the fast support.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15282
    • View Profile
Re: Importing LIDAR Data
« Reply #9 on: March 27, 2018, 09:24:41 PM »
Hello flydrones,

You can use the following sample script as a reference:

Code: [Select]
import PhotoScan, math
chunk = PhotoScan.app.document.chunk
T = chunk.transform.matrix
for camera in chunk.cameras:

yaw, pitch, roll = math.pi * camera.reference.rotation / 180.
sinx = math.sin(pitch)
cosx = math.cos(pitch)
Rx = PhotoScan.Matrix([[1, 0, 0], [0, cosx, -sinx], [0, sinx, cosx]])
siny = math.sin(roll)
cosy = math.cos(roll)
Ry = PhotoScan.Matrix([[cosy, 0, siny], [0, 1, 0], [-siny, 0, cosy]])
sinz = math.sin(-yaw)
cosz = math.cos(-yaw)
Rz = PhotoScan.Matrix([[cosz, -sinz, 0], [sinz, cosz, 0], [0, 0, 1]])
R = Rz * Rx * Ry

coord = camera.reference.location
coord = chunk.crs.unproject(coord)
m = chunk.crs.localframe(coord)

R = 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]]]).t() * R * PhotoScan.Matrix().Diag((1, -1, -1))

row = list()
for j in range(0, 3):
row.append(PhotoScan.Vector(R.row(j)))
row[j].size = 4
row[j].w = coord[j]
row.append(PhotoScan.Vector([0, 0, 0, 1]))
M = PhotoScan.Matrix([row[0], row[1], row[2], row[3]])
camera.transform = T.inv() * M

chunk.updateTransform()

It should be run when for active chunk every camera has coordinate and angle information input in the Reference pane.
Best regards,
Alexey Pasumansky,
Agisoft LLC

flydrones

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Importing LIDAR Data
« Reply #10 on: March 27, 2018, 11:46:53 PM »
Thanks a lot

flydrones

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Importing LIDAR Data
« Reply #11 on: March 30, 2018, 01:25:42 AM »
I figured out the script and I can upload the LAS file.

When I try to create the mesh, I have an error "empty region". Any idea?

Thanks

« Last Edit: March 30, 2018, 10:26:32 PM by flydrones »

flydrones

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Importing LIDAR Data
« Reply #12 on: May 08, 2018, 07:49:46 PM »
Hello,

I have a project for which I have coordinates in UTM and Omega, Phi, Kappa for angles, and not ROll, Pitch, Heading.

Can you tell me how to "fix" the exterior orientation? If I just import them, it still requires to align camera.

Thanks

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15282
    • View Profile
Re: Importing LIDAR Data
« Reply #13 on: May 08, 2018, 07:58:42 PM »
Hello flydrones,

When importing the coordinate information via Import CSV dialog you can change the angle convention from YPR to OPK.

In principle, it is possible to stop PhotoScan from adjusting the exterior and interior orientation parameters, providing that they are know (usually it is the case, when they are estimated in other phtoogrammetric packages). For these purposes servers File Menu -> Import -> Import Cameras option that is then accompanied with Build Points procedure. Build Points operation is just performing the image matching basing on the known and fixed parameters of exterior/interior orientation.

But if the coordinates and angles comes from the onboard GPS/IMU device, then you should still perform the image alignment and use this reference information for optimization and georeferencing purposes.
Best regards,
Alexey Pasumansky,
Agisoft LLC

flydrones

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Importing LIDAR Data
« Reply #14 on: May 08, 2018, 11:37:49 PM »
Hello, thanks for your answer, sorry I was not clear.

Yes, I changed to OPK, no problem there.

The data I use is very precise, I want to process without alignment (fast mapping), using LiDAR data to orthorectify and product orthophoto.

When I import them using the CSV , they display properly. I am just looking for the command that say "those are aligned"

When using your script above (when I had data with RPY), it worked. I assume the same script will not work with OPK...

in short, what I am trying to do now is to import an alignement where I have: PIc ID, Easting, northing, Alt, Omega, Phi, Kappa.

Is that possible?
« Last Edit: May 08, 2018, 11:48:03 PM by flydrones »