Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th June 2018, 07:15   #61  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by StainlessS View Post
What would a scene like above look like to you in real time, just as the untouched original, or do eyes/brain somehow magically correct for low reds.
First, eyes have a wider dynamic range than every non pro camera. There is a very nice short bedsheet example regarding dynamic range: you can cover head or feet, not both. Second, brain knows what color should things appear too and I think it makes some channel mixing and white balance inside.

To tell you an example, there is a very large (more than 100 square meters) sponge in Dahab blue hole that is completely green and you can see with your bare eyes but not with any cam I have seen so far.

I keep on thinking that the simplest yet complex task would be to associate depth to color correction, feeding diving log. This could be the first step.

Today I will have a dive on a wreck and probably I will use natural light outside and artificial light inside. I have exchanged the torchlight head from a narrow beam to a 120° beam and set the cam accordingly to same lens width (it merely use a portion of 4k sensor and gives 1080p output, I think).

I changed the camera too for a 4k, mostly to have much better EIS and better light (sony sensor). It's still on the cheap wagon (Apeman A80) but has a diving mode too. Nothing special: it simply gives an automatic but fixed red filtering. Obviously I will use it outside and disable it when using artificial light. I won't for this dive, to give you an idea of water absorbtion. It will be a moderately deep one (40 meters) but red will be gone to hell already.

I will see if there will be some footage worth of posting. Any preferred file hosting? Perhaps youtube is the best place, despite moderate quality corruption.

Edit: no wreck footage. F***ing camera body collapsed under pressure at a ridicolous 32m over a 40m certified depth. No water leakage but buttons were not operative.
__________________
@turment on Telegram

Last edited by tormento; 11th June 2018 at 10:30. Reason: Utter jinx.
tormento is offline   Reply With Quote
Old 10th June 2018, 08:41   #62  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
Quote:
Originally Posted by tormento View Post
Second, brain knows what color should things appear too and I think it makes some channel mixing and white balance inside.
I'm sure you are right. Now if we could just replicate the neural pathways, we'd have a plugin.

Quote:
Originally Posted by tormento View Post
I keep on thinking that the simplest yet complex task would be to associate depth to color correction, feeding diving log. This could be the first step.
Well I was thinking along those lines by:

Quote:
Originally Posted by WorBry View Post
That's something that could applied in AVISynth (I think) - a Channel Mixer function (with sub-aqua absorption biases in mind) controlled via layer blend opacities.
I suppose, in theory, one could apply shifts based on putative changes in relative distribution of RGB channel luminance (%) with depth, if such data, however generalized, can be derived or obtained, but like I said, there are so many variables involved that you couldn't expect that it would magically 'auto correct' your footage - at best broad shifts in the 'right' direction, maybe.

