comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Image Inpainting
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Image Inpainting [message #64825] Mon, 26 January 2009 04:29 Go to next message
Gianluca Li Causi is currently offline  Gianluca Li Causi
Messages: 21
Registered: August 2005
Junior Member
On Jan 21, 6:19 pm, erano <eran.o...@gmail.com> wrote:
> On Jan 21, 3:42 pm, "Jean H." <jghas...@DELTHIS.ucalgary.ANDTHIS.ca>
> wrote:
>
>
>
>> erano wrote:
>>> Hello,
>>> I'm looking for a simple IDL code for Image Inpainting.
>
>>> Input is an image (2D) with small missing areas, and I wish to add
>>> values to the unknowm pixels, based on the known pixels.
>
>>> Thanks
>>> Eran
>
>> Hi Eran,
>
>> there are a lot of ways of filling missing pixels... one of them is to
>> have a 3*3 (or else) window that moves over your image. When the central
>> pixel is a "missing" one, get the value of the pixels in the window and
>> assign the majority value to the missing pixel... this works well for
>> classification, you might want to do an average instead if you have
>> continuous values.
>
>> The trick is not to assign the missing value to any pixel, even if it is
>> the majority value, so you would have to iterate it several times... And
>> of course, your window doesn't need to move over the whole image, just
>> select the missing pixels via Where().
>
>> Jean
>
> Hi,
> The missing pixels are in a groups so I can not do so.
> For now I'm using the MPFIT2DFUN.PRO (Craig's codehttp://www.physics.wisc.edu/~craigm/idl/idl.html)
>
> I'm using a binary mask for the WEIGHTS, but the result is not smooth
> at all.
> If I take the missing edge then I must to keep the fit function (f) to
> be also fit on the 2D gradient function (df/dx and df/dy) on the
> bounds.
> Can I add these rules to the MPFIT2DFUN ?


Dear Eran,
image inpainting is a difficult task: I don't know what kind of images
you're qpeaking of, but in general you should also fit the laplacian
at the border (e.g.: consider to have a group of missing pixels on a
circle: your inpainting should propagate the curve at the border, in
order to reconstruct the circle). More, you should also propagate the
texture, or the noise, in the image.
If a totally *manual* intervention is ok for you, I suggest to use the
very very powerful "healing tool" of PhotoShop CS3, which is able to
do al that with one click.
Try it, sometimes it is really incredible.

Hope to be of help
bye
Gianluca
Re: Image Inpainting [message #64859 is a reply to message #64825] Wed, 21 January 2009 09:19 Go to previous messageGo to next message
erano is currently offline  erano
Messages: 22
Registered: November 2008
Junior Member
On Jan 21, 3:42 pm, "Jean H." <jghas...@DELTHIS.ucalgary.ANDTHIS.ca>
wrote:
> erano wrote:
>> Hello,
>> I'm looking for a simple IDL code for Image Inpainting.
>
>> Input is an image (2D) with small missing areas, and I wish to add
>> values to the unknowm pixels, based on the known pixels.
>
>> Thanks
>> Eran
>
> Hi Eran,
>
> there are a lot of ways of filling missing pixels... one of them is to
> have a 3*3 (or else) window that moves over your image. When the central
> pixel is a "missing" one, get the value of the pixels in the window and
> assign the majority value to the missing pixel... this works well for
> classification, you might want to do an average instead if you have
> continuous values.
>
> The trick is not to assign the missing value to any pixel, even if it is
> the majority value, so you would have to iterate it several times... And
> of course, your window doesn't need to move over the whole image, just
> select the missing pixels via Where().
>
> Jean

Hi,
The missing pixels are in a groups so I can not do so.
For now I'm using the MPFIT2DFUN.PRO (Craig's code
http://www.physics.wisc.edu/~craigm/idl/idl.html)

I'm using a binary mask for the WEIGHTS, but the result is not smooth
at all.
If I take the missing edge then I must to keep the fit function (f) to
be also fit on the 2D gradient function (df/dx and df/dy) on the
bounds.
Can I add these rules to the MPFIT2DFUN ?
Re: Image Inpainting [message #64864 is a reply to message #64859] Wed, 21 January 2009 04:42 Go to previous messageGo to next message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
erano wrote:
> Hello,
> I'm looking for a simple IDL code for Image Inpainting.
>
> Input is an image (2D) with small missing areas, and I wish to add
> values to the unknowm pixels, based on the known pixels.
>
> Thanks
> Eran

Hi Eran,

there are a lot of ways of filling missing pixels... one of them is to
have a 3*3 (or else) window that moves over your image. When the central
pixel is a "missing" one, get the value of the pixels in the window and
assign the majority value to the missing pixel... this works well for
classification, you might want to do an average instead if you have
continuous values.

The trick is not to assign the missing value to any pixel, even if it is
the majority value, so you would have to iterate it several times... And
of course, your window doesn't need to move over the whole image, just
select the missing pixels via Where().

Jean
Re: Image Inpainting [message #64915 is a reply to message #64825] Tue, 27 January 2009 00:37 Go to previous message
erano is currently offline  erano
Messages: 22
Registered: November 2008
Junior Member
> Dear Eran,
> image inpainting is a difficult task: I don't know what kind of images
> you're qpeaking of, but in general you should also fit the laplacian
> at the border (e.g.: consider to have a group of missing pixels on a
> circle: your inpainting should propagate the curve at the border, in
> order to reconstruct the circle). More, you should also propagate the
> texture, or the noise, in the image.
> If a totally *manual* intervention is ok for you, I suggest to use the
> very very powerful "healing tool" of PhotoShop CS3, which is able to
> do al that with one click.
> Try it, sometimes it is really incredible.
>
> Hope to be of help
> bye
> Gianluca- Hide quoted text -
>
> - Show quoted text -

Thanks, but I wish to solve it by IDL. I found few algorithems for
MATLAB and a I wish to translate one of them to IDL. But if anuone did
it allready, I will be happy to share.
Eran
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL-Java bridge problem
Next Topic: How to control the order of the objects to draw [using object graphics]

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:15:25 PDT 2025

Total time taken to generate the page: 0.00835 seconds