supplierdeeply

Jpeg badpixel removal isn't working for me. Am I doing something wrong?

  • 7 Replies
  • 2215 Views
Advertisements
Does CHDK for the S95 support badpixel removal for jpeg files?
My S95 has developed a stuck pixel that I'd like to map out. I'm running the recent version 0.9.9-1418

In CHDK I ran "RAW Parameters/Create badpixel.bin" to create the badpixel.bin file
In Windows I then loaded this into "Badpixel Manager 1.1 for Windows" and used it to save a text file named "badpixel"
I made sure that this file uses only LF characters as line terminators
I copied this file back to the SD card in the same directory as badpixel.bin
I have "RAW Parameters/Bad pixel removal" set to "Averag."

This has no visible effect on my jpegs - at least the stuck pixel is still there.

I also tried generating a badpixel file from scratch that defined a 20x20 pixel region to be bad, just to see whether this had any effect on jpeg shooting, and it doesn't.
Am I doing something wrong?

Re: Jpeg badpixel removal isn't working for me. Am I doing something wrong?
« Reply #1 on: 10 / December / 2011, 09:31:42 »
Does CHDK for the S95 support badpixel removal for jpeg files?
CHDK is not involved in the process of creating jpeg files on the camera in any way - that's all a function of the Digics processer and the connected DSP chip.  So there is no way to manage bad pixels in the camera jpegs using CHDK.

Update : second sentence not correct. See posts below.
« Last Edit: 10 / December / 2011, 10:36:37 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline Lebeau

  • ***
  • 187
Re: Jpeg badpixel removal isn't working for me. Am I doing something wrong?
« Reply #2 on: 10 / December / 2011, 09:45:15 »
I hope this will answer your question. I had already been confused with bad_pixel processing.

There are 3 bad pixel processes :

First, the Canon bad pixel removal process, integrated to your camera, to remove bad pixels known at the Canon plant. It is applied during jpeg process, without learning capability.

The second process, use a CHDK's user created file "badpixel.txt" (or "badpixel") in CHDK folder, to create a list of bad pixels at CHDK boot up. The structure of the text file, per line, is [ col , line ] (ex: "123,456"). This The bad pixel's removal process will be execute just before CHDK raw and dng "check-to-save" (see raw.c) during CHDK raw process (and therefore CHDK dng process since raw process is preliminary).

The third process, use "badpixel.bin" in CHDK folder and is created by CHDK's raw/dng menu "create bad pixel bin", to remove bad pixels learned from black exposure. This bad pixel's removal process is executed only when DNG file is saved to SD card.

Briefly,
- Canon bad pixel process remove "JPEG plant known bad pixels";
- CHDK "badpixel.txt" file is used to remove "JPG/RAW/DNG CHDK's user known bad pixels";
........ raw.c, rev 1414, line 190, if (conf.bad_pixel_removal) patch_bad_pixels();
- CHDK "badpixel.bin" file is used to remove "DNG CHDK learned bad pixels".
........ raw.c, rev 1414, line 254, patch_bad_pixels_b();

P.S.: To complete waterwingz's comms, from what I know, jpeg file is created from raw data space and therefore applying bad pixel removal processes to raw data space will remove bad pixels but the second process is executed only during raw process and the third process is executed only during dng process.
« Last Edit: 11 / December / 2011, 10:34:57 by Lebeau »

Re: Jpeg badpixel removal isn't working for me. Am I doing something wrong?
« Reply #3 on: 10 / December / 2011, 10:00:48 »
...  jpeg file is created from raw data space and therefore applying bad pixel removal processes to raw data space will remove bad pixels ....
I'd be really interested to hear from others if this is correct.  If so, this is a good day because once more I will have learned something new.

EDIT : looks like this is a good day ! -   this is promising Bad Pixel Removal for JPG/JPEG
as does this CHDK_User_Manual#Bad_pixel_removal

UPDATE:   having now read through the code,  it looks like this works if capt_seq_hook_raw_here is inserted in capt_seq.c prior to the camera creating the jpeg.  If it gets inserted later in the sequence, RAW & DNG files will still get created but any bad pixel changes will get missed.  So to repond to the original question, it might be a question of how capt_seq.c was implemented on the S95.

« Last Edit: 10 / December / 2011, 10:48:16 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16


Re: Jpeg badpixel removal isn't working for me. Am I doing something wrong?
« Reply #4 on: 10 / December / 2011, 21:42:19 »
Thanks for the replies waterwingz and Lebeau. I'm guessing that I've probably done the correct thing and that the S95 isn't supporting this since the camera takes time after I take a shot to do its raw processing stuff, but there's no visible effect on the jpeg.
For others reading this thread in future, show_bad.exe doesn't work with the newer .CR2 version files produced by the S95 (and presumably a bunch of other current model Canon cameras), so support for badpixel removal for jpegs on this or other newer cameras requires getting the badpixel file some other way. The technique I mentioned of using "Badpixel Manager 1.1 for Windows" to produce the required badpixel text file seems to work.
@waterwingz, I can't check whether capt_seq_hook_raw_here is inserted somewhere in capt_seq.c because the S95 source code link is broken in the porting thread. I'll post a question over on the S95 porting thread in case someone over there is able to check.

Re: Jpeg badpixel removal isn't working for me. Am I doing something wrong?
« Reply #5 on: 10 / December / 2011, 21:58:53 »
@waterwingz, I can't check whether capt_seq_hook_raw_here is inserted somewhere in capt_seq.c because the S95 source code link is broken in the porting thread. I'll post a question over on the S95 porting thread in case someone over there is able to check.
The source is available from the svn server http://trac.assembla.com/chdk/browser.

You can assume the hook is there as the S95 is a very stable port.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline Lebeau

  • ***
  • 187
Re: Jpeg badpixel removal isn't working for me. Am I doing something wrong?
« Reply #6 on: 11 / December / 2011, 10:19:55 »
...  jpeg file is created from raw data space and therefore applying bad pixel removal processes to raw data space will remove bad pixels ....
I'd be really interested to hear from others if this is correct.  If so, this is a good day because once more I will have learned something new.

EDIT : looks like this is a good day ! -   this is promising Bad Pixel Removal for JPG/JPEG
as does this CHDK_User_Manual#Bad_pixel_removal

UPDATE:   having now read through the code,  it looks like this works if capt_seq_hook_raw_here is inserted in capt_seq.c prior to the camera creating the jpeg.  If it gets inserted later in the sequence, RAW & DNG files will still get created but any bad pixel changes will get missed.  So to repond to the original question, it might be a question of how capt_seq.c was implemented on the S95.
I don't know for specific cameras, other than A650, but when I do DNG save, I have to execute "reverse_bytes_order2" to de-endianeese, else the saved jpeg is "endianeese".

Also, my A650 have a defective row, visible on video and jpeg files, which display values depending on supposed content (like big photon noise, nor zero, nor black, nor white). I added a bad pixel removal entry specific for that row and it work well.

P.S.: I correct the 2nd process explanation !!!
« Last Edit: 11 / December / 2011, 10:38:14 by Lebeau »

Re: Jpeg badpixel removal isn't working for me. Am I doing something wrong?
« Reply #7 on: 11 / December / 2011, 10:45:28 »
This thread has forked to the S95 porting thread.  It seems to continue there.

http://chdk.setepontos.com/index.php?topic=5641.msg77774#msg77774
Ported :   A1200    SD940   G10    Powershot N    G16


 

Related Topics