Quote:
Originally Posted by tormento View Post
I will see if there will be some footage worth of posting. Any preferred file hosting?
Like I said, I was only interested in seeing how these correction methods hold up in varied scenarios. Purely that. I hope it won't be taken that this will lead to something. No preferred file host for me, as long as its safe.
__________________
Nostalgia's not what it used to be
WorBry is offline   Reply With Quote
Old 10th June 2018, 08:45   #63  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Have you try bringing a colorchecker along the way in your dives? It helps give you a good reference of color and white balance without all the guessing.
lansing is offline   Reply With Quote
Old 10th June 2018, 10:01   #64  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Nuther daft question, is there any benefit to taking your own red light source, ie red floodlight [EDIT: with some kind of diffusion to avoid bright spots] to bolster the remaining natural reds (rather than filtering).
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 10th June 2018 at 10:05.
StainlessS is offline   Reply With Quote
Old 10th June 2018, 14:37   #65  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
Quote:
Originally Posted by WorBry View Post
It's been many years since I last went diving (mostly Red Sea and Persian Gulf), but that unprocessed sample with the strong green cast (Test#1) is really how it would have looked to the diver? Maybe I never went deep enough. Is that where the phrase 'looking at the world through rose colored goggles' comes from ?
Maybe I'm a bit oversimplifying. Of course eye has more bits and less noise.
My adventures are mostly freediving madness Not sure my samples qualify as representative.
Often there is "sky" which I currently have no way to protect (tends to become red).
Here are some directly cut from original: https://drive.google.com/open?id=1HB...NKh2YUwwAY86Kn
triggerfish: good colors
GOPR0201.MP4: needs dynamic treatment
turtle: I fail to get any color out of it
__________________
VirtualDub2
shekh is offline   Reply With Quote
Old 10th June 2018, 15:34   #66  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
Quote:
Originally Posted by lansing View Post
Have you try bringing a colorchecker along the way in your dives? It helps give you a good reference of color and white balance without all the guessing.
Finally sense prevails. Resolve has a Color Match function for use with SpyderCheckr and X-Rite color checker boards, btw. Downside of course being that you need to include reference shots with each change in scene. Even a white balance (grey) card frequently in shot would be helpful in establishing neutral balance in post. In that clip Tormento posted I was able to use the white stripes on the fish as reference. In the other samples from that YT GoPro video I had to use what I could- a shell, whitish coral on rocks, a fish that I thought was maybe cool-greyish - and as a last resort, highlights in rising air bubbles from divers regulators, where not totally blown-out.
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 10th June 2018 at 21:28.
WorBry is offline   Reply With Quote
Old 10th June 2018, 15:43   #67  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
Quote:
Originally Posted by shekh View Post
Here are some directly cut from original: https://drive.google.com/open?id=1HB...NKh2YUwwAY86Kn

Thanks Shekh - good test material indeed.

Edit: What turtle species is that btw, just to know what colors I might hope to get from it ?
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 10th June 2018 at 21:17.
WorBry is offline   Reply With Quote
Old 11th June 2018, 10:27   #68  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by StainlessS View Post
Nuther daft question, is there any benefit to taking your own red light source, ie red floodlight [EDIT: with some kind of diffusion to avoid bright spots] to bolster the remaining natural reds (rather than filtering).
Why red light source? A white one is the correct one to bring.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 11th June 2018, 15:51   #69  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Well if its Red that is mostly missing, probably wrong though. (maybe, pinkish then ???, [EDIT: or orangy fleshy])
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 12th June 2018 at 00:56.
StainlessS is offline   Reply With Quote
Old 11th June 2018, 22:23   #70  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
Quote:
Originally Posted by WorBry View Post
Actually I just figured out an easier way to do the channel 'reconstruction' (redistribution) using what Resolve calls a 'Splitter-Combiner' node - basically splits the input into monochrome R,G, B channels with a separate node for each, so you can work on them independently, and combines them again. What I've done is to create blend (composite) overlays (layer nodes) between the monochrome G and R nodes and G and B nodes, with the G feed as the top layer and 'Add' as the blend mode. In that way, the redistribution of G channel luminance can be controlled by balancing the opacities (key gain in Resolve) of the two layer nodes. Fine tuning is then largely a matter of adjusting Color Temperature/Tint. Works very nicely and much easier than nudging individual sub-channel values.

Thinking about what I said earlier....

....That's something that could applied in AVISynth (I think) - a Channel Mixer function (with sub-aqua absorption biases in mind) controlled via layer blend opacities.
On wider testing I'm beginning to see the limitations of this approach. Works well for 'reconstructing' depleted red channel data when there is a dominant green or blue cast, but less useful in reaching a balanced outcome when there is a higher content of concealed ('what should be') red colored subjects to be 'exposed', especially when the dominant cast is not blue or green, but somewhere in between. In such cases the RB and BR sub-channels play a greater role in tuning the mix. I'm not sure if I can assimilate that in the Resolve 'splitter-combiner node' based 'blender' I concocted without it becoming overly convoluted. In which case it's probably easier to adjust the RGB Mixer channels directly. Seemed a good idea anyway.
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 11th June 2018 at 22:28.
WorBry is offline   Reply With Quote
Old 12th June 2018, 02:15   #71  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
Quote:
Originally Posted by WorBry View Post
Thanks Shekh - good test material indeed.

Edit: What turtle species is that btw, just to know what colors I might hope to get from it ?

Is this about right for the color of the turtle ?


Original:






Corrected Resolve:





