alicevision / AliceVision

Photogrammetric Computer Vision Framework
http://alicevision.org
Other
2.96k stars 822 forks source link

--boundingBox in aliceVision_meshing.exe #1038

Closed Ambrosiussen closed 3 years ago

Ambrosiussen commented 3 years ago

Would it be possible to make note of the default measure of unit of the bounding box at scale 1,1,1 in the documentation?

Currently the help is limited to: Specifies a bounding box to reconstruct: position, rotation (Euler ZXY) and scale.

I am hoping to feed a custom bounding box on commandline, but I don't know how to convert the unit sizes between eg Houdini/AliceVision. How big is the bounding box at default settings in meters?

natowi commented 3 years ago

How big is the bounding box at default settings in meters?

You would need to (place cctags in your scene and) scale the model first. Then you have consistent units you can work with. (UI documentation https://github.com/alicevision/meshroom/wiki/CCTAG-scaling ) There is also a note on Meshroom units used for scaling there. For models scaled to mm: 100mm = 1 MR unit (should also apply for the BBox)

Ambrosiussen commented 3 years ago

Thanks for the suggestion.

I am running AV from Houdini (commandline). So I can see my initial pointcloud. I now create a Houdini box (1u = 1m) which I move to any position to isolate a set of points.

Once done, I extract the transformations of that box so that I can feed translate, rot, scale into AV using the correct format. The problem however is not knowing what size that box is relative to what AV expects. In order to properly extract the transforms of my Houdini box, I need to know what measure of unit it is scaled against.

Notice in the images below that both the box in Houdini and Meshroom have default settings (rot, scale). To get the box in Meshroom to be the same scale as in Houdini, my Houdini box would need to be scaled up (~10x?)

If the coordinate scale is unknown during computation, would it be possible to export some sort of reference size to disk which I can measure against? Eg a file that tells me that the default "box" in Meshroom is X units.

AV_Box1 AV_Box2

natowi commented 3 years ago

The coordinate system scale is 100mm per unit. As Meshroom has no references by default, the model/point cloud is not correctly scaled within this coordinate system (But you should be able to create a BBox by applying the scaling factor). Here is a similar issue https://www.sidefx.com/forum/topic/42683/?page=1#post-199010

Example of a scaled pointcloud in Meshroom - 1 coordinate grid square is 1x1 units equal to 100mm x100mm grafik

Ambrosiussen commented 3 years ago

Ah perfect! I misunderstood what you meant in your previous reply :) The BBox then appears to be 200x200x200mm by default, which is what I was after. Thanks for the help.