Bug(?) in Edge Overlay - General Help and Assistance on using CHDK stable releases - CHDK Forum

Bug(?) in Edge Overlay

  • 15 Replies
  • 9276 Views
*

Offline icmn78

  • *
  • 7
  • PowerShot S3 IS
Bug(?) in Edge Overlay
« on: 10 / March / 2013, 15:08:35 »
Advertisements
Hello,

I can't seem to get the Edge Overlay function to work correctly.
I have a S3IS with CHDK build nr 2626. Everything else seems to work okay, I made some simple script, it all works.

But the edge overlay function is not working. I can enable it, and in LIVE mode it works okay (makes a nice overlay), but if I half press the shutter in FROZEN mode, the whole screen fills up with yellow pixels.
In FROZEN mode, I can save the overlay, and load it again. But it again shows the whole screen yellow.

Zebra mode is disabled.
There is plenty of free memory (~1MB)

Is there a known bug or am I missing a setting somewhere?

*

Offline icmn78

  • *
  • 7
  • PowerShot S3 IS
Re: Bug(?) in Edge Overlay
« Reply #1 on: 11 / March / 2013, 18:18:07 »
I tried some things today:

1 - Opened a .EDG file in a hex editor, and it is full of "FF", and some other numbers here and there. So that explains the yellow screen.

2 - With a hex editor, I made a .EDG file filled with "00", and some lines of "FF" in different places. If I load this file in the camera, the overlay has just some lines. So the overlay loading function and view function works! (this is FROZEN state)

3- Also noticed when I make a dark pictures (e.g. with lens cap attached), the overlay is not completely yellow. Sometimes it is completely empty (transparent), sometimes the lower 1/3 or 1/4 is yellow.

What I think : The overlay program gets interrupted when full-pressing the shutter. While half-pressing, the overlay is properly shown, when full pressing the overlay gets all crazy, and then gets written to memory.
Does this make sense? Is there maybe a timing issue in the code?

*

Offline srsa_4c

  • ******
  • 4451
Re: Bug(?) in Edge Overlay
« Reply #2 on: 11 / March / 2013, 19:31:39 »
I don't use this feature a lot (or at all), but I'll try to guess what might be happening.
While half-pressing, the overlay is properly shown, when full pressing the overlay gets all crazy, and then gets written to memory.
Does this make sense? Is there maybe a timing issue in the code?
The edge overlay works with the camera's live framebuffers. These framebuffers (there's 3 or 4 of them in rec mode) hold the live picture you see on the LCD. They are located in a certain part of the camera's memory (the 3 or 4 buffers follow each other). When the camera takes a photo, parts of the camera memory are reused to hold the still image (the uncompressed original data, then the compressed photo, then the photo gets uncompressed again for image review - when it's enabled). Your camera is probably reusing parts of the "live image" memory area in that process, and when the edge overlay code takes its snapshot, it's already overwritten.
FYI, it's also unusable on my Ixus65 which is from the same era and has the same sensor.

*

Offline icmn78

  • *
  • 7
  • PowerShot S3 IS
Re: Bug(?) in Edge Overlay
« Reply #3 on: 13 / March / 2013, 07:01:55 »
That could very well be an explanation of what's happening. But I don't know anything about the inner workings of the camera.

It would explain that I don't get the full yellow screen if I make a fully black picture. A fully black picture would take far less space in memory in compressed state.
I did some tests with the size and quality settings of the JPG's set to lowest, but there is no difference. I would expect it to have the same effect as a black picture. But maybe the settings are only applied to how the JPG is written to the SD, and don't have an effect on how it is handled in memory.

But, if it is true that more of the cameras of the same era and same sensor have this problem, I would expect to read something about it on the wiki or forum? The hack is done on a lot of S3IS's.


*

Offline srsa_4c

  • ******
  • 4451
Re: Bug(?) in Edge Overlay
« Reply #4 on: 13 / March / 2013, 18:08:25 »
I did some tests with the size and quality settings of the JPG's set to lowest, but there is no difference.
Same results here.

