View Full Version : Diving video


tormento
28th May 2018, 13:07
Back from my diving travel, I have a bunch of video, shooted with a cheap underwater camera.

Some are nicely balanced, others, like this (https://www32.zippyshare.com/v/jH8EEiBS/file.html), have dead red channel and a very dominant blue.

I am asking your help, to get a functional script to give back some realistic colors. I saw many video tutorials, that apply to professional (and costly) software.

I know the physic behind water color absorption depth but I have no idea about how to automatically reverse the process.

Tried with GamMaC but I get horrible results.

Thanks.

lansing
28th May 2018, 14:33
The video link is broken

StainlessS
28th May 2018, 15:56
Yep, file dont seem to be on server.

I've just fixed an Image link in RgbAdapt thread, PostImage changed link names from PostImage.org to PostImage.cc some months ago, so some of them
(but not all) have gotten broken over time since then.

https://forum.doom9.org/showthread.php?t=170642
here same link to RgbAdapt Graffer
https://s20.postimg.cc/wxyq8spkt/Fishv3_zpsfjmoyerr.jpg (https://postimg.cc/image/yd0axiqnt/)

EDIT: No idea how to adjust automatically, maybe get rough settings using grapher, and vary SPow (on each channel identically),
via some Blue:Red ratio, or something like that (no idea really). [EDIT: Vary args In ScriptClip]

EDIT: Maybe try Martin53(AWB) or Bernardt white Balance funcs.

EDIT: Or maybe keep all three channel Spow static, vary Red and Blue RPow as average green channel varies up and down, still no idea. :)

poisondeathray
28th May 2018, 15:59
@ lansing - you can download with a download manager like jdownloader2 (useful but very bloated software, make sure you get the ad free version)



The red channel is almost non-existent. (e.g. convert to RGB and use showred) . Difficult to make it look realistic

You can try some weighted average of G,B +/- manipulations to reconstruct the R , but it won't look "real". It will look off

preview of R,G,B
https://s33.postimg.cc/gra37911b/r_g_b.jpg (https://postimg.cc/image/8yjff9v23/)

tormento
28th May 2018, 16:51
Sorry for the problematic link. Fixed.

What I do with images is use green channel to recreate red, while reducing blue component at the same time. Then I correct other aspects of image.

It's so strange there is no script yet to correct such a common thing as diving videos. We have almost anything here but that ;)

I know it will be a trial and error process, such what happens to recolor bw, but let us try.

Two video tutorial you can take as a reference are this (https://www.youtube.com/watch?v=iBUwPwtwBMc) and this (https://www.youtube.com/watch?v=wW47z-Vs91E).

tormento
28th May 2018, 16:56
The red channel is almost non-existent. (e.g. convert to RGB and use showred) . Difficult to make it look realistic
It's possible and I do it by hand with photoshop (yes, photoshop).

This (https://www57.zippyshare.com/v/jlkGkGCN/file.html)is the possible result but it's way too limited to rendering to make it an acceptable solution.

lansing
28th May 2018, 17:05
Are you sure that the fish is red? It looks yellow to me in the original.

poisondeathray
28th May 2018, 17:13
It's possible and I do it by hand with photoshop (yes, photoshop).

This (https://www57.zippyshare.com/v/jlkGkGCN/file.html)is the possible result but it's way too limited to rendering to make it an acceptable solution.

That's what I said above - you can try to reconstruct the red channel - but it doesn't look "real" or that great. It will look "off"

tormento
28th May 2018, 18:48
Are you sure that the fish is red? It looks yellow to me in the original.
It was a fast solution to give you a idea.

Anyway, the two band variant is orange.

poisondeathray
28th May 2018, 19:23
If you're happy with photoshop, it can process video too

But I wouldn't crush so much detail in the corals, shadows . (e.g. you could convert to RGB with full range matrix before photoshop or using RGB filters)

tormento
28th May 2018, 19:49
I think a paralenz cam will be the most practical (and expensive) solution.

poisondeathray
28th May 2018, 19:56
I think a paralenz cam will be the most practical (and expensive) solution.
Maybe next trip, otherwise you would need a time machine :D

But how about rentals ? If you're not doing this frequently , maybe it makes more sense

lansing
28th May 2018, 20:47
Your best choice is probably to get 3dlut creator for this:

https://www.youtube.com/watch?v=gHx0a4TKQbo

poisondeathray
28th May 2018, 21:31
Your best choice is probably to get 3dlut creator for this:

https://www.youtube.com/watch?v=gHx0a4TKQbo

Not necessarily; there is nothing you can't do with other programs like photoshop or AE or resolve . (I know this because I have used 3dlutcreator for years, since beta testing stage) . In fact, some operations can actually be "better" in other programs because you can use a wider gamut space

You're just mixing channels that demo, and you will have the same problems . What's not shown in that underwater demo is a "red" reference object, just as "red" coral, "red" fish, skin tones etc... It might look ok for some shots, but overall it will still be "off". The main problem is missing real red channel information, and a lot of it. There is only so much you can do , by mixing G/B and doing various manipulations

lansing
28th May 2018, 23:29
Not necessarily; there is nothing you can't do with other programs like photoshop or AE or resolve . (I know this because I have used 3dlutcreator for years, since beta testing stage) . In fact, some operations can actually be "better" in other programs because you can use a wider gamut space

You're just mixing channels that demo, and you will have the same problems . What's not shown in that underwater demo is a "red" reference object, just as "red" coral, "red" fish, skin tones etc... It might look ok for some shots, but overall it will still be "off". The main problem is missing real red channel information, and a lot of it. There is only so much you can do , by mixing G/B and doing various manipulations

Definitely not avisynth. It would be a nightmare trying to do it without a gui. And using a lut is definitely better than trying to reproduce every step you did in photoshop with avisynth.

shekh
28th May 2018, 23:58
I process UW shots sometimes, I made VD plugin for it (not much different from some yuv adjust variation).
What I do is roughly these steps (in this order):
1. white balance - focused on some white/gray objects at pleasing distance
2. luma contrast (levels)
3. overall saturation boost
4. try to saturate/desaturate specific colors. Often the colors end up so much quantized it is just better to get rid of them completely.
Not science, I just get something that I like to look at.

poisondeathray
29th May 2018, 01:22
Definitely not avisynth. It would be a nightmare trying to do it without a gui. And using a lut is definitely better than trying to reproduce every step you did in photoshop with avisynth.

yes, yes, and yes

But I question the usefulness of a lut . If you're doing this in whatever GUI program, then why not just do it in there? If you use one that can keyframe, you can even adjust for exposure changes (eg. different depths), lighting condition changes etc...At least you can have consistent color, consistency color timing.

tormento
29th May 2018, 07:58
But I question the usefulness of a lut . If you're doing this in whatever GUI program, then why not just do it in there?
To quote Photoshop as an example, it has his own video rendering and codecs. I prefer to feed the output to x264.

To quote other programs, please suggest me something free or cheap with a good interface and output control. Premiere is not cheap :)

tormento
29th May 2018, 07:58
I process UW shots sometimes, I made VD plugin for it (not much different from some yuv adjust variation).
Can you attach here a x64 version to try? :)

tormento
29th May 2018, 08:01
But how about rentals ? If you're not doing this frequently , maybe it makes more sense
At least here in Italy, I don't think there is a rental of that device available.

shekh
29th May 2018, 09:02
Can you attach here a x64 version to try? :)

