Author Topic: Luminance triggered full-res silent pictures  (Read 34946 times)

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Luminance triggered full-res silent pictures
« Reply #25 on: August 06, 2014, 05:06:11 PM »
Try the full-res silent pictures branch from the main repo, if it doesn't work, then report it here: http://www.magiclantern.fm/forum/index.php?topic=12523.0

If it does work, perhaps I did a merge wrong and can look at it to reconcile any differences.

mk11174

  • Contributor
  • Hero Member
  • *****
  • Posts: 809
Re: Luminance triggered full-res silent pictures
« Reply #26 on: August 06, 2014, 06:13:47 PM »
picture quality is RAW and iso is 100
some time I got "raw error" on the screen but no black screen
Try this one and see if you get the same results. This one also has the tweaked code thats adds the bolt_rec scanline type detection, better for bolts because it doesn't calculate the whole view just a single pixel line that goes from left to right. I only gave it a max of 3 lines cause 3 is plenty, 1 will be in the middle, 2 and 3 will be evenly spread from top to bottom. For now, I only added the visible line for 1 line, but the detection is still there and working for 2 and 3, just can't visibly see the lines.

Also added off, color and grayscale option for preview.

Oh, and one reason another user got black screen was simply because global draw was off, so make sure global draw is on in ML.

https://bitbucket.org/mk11174/magic-lantern-fullres/downloads/magiclantern-Nightly.2014Aug06.5D2212.zip
500D/T1i  550D/T2i  600D/T3i  700D/T5i

maxchen

  • New to the forum
  • *
  • Posts: 16
Re: Luminance triggered full-res silent pictures
« Reply #27 on: August 06, 2014, 07:44:27 PM »
Thank you dmilligan and mk11174
But the full-res silent pictures branch from the main repo and the one mk11174 provide did not work neither.
still got blash screen or "raw error" on lcd, global draw is already on.

maybe I should report to the fullres thread

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Luminance triggered full-res silent pictures
« Reply #28 on: August 06, 2014, 07:52:47 PM »
The zip from mk11174 works fine here.

I get "raw error" and blank screen only if picture quality is not RAW in Canon menu.

mk11174

  • Contributor
  • Hero Member
  • *****
  • Posts: 809
Re: Luminance triggered full-res silent pictures
« Reply #29 on: August 07, 2014, 02:52:45 AM »
By the way, anyone else that has a build compiled from fullres-silent-pics branch you can use this silent.mo https://bitbucket.org/mk11174/magic-lantern-fullres/downloads/silent.mo module with the fullres luminance trigger made from dmilligans build just with the addons of the scanline type detection like in bolt_raw and bolt_rec live view bolt trigger. And I added the visibilty of all scanlines. You can choose to turn on and off the plot, the raw data and the preview as well.

No autoexposure feature like with bolt_raw because fullres works totally differ, but with dmilligans last_measurement idea, you really don't need to worry about keeping your exposure under a trigger line to keep from false detections, you just have to go back to live view when you think you need to tweak your exposure if the sky looks like it gets really lighter or darker.

For day stuff try to use 1 second exposure with ND8 filter of course, you will have more time processing the sky and not the code, if not, dont bother any faster then 1/10 because fullres does not really have any affect any faster.

At evening and night you can use 3 seconds for crawlers, just try to guess count how long a crawler will last and set your exposure for that, it will easily crab those, no reason for longer exposure because this auto saves when one happens.

If you only have cloud to ground, that 1 second is fine but you can easily go longer, just dont go longer than 15 seconds cause fullres wont work longer than that. But since it auto detects theres no reason to  set longer then a single strike.

I use Photo Mode, I set my quality to RAW of course, turn on live view, goto silent pictures module and select Full Res then go into the sub and turn on the Luminance trigger and adjust whatever settings I want, then back to Live view I just press half shutter to turn on the trigger and press again will turn it off.

I do notice 1 bug from the begining of the luminance trigger and any build I messed with myself, if you start and stop the code more then a few times, eventually it will stop running the code until you restart cam and then all works fine again. Thats is the only bug I noticed with this way of doing fullress pictures. Maybe the gui code bugs out eventually going back and forth this way, not sure, but you can run the code on and off a few times before a restart is needed so that is good.
500D/T1i  550D/T2i  600D/T3i  700D/T5i

