| Re: Image Inpainting [message #64859 is a reply to message #64825] |
Wed, 21 January 2009 09:19   |
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 ?
|
|
|
|