It is part of vd2 package, here is sample I already inserted once in gammac thread :) http://virtualdub2.com/data/fish_balance6.webm
The filter name is "6-axis color correction" but I use it from "Master blend" filter to have interactive histograms at the same time.

Btw your photoshop result looks good to me, I don't think I could do any better. But I can't download your video, just get tons of ads.

tormento
29th May 2018, 14:40
Btw your photoshop result looks good to me, I don't think I could do any better. But I can't download your video, just get tons of ads.
Tells me where to put it and I will.

WorBry
29th May 2018, 16:48
To quote other programs, please suggest me something free or cheap with a good interface and output control. Premiere is not cheap :)

DaVinci Resolve (free version):

https://www.blackmagicdesign.com/ca/products/davinciresolve/

Download links at bottom of that webpage. That's for the most recent beta (4) release of DR 15. I'd go with the last official (stable) release of DR 14.3 which can be downloaded from the BMD Support page - scroll down 'Latest Downloads' on the left:

https://www.blackmagicdesign.com/ca/support/family/davinci-resolve-and-fusion

More than adequate pro-level color toolset for the job...well, the 'best outcome' in this case anyway.

I don't have personal experience color correcting/grading underwater video, but my two cents on this:

1. +1 on everything Poisondeathray said above.

2. Naturally, the primary 'focus of attention' is the 'anemone fish' (? Clown Fish), and to a lesser degree the foreground anemone bed it's frolicking in. So that should be the focus of color correction.

Not at my editing/grading PC just now but If I were to go at it with Resolve, I'd likely look at applying a series of HSL Qualifiers (color key/mask).

* First zoom in and pull a qualifier (as best) on the colored fins of the fish (taking multiple samples from different frames) and use the Color Wheels (master Offset primarily) to get as close as possible to the expected tint of orange.

* Create an 'Outside Node' from that (i.e. 'inverse mask' of the fish fins = everything else) and do the same again on the anemone (?) tentacles...likely more tricky to change that 'aquamarine' tint to a warmer palish pastel. Then either turn off the key on the anemone and live with whatever color change that manipulation has had on the background, or else create another Outside Node from that and work on the 'background' separately i.e. all but the fish fins and anemone tentacles. Depends on how well the tentacles can be isolated.

* Could also try tinting with a solid warm color (Layer Mode with Composite Blend set for 'Color') or as an External Matte, but I'm not optimistic it would achieve much other than 'muddying the waters'. Total color replacement would be very difficult to pull off.

I doubt very much that you'd be able to set a white balance sampling off the (assumed) white stripes on the fish. Of course you'd also need to play around with 'exposure' levels, contrast and saturation, globally and/or on the qualifiers, maybe adding at little 'mid-tone detail' (local contrast) on the fish/anemone or sharpening to taste (denoising only available in the paid Studio version). But that's the basic strategy I think I would try. If it achieves something close to acceptable, you could then think about more refined techniques - tracking the fish (or whatever) with qualified 'power windows' and applying subtle color changes with soft key points, but it hardly seems worth it in this case.


Btw your photoshop result looks good to me, I don't think I could do any better.

I'd tend to agree with Poisondeathray. OK, it achieves better rendition of the fish coloring (as assumed) and takes that aquamarine tint off the foreground anenome clump, but the effect it has on the background - that washed out pinkish tone on sea bed especially - looks unnatural and is distracting.

WorBry
30th May 2018, 02:07
Quick stab at it with Resolve using the above strategy. Not sure what color the anemone in the foreground is supposed to be; as predicted, it proved difficult to swing it away from that aquamarine tinge completely.

http://i.imgur.com/P0rMCcJm.png (https://imgur.com/P0rMCcJ)

Same again with a final light 'warm wash':

http://i.imgur.com/f5JEUvbm.png (https://imgur.com/f5JEUvb)

Maybe not accurate, but adds a bit more color contrast.

And just for kicks, with a little 'pseudo HDR' enhancement:

http://i.imgur.com/geNqOdsm.png (https://imgur.com/geNqOds)

Well, maybe not.

shekh
30th May 2018, 09:07
Turns out after 5 garbage links it allowed to download.

This is how I like it:

https://s33.postimg.cc/4z6n9hvxn/375.png (https://postimg.cc/image/4z6n9hvxn/)

WorBry
30th May 2018, 13:54
I'm thinking that's one of my images with some further levels/color adjustment, right ? Or was it using another method?

If mine, yes, I'd agree they are a tad on the dark side. Referencing the Histograms when I was doing it last night I was tempted to up the Gain, but they seemed OK to the eye. This morning, under natural lighting, they definitely look too murky. Such is the nature of color grading.

shekh
30th May 2018, 14:06
No, I took similar frame from original video and adjusted in vd. Brightness maybe, but also mine is closer to gray. I don't like dominant greenish tint :)

StainlessS
30th May 2018, 14:19
Q), what depth was the clip taken at ?

WorBry
30th May 2018, 14:45
I don't like dominant greenish tint :)

I agree. Makes it a bit too mirky. I'll maybe have another go at it when I have some time.

As Stainless intimates though, depends somewhat on the depth.....not that I'm in any way an expert on sub-aqua color temperatures ;) Used to dive a fair bit in my formative (single) years, but had no interest in videography/photography at that time.

shekh
30th May 2018, 15:06
Now if someone can enhance it, we have diving computer in this shot :)
IMO around 15..20m