Quote
But, if it is true that more of the cameras of the same era and same sensor have this problem, I would expect to read something about it on the wiki or forum? The hack is done on a lot of S3IS's.
We barely get feedback (especially from owners of old cameras), so in case of a less often used feature it may take a while until someone complains.

I have a few ideas to fix this. If you're interested, watch this thread (the solution will probably be camera specific).

*

Offline icmn78

  • *
  • 7
  • PowerShot S3 IS
Re: Bug(?) in Edge Overlay
« Reply #5 on: 14 / March / 2013, 06:28:42 »
I bought the camera to do a long term timelapse, so the edge function would be very helpful but I can manage without.

If you need any help in testing please let me know, I have turned on notifications for this topic. Thanks in advance for your effort!

FYI : If I make a black picture, the saved overlay is almost completely empty (just some yellow pixels, probably it detects the edges of noise) except the upper and lower line is yellow. Maybe this helps in debugging?

*

Offline srsa_4c

  • ******
  • 4451
Re: Bug(?) in Edge Overlay
« Reply #6 on: 16 / March / 2013, 10:38:19 »
FYI : If I make a black picture, the saved overlay is almost completely empty (just some yellow pixels, probably it detects the edges of noise) except the upper and lower line is yellow. Maybe this helps in debugging?
The result depends on shutter speed. If it's slow (one or more seconds), the live framebuffers are untouched when the edge overlay is created. You can try this in Tv or M mode.

Small status update:
The only alternative way of getting the image data which would work on all cameras is to get it in "record review" mode. This mode is entered when you press SET during image review after shooting. It's much less convenient, but I don't see another way.
This is still in planning phase, not implemented yet.

*

Offline icmn78

  • *
  • 7
  • PowerShot S3 IS
Re: Bug(?) in Edge Overlay
« Reply #7 on: 16 / March / 2013, 17:53:27 »
Thanks! The long shutter time trick works, only I have to give it 2 seconds. What happens? Does the long shutter  give it time to capture the overlay?

While not perfect, this will work fine for me. I can take a reference overlay and load that one each time I had to move the camera for whatever reason. Or make a new one before moving.

Would it somehow be possible to get an overlay of an image in play mode? I think that would be a very useful feature.


*

Offline srsa_4c

  • ******
  • 4451
Re: Bug(?) in Edge Overlay
« Reply #8 on: 17 / March / 2013, 12:58:37 »
Thanks! The long shutter time trick works, only I have to give it 2 seconds. What happens? Does the long shutter  give it time to capture the overlay?
The edge overlay routine checks for a full shutter button press. If it detects that, it gets a "screenshot" (this process is relatively slow).

1st line: shooting process, 2nd line: edge overlay routine activity
(full_shoot) -> (expo start) ........... (expo end) -> (CCD readout) .. (readout end)
             (noticed) -> (edge processing) .. (end)


Quote
Would it somehow be possible to get an overlay of an image in play mode? I think that would be a very useful feature.
Yes, just play with the options (enable it in play mode).

*

Offline srsa_4c

  • ******
  • 4451
Re: Bug(?) in Edge Overlay
« Reply #9 on: 24 / March / 2013, 22:32:00 »
Attached is a patch for CHDK trunk. It may not be perfect, tested on one camera so far. The aim is to improve operation on cameras whose live viewports are overwritten during shooting (earlier VxWorks?). It may also work on others (except on DryOS r51+ ATM).

The modification is optional, everything will continue to work as before when the new option is not selected.

I'm assuming that the play mode framebuffer is used to hold the review picture, and that the picture dimensions are correctly returned by the CHDK support functions.

What's changed?

- a new menu item is introduced (together with a new config value), which controls when to take the "screenshot". It's unchecked by default.
- plugin version incremented
- universal support code added to enable sensing the "record review" (recreview) state. It's based on code from the remote capture branch.

When to use?

If edge overlay images are mostly corrupted.

How to use?

- Edge overlay -> Get overlay in review [.]
- enable review in the Canon shooting menu
- use edge overlay as usual

I can provide test builds if needed. I'd be grateful for some feedback or review.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal