Dealing with Focus Pixels in raw video

Started by dfort, October 22, 2015, 11:09:10 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

masc

Thank you dfort! This works excellent! No more focus pixels in this mode.
As far as I understood, for MLVApp the fpm name has to fit exactly the raw buffer resolution found in the MLV header. So this should be identical to MLVFS.
5D3.113 | EOSM.202

dfort

Quote from: Danne on September 16, 2019, 08:51:16 PM
I recently decreased height...

If the full raw buffer size changes, simply rename a map file that has the same width but has a little more vertical resolution. That should be a quick fix though we should eventually make a new map file.

2blackbar

I figured problem with croprec pixel maps not being fixed, mlvapp is using wrong pixel map file, cause two modes are 1736x976 zoom crop mode in 16:9 and normal uncopeed full view in 16:9, soo... if i remove pixel map that mlvapp is using for both of those then zoom mode is fixed, and non zoom mode is not fixed when i bring that pixel map back, then its other way around, looks like there is no way around that besides choosing pixel map manually which i would really prefere to do.

80000331_1872x1190.fpm is the one being used, when i delete it then zoom is fixed and non zoom has focus pixels.This mode is 1736x976, not sure why map with 1872 pixels is being used

Danne

What camera? Exact presets referred to. I get a vague understanding but need more to be able and reproduce your issue. Maybe upload sample files?

2blackbar

Its EOS M, one is zoom mode , by pressing set, and other os regular mcm rewire, both are 1736x976 and it confuses mlvapp, when i remove all pixel maps, then mlvapp is removing focus pixels on zoom mcm video without them but normal mcm rewire non zoom mode is not being fixed without pixel maps installed.
So maybe one pixel height difference between those 2 modes would help ( between mcm rewire and zoom mode by set button in mcm rewire )or some kind of manyual selector of pixel map files for each mlv file.
Biggest issue for me was that i had to use chroma smooth to get rid of focus dots, it took more time to process + most imporatnt i could not use it on 10 bit compressed raw because blacks and dark areas became ugly green like posterize filter, but i wanted to experiment today and figured what pixel map is being used by checking installed pixel maps, then i tried to swap the map until i see some results that fixed both zoom and non zoom mlv files, it was always one being fixed and other one not.Cause they both use same map file but they both need different map files, i mean zoom mode does not need any map file at all, its being fixed without any maps installed but i suspect mlvapp has some maps buiilt in besides those FPM files that you feed it.
14mb mlv files :
https://drive.google.com/open?id=1eroqR4-I548iHWxOVmhxO-tkXyQF6L98
https://drive.google.com/open?id=1fZFFDTqkiM9JxpFJPfxpzkHjCrkrxqdW

yokashin

With EOS M I use 3x3 chroma smooth. All focus pixel maps do not work at 1736x976.
70D.112 [main cam] | M.202 | S110 [CHDK]

2blackbar

I know this, but try it in 10 bit raw and look at the dark /black areas, uglygreenfest.
Also it takes longer to render with chromasmooth.
Id prefere to fix this the right way.Just differentiate between zoom and non zoom mcm modes somehow so mlvapp wont use the same map file for both.

Danne

Seems you have been using an old build. Tested your files and non zoom works fine but the maps for zoom mode doesn´t work.

If I leave your error description and record these two files myself and then turn Fix Focus Dots on or off over each file I clearly see focus dots entering and dissapearing exactly as expected. You can test these two files yourself:
https://bitbucket.org/Dannephoto/magic-lantern/downloads/focus_pixels.zip

1 - Lower exposure to -1 and push F to zoom in on image to get a clear view of the focus dots
2 - Toggle Fix Focus Dots On and Off to see the magic happen

I am on mac. I have all map files installed and downloaded through Mlv_app_compiler.app. I suspect either you are missing maps or your files are old and I recommend you use the latest build from my download area. Use CS 3x3 on these older files or create your own map files.

Generally speaking. Comparing against latest build should have revealed your issues.

2blackbar

Zoom mode will be cleaned from focus pixels whwn you rwmove fpm files from mlvapp folder.
Whixh means rhat intwnal builtin mlvappmaps do work with this mode withoit additional maps but when you introduce maps to fix non Zoom mode, then zoommpde ia not cleaned from p ixels
Probbaly cause fpm maps are overeiding internal mlvapp maps that can fix Oom mode.
I suspect issue is that both filesare the same resolution while their focus pixela are different
Yes i have custom one made from older ML builds, so what exactly should i change so i can recompile it, or its too complicated? Usually i used compare in notepad++ to add the code i was missing in custom builds that i edited.
I can see that it does work on your files even with older mlvapp buiild that i customised.
Id like to add parts of the code that will solve the issue in my old build, but is it in one place or in a couple of places ? Whats it related to ? Is it because i moved zoom mode a bit up or down to get no dark corners with cctv lens ? Looks like i would have to recreate my custom build from your newest ML build.

Danne

If you follow the way I described in my answer you should be ok. Did you test my uploaded files?
If you change code I have no time to help out more than briefly. Learn to compile following posts here in the forum. If you continue using your old build expect the issue to persist.

2blackbar

I tested, it doesnt work, wont fix dots when i record in 16:9, youre in 2.4:1 mode.
Im not using that small  ratio menu , i choose aspect ratio from that menu with resolutions.
Maybe it doesnt work without this ratio menu enabled.
Yup, i enabled ratio for 16:9 and it does work, removes pixels in both files zoom and non zoom, so... what should i do to get pixels fixed without using ratio menu ?
I dont have anything against it but its interfering with my custom crop area for cctv lenses.So id like to record without ratio but still be able to fix focus pixels in zoom mode.
So its a matterof ratio menu turned on , not old builds.I tested your files they work, also all filea recorded with ratio turned on will work.

