Hi Luke,
Welcome to the scalismo community.
The easiest solution is to loop through the points of the fitting
result and find for each point the closest point. This can be done (in
scalismoLab) as follows:
val fit : TriangleMesh = MeshIO.readMesh(new File("dataset/noseless.stl")).get
val target : TriangleMesh = MeshIO.readMesh(new
File("datasets/noseless.stl")).get
val projectedPoints = for (fittedPoint <- fit.points) yield {
target.findClosestPoint(fittedPoint).point
}
val projectedMesh = TriangleMesh(projectedPoints.toIndexedSeq, fit.cells)
Note however, that unless your fit is already rather good, this can
lead to artifacts. For practical model building, we usually avoid
using the projection step.
I would also like to mention, that ScalismoLab is only meant as a tool
to get started. If you are planning to use Scalismo for more serious
research, it would maybe be a good point to switch to an IDE such as
Intellij IDEA or Eclipse. It makes working with Scala much more
pleasent and also allows you to work with more current versions of
scalismo. We have prepared a document which outlines the necessary
steps to switch to an IDE:
https://github.com/unibas-gravis/scalismo/wiki/From-a-Scalismo-Lab-script-to-a-Scalismo-application.
As a last remark: Depending on your problem, you may observe that you
can achieve much better results using an gradient based approach as
outlined in the Quickstart guide. We have presented the ICP approach
in the course since from a didactic point of view it fits much nicer
to the other concepts.
Best regards,
Marcel
> --
> You received this message because you are subscribed to the Google Groups
> "scalismo" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
scalismo+u...@googlegroups.com.
> To post to this group, send email to
scal...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/scalismo/923bf7f5-21d0-4c18-8f04-ef7507e7169e%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.