This was using Channel Mixer and Color Temp/Tint only for color balance. Plus some levels adjustment, contrast, mid-tone detail (local contrast) and a teeny pinch of sharpening to tease out the turtle detail as best. Obviously no denoising.


As you can see there's this red coloration thing going on the left of image - the light bouncing off red coral? I can reduce that with a qualifier but it will also remove some markings on the turtle that have a similar tones and I'm not sure if that is how they are supposed to appear.

If it looks about right I'll try it with VDub2.
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 12th June 2018 at 04:45.
WorBry is offline   Reply With Quote
Old 12th June 2018, 02:23   #72  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Images of turtles, (Amongst them some tortoises and terrapins):- https://www.google.com/search?q=turt...w=1280&bih=874
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 12th June 2018, 10:22   #73  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
Looks like there is still a lot of residual tint, but can it be adjusted further without ruining everything else?
Green sea turtle from red sea.
I added another sample close to surface (2..3m)


Hard to say what forms the red stripes. It definitely belongs to landscape, not a lens flare.
There is same effect on the bottom sand where lighting transitions to shadow. I'm quite sure the sand is uniform. So I think it becomes red because of flaws in out correction method (I get the same with 6-axis color correction).
__________________
VirtualDub2
shekh is offline   Reply With Quote
Old 12th June 2018, 13:28   #74  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
Quote:
Originally Posted by shekh View Post
Looks like there is still a lot of residual tint, but can it be adjusted further without ruining everything else?
Green sea turtle from red sea.
I added another sample close to surface (2..3m)


Hard to say what forms the red stripes. It definitely belongs to landscape, not a lens flare.
There is same effect on the bottom sand where lighting transitions to shadow. I'm quite sure the sand is uniform. So I think it becomes red because of flaws in out correction method (I get the same with 6-axis color correction).

Thanks. I can probably tweak it some more with the Color Wheels to address the residual aquamarine tint, which of course impacts the turtle coloration as well. That's why I was querying the turtle species and expected coloration - although termed 'Green Turtle' the shell coloration is typically more brownish. I could also apply a secondary qualifier to diminish/offset that rust coloration on the rocks and the shadow cast on the sand, but it will be difficult to do so without impacting the warmer colors on the turtle in some way - difficult to isolate the turtle with a shaped mask ('Power Window' in Resolve speak) as it's passing in front of those rocks without tracked rotoscoping. Might have to strike some kind of compromise.


I also got a similar outcome with VDub2, applying the same Channel Mixer biases and adjusting with the '6-axis corrector' but I didn't spend much time on it. If I can get a better result tweaking the balance in Resolve, I'll have another go at it.

Only had time for a brief look at the other clips. A couple are pretty straightforward (the 'Snapper Fish' ones) but the others are definitely challenging - might have to get creative with those strong 'skylights' streaming in.
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 12th June 2018 at 14:28.
WorBry is offline   Reply With Quote
Old 13th June 2018, 11:58   #75  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
I thought some false coloring pops because I'm mixing srgb values.
This is result of correction after applying srgb to linear filter:

Almost grey, but at least no red spots.
__________________
VirtualDub2
shekh is offline   Reply With Quote
Old 13th June 2018, 16:12   #76  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
Interesting.

Quote:
Originally Posted by shekh View Post
This is result of correction after applying srgb to linear filter:
How/where do you do that in VDub2 ?


Meanwhile.....here's the best compromise I could come up with in Resolve.






Any warmer than that and the rust coloration on the rock just bloomed. It proved impossible to a apply a qualifier to diminish/offset that and the shadow cast on the sand. There was just too much overlap in the wide spectrum of hues with those on the turtles shell. To try and do so just wrecked the detail on the turtle that I'd worked hard to bring out. No amount of feathering (smoothing) of the qualifier helped and blurring...well just blurred it. Best I could do was to target a narrower range of 'hot-spot' hues picked off the turtle shell (using the Hue-Saturation Curve) and partially desaturate them, which helped a bit.

Edit: The image as posted definitely shows more residual green tint (notably on the seabed) than the original graded image. Not sure why, but I aint redoing it.


