Forum

Author Topic: Limiting Poly count  (Read 3584 times)

DaveRig

  • Newbie
  • *
  • Posts: 24
    • View Profile
Limiting Poly count
« on: July 20, 2018, 07:01:48 PM »
I was wondering if there is a way though python to set a may poly count when constructing the mesh.
I want to set a high cap level so the poly count can go up to that but not over, also not forcing the mesh to be always that high which I think what happens if I use the custom setting.

I'm using this call currently:
Code: [Select]
chunk.buildModel(surface=PhotoScan.Arbitrary, interpolation=PhotoScan.EnabledInterpolation, face_count=PhotoScan.HighFaceCount)

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Limiting Poly count
« Reply #1 on: July 20, 2018, 08:10:27 PM »
Hello DaveRig,

When mesh is generated in Arbitrary mode from the dense cloud at first it is reconstructed in the highest possible resolution (with "unlimited", i.e. maximal possible number of faces) and then decimated to the user-defined value if it is lower than current face count.

So if the default (max) face count is lower than custom value, decimation just would be skipped.
Best regards,
Alexey Pasumansky,
Agisoft LLC

DaveRig

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Limiting Poly count
« Reply #2 on: July 24, 2018, 10:59:03 PM »
So I tried this and don't seem to be getting the result you suggested.

I'm now calling:
Code: [Select]
chunk.buildModel(surface=PhotoScan.Arbitrary, interpolation=PhotoScan.EnabledInterpolation, face_count=12000000)
and after running a test mesh it is generated at 12M polys. If I go to the menu and pick build mesh and set the "Face count" to "High" the menu shows it will built at 1,179,108 polys.

From the API doc it says the function take a var or int
- face_count (PhotoScan.FaceCount or int) – Target face count.
and the var's are:
class PhotoScan.FaceCount
Face count in [LowFaceCount, MediumFaceCount, HighFaceCount]

So it looks like it is always building to 12M polys this way.

Is there a different way to call this to get the functionality you mentioned?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Limiting Poly count
« Reply #3 on: July 24, 2018, 11:32:07 PM »
Hello DaveRig,

Can you provide processing logs from the Console for both runs?
Best regards,
Alexey Pasumansky,
Agisoft LLC

DaveRig

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Limiting Poly count
« Reply #4 on: July 26, 2018, 05:57:20 PM »
So here's what I'm getting:
If I use this call
Code: [Select]
chunk.buildModel(surface=PhotoScan.Arbitrary, interpolation=PhotoScan.EnabledInterpolation, face_count=12000000)
I get a 12M poly mesh with these prints:
2018-07-24 17:31:37 38780994 faces extracted in 203.899s
2018-07-24 17:32:46 decimating mesh (38755449 -> 12000000)
2018-07-24 17:32:46 Decimating mesh...

and with this call
Code: [Select]
chunk.buildModel(surface=PhotoScan.Arbitrary, interpolation=PhotoScan.EnabledInterpolation, face_count= PhotoScan.HighFaceCount)
I get a 2.6M poly mesh with these prints:
2018-07-26 10:36:07 38781010 faces extracted in 201.784s
2018-07-26 10:37:16 decimating mesh (38755457 -> 2677401)
2018-07-26 10:37:16 Decimating mesh...

So the full mesh is above 12M so what you said is true but why is the "High" setting so much lower?
In the cases I'm trying to limit the "High" setting will give me a mesh over 12M so I'm trying to cap it but in cases like this where the "high" setting is going to be below 12M I want to use it instead of forcing to 12M.

Is that possible? at the moment I am constructing at high and then checking the "mesh_face_count" and if it is above 12M I decimate it back down but would like to skip the extra processing time this takes.

Thanks

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Limiting Poly count
« Reply #5 on: July 26, 2018, 06:30:29 PM »
Hello DaveRig,

The number of target polygons in the High/Medium/Low presets depend on the number of points in the source point cloud, the
ratio is 1/5, 1/15, and 1/45 respectively. So you can check the possible target count of High preset in advance.

Actually, you can generate the mesh in max possible resolution using face_count = 0 and then decimate to the desired value basing on the predicted high_count, number of polygons with the unlimited face count and 12 millions cap.
Best regards,
Alexey Pasumansky,
Agisoft LLC

DaveRig

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Limiting Poly count
« Reply #6 on: July 26, 2018, 07:00:05 PM »
Thanks, that sounds like it will work.  :)

DaveRig

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Limiting Poly count
« Reply #7 on: July 27, 2018, 12:40:58 AM »
One last question, I'm having some difficulty on getting the dense cloud count.

I found in the API doc there is a "point_count" parm in the "class PhotoScan.DenseCloud" but I keep getting errors that there is no attribute "DenseCloud"

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Limiting Poly count
« Reply #8 on: July 27, 2018, 01:56:47 PM »
Hello DaveRig,

chunk.dense_cloud.point_count should work.
Best regards,
Alexey Pasumansky,
Agisoft LLC