I am reading in an image with a face also im also reading reading second image that has face on it. Once I have read the both image, what i want to do is replace the face on the first image with the face on the second image. How can I do that?

2 次查看(过去 30 天)
So far in my code i can read in my files and store it. the problem is I do not know the commands to replace the face on first image with the face that is on the second image. If any one could please help on how to that, and what code can I use to to do this Thank You.

采纳的回答

Image Analyst
Image Analyst 2013-11-22
See my demo attached below in blue. You'd need to adapt it to the shapes of the faces - I didn't do that in this general purpose demo (it's not developed with faces in mind).
  2 个评论
Matias
Matias 2013-11-22
Thank you very much I appreciate it very much. It worked very well and i was able to figure out how to operate it. The only question I have is if i wanted to read in my own image how can do that, and where would i place the file name?
Image Analyst
Image Analyst 2013-11-22
These are the lines that you change:
% Read in a standard MATLAB gray scale demo image.
folder = fullfile(matlabroot, '\toolbox\images\imdemos');
baseFileName = 'eight.tif';
% Get the full filename, with path prepended.
fullFileName = fullfile(folder, baseFileName);
You can also use uigetfile() if you want to have the user browse for the file.
% Get the name of the file that the user wants to use.
defaultFileName = fullfile(startingFolder, '*.*');
[baseFileName, folder] = uigetfile(defaultFileName, 'Select a file');
if baseFileName == 0
% User clicked the Cancel button.
return;
end
fullFileName = fullfile(folder, baseFileName)

请先登录,再进行评论。

更多回答(1 个)

Waleed Ahmed
Waleed Ahmed 2016-12-4
i need a code for face swapping through face detection, anybody can help please

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by