edge overlay - page 3 - General Discussion and Assistance - CHDK Forum  

edge overlay

  • 41 Replies
  • 19460 Views
Re: edge overlay
« Reply #20 on: 30 / April / 2008, 10:41:15 »
Advertisements
Why do programmers adopt that style ?

Ha Ha.  If I didn't dislike smiley's so much I would put in a few. 

The answer is that the tab behavior of the forum software differs from my editor.  Sometimes I unconsciously use spaces instead of tabs and never notice it in my editor, but it screws things up when displayed on the forum.

If you try the code you will notice that I added a conf.edge_thresh variable to my configuration code.  If this is 0 it turns off the edge overlay, if it is > 0 I multiply it by 10 to get the threshold.  For testing just set this to some number.  3 or 4 works for my camera.

I wish I knew how to determine if alt has been pressed.  If so I would not display the overlay when in that mode.  I also wish I knew how to handle up,down,left,right clicks.  I would put in code to offset the overlay when those are clicked.

And one other thing.  I notice that the overlay color is different when in alt mode.  So obviously I don't understand the overlay colors.  There must be some modifier that changes the colors, perhaps loads a new pallet.
« Last Edit: 30 / April / 2008, 10:55:14 by hiker_jon »

Re: edge overlay
« Reply #21 on: 30 / April / 2008, 11:10:52 »
if it is > 0 I multiply it by 10 to get the threshold. 

I just hard-coded to 30.

This works better, the main problem is that after taking a photo the first time you half-press and release the overlay rectangle is filled with a random pattern.


David

Re: edge overlay
« Reply #22 on: 30 / April / 2008, 11:19:09 »
This works better, the main problem is that after taking a photo the first time you half-press and release the overlay rectangle is filled with a random pattern.

Does this happen when you half-press, pause, then continue to full press.  After that the edge overlay  should appear in a few seconds, no new half press needed.

I  figured out how to detect the gui modes, changed the code:
         if((ymin >= screen_height-MARGIN)&& (gui_get_mode() == GUI_MODE_NONE))

I assume the problem is that when the memcpy occurs during shooting then the data is trashed.  That is why a 2sec delay works.  I hoped to get the memcpy in during half-press before full-press triggers the shooting sequence.  Try holding the half-press for varying amounts of time.

Re: edge overlay
« Reply #23 on: 30 / April / 2008, 11:21:43 »
I wish I knew how to determine if alt has been pressed.


In core\gui.c\gui_kbd_process() ,  add something like this :

  switch (gui_mode)
   {
     case GUI_MODE_ALT:
     conf.edge_thresh = 0;


Of course, you have to 'remember' the current setting of conf.edge_thresh and restore it when leaving ALT mode.

Study rest of gui_kbd_process().

David


Re: edge overlay
« Reply #24 on: 30 / April / 2008, 11:31:19 »
Does this happen when you half-press, pause, then continue to full press. 

Yes, even if I pause for five seconds.

ignore my comments about ALT mode).


David

Re: edge overlay
« Reply #25 on: 30 / April / 2008, 11:42:14 »
Yes, even if I pause for five seconds.

I guess I don't understand what is going on with your camera.  I give up on this for now, but I will get the offsets working if I can figure out the up,down,left,right keys.

Re: edge overlay
« Reply #26 on: 30 / April / 2008, 12:59:54 »
I guess I don't understand what is going on with your camera.  I give up on this for now[/quote]

That is OK because I prefer the version that forces you to use timer mode.
After pressing button for second shot, you have time to carefully align the overlay.


Quote
I will get the offsets working if I can figure out the up,down,left,right keys.

Again, in \core\gui.c you can see this done in ALT mode.

Problem is the AllBest version uses the keys for its own purpose.
I do not have that problem.


You would have to make your own personal version.

If I have an option 'conf.save_overlay' , can I save the overlay in a single operation ?

I guess it will have to be after the image is saved, not sure if it will be junk.

Unless, I can somehow use the taken image to generate a new overlay first and then save it.



David

Re: edge overlay
« Reply #27 on: 30 / April / 2008, 13:24:46 »
I have updated the code with offsets tied to the up,down,left,right keys.  Left and right work on my camera without problems.  Up and down are tied to camera settings.  So I switch to alt mode where those keys are not (at least in my settings) assigned to any function.  Here the keys work well.

The viewport image is saved in memory so if you save that memory plus the offset and threshold values then you can recreate the overlay.


Re: edge overlay
« Reply #28 on: 30 / April / 2008, 13:54:12 »
I have updated the code with offsets tied to the up,down,left,right keys.

I will play with that and also try saving the overlay.

Why do you want to be able to move the overlay ?

For my purposes, I set the threshold high so there are relatively few edges in the overlay.

This makes it easier to align the second image.



David

Re: edge overlay
« Reply #29 on: 30 / April / 2008, 15:49:08 »
Why do you want to be able to move the overlay ?

This is useful for panoramas, similar to Canon's stitch assist.  This is more general in that it can help you to do vertical panoramas as well as horizontal ones.

 

Related Topics