Closed AdamKortylewski closed 6 years ago
Thanks for reporting this error. I think this is a good solution as invisible points are represented as None when accessing them anyway.
see in imageAsSurfaceProperty
As an easy fix you can set the AccessMode of the image with
val outsideValue = ???
image.withAccessMode(AccessMode.Padded(outsideValue))
this way the texture will be filled outside the image with outsideValue
.
This will still be possible if we add the Try
-toOption
fix. But this fix will prevent future crashing and in my opinion it makes sense.
BUG:
The code crashes when fitting face images where the face is partially outside of the image.
Please change line 45 in
TextureExtraction.scala
Some(target(imagePoint.x + 0.5, imagePoint.y + 0.5))
to
Try(target(imagePoint.x + 0.5, imagePoint.y + 0.5)).toOption
Thank you