0

In this post OpenCV: Shift/Align face image relative to reference Image (Image Registration), there is a function called

void alignImage(vector<Rect> faceROIstore, vector<Mat> faceIMGstore)

Can somebody explain the meaning of the parameters and how these will be used in the code please?

My second question is: can this function be used to align 2 face images of the same person?

Community
  • 1
  • 1
Steph
  • 609
  • 3
  • 13
  • 32

1 Answers1

1

From OpenCV: Shift/Align face image relative to reference Image (Image Registration), you can easily found that:

  • vector<Rect> faceROIstore is a vector containing all face ROI regions.
  • vector<Mat> faceIMGstore is a vector containing all the corresponding face images.

To get the face ROI region of the image, you can do as follows:

Mat face_roi = faceIMGstore[i](faceROIstore[i]); // face ROI region of i-th image

For your second question: Yes, it can be used to align 2 face images no matter the face images are from the same person or two different persons. They works under the same idea.

Community
  • 1
  • 1
herohuyongtao
  • 49,413
  • 29
  • 133
  • 174
  • ok.When I call this function in my main,what parameters should I pass to the function? – Steph Mar 04 '14 at 05:18
  • @Steph `faceIMGstore` can be the images, and `faceROIstore` will be the face rects. – herohuyongtao Mar 04 '14 at 05:20
  • I will have 2 images in faceIMGstore(input image and template image).As for faceROIstore,I am quite unsure about it.What do you mean by face rects? – Steph Mar 04 '14 at 05:24
  • @Steph The `cv::Rect`s where your faces are. – herohuyongtao Mar 04 '14 at 05:24
  • faceIMGstore is for the original face images and and faceROIstore is for the detected faces found in the original images.Is that right? – Steph Mar 04 '14 at 05:27
  • will try aligning a profile face image with its frontal face and see if it works.thanks :) – Steph Mar 04 '14 at 05:30
  • I put the same function in my project."return 0" in the function is underlined because the function has type "void" and no instance of overloaded function "minMaxLoc" matches the argument list :s – Steph Mar 04 '14 at 09:47