CCD sensor burn marks camouflage - RAW Shooting and Processing - CHDK Forum  

CCD sensor burn marks camouflage

  • 10 Replies
  • 2121 Views
CCD sensor burn marks camouflage
« on: 30 / March / 2013, 20:21:03 »
Advertisements
Hi everyone,

during one of the experiments conducted, a cheap - but nevertheless durable - Canon A480 was non-intentionally subjected to a focused, high powered laser beam for a fraction of a second, enough to cause 3 burn spots on the sensor, visible as light blue stains, on the output images.

I'm well aware the affected area is permanently gone and the same used camera can be got for a few bucks on *insert famous auction site name here*, but I've been trying to counter this, at least partially, through software approach.
I've used CHDK on this camera for at least 2 1/2 years, especially its badpixel remover (through the generation of the BADPIXEL file from a few-second CR2/RAW exposure with lens completely covered).
Problem is, that the stains do not show up in dark, so they aren't generated in the file.

Is there any way to manually determine and add the coordinates of the affected areas so that CHDK can do the nearest-pixel color averaging work on the pictures?

Here's how the burn marks look like.
http://st-ware.com/b.jpg

Thanks and best regards.

*

Offline reyalp

  • ******
  • 12217
Re: CCD sensor burn marks camouflage
« Reply #1 on: 30 / March / 2013, 23:58:18 »
The format of the manual badpixel file(not badpixel.bin used for dng) is just a text file with x y coordinates. To determine the coordinates, you should take a CHDK raw (not DNG), convert it directly to grayscale without de-bayering and then measure in an imaging program like gimp or photoshop. You may be able to use dcraw -D for the conversion, or if that fails, use rawconvert from the chdk tools.

Alternately, you can use a DNG, but you will have to offset by the active area X1 Y1 offsets found in your cameras platform_camera.h (http://trac.assembla.com/chdk/browser/trunk/platform/a480/platform_camera.h for a480)

That said, given that the defects cover a substantial number of pixels, interpolating over them may not work terribly well.
Don't forget what the H stands for.

Re: CCD sensor burn marks camouflage
« Reply #2 on: 31 / March / 2013, 10:48:32 »
I've followed the CHDK raw to grayscale conversion with a success, but I'm afraid the pixel readout's not that easy, as every coordinate is followed by an equals sign, with a number from a 1-4095 range, that I'm unfamiliar of.
I've tried to supply the coordinates without this value, but it did not seem to work.

Regards

*

Offline srsa_4c

  • ******
  • 4057
Re: CCD sensor burn marks camouflage
« Reply #3 on: 31 / March / 2013, 11:41:11 »
@lasernator
See
http://chdk.wikia.com/wiki/Badpixel_removal
http://chdk.setepontos.com/index.php?topic=6038.0
or search the forum using google: site:chdk.setepontos.com badpixel.txt
You only need to create badpixel.txt .


Re: CCD sensor burn marks camouflage
« Reply #4 on: 31 / March / 2013, 12:41:36 »
Well I'm familiar with how to create the "badpixel" file from the RAW itself, problem is that the stains do not show up in the dark, when the lens are covered (as described above), so I cannot use this method.

I've managed to convert the RAW to grayscale and pinpoint the affected coordinates (pixels), however the badpixel file also consists of another value, preceded by an "equals" sign in the file, and I don't know what it means; only its range of 1 to 4095.
It does not work when I omit it.

Regards

*

Offline srsa_4c

  • ******
  • 4057
Re: CCD sensor burn marks camouflage
« Reply #5 on: 31 / March / 2013, 12:50:46 »
The function that loads that badpixel file is here: https://trac.assembla.com/chdk/browser/trunk/core/raw.c#L315
Unless I'm wrong, it only reads two numbers from each line, and expects a DOS/Windows style text file.

Re: CCD sensor burn marks camouflage
« Reply #6 on: 31 / March / 2013, 14:33:30 »
I have used the show_bad utility to this date, its output (badpixel file) is something like this:
Code: [Select]
367,3=686
726,3=318
447,4=914
171,7=1758
1785,7=394
1936,8=250
104,9=666
... etc.

The CMD files mentioned above in one of the links throw error 404 not found.

Regards

*

Offline reyalp

  • ******
  • 12217
Re: CCD sensor burn marks camouflage
« Reply #7 on: 31 / March / 2013, 14:49:33 »
I have used the show_bad utility to this date, its output (badpixel file) is something like this:
According to http://chdk.wikia.com/wiki/CHDK_firmware_usage/AllBest#Hot-Pixel_Removal_.28Build_100-16_and_later.29 everything after the = is ignored.

so to manually add your own you can just put in
x,y<newline>
for each pixel.
Don't forget what the H stands for.


Re: CCD sensor burn marks camouflage
« Reply #8 on: 01 / April / 2013, 08:30:39 »
Yes, that's exactly what I did, but I think I must be doing something wrong since the blue stains are still neither removed nor reduced.

The badpixel file was created straight out of the CR2 RAW exactly through the process you've hinted me above - hope there's no strange offset variable for the coordinates.

I've even tried to convert the newlines to UNIX-style and back, but this did not seem to help.

Regards

*

Offline srsa_4c

  • ******
  • 4057
Re: CCD sensor burn marks camouflage
« Reply #9 on: 01 / April / 2013, 09:03:18 »
Yes, that's exactly what I did, but I think I must be doing something wrong since the blue stains are still neither removed nor reduced.
The current interpolation method can't deal with larger spots.
Here's the source:
https://trac.assembla.com/chdk/browser/trunk/core/raw.c?rev=2642#L281
Only the nearest same color pixels are averaged.

That means the only thing you could do is to set "Manual bad pixel removal" in the RAW menu to "RAWconv" and use RAW software that can interpolate over larger blocks of dead pixels. Camera JPEGs won't be fixed by this of course...

 

Related Topics