S95 Porting Thread - page 98 - DryOS Development - CHDK Forum
supplierdeeply

S95 Porting Thread

  • 1015 Replies
  • 259721 Views
Re: S95 Porting Thread
« Reply #970 on: 12 / December / 2011, 06:50:52 »
Advertisements
Thanks for the explanation of the badpixel files Phil. I had assumed that the badpixel.bin contained both hot and stuck pixel information. So, I gather that the way I have to generate the badpixel.txt file is to take a photo, measure the xy-coords of the bad pixel, then manually calculate its sensor coordinates and create the entry in the badpixel.txt file. I've done this, but I must be getting the xy-coords wrong because the bad pixel is still there in my jpegs. Do you know of a RAW file converter that will give me an image of the full 3744x2784px sensor image? Perhaps I need to investigate dcraw? I used raw therapee to get a 3676x2752px png, but I have no idea what the offsets to 0,0 for this image are. I also took a 3648x2736px jpeg image and measured the coords, which I think are 1930,1346 (it's much harder to tell, even with sharpening set to a minimum, because of the jpeg processing), then I added the suggested 72, 24px offsets to these coords to get the coords for the badpixel.txt file.

*

Offline philmoz

  • *****
  • 3325
    • Photos
Re: S95 Porting Thread
« Reply #971 on: 12 / December / 2011, 16:46:38 »
Thanks for the explanation of the badpixel files Phil. I had assumed that the badpixel.bin contained both hot and stuck pixel information. So, I gather that the way I have to generate the badpixel.txt file is to take a photo, measure the xy-coords of the bad pixel, then manually calculate its sensor coordinates and create the entry in the badpixel.txt file. I've done this, but I must be getting the xy-coords wrong because the bad pixel is still there in my jpegs. Do you know of a RAW file converter that will give me an image of the full 3744x2784px sensor image? Perhaps I need to investigate dcraw? I used raw therapee to get a 3676x2752px png, but I have no idea what the offsets to 0,0 for this image are. I also took a 3648x2736px jpeg image and measured the coords, which I think are 1930,1346 (it's much harder to tell, even with sharpening set to a minimum, because of the jpeg processing), then I added the suggested 72, 24px offsets to these coords to get the coords for the badpixel.txt file.

Ok, sounds like you are setting it up correctly.
I've attached a badpixel.txt file that defines a 4x4 block at co-ord 200,200.
Also attached is a modified version of CHDK for the S95 1.00e - this version sets the bad pixels to white instead of removing them.

To test this:
- copy the new version to the SD card and the badpixel.txt file to the CHDK directory
- enable Bad pixel removal, disable saving CHDK RAW image, disable CHDK save raw as DNG option
- take a very dark photo (cover the lens or use a very fast shutter speed)

In the resulting JPEG there should be a bright 4x4 block towards the top left corner of the image.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline vnd

  • *
  • 36
Re: S95 Porting Thread
« Reply #972 on: 12 / December / 2011, 16:51:47 »

Quote
I actually came here to report there is no reason to have to hold the on button to get to recording mode. I have the 100H firmware and I made this change in boot.c

This is a design decision made early on - it is safer to start the camera in playback mode if the button is accidentally bumped or pressed while in a case.
It is also better to have all cameras operate the same way for consistency rather than have some work one way and others differently.


In cvs trunk it is somewhat inconsistent.

100e starts exactly like the original firmware.
100h always starts in playback mode, regardless of the button used for switching on.

The code in 100e boot.c sub_FF810354_my() differs from all the other versions. It looks like a bug fixed only in 100e.

Re: S95 Porting Thread
« Reply #973 on: 13 / December / 2011, 07:24:22 »
Thanks for these Phil. They have already been helpful. I loaded your firmware but used my own badpixel file and took a photo. This produced my jpeg with its red hot/stuck pixel and another white (or red or blue) pixel at the coordinates specified in the badpixel file (I had an offset of about 18 in x and 8 in y). I iterated a few times, updating the coordinates, until I got them to coincide by choosing the location that causes the least change in the resulting file when used with your code. A change of 1 in any direction of the pixel coordinate produced a noticably worse image artifact. I then tried setting the coordinates to each of the coordinates in a 3x3 region centred at the location I determined using the standard CHDK firmware, but it hasn't had any visible effect on removing the bad pixel, so there's still something not right. I'll have to look into it more on the weekend I think. I'm thinking of setting a sort of crosshair pattern of white pixels using your firmware to check how much I might be off by, then perhaps going through more of a range of pixels. I might have to look into how the interpolation is done.


*

Offline philmoz

  • *****
  • 3325
    • Photos