maxchen

  • New to the forum
  • *
  • Posts: 16
Re: Luminance triggered full-res silent pictures
« Reply #30 on: August 07, 2014, 03:17:01 AM »
The zip from mk11174 works fine here.

I get "raw error" and blank screen only if picture quality is not RAW in Canon menu.

I had double check the picture quality, is RAW.
And some time the ML crash.
Code: [Select]
ASSERT: GetMemoryAddressOfMemoryChunk( GetFirstMemChunk( pMem1AllocateListItem->hMemSuite ) ) == pMessage->pAddress
at SrmActionMemory.c:984, task RscMgr
lv:1 mode:3


Magic Lantern version : Nightly.2014Aug06.5D2212
Mercurial changeset   : 81a2fd653497+ (fullres-silent-pics) tip
Built on 2014-08-06 16:03:21 UTC by mathew@mathewubuntu64.
Free Memory  : 121K + 3936K

mk11174

  • Contributor
  • Hero Member
  • *****
  • Posts: 809
Re: Luminance triggered full-res silent pictures
« Reply #31 on: August 07, 2014, 06:05:30 AM »
Interesting find! When I was using halfshutter press to turn trigger code on and off, to where it goes to preview mode then back to live view then back to preview, etc... at first cam start I only get like 5 times then it stays at live view and wont run code in preview mode again until a restart I once thought.

But for the heck of it, I just hit play instead of restart to see if it would go into review mode and it did, then the trigger code once again worked without a restart and I did it 20 times this time and still no stuck at live view state?

So maybe there is a fix for it so it never gets stuck at live view since loading normal preview once seems to fix it without a restart?????

Update: after doing a search in the forum I see gui_uilock(UILOCK_EVERYTHING); helped, so I moved that and gui_uilock(UILOCK_NONE); around and no issues yet, hopefully that solves that issue.

This luminance trigger is in a different order then the fullres silent code cause of the previewing part, but if I put gui_uilock(UILOCK_EVERYTHING); right after     prop_request_change_wait(PROP_GUI_STATE, &new_gui, 4, 1000); and gui_uilock(UILOCK_EVERYTHING); after call("FA_DeleteTestImage", job); inside the loop, all is fine so far. I guess pretty much just how the regular code is in fullres silent picture. Alex knows his stuff and clearly has reasons these fixes are there.
500D/T1i  550D/T2i  600D/T3i  700D/T5i

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Luminance triggered full-res silent pictures
« Reply #32 on: August 07, 2014, 08:08:51 AM »
@maxchen: can you enable debug info in raw.c? (define RAW_DEBUG there)

This will show exactly why you get "raw error". Remember to turn off the overlays, otherwise you'll get a flood of success messages from there :P

mk11174

  • Contributor
  • Hero Member
  • *****
  • Posts: 809
Re: Luminance triggered full-res silent pictures
« Reply #33 on: August 07, 2014, 02:36:56 PM »
Updated silent.mo for fullres builds with dmilligans Positive, Negative, Both detection idea.
https://bitbucket.org/mk11174/magic-lantern-fullres/downloads/silent.mo
500D/T1i  550D/T2i  600D/T3i  700D/T5i

maxchen

  • New to the forum
  • *
  • Posts: 16
Re: Luminance triggered full-res silent pictures
« Reply #34 on: August 07, 2014, 06:48:33 PM »
@maxchen: can you enable debug info in raw.c? (define RAW_DEBUG there)

This will show exactly why you get "raw error". Remember to turn off the overlays, otherwise you'll get a flood of success messages from there :P

Is this one ? "LV raw disable"
And how to enable it ?

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Luminance triggered full-res silent pictures
« Reply #35 on: August 07, 2014, 06:57:03 PM »
Full-res silent pictures are stopping LiveView, so it shouldn't be that...

Have a video of the issue?

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Luminance triggered full-res silent pictures
« Reply #36 on: August 08, 2014, 02:22:51 AM »
I added the scanline stuff from bolt_rec. Didn't really have time to test it much.


