badpixel vs badpixelcopy4.exeEdit
I created badpixel.bin file using CHDK/SCRIPTS/TEST/badpixel.lua script which found 12166 badpixels. But using RAW-file with >10sec exp in dark room after running badpixelcopy4.exe with different thresholds:
# threshold 246637 badpixel 2 4524 badpixel 4 45 badpixel 10 13 badpixel 32 5 badpixel 64 3 badpixel 100 1 badpixel 256
So, there are several questions:
1) what threshold was used in lua-script to create badpixel.bin file
2) how badpixel.txt file created by badpixelcopy4.exe will be used together with badpixel.bin?
- A 1) The badpixel.lua script generates a list of the bad pixels which are already stored by Canon in the original firmware. These pixels are always the same, they were already defective when your camera left the manufactory. The script does not calculate the pixels, it calls the function get_bad_count_and_write_file which identifies the bad pixels already masked as bad by the Canon firmware; there's no threshold in use.
- This file badpixel.bin is a binary file, it is only used for the DNG RAW creation process
- A 2) There's the 'normal' Hot-Pixel removal function in CHDK, this function detects new bad / hot pixels which are not included in the manufacturers firmware list. The file badpixel is a text file with the coordinates of the defective pixels, it is generated as described in the link above. The threshold depends on your needs, without giving a threshold value the show_bad.exe uses 30 by default; a value between 64 and 128 is a good choice.
- This file badpixel is a text file, see the structure in the link above
- your badpixelcopy4.exe does the same as show_bad.exe, but CHDK needs a special format (on line for each pixel, x,y=z)
- To check whether the Hot-Pixel removal function removes all bad pixels load both files (long exposure dark shots, with and without the Hot-Pixel removal enabled) into your image viewer and compare the pixels on the corresponding coordinates...
- Fe50 13:04, 5 January 2009 (UTC)
Script usage questionEdit
The page nowhere mentions what I should do when creating the badpixel files/running the script - does the camera have to be static (what happens if I move it between it trying to take the shots?) - does it matter where I point the camera? It might be useful to add this info on the usage page, even if it does not make a difference how the camera is set up. Also, how should I interpret the number of bad pixels (10,786 on an 7.1 megapixel SD750 in my case) - is that good or bad? (18.104.22.168 04:16, 1 July 2009 (UTC))
- → i (a chdk newbie) just came across the same question but after reading fe50 answers above i came to believe the the picture-scene doesn't matter at all for the badpixel-lua script to work since its only used to access an internal static array of values. but you are right, it would be helpful if there would be a word or comment about this somewhere.< \br>i don't know how to interpret the numbers of bad pixels but 10,786 sounds a lot to me, i get 'only' 4813 on my 8 megapixel a590is... 22.214.171.124 10:25, 4 July 2009 (UTC)
- → thanks! (126.96.36.199 14:14, 5 July 2009 (UTC))
- →I have similar questions about the function of badpixel.lua. I am quite certain the background DOES matter - if not, why take two photos during the script if it is simply extracting embedded data? For consideration - just ran badpixel.lua 3 times on a SD880IS.
- •First test - oblique angle at desk with dark and light tones, slight movement between the two badpixel.lua photos. Bad pixel count = approx 24,000
- •Second test - aimed at a sheet of printer paper on a clipboard against wall, white paper fills screen, little to no movement. Bad pixel count = approx 7,000
- •Third test - same as second, but clipboard is on floor, camera points down aligned more carefully with center of clipboard. Bad pixel count = approx 4,000
- Looks to me like background makes a big difference! -- Mattjasb 21:30, January 4, 2010 (UTC)
Script usage / G7 Edit
I cannot get the badpixel.lua script to complete successfully on a G7. It always ends like this :
Try this script again...
- FINISHED ***
I googled for this, but did not find any explanations. I must add that I got it working (I mean the script asked for pressing set key to save result) on every run with a SX1 IS.
I tried again today before posting the question with latest build (0.9.9-872 as of today), no louck on the G7.
- Same behavior with G9 / 0.9.9-875.