Danne

Quote from: 2blackbar on May 04, 2020, 09:20:01 AM
I tested, it doesnt work, wont fix dots when i record in 16:9, youre in 2.4:1 mode.
Im not using that small  ratio menu , i choose aspect ratio from that menu with resolutions.
Maybe it doesnt work without this ratio menu enabled.
Yup, i enabled ratio for 16:9 and it does work, removes pixels in both files zoom and non zoom, so... what should i do to get pixels fixed without using ratio menu ?
I dont have anything against it but its interfering with my custom crop area for cctv lenses.So id like to record without ratio but still be able to fix focus pixels in zoom mode.
So its a matterof ratio menu turned on , not old builds.I tested your files they work, also all filea recorded with ratio turned on will work.
Can´t follow. What ratio is set from where? What works and what doesn´t. I need screenshots at least. Impossible to understand what you are doing now.

2blackbar

Simple, ratio menu above bit depth in ml menu, enable it or disable, and check results, when its enabled pixels get fixed in mlvapp, when its disabled , pixels arent fixed in zoom mode.
It works even with my custom ML builds from older ones, so there is something in ratio menu that gets focus pixels cleaned , without ratio menu enabled zoom mode is not cleaned.

Danne

Simple? Joking?
So, issue is narrowed down to following:
Focus maps isn´t working with hd1080p mode(aka mcm rewired mode) when ratios is set to OFF and in x3crop mode. Tested over here and yes, it´s not working.

You said you had it working by removing some map?

2blackbar

I had zoom mode working yes, when i removed all pixel maps from mlvapp folder. Thats other option, but maybe ratio enabled gets us different focus pixels in one of the modes so both are fixed.
Im on the run , when i get back home ill do more experiments as i have to go.
So, again i got zoom mode fixed and working by removeing all fpm files from mlvapp folder.But then regular not zoomed mode had focus pixels, it needs map fpm file i think. But when you feed it that FPM file , then suddenly zoom mode wont be fixed. Thats without ratio enabled.
Ratio in ML enabled solves all of this.

Danne

Well, reproduced. Seems internally some map file is handling x3crop mode fine but not when non crop map file(fpm) is included as you say. Conflict due to seemingly same buffer so external map file is always enabled even on x3crop mode. At least we know the issue now so we can start fixing it.

2blackbar

Great,what would have to be changed ?

Danne

I think @masc or dfort is better suited to answer that.

masc

Hm... not nice... but in the end "to be expected":
MLVApp has a pool of build in maps. Those maps are used if no MAPP file is found for the resolution of the active clip. If a MAPP file is found, it is used. Now we have two identical RAW resolutions with different maps at different readouts. This is bad. Because now, just one of them can work. The non-crop is working with the MAPP file, and the crop is working with the build-in map. If the RAW resolution would be just one pixel different, the problem would not exist...
I think this can't be fixed without inventing a new concept for map naming and selection.
5D3.113 | EOSM.202

Danne

Or ler's just put in all coordinates for borh crop and non crop into the same map file?

masc

That would work as well... this means: the focus pixels would go away, but you would "delete" the "good" pixels too by interpolating. In the end better than 3x3 smoothing.
5D3.113 | EOSM.202

Danne

I think we need to consult the "dotdoctor" himself.

dfort

I've been following the discussion but haven't had the time to get into it very far yet.

Quote from: 2blackbar on May 03, 2020, 10:32:26 PM
80000331_1872x1190.fpm is the one being used, when i delete it then zoom is fixed and non zoom has focus pixels.This mode is 1736x976, not sure why map with 1872 pixels is being used

1736x976 is the final image size but the full raw buffer size is 1872x1190. We use the full raw buffer size to figure out which pixel map file to use. That way the same map file can be used for all of the possible image sizes for each of the settings.

One possibility is that the internally generated pixel map file for the setting you used for the baby shot is from an older version that has fewer pixels mapped out. The newer fpm files cover every possible scenario. Generally, this works fine but in some cases the algorithm to fill in areas where we're mapping out areas that don't really need it are introducing artifacts. This isn't the first time I've seen this--funny thing is that last time it happened it was also from one of your baby pictures:

https://www.magiclantern.fm/forum/index.php?topic=16054.msg214714#msg214714

Note that using that same map file in a different application doesn't show that issue:

https://www.magiclantern.fm/forum/index.php?topic=16054.msg214767#msg214767

This isn't the case with your most recent shot--it looks to me like the new fpm just isn't working with this particular file. I need to look into that but in the meantime it seems to me that simply removing the new map file will work fine for this shot.

New fpm file looks the same as turning off "Fix Focus Dots" feature on MLV App (colors pushed to show focus pixels clearly):


Using the old fpm file built into MLV App:


Final results look good to me.

2blackbar

i can get that file working fine, its the other one that doesnt work with fpm files, with cup and spoon 3xcrop mode, both have same resolution but diffwrent focus pixels.both recorded without ratio in ml turned on.

So focus pixels map work fine for non 3xcrop mode, the one you posted screengrabs from.The one in 3xcrop mode is with cups and it gets cleaned in mlvapp only when i remove all FPM files, but this makes that shot with baby not work again and you cant clean it, uinless you bring back deleted FPM files, which again make 3xcrop mode not getting cleaned and so on...

Danne

The issue still persists with newer recordings. Only internal mapping works in x3crop mode ratios set to off. I'm sure it will get fixed one way or the other ;).

Edit: or is it non crop mode internal dot mapping that is broken? Many angles...