Extension factors relative to corresponding dimension of the full image. For example,
upFactor and downFactor define extensions relative to image height, e.g.
when upFactor is 0.5, upper image boundary will be extended for half of image's full
height.