sustaining_gazes/matlab_version/face_validation/paw_helpers/Crop.m
Tadas Baltrusaitis 5959176921 Some big changes:
- face validator is a retrained CNN now
- starting retiring CLM-Z from OpenFace
2017-08-01 17:11:02 -04:00

15 lines
No EOL
553 B
Matlab

function [warpedImage] = Crop(inputImage, destinationPoints, triangulation, triX, mask, alphas, betas, nPix, minX, minY)
coeffs = CalculateCoefficients(alphas, betas, triangulation, destinationPoints);
[ mapX, mapY ] = WarpRegion( minX, minY, mask, triX, coeffs );
if(size(inputImage,3) == 1)
warpedImage = Remap(inputImage, mapX, mapY);
else
warpedImage = [];
for i=1:size(inputImage,3)
warpedImage = cat(3, warpedImage, Remap(inputImage(:,:,i), mapX, mapY));
end
end
end