‎01-23-2013 11:04 PM
In one CCD image (600X800), I have few patches of bad pixels (few are in irregular shapes, few are in regular one like rectangle of 8X8 pixels). For correcting these bad pixel patches, I am looking for some surface fitting function, which should have provision for excluding the defined pixel location.
These bad pixel patches needs to be computed by fitted surface only.
‎01-24-2013 10:35 AM
You're talking about a 2D interpolation, of which LabVIEW's has various interpolation modes.
If you convert the image into a 2D array of data values you can replace the bad pixel values with interpolated values using "Interpolate 2D.vi" (use Quck Drop to find this) with the Bicubic Spline method.
You'll need to approach your bad pixels from the outside inwards to attain good results, which can get a bit tricky, but is possible.
‎01-26-2013 12:19 AM
HI Thoric,
Thanks for reply,
When I convert the image in 2D array, bad patches also comes into 2D array.
and when I tried interpolation2D.vi, it considers these bad pixels for interpolation also.
I need to exclude these pixels for fitting (interpolation). How to exclude these points ?
Kindly help.
‎01-28-2013 05:12 AM
@ashok_kumar wrote:
HI Thoric,
Thanks for reply,
When I convert the image in 2D array, bad patches also comes into 2D array.
of course...
and when I tried interpolation2D.vi, it considers these bad pixels for interpolation also.
I need to exclude these pixels for fitting (interpolation). How to exclude these points ?
Kindly help.
exactly, and this is where it gets complicated. So long as you know where the good and bad pixels are you can work on subsets of the 2D array that contain only one bad pixel, replacing that bad pixel with an interpolation of the surrounding good pixels. So, try working on 3x3 or 4x4 subsets that each contain only 1 bad pixel and perform the interpolation on each one at a time, putting the new interpolated result back into the original 2D array. With a knowledge of where each bad pixel is you can attack each one singularly.
‎01-28-2013 08:26 AM
thanks for reply,
I don't have single bad pixel, otherwise I would have corrected it through 3X3 averaging operation or through median/wiener filter.
I have bad pixel patches like square patch of 4X4 or 5X5 ( in which all pixels are bad only). We won't have sufficient good pixel in neighbourhood for interpolation.
That's why I am opting for 2D interpolation.
I have prior knowledge of these patch'es location.
Then the main task is to how to do 2D interpolation (fitting) while excluding these bad pixel pataches.
Kindly suggest.
‎01-29-2013 07:41 AM
I don't have single bad pixel, otherwise I would have corrected it through 3X3 averaging operation or through median/wiener filter.
I have bad pixel patches like square patch of 4X4 or 5X5 ( in which all pixels are bad only). We won't have sufficient good pixel in neighbourhood for interpolation.
That's why I am opting for 2D interpolation.
You did state in your original post that you have irregular patches of bad pixels, but that doesn't stop you using subsets of the 2D array. If you start with a 3x3 array which has one bad pixel in it (such as the bottom right pixel) and use interpolation to estimate it, then repeat across the original master array one bad pixel at a time. This approaches the bad pixels from the 'outside inwards'.