Forum

Author Topic: Error while classifying dense cloud - Unreferenced chunk  (Read 4719 times)

manoloribera

  • Newbie
  • *
  • Posts: 7
    • View Profile
Error while classifying dense cloud - Unreferenced chunk
« on: March 31, 2017, 12:23:05 PM »
Hello,

I have a dense cloud.
I've written this Python code:
Code: [Select]
import os, PhotoScan

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

chunk.dense_cloud.classifyGroundPoints(max_angle= 15, max_distance = 0.1, cell_size = 1)


So I open my .psx file with the dense cloud and I run this script.

However i get this error:
Finished processing in 0 sec (exit code 0)
Error: Unreferenced chunk


i've also tried to do quite the same thing by going to Tools > Dense Cloud > .. But Classify Ground Points is not avalaible (I can't click on it).


My project is not georeferenced (I don't need it). Maybe this is the problem ?!

I also have scale bars, maybe they could be helpful to create a fake Z ? (just an idea, not sure it could work)



Thank you for your answers!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15029
    • View Profile
Re: Error while classifying dense cloud - Unreferenced chunk
« Reply #1 on: March 31, 2017, 12:25:50 PM »
Hello manoloribera,

Dense cloud classification can be applied to the referenced chunks only.

If you have the chunk scaled, you can then position the model properly using Rotate Object tool (to have Z-up orientation) and then type in the following line to the Console pane and press Enter:
Code: [Select]
PhotoScan.app.document.chunk.transform.matrix = PhotoScan.app.document.chunk.transform.matrix
Best regards,
Alexey Pasumansky,
Agisoft LLC

manoloribera

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Error while classifying dense cloud - Unreferenced chunk
« Reply #2 on: March 31, 2017, 01:39:37 PM »
Seems to work !

Thank you :)

manoloribera

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Error while classifying dense cloud - Unreferenced chunk
« Reply #3 on: March 31, 2017, 02:37:27 PM »
I spoke too fast..

First I place the view as wanted (to have Z up). Then I write the following command you gave me:
Code: [Select]
PhotoScan.app.document.chunk.transform.matrix = PhotoScan.app.document.chunk.transform.matrix
However, I don't get the " >>> " in the next line. Is it possible that it takes some time to apply the transform ?!


Thanks for your answer

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15029
    • View Profile
Re: Error while classifying dense cloud - Unreferenced chunk
« Reply #4 on: March 31, 2017, 02:43:52 PM »
Hello manoloribera,

I don't see that the model has Z-up orientation on your screenshot, according to the coordinate system axis in the bottom-left corner. You need to use Rotate Object tool first, not just change the viewpoint angle.

Alternatively you can use the script that will apply the coordinate system orientation according to the bounding box sides:
http://wiki.agisoft.com/wiki/Coordinate_System_to_Bounding_Box.py
Best regards,
Alexey Pasumansky,
Agisoft LLC

manoloribera

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Error while classifying dense cloud - Unreferenced chunk
« Reply #5 on: March 31, 2017, 03:12:08 PM »
Now it works perfeclty !

Thank you very much :)