Description:
At the previous step a mesh was created out of the 3D cloud of points. A texture was applied to the mesh from the brightest image. The model used was DECAL (that is, look in the texture map and paste the color onto the mesh). This model has its disadvantages:
At this point, we are trying to use a MODULATE model (that is, look in the texture map for the color and then multiply with the cosine of the angle between the normal to the surface at that point and the line from the point to the light source). This model will reduce the size of the file by approximately 20% and it will improve the quality of the mesh.
The idea is to create a new orthogonal texture map. The object is orthogonally projected onto a plane (the texture plane). For each point in the new texture map find the closest triangle in the mesh that a ray from that point, perpendicular to the plane, intersects. Get the coordinates of the intersection point, look up its color (luminosity) in the new texture map, divide this color by the cosine of the angle between the normal in that popint to the surface and the ray from the projector to that point (accounting for Lambert's cosine law). The value obtained is the value to be stored in the new texture map.
Code:
Results:
Comments:
The two problems mentioned above are solved: the size of the file is decreased (the new file is 20% smaller) and the mesh is more realistic (compare the head with the original texture vs. the head with the unshaded orthogonal texture).
Sorry, but I cannot post the results for the other views due to the disk quota on the UGCS cluster.