PowerShot SX230 HS - Porting Thread - page 70 - General Discussion and Assistance - CHDK Forum

PowerShot SX230 HS - Porting Thread

  • 706 Replies
  • 307232 Views
*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: PowerShot SX230 HS - Porting Thread
« Reply #690 on: 12 / September / 2020, 21:10:15 »
Advertisements
The SX220 sample has the white border on the right (if you change the active area), the SX230 sample does not for some reason. Also in the SX220 sample you can see the blue pixels just like I'm getting on the last row (on lower right hand corner of the image).

The only difference between the SX220 and the SX230 is that the SX230 has a GPS.


Thanks for the links.


I tried both DNG files in dcraw 9.28 and RawTherapee 5.8 (MacOS) and cannot see any issues with either.


There are a couple of tiny blue areas at the lower right of the SX220 DNG file (possibly bad/dead pixels).
I can't see any issues with the SX230 file.
No white borders on either image in RT or TIFF from dcraw.


The CHDK active area in both cameras includes partially masked areas on all four edges - there is image data there; but it is significantly darker than the rest of the image.


Whoever did the ports chose to include these parts of the sensor in the active area.
If you wanted to exclude the partially masked areas then the active area for both cameras would be - 36 120 3040 4136


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 SX720

  • *
  • 43
Re: PowerShot SX230 HS - Porting Thread
« Reply #691 on: 12 / September / 2020, 22:39:39 »
For the darker region on the edges this only happens when taken zoomed all the way out. If you zoom in with the lens you won't see those darkened edges. It's related to the camera's vignetting correction which for some reason is not applied to the outer edges.

I think the SX230 HS DNG sample has somehow been modified to remove the white border or perhaps all pixels marked as bad where removed. I think CHDK does this when using the DNG 1.1 mode. Also for some reason with the SX220 sample on my computer RawTherapee seems to be ignoring the active area and using something else.

For the SX220 sample to see the white border you must change the active area with exiftool and use dcraw to recreate the behavior. Here are the commands I use to see the same white border on the right of the image that I see:
Code: [Select]
exiftool -ActiveArea="0 0 3060 4168" "Canon - Canon PowerShot SX220 HS - 12bit CHDK ver. 1.4.1 (4_3).DNG"
dcraw "Canon - Canon PowerShot SX220 HS - 12bit CHDK ver. 1.4.1 (4_3).DNG"

I think the SX220 values should be brought over to the SX230. Here is my proposed patch for trunk/platform/sx230hs/platform_camera.h:
Code: [Select]
--- platform_camera.h.bak
+++ platform_camera.h
@@ -69,9 +69,9 @@
     #define CAM_JPEG_WIDTH                  4000
     #define CAM_JPEG_HEIGHT                 3000
 
-    #define CAM_ACTIVE_AREA_X1              96
-    #define CAM_ACTIVE_AREA_Y1              24
-    #define CAM_ACTIVE_AREA_X2              4168
+    #define CAM_ACTIVE_AREA_X1              92
+    #define CAM_ACTIVE_AREA_Y1              16
+    #define CAM_ACTIVE_AREA_X2              4164
     #define CAM_ACTIVE_AREA_Y2              3060
 
     #define PARAM_CAMERA_NAME               4
« Last Edit: 12 / September / 2020, 22:44:26 by SX720 »

*

Offline reyalp

  • ******
  • 14080