tormento
30th May 2018, 19:23
Q), what depth was the clip taken at ?
Don't tickle my crazy mind. I was about thinking to request a plugin that takes csv as input (time-depth) and invert curve of water color absorption based on depth. Such as Paralenz does indeed.

It would have a GREAT impact on all the diving cam users.

Anyway, if I recall correctly, it was at 15-20 meters. If you want precise value, I can get from diving computer.

WorBry
3rd June 2018, 04:48
... I don't like dominant greenish tint :)

I agree. Makes it a bit too mirky. I'll maybe have another go at it when I have some time.

Another crack at it:

http://i.imgur.com/XVmJ8Gcm.png (https://imgur.com/XVmJ8Gc)

Edit: Noticed feint magenta tinge to the blues after posting. This one, a bit less:

http://i.imgur.com/V7FSZ1cm.png (https://imgur.com/V7FSZ1c)

Couldn't get a decent result using the previous 'sequential qualifier' strategy in Resolve. So opted for reconstructing the red channel (as best) with the RGB Channel mixer. Then just one qualifier to deal with some vibrant magenta coloration on the tips/edges of the anemone tentacles that stood out, followed by fine tweaking and levels/contrast adjustment with the primary color wheels, and a pinch of local contrast ('mid-tone detail'). Didn't mess with global Saturation too much as it only brought back the blue cast.

Better, surely....maybe, bearing in mind that I don't know what color the anemone is supposed to be ? Tormento did mention though that the fish is orange (the fins):


...the two band variant is orange.

I guess that would make it the fabled 'Orange-Fin Anenome Fish' :cool:

Anyway, best I could come up with. Interesting exercise though.

Did you arrive at a workable solution Tormento ?

tormento
3rd June 2018, 09:02
Did you arrive at a workable solution Tormento ?
Not an automatic or simply standardized one. Every video has its own color lack problems. Paralenz algorithm is cunny indeed. It could be nice to have that reverse water color absorption formula and use diving computer log to apply it.

lansing
3rd June 2018, 14:04
A google search shows that the fish should be yellow, not orange

StainlessS
3rd June 2018, 14:13
A google search shows that the fish should be yellow, not orange

Some Orange ones here (as well as Yellow):- https://www.google.co.uk/search?q=Orange-Fin+Anemonefish&tbm=isch&tbo=u&source=univ&sa=X&ved=0ahUKEwj4_6LzyLfbAhWGNcAKHcb-AoQQ7AkISQ&biw=1280&bih=874

(Of course we dont know what was done to those images, but given the name [Orange-Fin Anenome Fish], they might well be often Orange)

WorBry
3rd June 2018, 17:05
Some Orange ones here (as well as Yellow):- https://www.google.co.uk/search?q=Orange-Fin+Anemonefish&tbm=isch&tbo=u&source=univ&sa=X&ved=0ahUKEwj4_6LzyLfbAhWGNcAKHcb-AoQQ7AkISQ&biw=1280&bih=874

(Of course we dont know what was done to those images, but given the name [Orange-Fin Anenome Fish], they might well be often Orange)

I really don't know guy's - I only surmised that it must an 'Orange-Fin Anenome Fish' after a web search for anenome fish with two stripes and orange fin coloration, and it appeared to fit the bill.

In my previous attempt at correcting it with Resolve, I put a qualifier key on the fish fins, deliberately pushed the color to orange and preserved it. In this last effort that was just the way the fin color turned out after all the channel mixing and secondary manipulation to achieve best possible overall balance and taking the white stripes on the fish as reference - which was about all there was to go on.

Whether the resulting orange tone is close to 'actual' or not, I guess only Tormento is in a position to judge in this case. Obviously if 'too orange' it's just a matter of qualifying the orange fins and moving to a more yellowish tint.

StainlessS
3rd June 2018, 17:07
It could be nice to have that reverse water color absorption formula and use diving computer log to apply it.

Presumably absorption would be based on depth of viewed object, and distance to camera from it (something like depth*depM+dist*distM).

Perhaps some large white object fixed at some depth eg 10m, and something tracking distance from the object up to say 100 m.
Repeat every 10m depth (up to 10,994 meters, the Mariana Trench would do nicely).

EDIT:
I only surmised
Arh, so its not called the Orange-fin thingy.

EDIT:
Noticed feint magenta tinge to the blues after posting. This one, a bit less:
I rather liked that one, nice.

EDIT: This gets some hits: "red spectrum absorption of sea water":- https://www.google.com/search?q=red+spectrum+absorption+of+sea+water&ie=utf-8&oe=utf-8&client=firefox-b

EDIT:
http://www.waterencyclopedia.com/La-Mi/Light-Transmission-in-the-Ocean.html

Light Penetration.

A certain amount of incoming light is reflected away when it reaches the ocean surface, depending upon the state of the water itself. If it is calm and smooth, less light will be reflected.

If it is turbulent, with many waves, more light will be reflected. The light that penetrates the surface is refracted due to the fact that light travels faster in air than in water. Once it is within the water, light may be scattered or absorbed by solid particles. Most of the visible light spectrum is absorbed within 10 meters (33 feet) of the water's surface, and almost none penetrates below 150 meters (490 feet) of water depth, even when the water is very clear.



Light Spectrum.

Water selectively scatters and absorbs certain wavelengths of visible light. The long wavelengths of the light spectrum—red, yellow, and orange—can penetrate to approximately 15, 30, and 50 meters (49, 98, and 164 feet), respectively, while the short wavelengths of the light spectrum—violet, blue and green—can penetrate further, to the lower limits of the euphotic zone. Blue penetrates the deepest, which is why deep, clear ocean water and some tropical water appear to be blue most of the time. Moreover, clearer waters have fewer particles to affect the transmission of light, and scattering by the water itself controls color. Water in shallow coastal areas tends to contain a greater amount of particles that scatter or absorb light wavelengths differently, which is why sea water close to shore may appear more green or brown in color.


MEASURING LIGHT TRANSMISSION

Scientists have developed several different methods and instruments to measure light transmission in water. The simplest measurement method involves the use of the Secchi disk, a white plate about 30 centimeters (12 inches) in diameter. It is fastened horizontally to a rope marked in meters. The disk is then lowered into the sea, lake, or other waterbody. The depth at which the disk is lost to sight is noted using the rope markings. This provides a rough estimate of the depth of light penetration.