I do notice 1 bug from the begining of the luminance trigger and any build I messed with myself, if you start and stop the code more then a few times, eventually it will stop running the code until you restart cam and then all works fine again. Thats is the only bug I noticed with this way of doing fullress pictures. Maybe the gui code bugs out eventually going back and forth this way, not sure, but you can run the code on and off a few times before a restart is needed so that is good.

For me it happens if you go back into the ML menu after running the luminance trigger. Doesn't work again until you reboot (just get a black screen). I will investigate when I get some more time.

mk11174

  • Contributor
  • Hero Member
  • *****
  • Posts: 809
Re: Luminance triggered full-res silent pictures
« Reply #37 on: August 08, 2014, 03:35:58 AM »
For me it happens if you go back into the ML menu after running the luminance trigger. Doesn't work again until you reboot (just get a black screen). I will investigate when I get some more time.
It will work if you press play to go to canon review then half shutter back and it will work fine, but you have to at least have a cr2 on it to review.

And the bolt_rec code works in it good, I have it in the module I posted. All added to the source you started. Big thanks to you by the way!

I checked your commit, LOL, you code so more PRO then me, nice!!!! the way I added it works fine, but yours obviously looks all pro when looking at the source. Mine is always so basic, but it is doing the job, I will def test yours tonight see how it works too.
500D/T1i  550D/T2i  600D/T3i  700D/T5i

mk11174

  • Contributor
  • Hero Member
  • *****
  • Posts: 809
Re: Luminance triggered full-res silent pictures
« Reply #38 on: August 08, 2014, 10:34:01 AM »
I added the scanline stuff from bolt_rec. Didn't really have time to test it much.
I like the idea of the color preview at capture. All works and all, but for the fullres version the Absolute method is really no good because we can't adjust exposure on the fly like in live view, it will take to many trips back and forth most likely causing raw error. This is why after I added the scanline I added back in your last measured method back in, that is a must for sure it gives you some room for exposure error too.

Next option to do for it is to add the visible lines like how I did if you test my module, you would probably write the code much cleaner then me. It is only needed to be able to move the position of the scanline when using 1 and while you move it from the menu its really important to use transparent menu so you can see where your moving it. As for 2 - 5, those can be more like the preset ones, no need to move them, but seeing where they are is vital just in case you have a hard sky to deal with in luminance range and 1 line falls on a dark base while the other falls on a bright grey sky. This is why I added custom position to it so I can aim the camera how it look best for the view and then moved my scanline to the middle of the sky under the dark base but above houses or trees.

Oh, and I used a double line, offset 1 pixel, a black one and a white one which looks like 1 line, but makes it look like the line changes from what to dark depending on the sky level, very hard to see a white line on a brighter gray sky.
500D/T1i  550D/T2i  600D/T3i  700D/T5i

maxchen

  • New to the forum
  • *
  • Posts: 16
