← Back to team overview

hugin-devs team mailing list archive

[Bug 721156] Re: left image margin shows though image is totally masked

 

I think I figured out what went wrong. I think hugin is correct, after
all, and I just didn't understand the coordinate system properly. PT,
and therefore hugin, uses a coordinate system where the *center* of
pixel (0,0) has coordinates (0.0,0.0). So the top left corner of the
pixel, seen as a 1 squared surface, extends from (-0.5,-0.5) to
(0.5,0.5). This means that the left margin of an image doesn't have an X
coordinate of 0, but of -0.5. This behaviour is sensible, though not
necessary - other image processing systems use a system where the top
left pixel extends from (0,0) to (1,1) and the pixel's center is at
(0.5,0.5). So to construct a mask which precisely covers a 640X400
image, as in my example, this mask would be needed:

# w640 h400
k i0 t0 p"-0.5 -0.5 639.5 -0.5 639.5 399.5 -0.5 399.5"

Lo and behold, this works. I'm reassured now that everything is in order
and apologize for any accusations of sloppiness I have raised. And it
seems to me as if the masks do actually work with subpixel accuracy, as
one might assume from the fact the coordinates of the mask points can be
given as float values.

Kay

-- 
You received this bug notification because you are a member of Hugin
Developers, which is subscribed to Hugin.
https://bugs.launchpad.net/bugs/721156

Title:
  left image margin shows though image is totally masked

Status in Hugin - Panorama Tools GUI:
  Won't Fix

Bug description:
  I noticed what I think is faulty mask processing on images where a mask boundary coincides with the left image boundary. I have managed to produce a very simple demonstartion of the behaviour with the enclosed files. The pto contains a single monochrome image with a mask of precisely the same dimensions, and one would assume that this should render the whole image invisible. But in the previews and in the final output, a narrow strip of the image's left margin still shows. In the pto I have attached I have centered on this and chosen a small FOV to make this well visible - if you can reproduce the bug it would show as a vertical malachite band in the preview. The attached file contains input image, pto and output image - since the images are jpg and very small, I took the liberty to attach them as well. Notice that I manually edited the k-line in the pto to position the mask precisely on the image boundaries.
  I noticed this using Pre-Release 2010.5.0.5a0bdb77823c, self-compiled on Kubuntu 10.10, but I've seen it earlier as well and was never bothered enough to send in a bug report. I think it only occurs if the left margin coincides with the mask and the remainder of the mask can be any shape.
  Kay

To manage notifications about this bug go to:
https://bugs.launchpad.net/hugin/+bug/721156/+subscriptions


References