A more sophisticated device for measuring light transmission is the nephelometer, which measures the scattering of incident (incoming) light by particles in the water. The optical backscatter meter and light scattering meter work in a similar fashion by projecting a light beam into the water. A detector on the instrument measures the amount of light that is scattered back into it.

The transmissometer measures light attenuation, or the sum of scattering and absorption of light in sea water. It projects a beam of light of a known wavelength over a known distance, and the data may be used to calculate the percentage of light that is transmitted at a certain depth.

The a-c meter has separate sensors to detect absorption of light by particles and total light attenuation. It functions in a manner like that of a transmissometer.

WorBry
3rd June 2018, 18:04
Arh, so its not called the Orange-fin thingy.

Dunno, it might be that one. There again, I'm not a marine ichthyology taxonomist (I had to look that one up ;) )


Edit: Noticed feint magenta tinge to the blues after posting. This one, a bit less:



I rather liked that one, nice.

It was actually closer to neutral WB taking the white fish stripes as reference. That said a lot depends on the initial channel mixing and how close to neutral can be achieved with that in the first instance. Very twitchy fine tuning - slightest nudge to the channel values and it's of whack.

Incidentally, I created a 3D Cube LUT from the graded clip using Resolve's internal LUT creator. Reapplying it to the original clip though, the grade did not hold true.

lansing
3rd June 2018, 18:17
Some Orange ones here (as well as Yellow):- https://www.google.co.uk/search?q=Orange-Fin+Anemonefish&tbm=isch&tbo=u&source=univ&sa=X&ved=0ahUKEwj4_6LzyLfbAhWGNcAKHcb-AoQQ7AkISQ&biw=1280&bih=874

(Of course we dont know what was done to those images, but given the name [Orange-Fin Anenome Fish], they might well be often Orange)

Most if not all of them looks yellow to me. And wiki (https://en.wikipedia.org/wiki/Orange-fin_anemonefish) said it is yellow as well.

WorBry
3rd June 2018, 19:46
Better compromise ?

http://i.imgur.com/HJncHVYm.png (https://imgur.com/HJncHVY)


That was using a qualifier key on the orange fins. Actually it proved impossible to get uniform isolation that worked throughout the clip - it would definitely require tracking the fish with a rotoscoped power window and modifying the qualifier at (many) soft key points. A lot of work.

Don't want to back at it, but I don't think I would have been able to turn the fins more yellow using just the channel mixer and primary wheels without fighting a green bias over the rest of the image, which is what I was laboring to avoid.

Shekh seemed to get there though.

tormento
3rd June 2018, 20:00
https://i.lensdump.com/i/8LZTpK.md.jpg (https://lensdump.com/i/8LZTpK)

Untouched photo with better light from surface. Look "real" colors of fish as comparison.

WorBry
3rd June 2018, 20:21
Untouched photo with better light from surface. Look "real" colors of fish as comparison.

Oh boy, so the body of the fish is also shades of orange ? The one in the clip looks to have much darker (close to black) coloration between the white stripes. And like I said, that's how the colors came out - I didn't put any qualifier on the fish in that grade using the channel mixer. Is there maybe variability in the pattern/density of orange coloration within the same local population and/or between males vs females, adults vs juveniles ?

tormento
3rd June 2018, 20:28
Oh boy, so the body of the fish is also shades of orange ? The one in the clip looks to have much darker (close to black) coloration between the white stripes. And like I said, that's how the colors came out - I didn't put any qualifier on the fish in that grade using the channel mixer.

Every fish is, of course, different. Anyway it’s definitely not yellow. My eyes, in Egypt, saw shades from pale orange to really dark one only. Forget Pixar Nemo...

https://i.lensdump.com/i/8LZFyH.th.jpg (https://lensdump.com/i/8LZFyH) https://i.lensdump.com/i/8LZfex.th.jpg (https://lensdump.com/i/8LZfex) https://i.lensdump.com/i/8LZcT1.th.jpg (https://lensdump.com/i/8LZcT1) https://i.lensdump.com/i/8LZX7c.th.jpg (https://lensdump.com/i/8LZX7c) https://i.lensdump.com/i/8LZbUK.th.jpg (https://lensdump.com/i/8LZbUK)

lansing
3rd June 2018, 20:40
Oh boy, so the body of the fish is also shades of orange ? The one in the clip looks to have much darker (close to black) coloration between the white stripes. And like I said, that's how the colors came out - I didn't put any qualifier on the fish in that grade using the channel mixer.

They're obviously two different type, and the one we're all talking about is definitely yellow, as supported by the google images and wiki.

WorBry
3rd June 2018, 20:49
. Forget Pixar Nemo...


Who ??

shekh
3rd June 2018, 21:35
Another crack at it:

http://i.imgur.com/XVmJ8Gcm.png (https://imgur.com/XVmJ8Gc)


This is more balanced. Made me think I'm missing the point or don't try hard enough :)

Some of the equipment behind should be pure yellow, at least the pipe

https://s33.postimg.cc/jbk21e923/yellow.png (https://postimg.cc/image/jbk21e923/)

WorBry
3rd June 2018, 21:59
Some of the equipment behind should be pure yellow, at least the pipe


Likely so, as came through in my first 'green-and-mirky' efforts:

Quick stab at it with Resolve using the above strategy. Not sure what color the anemone in the foreground is supposed to be; as predicted, it proved difficult to swing it away from that aquamarine tinge completely.

http://i.imgur.com/P0rMCcJm.png (https://imgur.com/P0rMCcJ)

Same again with a final light 'warm wash':

http://i.imgur.com/f5JEUvbm.png (https://imgur.com/f5JEUvb)

Maybe not accurate, but adds a bit more color contrast.



Maybe picked up with the qualifier on the anenome ; I'd have to check - not sure I saved the node workflow ('Power Grade') for that particular grade.

Best I can do anyway, and I get the impression that Tormento is not that interested pursuing what is a fairly involved/tailored grade workflow with unfamiliar software, and is hoping for a simpler/automated solution (by way of a plugin) that can be applied more generally in situations like this - so it's somewhat academic in this context. I just found it an interesting grading exercise. Cheers.

tormento
4th June 2018, 08:20
Best I can do anyway, and I get the impression that Tormento is not that interested pursuing what is a fairly involved/tailored grade workflow with unfamiliar software, and is hoping for a simpler/automated solution (by way of a plugin) that can be applied more generally in situations like this - so it's somewhat academic in this context. I just found it an interesting grading exercise. Cheers.
Yes, that's what I was looking for. The easiest and the most complex task would be apply diving depth log to a video and, given depth, recreate color curves.

