akashmaity / RobustPPG

10 stars 1 forks source link

How can I generate the Rendered Video like front page? #5

Open xiaoyaozzr opened 1 year ago

xiaoyaozzr commented 1 year ago

How can I generate the Rendered Video like front page?

akashmaity commented 1 year ago

I have uploaded a file visualize_weights.m in the utils directory.

For generating a video, please use the example code snippet as follows:

writerObj = VideoWriter('rendered_face.avi');
writerObj.FrameRate = 30;
open(writerObj);
for frame_ind = 1:1200

BWx = visualize_weights(squeeze(lam(frame_ind,:,1)),tri_info{frame_ind},frame0); % where lam contains the rendered intensity at each mesh
BWy = visualize_weights(squeeze(lam(frame_ind,:,2)),tri_info{frame_ind},frame0);
BWz = visualize_weights(squeeze(lam(frame_ind,:,3)),tri_info{frame_ind},frame0);
BW = cat(3,BWx,BWy,BWz);
frame0= uint8(BW);
% imshow(uint8(BW),[]);
frame_ind
writeVideo(writerObj, frame0);
end
close(writerObj);
xiaoyaozzr commented 1 year ago

@akashmaity Thanks,I can show the rendered face.
But I still have 2 questions:

how to understand the function "createB", and how to get the value c1 to c5 ? 'V, rho, lam' in function 'light_dir_lam' correspond to which formula in the paper