I'm not sure if this is the right place to post such a question. But maybe, someone can help me.
I took a lot of photos from a person the last few month. The pictures are all front-faced pictures, with different lightnings, one time the face is closer to the camera, then one time farer away etc. Now I want to create a movie with all the pictures, to show some progress. But before I begin to manually correct the photos (fix lightning, make all faces the same size, rotate the faces a little bit...), and put them in Premiere, I was wondering if there is some kind of software to achieve this. It could be a program, script, library... I read a little bit about open cv, but maybe there is already something out there.
Might be possible with OpenCV ,
As your requirement the first thing is
Lighting adjustment
OpenCV has an entire documentation about Changing the contrast and brightness of an image. In another way you adjust the contrast with histogram equalization. For this you need to convert your RGB image to HSV and apply equalizeHist() to the V(value) channel.
OpenCV Resize
For resizing you can use OpenCV resize function
Here is a piece of code how to do this
Mat src = imread(image.jpg);
Mat dst;
resize(src, dst, Size(640, 480), 0, 0, INTER_CUBIC); // resize to 640X480 resolution
Rotation
For rotation you can use Affine Transformations
Video Writing
OpenCV has VideoWriter class to write video using various frame rate,codec, resolution etc..
Here is the source code for writing video using series of image, assuming your images with names 0.jpg,1.jpg,2.jpg.....
int main()
{
VideoWriter writer;
writer.open("out.avi",CV_FOURCC('M','J','P','G'),15,Size(640,480),true);//Initialize video writer. The resolution should be same as source image
if(!writer.isOpened()){
cout<<"Cannot write video..!!!"<<endl;
return -1;
}
char name[10];
int i=0;
while(1){
sprintf(name,"%d.jpg",i++);
Mat src=imread(name,CV_LOAD_IMAGE_COLOR);
if (src.empty()){
cout<<"No source found...."<<endl;
break;
}
writer.write(src);
imshow("src", src);
waitKey(0);
}
return 0;
}