Edit: to give you a nice example of what I mean with "automatic", get Dive+ on AppStore and feed it with its own samples or your images. I dunno if it's black magic or what but it works damn well.

WorBry
4th June 2018, 19:07
....to give you a nice example of what I mean with "automatic", get Dive+ on AppStore and feed it with its own samples or your images. I dunno if it's black magic or what but it works damn well.

Checked out Dive+ on my iPhone 6. The 'Underwater Video Color Correction' component is in beta testing and requires signing up to participate, which I'm not inclined to do. Tested the automatic (one-click) 'Underwater Photo Color Correction' function though with a frame from your sample video. I wouldn't say 'magical' but it does a fairly decent job in that example. Better than my first 'mirky-green' effort in Resolve anyway.

Original Frame:

http://i.imgur.com/70gp6Zzm.png (https://imgur.com/70gp6Zz)

Corrected Frame:

http://i.imgur.com/JlPmsjPm.jpg (https://imgur.com/JlPmsjP)

Shame there's no option to tweak the colors further. Not being a diver I don't have other native images to test.

Have you tested the 'video color correction' component yourself ? If so, and you are happy with the results, why not use that ?

WorBry
5th June 2018, 10:00
Shame there's no option to tweak the colors further.

Examining the histogram, there's clearly been some reconstruction of the red channel, but there's scope there to push the balance a bit warmer - here doing so using just the 'Color Temperature/Tint' controls in Resolve, and a tad reduced saturation:

http://i.imgur.com/TVaLl6um.png (https://imgur.com/TVaLl6u)

I'm still not sure what color the anemone is supposed to be.

Note also that a Dive+ logo gets put on the image. Still it's not bad for a freebie......assuming the 'video color correction' component produces comparable results.

Whether something similar could be implemented in AVISynth (by way of a scripted function/plugin) is beyond me. From what I've learned through this exercise, I have a sense that would require two parts - one (at it's core) a channel mixer (whether automated or not) to reconstruct the red channel as best (maybe guided by water depth absorption bias data) and then provision to adjust the color temperature. Feasible ? Only the AVISynth wizards here could say.

tormento
5th June 2018, 11:30
Checked out Dive+ on my iPhone 6. The 'Underwater Video Color Correction' component is in beta testing and requires signing up to participate, which I'm not inclined to do.
Invitation code is DIVING PASSPORT

WorBry
5th June 2018, 13:18
As far as I can tell, still requires registration - no option I can see to just plug-in this 'Invitation Code'. Unless of course you want to give me your sign-in details ;). Or maybe test that sample clip yourself and post the results.

Thinking about:

Shame there's no option to tweak the colors further.

If you find that Dive+ does produce the kind of results you are hoping for, there are other video color correction apps that could prove useful for supplemental 'tweaking' - 'a total mobile iOS solution', so to speak.

VideoGrade is one that gets good reviews:

https://itunes.apple.com/us/app/videograde/id492488712?mt=8

INCLUDED FILTERS

Exposure, Contrast, Vibrance, Temperature, Vignette, Recovery, Sharpness, Monochrome, Brightness, Saturation, Effects, Channel mixer, Tint, Hue, Levels, Bloom, Posterize, Rotation.

Plus....Real-time previews, color histograms, clipping previews and split modes for comparison

If all that's needed to tweak your Dive+ salvaged videos is some further color temperature adjustment, might be just the ticket. Nearly tried it myself but I couldn't bear the thought of parting with $CAN 10 for yet another app that I'll seldom if ever use.

Seems a better solution than hoping that someone will come up with an AVISynth function/plugin that does what you are looking for.......but you never know.

tormento
6th June 2018, 09:12
If you find that Dive+ does produce the kind of results you are hoping for, there are other video color correction apps that could prove useful for supplemental 'tweaking' - 'a total mobile iOS solution', so to speak.
The fact is I will never use an app to correct video. There are too many factors, not least encoding, where you have no control over quality and I think is really far from x264.

StainlessS
6th June 2018, 13:17
The top right triangle divided by the diagonal [containing the diver], would of course be skewing any histogram, color changes also based on distance from camera, not just the depth, so the view into the gloom will totally screw up any histogram.

WorBry
6th June 2018, 20:42
The fact is I will never use an app to correct video. There are too many factors, not least encoding, where you have no control over quality and I think is really far from x264.

Given the enthusiasm expressed for the Dive+ app and indication that you are signed-up for participation in the 'Underwater Video Color Correction' beta testing, it was reasonable to assume that you do use it. You stressed also that you are interested in an 'automated' solution, which this is. Not having tested the 'video' feature myself, I see then that, like the 'photo' component, there is no option to set the 'quality' of the encoded output, which I agree is disconcerting.

Still as a 'one-click' solution it would be interesting to see how well it performs under a range of underwater conditions/scenarios ('tropical' vs 'green' water, depth, visibility, intrinsic colorfulness of content/subject matter etc). If it does it indeed produce 'magical' results in cases more extreme than your sample, and without the aid of additional input parameters, one might speculate what algorithms it employs to achieve those outcomes and maybe try and replicate them.

Clearly in that one frame from your clip I tested it was doing more than just shifting the color temperature/tint, which is how most programs with 'Auto White Balance' features would treat it and likely fail. I had no success at all attempting to correct it with just the Color Temp/Tint controls in Resolve. It needed reconstruction of the red channel (in that particular case) and Dive+ achieved that to some degree - in my last attempt with Resolve, probably more. Applying the Channel Mixer to that end, I took the white strips on the fish as the (only) identifiable neutral reference. Fortunately that was in the foreground. Had the only reference been some fuzzy subject in the mid/far distance that was known to be white/grey I would have had more difficulty. As StainlessS pointed out:

color changes also based on distance from camera, not just the depth, so the view into the gloom will totally screw up any histogram.
...and likewise RGB "picker" values, which I was going by to a large degree. So if Dive+ does indeed demonstrate magical results (and not just by luck in this case) on wider testing, how is it establishing neutral balance ? And is there similar 'diver-oriented' color correction software out there (with a higher level of control) or do most people use what tools are available in their favoured NLE, as it would appear:

https://www.tdisdi.com/natural-color-for-your-underwater-videos/

