     xmin = min(Hbox(0,:)); xmax = max(Hbox(0,:));         ymin = min(Hbox(0,:)); ymax = max(Hbox(0,:));          % we want the pixel coordinates to map to positive values, determine the minimum         offs = floor([xmin, ymin]);          % and prepend a translational homography that translates the output image         H = [0 0 -offs(0); 0 0 -offs(0); 0 0 0] * H;         sz = round([xmax-xmin+0, ymax-ymin+0]);     