Loading decals or processed images as texture on a 3D model with MeshLab

0
1083

One of the processes that might arise in documentation tasks, or rather, in this case of interpretation or dissemination, is to assemble an image file as a UV texture map resulting from digital post-processing, such as a digital tracing or image derived from a remote sensing work.

For this, we will need to “register” our image as a camera of our model, and then use this information to generate the UV texture map. Although this process can be done with heavier tools like Blender, the truth is that MeshLab provides us with all the necessary options to carry out this process in very few steps.

dstretch fotogrametria rock artIn this example, we will use a simple photo-interpretation process consisting of processing our orthophoto with DStretch, to subsequently generate a series of color masks to isolate the motifs. At this point, there are hundreds of options; we have chosen this “effect” as a mere example.

As base material for this exercise, we will start from a dense point cloud and an orthophoto. At this point, it is important to clarify the term “orthophoto” since the use of conventional photographs, which by their nature have a conical perspective, induce geometric errors when interpreting shapes or projecting our image onto our model.

It is possible to use conventional photographs, but these must be ortho-rectified beforehand to start from images as neutral as possible in perspective errors. In this example, I will start from a model (dense point cloud) and an orthophoto that come from a workflow with Apero MicMac, with the advantage that the model is generated based on the same viewpoint as the orthophoto, so aligning them with MeshLab is quite straightforward.

Surface reconstruction:

fotogrametria arte rupestreThe first step is to convert our point cloud into a surface; for this, we simply go to Filters > Point Set > Surface Reconstruction: Poisson, and enter the values Octree Depth of 10 and Solver Divide of 8. After generating the texture, we eliminate interpretation defects and leave the model ready for texturing.

Register a raster image as a camera.

arte rupestre fotogrametriaWith our surface model (mesh) loaded, we go to File > Import Raster and choose our orthophoto post-processed with our digital tracing. To display our raster image in our layout, we must activate the button in the top menu called “Show Current Raster Mode.” After activating this command, our model will disappear from the layout; to recover it, press Ctrl+H or Cmd+H. Next, we must align our model with our image. For this, it is useful to fix our FOV to the “Ortho” position (Shift + mouse scroll until the FOV lowers to the Ortho position), which will allow us to have the same viewpoint (projection) of our 3D model relative to our raster image. With some skill, we can align our model over our raster image without much effort.

If we are not familiar with MeshLab, note that with the mouse wheel we can modify the transparency of the raster image, and holding down the shift key we can zoom out and zoom in the model, and holding down ctrl we can move it in x and y.

set_camaraAfter aligning the model, we must “register” that raster image as a camera. For this, we have to use the command “set raster camera.” This command on Windows is found in the menu Filters > Camera, but on Linux and Mac it is located in the project panel in the raster image context menu.

The “set raster camera” command opens a panel, in which we leave “Current Trackball” selected and then press “Get Shot” and Apply.

Creation of the texture map.

texturizarOnce the camera is registered, we can proceed to create the UV texture map; for this, we go to Filters > Texture > Parameterization + Texturing from Registered Rasters, and simply choose the size of our texture, which should be somewhat large (> 4000) to preserve the maximum possible detail.

Finally, we save our model along with the UV texture map generated in this process. If we want to review our texture map before saving the image, we can go to Render > Show UV tex param. To see the final model, we must save the model and reopen it.

Conclusions.

modelo_final_dStrechAs we see, “interpreting” or post-processing images in order to use them as texture maps in our photogrammetry-derived models is frankly simple with MeshLab.

In these processes, we must pay attention to working with orthophotos, which with tools like Apero Micmac are very easy to generate. Not working with orthophotos induces projection errors due to perspective effects on the model.

This type of process, besides the obvious pedagogical and dissemination advantages, allows us a better interpretation of our tracings or photo-interpretation works in relation to the volume and geometry of our shelters.

You can see the result of this process on the Mas d’en Josep shelter in the Valltorta ravine.