Forum

Author Topic: Problems with dense cloud and DEM in 1.4.1  (Read 3651 times)

andyroo

  • Sr. Member
  • ****
  • Posts: 440
    • View Profile
Problems with dense cloud and DEM in 1.4.1
« on: May 25, 2018, 09:28:12 PM »
I am working on a project in PS 1.4.1  EPSG::6318 (geoid loaded - navd88-12b.tif) with 39 images covering a few km of beach in California (Nikon D800 36 megapixel), no camera coordinates and a single ground control point (experiment). I have some weirdness.

When I generate the dense cloud with python script or console I can see it in the chunk and model views (60M points), my ground control is in the right place, and I can see the depth maps in the image pane when I select them (keep depth maps is enabled), but Workflow/Build DEM is grayed out in the dropdown options.

When I build the DEM programmatically in EPSG::6339 it takes about 18 hours, and the pixel size is 1.6mm (should be ~10-15cm). Then I can't see the DEM - It shows up in the project as an item under the chunk, but I can't see it when I double-click on it.

If I try to export the DEM, the boundaries are very strange. In unprojected coordinates it goes from -60.321268 longitude to 177.997312 longitude and latitude is about -89.963764 to -89.956196, which seems ok.

I am going to try to rebuild the DEM in unprojected based on other posts here, but I still don't understand why that option is grayed out in the console view when I have the dense cloud built.

Code snippet below:

Code: [Select]
        doc.chunk.buildDepthMaps(quality=PhotoScan.HighQuality, filter=PhotoScan.MildFiltering, reuse_depth=False)
        doc.chunk.buildDenseCloud(point_colors=True, keep_depth=True)
        doc.chunk.buildDem(source=PhotoScan.DenseCloudData, interpolation=PhotoScan.DisabledInterpolation, projection=PhotoScan.CoordinateSystem("EPSG::6339"))
 

[EDIT] I also just noticed that when I try to export the dense or sparse cloud, my only option is to export it in local coordinates.
« Last Edit: May 25, 2018, 09:38:09 PM by andyroo »

andyroo

  • Sr. Member
  • ****
  • Posts: 440
    • View Profile
Re: Problems with dense cloud and DEM in 1.4.1
« Reply #1 on: May 25, 2018, 09:39:11 PM »
Project coordinates are set as EPSG::6318. chunk info screenshot attached. I couldn't attach when I edited my OP.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14846
    • View Profile
Re: Problems with dense cloud and DEM in 1.4.1
« Reply #2 on: May 25, 2018, 09:39:42 PM »
Hello Andy,

Usually it is required to have at least three reference points to define the model scale and orientation in the coordinate system space.

The option is not active since the chunk if not georeferenced, but starting the procedure via Python or Batch Process would likely jump over this obstacle, but the produced result will be incorrect.
Best regards,
Alexey Pasumansky,
Agisoft LLC

andyroo

  • Sr. Member
  • ****
  • Posts: 440
    • View Profile
Re: Problems with dense cloud and DEM in 1.4.1
« Reply #3 on: May 25, 2018, 09:59:16 PM »
Hi Alexey,

Thanks for the quick reply. I was starting to figure this out with dense cloud in local coordinates only. Then generated a DEM without projecting it (took about 10s) and was able to visualize, and saw what a mess it was, which is fine for the experiment. But I am interating through a lot of scenarios and didn't want the DEM generation to take 15 hours for each step. Turns out that projecting a DEM is a bad idea when your source data is local coordinates :)

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14846
    • View Profile
Re: Problems with dense cloud and DEM in 1.4.1
« Reply #4 on: May 25, 2018, 10:20:48 PM »
Hello Andy,

DEM will work in local coordinates fast, but you need proper model orientation anyway.

As a quick test you can remove your single marker, switch the model back to Local Coordinates, reset transformation for the chunk and adjust the model orientation in system using Rotate Object tool (just make it Z-up). Then use the following line in the Console or your script to apply a fake referencing:
Code: [Select]
PhotoScan.app.document.chunk.transform.matrix = PhotoScan.app.document.chunk.transform.matrix and then generate DEM.
Best regards,
Alexey Pasumansky,
Agisoft LLC

andyroo

  • Sr. Member
  • ****
  • Posts: 440
    • View Profile
Re: Problems with dense cloud and DEM in 1.4.1
« Reply #5 on: May 26, 2018, 02:47:26 AM »
I still had this problem when I iterated through adding different combinations of ground control markers.

I realized that the issue was that when I imported the xml with my ground control markers and their image coordinates via python, then optimized, I never updated the transformation.

Adding this line after importing GCPs fixed my problems:

Code: [Select]
chunk.updateTransform()