Re: S95 Porting Thread
« Reply #974 on: 13 / December / 2011, 16:49:11 »
Thanks for these Phil. They have already been helpful. I loaded your firmware but used my own badpixel file and took a photo. This produced my jpeg with its red hot/stuck pixel and another white (or red or blue) pixel at the coordinates specified in the badpixel file (I had an offset of about 18 in x and 8 in y). I iterated a few times, updating the coordinates, until I got them to coincide by choosing the location that causes the least change in the resulting file when used with your code. A change of 1 in any direction of the pixel coordinate produced a noticably worse image artifact. I then tried setting the coordinates to each of the coordinates in a 3x3 region centred at the location I determined using the standard CHDK firmware, but it hasn't had any visible effect on removing the bad pixel, so there's still something not right. I'll have to look into it more on the weekend I think. I'm thinking of setting a sort of crosshair pattern of white pixels using your firmware to check how much I might be off by, then perhaps going through more of a range of pixels. I might have to look into how the interpolation is done.

There are two options for the 'Bad pixel removal' option in the menu.
Average tries to fill the pixel by averaging the values around it - if you don't have the co-ordinate exactly right then it will smear the stuck pixel into it's neighbours.
RAWConv sets the bad pixels to 0, the JPEG engine should then average these out, so I would try this option.

For RAWConv to work the 'DNG format' option has to be unchecked.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: S95 Porting Thread
« Reply #975 on: 16 / December / 2011, 21:54:39 »
Success! The badpixel removal is now successfully removing the stuck/hot pixel in my jpeg and raw files. Huge thanks to Phil and waterwingz, particularly to Phil for the invaluable diagnostic version of CHDK that set the badpixel coordinates white. To find the coordinates, I did the following:

1. I used Phil's special firmware to help home in on the bad pixel coordinate (x,y) by repeatedly shooting jpegs and changing the coordinates until the white pixel position corresponded as closely as possible with the stuck pixel. In my case, Canon's jpeg processing turns the stuck pixel into a roughly 12 pixel red blob, so I could only get the coordinates approximately. At this point, the best coordinate guess was (x,y) = (2000, 1370).
2. Use standard CHDK and set Mode to RAWConv.
3. Make a badpixel file containing all coords from (x-2,y-2) to (x+2,y+2), i.e. 25 entries from 1998,1368 through to 2002,1372.
4. Take a photo and verify that the badpixel isn't showing up.
5. Repeatedly take a photo, check for stuck pixel showing up, remove the coordinates of an outer row or column to hone down the affected region until only the single entry is required to map out the pixel. In my case this was (2002,1370).
6. Set the badpixel removal mode back to Average.
7. Celebrate.

My RAW settings menu are now simply
Save RAW [ ]  (i.e. I thought this had to be checked, but it doesn't)
Bad pixel removal [Averag.]

My bad pixel is mapped out of both jpeg and .CR2 files if Bad pixel removal is set. I'm not using any of CHDK's RAW file modes, just the S95's built-in RAW settings. I wasn't expecting CHDK's badpixel removal to also affect the .CR2, so this is an extra bonus for me. Now that I know the correct sensor coordinates of the bad pixel, I disabled CHDK, took a RAW image and saved a 3676x2752 pixel .png file from RawTherapee v4.0. The bad pixel is easy to identify in the .png file and is at (1947,1355). Here, the top left image pixel has coordinates (1,1). Since my bad pixel is at (2002,1370) in sensor coordinates, there is an offset of (55,15) pixels to the top left of the png produced by RawTherapee.

Re: S95 Porting Thread
« Reply #976 on: 13 / January / 2012, 04:10:53 »
Hello there
I have a aerial photography platform and a Camera holder that hold the camera Upside down from the bottom of this platform.
I can hang the Gopro fine and set gopro to UpsideDown mode.

Is there any possibility with Canon S95 and   CHDK rotate the image upside down?

*

Offline fe50

  • ******
  • 3131
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: S95 Porting Thread
« Reply #977 on: 13 / January / 2012, 06:53:07 »
Is there any possibility with Canon S95 and   CHDK rotate the image upside down?
No.
Most apps use the orientation info from the EXIF data to show the image in the "correct" orientation.
You could change this orientation value in the EXIF data, e.g. with a tool like EXIFTOOL, maybe in batch mode...

To rotate the image you may use a software app with support for lossless JPEG rotation...


Re: S95 Porting Thread
« Reply #978 on: 17 / February / 2012, 13:03:21 »
hi guys, what are you solutions for taking time-lapse pictures? (using the chdk of course)
there's the option of buying the power adapter, but i can't seem to find them here in thailand.

has anyone use it before?  can it leave it plugged in and set it up so it'll take pictures for 4-5 days straight?  for example, on a 16GB card, 1920x1280res. pics, interval of 1 pic per minute, so it'll be 60pics an hour, 1440pics per day, 7200pics for 5days, something like that.

or are there any other options?

what about when you guys do time-lapse outdoor?  there'll be no place to plug in the power if i use the power adapter, haha.

thanks all.

Re: S95 Porting Thread
« Reply #979 on: 29 / August / 2012, 11:55:03 »
hmmm, is this board dead? haha

anyways, i finally went out and bought external power source from ebay, generic brand, it's not by canon.  and it works fine.

here's one of a time-lapse video that i did

growamushroom4.avi

using CHDK to run script taking photos 1 every 2mins

 

Related Topics