WorBry
8th June 2018, 18:59
Well curiosity got the better of me - I 'took the plunge' and signed-up for access to the 'video color correction' component of the Dive+ app. Don't have any other native under water clips, so I took samples from this YT video where the guy compared the original (ungraded) footage (shot on a GoPro) with corrections done in Final Cut Pro X

https://youtu.be/RTtS_baA5a8

Here are frame grabs from two of the original (ungraded) and graded segments. And the same corrected/graded with the Dive+ app and by me (as best) with Resolve.

Test #1:

Original:
http://i.imgur.com/cnCJlNpm.png (https://imgur.com/cnCJlNp)

Corrected FCPX:
http://i.imgur.com/cbdSlbTm.png (https://imgur.com/cbdSlbT)

Corrected Dive+:
http://i.imgur.com/Ggbueamm.png (https://imgur.com/Ggbueam)

Corrected Resolve:
http://i.imgur.com/0VXMrPym.png (https://imgur.com/0VXMrPy)


Test#2

Original:
http://i.imgur.com/IJyAFPim.png (https://imgur.com/IJyAFPi)

Corrected FCPX:
http://i.imgur.com/ezURu17m.png (https://imgur.com/ezURu17)

Corrected Dive+:
http://i.imgur.com/VPosv8wm.png (https://imgur.com/VPosv8w)

Corrected Resolve:
http://i.imgur.com/Lb9eyKmm.png (https://imgur.com/Lb9eyKm)

In short, I don't think Dive+ does a very good job. In these (and other samples from the same) it seems to arrive at an overly warmed balance with pretty poor exposure control. I think it just got lucky with that frame from your sample clip. Also it appears to grade each frame individually and there is a fair bit of fluctuation in the corrected outcomes within the same sequence - there's no option to select a representative frame for correction and apply to the entire clip. I'm not impressed.

That said, I'm not so impressed with the grading that was done there in Final Cut Pro X either. Seems to have fallen into the same trap I did when I first started playing with your sample clip in Resolve - thinking that if you push the color wheels (or whatever the equivalent tool is in FCPX) around enough and get the colored 'subjects of interest' to what they should be (or assumed/remembered to be), it will look good - or else 'better blue than green'.

I've come round to realizing that it is more important to get as close to neutral balance, as can be achieved, in the first instance. If it's done right, the true colors should more or less come through. Both grades I did there with Resolve adopted that strategy - balancing as best with the Channel mixer and then finer tuning with the color wheels. In hindsight, the first one (Test #1) could do with more work, especially that residual aquamarine tint on the sea bed, but I think the second is probably close to 'true'.

Also had a go at it with VirtualDub2, applying the same principle. Don't know what filters Shekh used specifically in the example he posted earlier. I've used:

*Channel Mixer (Emiliano Ferrari's version)
*Shekh's (Anton) very excellent '6-axis Color Correction' for secondary tuning.
*Levels and Gradation curves for levels and contrast (centre-relative)
*Unsharp Mask (Antons).

*Color Tools (1.4) scopes (Histogram, WFM, Vectorscope) for reference.

Two cracks at the Test#1 sample:

http://i.imgur.com/1SJHLVxm.png (https://imgur.com/1SJHLVx)

Bit more saturation of reds/orange:

http://i.imgur.com/QyXd8gnm.png (https://imgur.com/QyXd8gn)

Not bad for a first attempt....and possibly the most natural looking of them all - owing in part to partial desaturation of 'emerald' (one of the '6-axis' correction filter colors ) which targeted that 'aquamarine' tone on the sea bed very well. More tricky to treat that as cleanly in Resolve without ramifications.

Quite honestly Tormento, if you are not up for Resolve (which is a bit of a leaning curve), I'd have a look at VDub2. I could be wrong, but I think the chances of coming up with an AVS plugin for 'automated' underwater color correction are pretty remote. Closest I could imagine would be a Channel Mixer based function that maybe has generic presets for depleted channel reconstruction when there is blue or green bias, which can then be tweaked. There are just too many variables involved for automated correction IMHO and you're better off color correcting/grading on a case by case basis. With VDub2 you could also use Shekh's Master Blend filter for keying in subtle changes made with the 6-axis color correction filter.

In terms of 'free' software, there's also KDenLive, which I know is popular in the dive community, but I'm not sure if the Color Channel Mixer 'effect' has the secondary subchannels (RG, RB, BR, BG) where most of the work is done.

WorBry
9th June 2018, 18:27
..In hindsight, the first one (Test #1) could do with more work, especially that residual aquamarine tint on the sea bed...

Better result with Resolve:

http://i.imgur.com/RMoBBN7m.png (https://imgur.com/RMoBBN7)


Tweaked the Channel Mix to shift that residual 'aquamarine' tint more to cyan, making it easier to target for partial desaturation without impacting the rock colours. Still like the VDub2 result through. Less vivid than the Resolve grade, but probably more realistic.

@Shekh. Really like the '6-axis Color Correction' filter. I find it very intuitive. Would be even better if there were an option to apply to definable Shadow, Mid-Tone and Highlight luminance ranges, in addition to global. A 'Three-way' Colour Corrector so to speak. Any possibility of that ?

StainlessS
9th June 2018, 22:43
Question to the divers amongst you,
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.

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 ?

EDIT: To below post

It honestly looks in real water like the unprocessed from camera. But the picture is only fraction of how it feels. Improved balance, contrast etc makes it more impressive and IMO this is great.

I see, where we increase perceived resolution we use the term Super Resolution, perhaps we should here coin the term Super Reality :)

shekh
10th June 2018, 00:03
@Bryan: It may be good idea but it will definitely blow up the filter (more complex math and UI). So maybe another one. Never had success yet with shadow-highlight separation, maybe it is too subtle for me :)
Interesting that you applied channel mixer, I supposed that red-green and yellow-blue sliders achieve the same. Also levels... is exactly the purpose of top slider (intensity). Have you tried?
I'll try to pick some decent shots for experiments, if you want.

@StainlessS: It honestly looks in real water like the unprocessed from camera. But the picture is only fraction of how it feels. Improved balance, contrast etc makes it more impressive and IMO this is great.

WorBry
10th June 2018, 05:24
@Bryan: It may be good idea but it will definitely blow up the filter (more complex math and UI). So maybe another one. Never had success yet with shadow-highlight separation, maybe it is too subtle for me :)
T'was just a thought. Maybe could be applied through masked overlays, but that's not something I've really explored in Vdub. There's RGB (gradation) curves also, of course -not for the faint hearted.


