In order to find the coordinates of the corners of the warped image, you can do the following:
cv::Mat_<float> p(3,1), c_topleft, c_topright, c_botleft, c_botright;
p(0)=0; p(1)=0; p(2)=1;
c_topleft=H1*p; c_topleft/=c_topleft(2); // Top-Left corner
p(0)=input2.cols-1; p(1)=0; p(2)=1;
c_topright=H1*p; c_topright/=c_topright(2); // Top-right corner
p(0)=0; p(1)=input2.rows-1; p(2)=1;
c_botleft=H1*p; c_botleft/=c_botleft(2); // Bottom-left corner
p(0)=input2.cols-1; p(1)=input2.rows-1; p(2)=1;
c_botright=H1*p; c_botright/=c_botright(2); // Bottom-right corner