Esempio n. 1
0
from pybug.transform.tps import TPS
from warp import build_similarity_transform

# tr = build_similarity_transform(intensity_image.landmarks['ibug_68_edge'].lms)
tr = TPS(reference_frame.landmarks["ibug_68_closed_mouth"].lms, intensity_image.landmarks["ibug_68_closed_mouth"].lms)

# <codecell>

from pybug.transform import SimilarityTransform
from pybug.image import MaskedNDImage, IntensityImage

warped_intensity_image = intensity_image.warp_to(reference_frame.mask, tr)
warped_ground_truth_image = ground_truth_images.warp_to(reference_frame.mask, tr)

warped_intensity_image = MaskedNDImage(warped_intensity_image.pixels, mask=warped_intensity_image.mask)
warped_intensity_image.view()

# <codecell>

# Use ground truth light
estimate_light = lights[sfs_index, :]
print estimate_light

# <codecell>

from photometric_stereo import photometric_stereo as ps

ground_truth_normals, ground_truth_albedo = ps(warped_ground_truth_image, lights)

# <codecell>
Esempio n. 2
0
# tr = build_similarity_transform(intensity_image.landmarks['ibug_68_edge'].lms)
tr = TPS(reference_frame.landmarks['ibug_68_closed_mouth'].lms,
         intensity_image.landmarks['ibug_68_closed_mouth'].lms)

# <codecell>

from pybug.transform import SimilarityTransform
from pybug.image import MaskedNDImage, IntensityImage

warped_intensity_image = intensity_image.warp_to(reference_frame.mask, tr)
warped_ground_truth_image = ground_truth_images.warp_to(
    reference_frame.mask, tr)

warped_intensity_image = MaskedNDImage(warped_intensity_image.pixels,
                                       mask=warped_intensity_image.mask)
warped_intensity_image.view()

# <codecell>

# Use ground truth light
estimate_light = lights[sfs_index, :]
print estimate_light

# <codecell>

from photometric_stereo import photometric_stereo as ps

ground_truth_normals, ground_truth_albedo = ps(warped_ground_truth_image,
                                               lights)

# <codecell>