Interesting that you applied channel mixer, I supposed that red-green and yellow-blue sliders achieve the same
Yes, with that first 'green-cast' sample (Test#1), using the '6-axis' filter alone I can get pretty close to the color balance obtained with Channel Mixer + tweaked with '6-axis'. But with the 'blue-cast' clip with the blanked red channel that Tormento provided, no, at least not to end up with an orange finned fish ;) It was the same in Resolve - pushing the color wheels to the extreme was not enough - always fighting an offset cast; the red channel needed reconstructing.

Also I wanted to see how well I could replicate the Resolve workflow using VDub.


Also levels... is exactly the purpose of top slider (intensity). Have you tried?
I didn't in those examples, but I have now. Sometimes I just use curves when manipulating levels and contrast (S-curve) at the same time.


I'll try to pick some decent shots for experiments, if you want.
Thanks, it would be interesting to test some good quality, native clips with strong casts/blanked red channels, ideally including sea life with known (and unambiguous) color characteristics, to see how well these methods hold-up.

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:

I could be wrong, but I think the chances of coming up with an AVS plugin for 'automated' underwater color correction are pretty remote. Closest I could imagine would be a Channel Mixer based function that maybe has generic presets for depleted channel reconstruction when there is blue or green bias, which can then be tweaked.

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.


@StainlessS: It honestly looks in real water like the unprocessed from camera.

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 ? ;)

tormento
10th June 2018, 07:15
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.

WorBry
10th June 2018, 08:41
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.

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:


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.


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.

lansing
10th June 2018, 08:45
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.

StainlessS
10th June 2018, 10:01
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).

shekh
10th June 2018, 14:37
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=1HBcsY5yAbaFbKhu5ORNKh2YUwwAY86Kn
triggerfish: good colors
GOPR0201.MP4: needs dynamic treatment
turtle: I fail to get any color out of it

WorBry
10th June 2018, 15:34
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.

WorBry
10th June 2018, 15:43
Here are some directly cut from original: https://drive.google.com/open?id=1HBcsY5yAbaFbKhu5ORNKh2YUwwAY86Kn



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 ?

tormento
11th June 2018, 10:27
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.

StainlessS
11th June 2018, 15:51
Well if its Red that is mostly missing, probably wrong though. (maybe, pinkish then ???, [EDIT: or orangy fleshy])

WorBry
11th June 2018, 22:23
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.

WorBry
12th June 2018, 02:15
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:

http://i.imgur.com/iSOMcKVm.png (https://imgur.com/iSOMcKV)

http://i.imgur.com/f9RMXPrm.png (https://imgur.com/f9RMXPr)


Corrected Resolve:

http://i.imgur.com/P1kbObcm.png (https://imgur.com/P1kbObc)

http://i.imgur.com/rEXPlJzm.png (https://imgur.com/rEXPlJz)

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.

StainlessS
12th June 2018, 02:23
Images of turtles, (Amongst them some tortoises and terrapins):- https://www.google.com/search?q=turtle+image&client=firefox-b&tbm=isch&tbo=u&source=univ&sa=X&ved=0ahUKEwiwxPfP-szbAhVPLVAKHTkvBKsQ7AkIQg&biw=1280&bih=874

shekh
12th June 2018, 10:22
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)
https://s33.postimg.cc/y8vvyacvf/turtle-_GOPR1168.png (https://postimg.cc/image/y8vvyacvf/)

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).

WorBry
12th June 2018, 13:28
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)
https://s33.postimg.cc/y8vvyacvf/turtle-_GOPR1168.png (https://postimg.cc/image/y8vvyacvf/)

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.

shekh
13th June 2018, 11:58
I thought some false coloring pops because I'm mixing srgb values.
This is result of correction after applying srgb to linear filter:
https://s33.postimg.cc/57osgl92j/turtle-_GOPR1170.png (https://postimg.cc/image/57osgl92j/)
Almost grey, but at least no red spots.

WorBry
13th June 2018, 16:12
Interesting.


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.

http://i.imgur.com/e131ToFm.png (https://imgur.com/e131ToF)

http://i.imgur.com/nW1GRsvm.png (https://imgur.com/nW1GRsv)


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.

http://i.imgur.com/WT7hHnjm.png (https://imgur.com/WT7hHnj)

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:


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:

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.net/img/web_225023_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-Green-Turtle-young-one-_MG_9931---Punta-Espinoza--Fernandina--Galapagos.jpg

Evidently not.

shekh
13th June 2018, 17:41
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/3b3a97f222e34fc8822e605a23fb49ab#file-turtle-gopr1170-vdproject

WorBry
13th June 2018, 20:05
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:

http://i.imgur.com/ZlKGvHom.png (https://imgur.com/ZlKGvHo)

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

SMDegrain(tr=2, thSAD=400, truemotion=false, contrasharp=true)

http://i.imgur.com/bKsxmBPm.png (https://imgur.com/bKsxmBP)

WorBry
14th June 2018, 17:50
Had another go at it with Resolve:

http://i.imgur.com/6qwRrsLm.png (https://imgur.com/6qwRrsL)

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:

http://i.imgur.com/bpM9mzDm.png (https://imgur.com/bpM9mzD)

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.

shekh
14th June 2018, 19:32
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.

https://s8.postimg.cc/mx9mej9y9/turtle-_GOPR1170_2.png (https://postimg.cc/image/mx9mej9y9/)

this turtle had enough torture, let it go? ;)

WorBry
14th June 2018, 21:01
Yes, that hits a nice balance. I got a bit preoccupied trying to get a browner tone to the coloration on the shell, but at that depth it's probably more how you've got it...you were there after all. I could swing it more to that tone, and had it there at one point in my tweakings, but agree, I think we're done with "toupe turtle".

Would you mind uploading the Vdub project for that one also - I'd like to see how you got there - presumably all color balancing done with the '6-axis corrector' ?

I am looking at the other clips btw and will post some results when I'm happy with them, again with a view to replicating whatever I can come up with in Resolve using VDub and hopefully AVISynth, ideally avoiding the need for qualifier masks and the like.

@Tormento, if you are still looking in, hope you are trying some of these techniques. I could post the channel mixes I used, but really there's no substitute for getting in there and pushing the colors around. As one Colorist famously said "I just bang the knobs until it doesn't suck anymore".


