stitching with mask / transparency / non-rectangular images

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

stitching with mask / transparency / non-rectangular images

Adrian Daerr-2
Hello,

I have images where only a circular central region shows my sample, the
corners of my camera's sensor are not illuminated. I would like to
stitch several of these images together, but using only the central part
(both for the registration - which is otherwise dominated by the black
circular border which is not part of the sample - and for blending
obviously). Is this possible in ImageJ ? Is there a stitching plugin
which accepts either a ROI selection, or a binary mask image, selecting
the parts of the images to take into account ?

I could of course inscribe a rectangle in the circular aperture and crop
to it, but I wouldn't have sufficient overlap any more in the pictures I
have taken so far (of course in the future I could just take about four
times as many pictures to get a denser coverage). And the cropping
solution would not be applicable in another case where I'd very much
like to be able to exclude some regions from the stitching: when there
is a bit of dirt or another defect at a fixed position with respect to
the sensor, covering a spot in one image which is nicely visible in
another shifted view. Currently the stitched image will blend the dirt
with the undamaged spot.

The hugin/enblend software suite has the possibility to define 'include'
and 'exclude' regions, but if I could avoid the detour and do the stuff
in Fiji that would be splendid.

Thanks in advance,
Adrian

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: stitching with mask / transparency / non-rectangular images

Stephan Saalfeld
Hi Adrian,

yes, you can do that with TrakEM2 and some scripting.  TrakEM2 enables
to assign a byte alpha mask to every image in a project and the
alignment routines work with the alpha-masked images.  Blending is
another story but as you learn how to deal with alpha masks, you may
just use that for blending later.

Check this Javascript which assigns a rectangular mask to every image
tile in a TrakEM2 project:

https://github.com/axtimwalde/fiji-scripts/blob/master/TrakEM2/mask_dat_border.js

instead of a rectangular Roi, you would make an OvalRoi.

You can also paint the alpha mask manually into the images by selecting
an arbitrary Roi on top of the canvas and filling it with
black/white/grey respectively---that's for the selective dirt parts.

Good luck,
Stephan



On Fri, 2013-08-30 at 12:58 +0200, Adrian Daerr wrote:

> Hello,
>
> I have images where only a circular central region shows my sample, the
> corners of my camera's sensor are not illuminated. I would like to
> stitch several of these images together, but using only the central part
> (both for the registration - which is otherwise dominated by the black
> circular border which is not part of the sample - and for blending
> obviously). Is this possible in ImageJ ? Is there a stitching plugin
> which accepts either a ROI selection, or a binary mask image, selecting
> the parts of the images to take into account ?
>
> I could of course inscribe a rectangle in the circular aperture and crop
> to it, but I wouldn't have sufficient overlap any more in the pictures I
> have taken so far (of course in the future I could just take about four
> times as many pictures to get a denser coverage). And the cropping
> solution would not be applicable in another case where I'd very much
> like to be able to exclude some regions from the stitching: when there
> is a bit of dirt or another defect at a fixed position with respect to
> the sensor, covering a spot in one image which is nicely visible in
> another shifted view. Currently the stitched image will blend the dirt
> with the undamaged spot.
>
> The hugin/enblend software suite has the possibility to define 'include'
> and 'exclude' regions, but if I could avoid the detour and do the stuff
> in Fiji that would be splendid.
>
> Thanks in advance,
> Adrian
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: stitching with mask / transparency / non-rectangular images

Adrian Daerr-2
Hi Stephan,

Thanks a lot for your explanation and pointer. I'll try that way.

Adrian


On 30.08.2013 18:19, Stephan Saalfeld wrote:

> Hi Adrian,
>
> yes, you can do that with TrakEM2 and some scripting.  TrakEM2 enables
> to assign a byte alpha mask to every image in a project and the
> alignment routines work with the alpha-masked images.  Blending is
> another story but as you learn how to deal with alpha masks, you may
> just use that for blending later.
>
> Check this Javascript which assigns a rectangular mask to every image
> tile in a TrakEM2 project:
>
> https://github.com/axtimwalde/fiji-scripts/blob/master/TrakEM2/mask_dat_border.js
>
> instead of a rectangular Roi, you would make an OvalRoi.
>
> You can also paint the alpha mask manually into the images by selecting
> an arbitrary Roi on top of the canvas and filling it with
> black/white/grey respectively---that's for the selective dirt parts.
>
> Good luck,
> Stephan
>
>
>
> On Fri, 2013-08-30 at 12:58 +0200, Adrian Daerr wrote:
>> Hello,
>>
>> I have images where only a circular central region shows my sample, the
>> corners of my camera's sensor are not illuminated. I would like to
>> stitch several of these images together, but using only the central part
>> (both for the registration - which is otherwise dominated by the black
>> circular border which is not part of the sample - and for blending
>> obviously). Is this possible in ImageJ ? Is there a stitching plugin
>> which accepts either a ROI selection, or a binary mask image, selecting
>> the parts of the images to take into account ?
>>
>> I could of course inscribe a rectangle in the circular aperture and crop
>> to it, but I wouldn't have sufficient overlap any more in the pictures I
>> have taken so far (of course in the future I could just take about four
>> times as many pictures to get a denser coverage). And the cropping
>> solution would not be applicable in another case where I'd very much
>> like to be able to exclude some regions from the stitching: when there
>> is a bit of dirt or another defect at a fixed position with respect to
>> the sensor, covering a spot in one image which is nicely visible in
>> another shifted view. Currently the stitched image will blend the dirt
>> with the undamaged spot.
>>
>> The hugin/enblend software suite has the possibility to define 'include'
>> and 'exclude' regions, but if I could avoid the detour and do the stuff
>> in Fiji that would be splendid.
>>
>> Thanks in advance,
>> Adrian
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html