Re: PowerShot SX230 HS - Porting Thread
« Reply #692 on: 12 / September / 2020, 23:11:55 »
I think the SX230 HS DNG sample has somehow been modified to remove the white border or perhaps all pixels marked as bad where removed. I think CHDK does this when using the DNG 1.1 mode.
I very much doubt CHDK is doing anything like this.
Quote
For the SX220 sample to see the white border you must change the active area with exiftool and use dcraw to recreate the behavior.
If you have dcraw interpolating over 0 valued pixels (https://chdk.setepontos.com/index.php?topic=14097.0), perhaps some of the areas truly outside the actual active area could get interpolated over.

Quote
I think the SX220 values should be brought over to the SX230.
They should almost certainly have the same values.
Don't forget what the H stands for.

*

Offline SX720

  • *
  • 43
Re: PowerShot SX230 HS - Porting Thread
« Reply #693 on: 12 / September / 2020, 23:30:50 »
I'm using the unmodified dcraw for these tests. In RawTherapee for SX230 DNGs you can see that the pixels on the far right are bright by using the show sensor pattern option. This bypasses interpolation.

In addition you can also use the document mode for dcraw which bypasses interpolation and it shows the white border on the far right. I've attached an example of the output using the SX220 HS sample which is the same as what I'm getting. I had to crop it because of the attachment file-size limit. It's the bottom 256 pixels. The DNGs I get from my SX230 are very similar to the attached file including the last row being brighter and the very bright pixels on the bottom row on the right and the border.

Here is the command I used to generate the image:
Code: [Select]
dcraw -d -W "Canon - Canon PowerShot SX220 HS - 12bit CHDK ver. 1.4.1 (4_3).DNG"
« Last Edit: 12 / September / 2020, 23:35:40 by SX720 »


*

Offline reyalp

  • ******
  • 14080
Re: PowerShot SX230 HS - Porting Thread
« Reply #694 on: 13 / September / 2020, 00:58:36 »
I agree the active width should be 4164, updated in trunk 5566 and 1.4 5567.

Using chdkptp
Code: [Select]
dngload "Canon - Canon PowerShot SX220 HS - 12bit CHDK ver. 1.4.1 (4 3).DNG"
dngdump -rfmt=16pgm -raw=sx220-pixls.pgm
and examining the resulting file in gimp, I see the 4 rightmost pixels are solid white. On the SX230 sample, they are 0 (not black level).

The bottom most row is also weird in both, but I haven't changed the active height. There are actually black (0 value) sections in the sx230 one that correspond to the white ones in the sx220.

edit:
CHDK definitely isn't removing the white border, I'd guess the camera makes those parts black or white level depending on some factor not known to us.
« Last Edit: 13 / September / 2020, 01:10:15 by reyalp »
Don't forget what the H stands for.

*

Offline SX720

  • *
  • 43
Re: PowerShot SX230 HS - Porting Thread
« Reply #695 on: 13 / September / 2020, 01:21:56 »
That's a good change but what about the X1, Y1 values that the SX220 HS has?

CAM_ACTIVE_AREA_X1 could be set to 92 (instead of 96) and CAM_ACTIVE_AREA_Y1 could be set to 16 (instead of 24). The SX220 HS port is already doing it and I verified that the (16, 92) origin works for both of the samples linked earlier and it works for my own photos taken with the SX 230 HS.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: PowerShot SX230 HS - Porting Thread
« Reply #696 on: 13 / September / 2020, 02:18:43 »
That's a good change but what about the X1, Y1 values that the SX220 HS has?

CAM_ACTIVE_AREA_X1 could be set to 92 (instead of 96) and CAM_ACTIVE_AREA_Y1 could be set to 16 (instead of 24). The SX220 HS port is already doing it and I verified that the (16, 92) origin works for both of the samples linked earlier and it works for my own photos taken with the SX 230 HS.


Based on the samples linked to earlier the sensors are different (examined in RawDigger).
The top left corner on the SX230 is at 24,96. If you change it to 16,92 you will have thin black borders on the top and left edges.


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 reyalp

  • ******
  • 14080
Re: PowerShot SX230 HS - Porting Thread
« Reply #697 on: 13 / September / 2020, 02:31:37 »
Based on the samples linked to earlier the sensors are different (examined in RawDigger).
The top left corner on the SX230 is at 24,96. If you change it to 16,92 you will have thin black borders on the top and left edges.
Hmm, I'm with SX720 on this one. Here's what a 92x16 selection looks like to me on the sx230 sample. It just hits the edge of the image data. The current 96 24 would just be part way into the non-vignette corrected area. The same is true on the sx220.

Also, looking at the bottom most row, it looks like aside from the black white 8x1 pixel spots the image data is shifted, so I'd be inclined to remove that as well, to 3058 to keep it even.
Don't forget what the H stands for.


*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: PowerShot SX230 HS - Porting Thread
« Reply #698 on: 13 / September / 2020, 05:41:10 »
Based on the samples linked to earlier the sensors are different (examined in RawDigger).
The top left corner on the SX230 is at 24,96. If you change it to 16,92 you will have thin black borders on the top and left edges.
Hmm, I'm with SX720 on this one. Here's what a 92x16 selection looks like to me on the sx230 sample. It just hits the edge of the image data. The current 96 24 would just be part way into the non-vignette corrected area. The same is true on the sx220.

Also, looking at the bottom most row, it looks like aside from the black white 8x1 pixel spots the image data is shifted, so I'd be inclined to remove that as well, to 3058 to keep it even.


Yes you're right. My mistake, sorry about that.


(RawDigger hides the masked area pixel values in the default render mode, so I was not seeing the data correctly).


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 reyalp

  • ******
  • 14080
Re: PowerShot SX230 HS - Porting Thread
« Reply #699 on: 13 / September / 2020, 16:23:44 »
Yes you're right. My mistake, sorry about that.

(RawDigger hides the masked area pixel values in the default render mode, so I was not seeing the data correctly).
No problem. I ended up making my own tools to do this because I got tired being confused by what other programs were doing ;)

Updated in trunk 5568, 1.4 5569
Don't forget what the H stands for.

 

Related Topics