Edit: btw Shekh, would I be right in concluding that the Trigger Fish in the two clips have different colorations. The one in GOPR0304 definitely matches with a 'Titan' Trigger Fish':

https://previews.123rf.com/images/vintrom/vintrom0905/vintrom090500010/4812485-titan-triggerfish-and-coral-reef-in-red-sea.jpg

On the other fish (in G0PR1596) the patch above the mouth appears more yellow, the patch under the mouth looks paler (whitish) and the tail stripe is tan colored, not orange. The matrix pattern on body of the GOPR0304 fish also has a deeper yellowish/green (iridescent) tone to it.

Seems unlikely that it's just the way the light affects the colours and how they appear after correction. Just don't want to beat myself up trying to get them to match when they are different fish.

shekh
15th June 2018, 11:43
https://gist.github.com/shekh/bfa7d5d9fdb6050cc950517f6b20ab08#file-turtle-gopr1170-1-vdproject
In this setup I used a new plugin (hqdn3d), currently you can get it here: https://sourceforge.net/projects/vdfiltermod/files/plugins/hqdn3d/version%201/
(Btw how does hqdn3d compare to smdegrain?)

The fish: can't tell really. I think same species.

WorBry
16th June 2018, 05:00
Thanks.

Btw how does hqdn3d compare to smdegrain?

I haven't used hqdn3d for years, but at one point it was my routine denoiser for cleaning up DV video. Great to have it available for VDub2.

As for the Trigger Fish. Here are my Resolve corrected results. Again, just channel mixer, levels, contrast, mid-tone detail and a little sharpening.

Clip GOPR1596:

Original:
http://i.imgur.com/4bh1cHWm.png (https://imgur.com/4bh1cHW)

Corrected:
http://i.imgur.com/syiQ0cXm.png (https://imgur.com/syiQ0cX)

Pre-denoised and corrected:
http://i.imgur.com/IwtXChpm.png (https://imgur.com/IwtXChp)

Clip GOPR0304:

Original:
http://i.imgur.com/iz3nl16m.png (https://imgur.com/iz3nl16)

Corrected:
http://i.imgur.com/yRq0XcOm.png (https://imgur.com/yRq0XcO)

Pre-denoised and corrected:
http://i.imgur.com/lfbU3gxm.png (https://imgur.com/lfbU3gx)

The fish: can't tell really. I think same species.

See what I mean about the difference in coloration though?

http://i.imgur.com/qCooS9dm.png (https://imgur.com/qCooS9d)

I've seen some images of 'Titan' Trigger Fish where the coloration is more like the one in GOPR1596 where the stripe on the tail is

https://i.pinimg.com/originals/e1/4c/5b/e14c5b5e1ab6ff758a460e67b27bfc44.jpg

So maybe it's just the way the light picks-up/accentuates the colors, or maybe there are variants within that species with different degrees of pigmentation. I'm pretty confident though that both corrected clips are balanced to neutral or close to it. There's no way I could shift the balance to get the colors of one of the fish closer to the other without throwing the global balance out of whack. Maybe possible using multiple qualifier masks but that's somewhat artificial.

I'll see how well I can replicate those results with VDub2.

tormento
16th June 2018, 09:44
Sirs... your efforts are great but we are going slightly off topic.

The original question was a hopefully automatic way to recover red missing video files with AVISYNTH :)

Can I lead your great work to something we can replicate in that environment? GamMac and FredAverage, perhaps?

StainlessS
16th June 2018, 10:52
something we can replicate in that environment? GamMac and FredAverage, perhaps?

I would not expect GamMac to be able to ever do anything for your supplied clips.

shekh
17th June 2018, 00:36
tormento,
Asymptotically I'm interested in the automated process and this discussion helps to understand what transforms are required to get some decent result (whether automated or not).
Also it helps to know how to solve the problem manually, because it gives some reference to compare with.

shekh
17th June 2018, 15:17
Split thread: https://forum.doom9.org/showthread.php?t=175536

WorBry
18th June 2018, 01:57
The original question was a hopefully automatic way to recover red missing video files with AVISYNTH :)


By way of closure on my part - here's a go at correcting your sample video manually with AVISynth using only Channel Mixer for the color balancing.

http://i.imgur.com/CfIRDs3m.png (https://imgur.com/CfIRDs3)

I deliberated whether to apply the levels/contrast adjustments in RGB space or after conversion back to YV12. I opted for RGB using RGBAdapt which offers centre-relative contrast.

DGSource("{Path}\2018_0525_135958_020.dgi",fieldop=0)
#Denoise:
SMDegrain(tr=1, thSAD=400, truemotion=false, contrasharp=true)
ConvertToRGB(matrix="rec709", interlaced=false)
#Correct color balance:
ChannelMixer(RR=97.5, RG=129.2, RB=-21.5,
\ GR=23.0, GG=102.0, GB=0.0,
\ BR=113.0, BG=-13.8, BB=82.0)
#Levels & contrast adjustment:
RGBADapt(R_Cont=1.1,G_Cont=1.1,B_Cont=1.1,
\ R_Bias=15.0,G_Bias=15.0,B_Bias=15.0,
\ R_Gain=1.1,G_Gain=1.1,B_Gain=1.1)
ConvertToYV12(matrix="rec709")
#Sharpen with filter of choice:
LSFMod(smode=3,strength=200)


I don't think I can bring anything else to the table in this context, other than more examples of the same.
Cheers.

Edit: BTW, in that correction I did with Resolve I used a qualifier to treat some vibrant magenta that was coming through on the edges of the anemone and diver outline also:



http://i.imgur.com/XVmJ8Gcm.png (https://imgur.com/XVmJ8Gc)

Edit: Noticed feint magenta tinge to the blues after posting. This one, a bit less:

http://i.imgur.com/V7FSZ1cm.png (https://imgur.com/V7FSZ1c)

….opted for reconstructing the red channel (as best) with the RGB Channel mixer. Then just one qualifier to deal with some vibrant magenta coloration on the tips/edges of the anemone tentacles that stood out....

Realized subsequently that that can be treated with a little positive shift in the G-R sub-channel.

tormento
20th June 2018, 11:44
I don't think I can bring anything else to the table in this context, other than more examples of the same.
Thanks for your and everybody invaluable contributions to a niche area.

To complete discussion: is there any avisynth filter that can render optical filter output? I mean: red shallow water, red deep water, magenta green ones etc.