masking cropped images

8 views
Skip to first unread message

kfj

unread,
Dec 3, 2010, 3:54:29 PM12/3/10
to hugin and other free panoramic software
Hi all!
Prompted by the discussion about ptgui's seam display feature

http://groups.google.com/group/hugin-ptx/browse_thread/thread/0be2c724071484a4#

I had a close look at cropping and masking, and found behaviour which
I think is not quite right: If you crop an image, the effect of the
cropping is invisible in the masking window. The masking dialog still
shows the whole image, uncropped. If you proceed to put an include
mask onto the image which includes areas that have ben removed by
cropping, the resulting panorama will show black areas there. I reckon
that the effect of include masks should be intersected with the
cropped area, like their effect is intersected with the area of the
image total (though one can create masks that exceed the bounds of the
image).

Additionally, it would be nice if the cropping actually was visible in
the masking dialog.

Musing about this I did wonder whether the cropping feature is still
worth very much now that masking is here and, in my opinion, more
versatile. Is there anything that can be done with it that one cannot
do with masks? What springs to mind is the inclusion of the cropping
in the lens ini file, which potentially saves some work. But maybe it
wouldn't be too difficult to add masks to the lens ini, rather - then,
I think the cropping dialog might even become obsolete.

with regards
Kay

john doe

unread,
Dec 3, 2010, 4:01:23 PM12/3/10
to hugi...@googlegroups.com
 I think that maybe an error inside ptguis display system...


--
You received this message because you are subscribed to the Google Groups "Hugin and other free panoramic software" group.
A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to hugi...@googlegroups.com
To unsubscribe from this group, send email to hugin-ptx+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/hugin-ptx

kfj

unread,
Dec 4, 2010, 3:47:48 AM12/4/10
to hugin and other free panoramic software


On 3 Dez., 22:01, john doe <guerrerodelu...@gmail.com> wrote:
>  I think that maybe an error inside ptguis display system...

Sorry if I haven't made myself clear - I'm not talking about ptgui,
but about hugin. The discussion I was referring to only inspired me to
take a closer look at cropping and masking in hugin.

with regards
Kay

Felix Hagemann

unread,
Dec 6, 2010, 10:41:24 AM12/6/10
to hugi...@googlegroups.com
Hi

On 3 December 2010 21:54, kfj wrote:
>[...]


>
> Additionally, it would be nice if the cropping actually was visible in
> the masking dialog.

+1. I've been bitten by include masks in the cropped area as well.

> Musing about this I did wonder whether the cropping feature is still
> worth very much now that masking is here and, in my opinion, more
> versatile. Is there anything that can be done with it that one cannot
> do with masks? What springs to mind is the inclusion of the cropping
> in the lens ini file, which potentially saves some work. But maybe it
> wouldn't be too difficult to add masks to the lens ini, rather - then,
> I think the cropping dialog might even become obsolete.

While I like the idea of merging the crop tab with the mask tab, I
think there is a fundamental problem with the approach:
One the one hand masking as well as adding control point should best
done on remapped images. I think already is a wishlist items for this.
On the other hand cropping is mainly used to cut off dark edges of
input fisheye images, which can be sensibly done on the original
images only.

Regards
Felix

kfj

unread,
Dec 7, 2010, 4:26:29 AM12/7/10
to hugin and other free panoramic software
On 6 Dez., 16:41, Felix Hagemann <felix.hagem...@gmail.com> wrote:

> +1. I've been bitten by include masks in the cropped area as well.

Meanwhile I've filed a bug report concerning this issue:

https://bugs.launchpad.net/hugin/+bug/685558

so it's in the pipeline and may get resolved.

> While I like the idea of merging the crop tab with the mask tab, I
> think there is a fundamental problem with the approach:
> One the one hand masking as well as adding control point should best
> done on remapped images. I think already is a wishlist items for this.
> On the other hand cropping is mainly used to cut off dark edges of
> input fisheye images, which can be sensibly done on the original
> images only.

So, cropping is really like a less capable form of masking used for
source images only, whereas masking is a more capable form of cropping
that should be used on warped images but is not ;-)

Hmmm... conceptually, both are masking operations. And I see the point
of masking the input images (I often use it to 'remove myself' from
360/180s, which works just fine on unwarped images) - as I see the
point of using it on warped images, as it would actually be more
precise and predictable. I agree with you that control point editing
might be better with warped images.

So I reckon the ideal situation would be to allow masking on both
warped and unwarped images. It would be hard to make the two
compatible, though, with the current technique: The mask is described
by a polygon, and warping would make the polygon into a shape with
curved edges, something you'd have a real hard time describing with a
simple string of number pairs (that's how masks are represented in the
pto). Reversely, unwarping a polygonal mask defined for a warped image
would do the same. Maybe the masking could move to direct manipulation
of the alpha channel - then the warping/unwarping would just happen
together with the image data - I'm not entirely certain how it's done
technically in huign, but the only feasible way I can imagine is
calculation of the alpha channel from the polygonal mask and applying
or at least attaching it before warping, so the alpha channel handling
is already there, but the alpha channel can't yet be directly
manipulated.

There is one more aspect to cropping/masking. It is quite possible to
apply an alpha channel to the image before feeding it into hugin. This
is easily done with, e.g. the gimp, and there, a full infrastructure
exists to edit the alpha channel to one's heart's content, so the
facilty to create crops and simple polygonal masking in hugin is just
a nice-to-have tool just where you want it which does just what you
need most of the time, and not the only way to achieve such effects.

For the time being, with cropping and masking both happening on the
source image, and the only added feature for cropping is making the
mask circular, I think the two could be safely merged, especially if
the option to load mask(s) with the lens ini file, or an equivalent
mechanism, was included - any more involved operation on the input
images can be done externally. Working on warped images (like, direct
interaction with data displayed in the preview) remains an alluring
possibility for the future.

with regards
Kay
Reply all
Reply to author
Forward
0 new messages