Re: Luminance triggered full-res silent pictures
« Reply #39 on: August 08, 2014, 02:37:36 PM »
I finally make it work by clear all my camera setting.
compile the code from dmilligan's repository, and set scanline to 1 , turn off preview, my 5D2 only took 38-39 ms to process. Great !
Thank you all.

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Luminance triggered full-res silent pictures
« Reply #40 on: August 08, 2014, 02:54:54 PM »
This is why after I added the scanline I added back in your last measured method back in, that is a must for sure it gives you some room for exposure error too.
The scanline stuff I added from bolt_rec actually keeps track of the last measured value for every pixel in the scanline and computes the deltas for each individual pixel. In bolt_rec it was just keeping track of |delta|, but I changed it to keep track of positive or negative, so the positive/negative/both setting also applies here (or at least it should, I haven't tested it).

Next option to do for it is to add the visible lines like how I did if you test my module, you would probably write the code much cleaner then me. It is only needed to be able to move the position of the scanline...
Perhaps we can have it where you can simply move them with the arrow keys while running. Also should be possible to make the trigger threshold adjustable while running (this is all assuming we can detect button presses while running without any issues).

mk11174

  • Contributor
  • Hero Member
  • *****
  • Posts: 809
Re: Luminance triggered full-res silent pictures
« Reply #41 on: August 08, 2014, 04:19:23 PM »
The scanline stuff I added from bolt_rec actually keeps track of the last measured value for every pixel in the scanline and computes the deltas for each individual pixel. In bolt_rec it was just keeping track of |delta|, but I changed it to keep track of positive or negative, so the positive/negative/both setting also applies here (or at least it should, I haven't tested it).
Yes, the delta is working fine for Neg, Pos and Both, but the Absolute option is just like bolt trigger, and just uses a trigger amount. That was the only one I was referring to, the other 3 are fine, they works just as they do when scanlines are at 0 and it uses Histogram method.
Quote
Perhaps we can have it where you can simply move them with the arrow keys while running. Also should be possible to make the trigger threshold adjustable while running (this is all assuming we can detect button presses while running without any issues).
Now that would be really nice to move while using the code. But if you can use button codes, then using the arrows for adjusting the aperture would be most useful so you can adjust the aperture as storm gets brighter and darker without exiting code.

While using bolt_rec, I always found a trigger method of 5500 was perfect for every storm as long as your exposure was normal and not overexposed, so in bolt_raw, I coded it so the aperture would adjust only if raw data got close to the trigger amount to keep it under it which left it perfectly exposed as long as the trigger amount was at 5500. This has to be adjusted only if it goes above the amount for a couple seconds or else a bolt will also cause an aperture change.

But in this full res, since its a preview, I dont expect it will work, but would be a huge advantage not having to stop code to readjust and let the cam do all the work. The clouds change fast in many storms so adjusting the aperture allot was a big issue. This last measure idea you put in helps so you dont have to watch your camera like a hawk to keep it under a trigger line, but the aperture will still need to be adjusted so the bolts are not washed out with the sky or just in case you get a dark sky you can open the aperture to bring out those cool branches.

The scanline really only needs to be changed if you change your view, then you would normally be exiting code anyway. Seeing them while running is good option like I have them in bolt_raw, the custom version I put together of bolt_rec.
500D/T1i  550D/T2i  600D/T3i  700D/T5i

mk11174

  • Contributor
  • Hero Member
  • *****
  • Posts: 809
Re: Luminance triggered full-res silent pictures
« Reply #42 on: August 09, 2014, 05:12:56 AM »
Oh yeah you may want to move     bmp_printf(FONT_MED, 0, 35, "%s    ", image_file_name); so it don't show over the capture/process ms or have to choice to hide debug stuff like the capture ms, I'm sure you might already know that and are focusing on the working parts of it, but just in case, that is one tweak that others may prefer, cause all that data gets in the way. the important one I like are the delta info at top and under it when its done saving and the filename of course.
500D/T1i  550D/T2i  600D/T3i  700D/T5i

mk11174

  • Contributor
  • Hero Member
  • *****
  • Posts: 809
Re: Luminance triggered full-res silent pictures
« Reply #43 on: August 11, 2014, 05:07:50 PM »
Did another update for the luminance trigger in silent.mo module, found a solution for the freeze up that happens going in and out of the trigger, I added code to do the play sequence for you, it reviews and goes right back to code which keeps it running clean. Just make sure you have at least 1 still to review on camera. Fine solution for now, it goes fast enough you don't really notice it much.

Also added raw battery info so when your in the trigger and all your overlays go away, you can still keep track of your battery. For rebel users we only have 3 modes, 100, 30, and 5. 100 would be when the batter icon is white in ML, 30 is when it is yellow and 5 is when it is red. So alls you will see is Batt: 100  or Batt: 30 or Batt: 5  better than nothing cause I know it was bugging me not know while I was running the trigger waiting for lightning.

And added the visibility of all scanlines, not sure if that was in last update.

https://bitbucket.org/mk11174/magic-lantern-fullres/downloads/silent.mo

Thanks again to dmilligan. This code is based off his original with just tweaks I felt were needed while using it in the field for lightning.
500D/T1i  550D/T2i  600D/T3i  700D/T5i

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Luminance triggered full-res silent pictures
« Reply #44 on: August 11, 2014, 05:40:25 PM »
Care to share you source? (the GPL actually obligates you to share it). I can incorporate it into the pull request, do any necessary cleanup.

found a solution for the freeze up that happens going in and out of the trigger
I would call that a workaround, not a solution. We really need to figure out WHY it happens and prevent it in the first place (there could be more serious consequences or errors that we haven't seen yet).

mk11174

  • Contributor
  • Hero Member
  • *****
  • Posts: 809
Re: Luminance triggered full-res silent pictures
« Reply #45 on: August 11, 2014, 06:02:54 PM »
Care to share you source? (the GPL actually obligates you to share it). I can incorporate it into the pull request, do any necessary cleanup.
I would call that a workaround, not a solution. We really need to figure out WHY it happens and prevent it in the first place (there could be more serious consequences or errors that we haven't seen yet).
Yes, you are so right, I meant to say temp solution but forgot to add temp. But yes, def just a workaround for sure, always better to have a perfect fix.

And sure, I just am not great with committing stuff to the online repo yet so I work and share this manual way, LOL!

Here is the source, try not to laugh at my basic coding skills,  :-[

https://bitbucket.org/mk11174/magic-lantern-fullres/downloads/silent.zip
500D/T1i  550D/T2i  600D/T3i  700D/T5i

mk11174

  • Contributor
  • Hero Member
  • *****
  • Posts: 809
Re: Luminance triggered full-res silent pictures
« Reply #46 on: August 14, 2014, 03:09:14 PM »
Trigger working good with the new ResumeLiveView patch and Set button add on!

One other feature might be useful that I added locally was the option to adjust threshold first while not saving to card, good for first time setup for your current view, this way you can get a good idea what you need to set it for before it goes crazy saving to card. For now, I have the option to save to card in the menu, but maybe with button features we can use a button to turn that on or off with a symbol showing its on or font print letting you know its on to save?

Also would be cool to toggle preview on and off, I see INFO can be used, but it only will turn preview on if its off, wont turn back off, it will change the value because if you press SET to leave trigger and come back to it, it will be off again.

I wound up using Q button to turn save on and off and added it to the print at top plus at lower screen Red font saying Recording and Yellow for Stand-By, works good!
500D/T1i  550D/T2i  600D/T3i  700D/T5i

mk11174

  • Contributor
  • Hero Member
  • *****
  • Posts: 809
Re: Luminance triggered full-res silent pictures
« Reply #47 on: August 14, 2014, 11:00:49 PM »
Updated the silent.mo with dmilligans nice fix to the gui freeze up so we don't have to enter play mode and then come out of it. Also updated the plot revamped by him as well. And now you use the SET button to come out of the Luminance trigger, and to start it you still use the HALFSHUTTER_PRESS.

It is working great now!

I added the feature to press Q to toggle save to card, this way it will say Stand-By at first so you can set your threshold up before it starts saving, once your all setup, just press Q and it will save to card on detection.

To turn on plot, go into the trigger menu to toggle it on or off by choice, also the raw data can be toggled as well.

https://bitbucket.org/mk11174/magic-lantern-fullres/downloads/silent.mo
500D/T1i  550D/T2i  600D/T3i  700D/T5i

milank

  • New to the forum
  • *
  • Posts: 34
  • 5D3, 700D
Re: Luminance triggered full-res silent pictures
« Reply #48 on: August 15, 2014, 08:46:37 AM »
@mk11174: looks great! I however noticed strange behaviour like working arrow buttons outside trigger code until restart. Also I am still missing how to run sticky HS along with full-res trigger code, would you mind sharing the code as suggested? Udating your repo would be fine.

mk11174

  • Contributor
  • Hero Member
  • *****
  • Posts: 809
Re: Luminance triggered full-res silent pictures
« Reply #49 on: August 15, 2014, 10:23:58 AM »
@mk11174: looks great! I however noticed strange behaviour like working arrow buttons outside trigger code until restart. Also I am still missing how to run sticky HS along with full-res trigger code, would you mind sharing the code as suggested? Udating your repo would be fine.
Can you explain more about the working arrow buttons outside the code? Up and Down Buttons should only control the scalines position while code is running and color or grayscale preview is on and Left and Right will control your threshold in all 3 preview modes. Are you saying the arrow buttons operate something else when you exit Full Res trigger, if so, explain so I can try to reproduce it.

There is no code for sticky HS with fullres trigger code, what are your uses for stick half shutter and the trigger, the full res trigger works all by itself?
 
500D/T1i  550D/T2i  600D/T3i  700D/T5i