Meaning of "corners" in stitching module

In the stitching pipeline warp() method returns a warped image together with the “corner” values. The corners are then fed into subsequent seam estimation, exposure compensation and blending stages, and from my experience they are important for result quality.

The exact meaning of the “corner” parameter is not documented. Obviously it means coordinates of the warped (projected) new coordinates of a point which used to be the top left corner of the source image. I tried to run stitching_detailed script provided in the samples directory of OpenCV and noticed that returned “corners” can be negative, sometimes the values are vary large (like 15000 when stitching two flat overlapping images of sizes of the order of 1000).

I reversed engineered it a bit, and found that the first coordinate (x) of the corner is probably calculated with the origin in the center of resulting panorama. Therefore points to the left of the panorama center have negative x values of corners. Unfortunately, I have no clue as to how second (y) coordinate of the corner is measured.

Could anyone provide any insight into how these “corners” work throughout the stitching module?