educelab / volume-cartographer

Volumetric processing toolkit and C++ libraries for the recovery and restoration of damaged cultural materials
GNU General Public License v3.0
63 stars 22 forks source link

UV map auto-orientation #56

Closed stephenrparsons closed 1 year ago

stephenrparsons commented 1 year ago

Discussed in https://github.com/educelab/volume-cartographer/discussions/49

Originally posted by **csparker247** October 31, 2023 We would like to auto-orient the UV map with respect to at least the volume (i.e. no frame of reference except the volume shape), but also landmarks in the volume (e.g. top, bottom, front, back, etc.). The appropriate place to fix UV map auto-orientation for general objects (i.e. without any frame of reference) is in the `FlatteningAlgorithm::orient_uvs_` method so that it's available to all subclasses. That's the base class for all UV algorithms, and all subclasses would need to call it inside their own `compute()` functions. The current implementation (which tried to align the z-axis to the v-axis) is not used because it was pretty unreliable in practice. At the moment, the current UV Map orientation is determined by [the two pinned edges in the OpenABF LSCM code](https://github.com/educelab/OpenABF/blob/develop/include/OpenABF/AngleBasedLSCM.hpp#L84), which is functionally arbitrary. Auto-orientation of the UV map with respect to landmarks should be implemented as a separate function/class that takes a UV map and landmarks as input and outputs an updated UV map. We really want to auto-orient the text in a readable direction. Once a single piece of text is found and oriented, all other text should be auto-orientable as a result.