And then another go at it with VDub2 applying similar Channel Mixer biases and just a little tweaking with the 6-axis correction filter. Increasing the pixel radius a tad (1.6) in the Unsharp Mask brought out a bit more detail on the turtle.



Bear in mind that there was no neutral reference to go by in this clip so I had to base it on a best judgement of the coloration of the turtle shell from the image you posted. Too warm maybe? No residual green tint there though.

I guess this a prime example of the question StainlessS posed earlier:

Quote:
Originally Posted by StainlessS View Post
If optimal correction was possible, should it then look as if all water had been sucked out of the scene, with everything bone dry,
or maybe slightly soggy, and with divers hovering around on jet packs, maybe, or something else, eh ?
What's better (for divers primarily)- a 'corrected' outcome like this that looks more like a turtle in a freshwater aquarium or leaving some 'aquamarine' tint in there to signal that this at depth in sea water, maybe even turning that (now) pale, slightly muddy distance into a vibrant blue ?

That (I would suggest) is the reason why underwater photographers/videographers favour using white (daylight balanced, one assumes) light sources for illuminating sea-life at close range:

Quote:
Originally Posted by tormento View Post
Why red light source? A white one is the correct one to bring.
When corrected it brings out the 'truer colors' of the subject whilst leaving the background tinted, lending itself to vivid images like:

https://d1rirzyrd4ly69.cloudfront.ne...5023_62594.jpg

A pink (magenta) tinted light source would (after correction) turn a blue tinted background more green.....I think.

Does the turtle care ?

http://birdsasart.com/248/Pacifc-Gre...-Galapagos.jpg

Evidently not.
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 13th June 2018 at 18:57.
WorBry is offline   Reply With Quote
Old 13th June 2018, 17:41   #77  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
Internal filter "gamma correct" is doing srgb to linear or reverse conversion. It works with rgb64, and 6-axis correction too (but I just discovered there is color error in x64 build, so if you try it make sure to use x86 version).
convert format to 16-bit yuv (needed to avoid some banding)
convert format to rgb64
gamma correct
...
full project (should work if you save it in same folder where mp4 is).
https://gist.github.com/shekh/3b3a97...1170-vdproject
__________________
VirtualDub2
shekh is offline   Reply With Quote
Old 13th June 2018, 20:05   #78  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
OK thanks. So the sRGB to linear gamma thing is effecting a significant shift to blue and you are then using the Red-Green and Yellow-Blue sliders offset to bring back the warmth. Have to experiment with that approach.

I see you set Unsharp Mask to serveas a 'local contrast' enhancer, with the pixel radius up at 25. Thought about that but wasn't keen on the stronger banding that was coming through. Here 0.85 strength:



Also didn't denoise in the above grade and I think this clip would benefit from it; so here pre-denoised:

Code:
SMDegrain(tr=2, thSAD=400, truemotion=false, contrasharp=true)
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 13th June 2018 at 21:38.
WorBry is offline   Reply With Quote
Old 14th June 2018, 17:50   #79  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
Had another go at it with Resolve:



Tried turning the turtle shell colors a bit browner, but then the rust tint starts to come through more in the shadow from the rocks:



So there is a trade-off.

Maybe needs brightening a tad, but in terms of color balance, better results all around. What's more, all done with the Channel Mixer - no secondary tweaking with Color Temp/Tint, the Color Wheels or qualifiers. After tuning the sub-channel biases some more just needed finer balancing of the primary R,G,B channels. Then levels, contrast and mid-tone detail and partial desaturation of the shadows. Also used the denoised (SMDegrain) clip as source here.

With that realization, I'm more confident about achieving a similar result with the Channel Mixer in AVISynth.
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 14th June 2018 at 18:08.
WorBry is offline   Reply With Quote
Old 14th June 2018, 19:32   #80  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
Adjusted for better looking blue, added sharpening and denoising.
I thought the gamma correct approach to defeat mid-shadow colorization is universal "do not mix srgb values linearly" but I cannot confirm this with simple pattern. Don't know why it really works here.



this turtle had enough torture, let it go?
__________________
VirtualDub2
shekh is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 18:04.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.