Author Topic: Dealing with Focus Pixels in raw video  (Read 206316 times)

masc

  • Contributor
  • Hero Member
  • *****
  • Posts: 1616
Re: Dealing with Focus Pixels in raw video
« Reply #700 on: September 16, 2019, 08:57:45 PM »
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

  • Developer
  • Hero Member
  • *****
  • Posts: 3751
Re: Dealing with Focus Pixels in raw video
« Reply #701 on: September 17, 2019, 03:35:36 AM »
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.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

2blackbar

  • Senior
  • ****
  • Posts: 392
Re: Dealing with Focus Pixels in raw video
« Reply #702 on: May 03, 2020, 10:32:26 PM »
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

  • Contributor
  • Hero Member
  • *****
  • Posts: 6698
Re: Dealing with Focus Pixels in raw video
« Reply #703 on: May 03, 2020, 10:40:15 PM »
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

  • Senior
  • ****
  • Posts: 392
Re: Dealing with Focus Pixels in raw video
« Reply #704 on: May 03, 2020, 10:44:54 PM »
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

  • Freshman
  • **
  • Posts: 88
Re: Dealing with Focus Pixels in raw video
« Reply #705 on: May 03, 2020, 11:11:43 PM »
With EOS M I use 3x3 chroma smooth. All focus pixel maps do not work at 1736x976.

2blackbar

  • Senior
  • ****
  • Posts: 392
Re: Dealing with Focus Pixels in raw video
« Reply #706 on: May 03, 2020, 11:15:20 PM »
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

  • Contributor
  • Hero Member
  • *****
  • Posts: 6698
Re: Dealing with Focus Pixels in raw video
« Reply #707 on: May 04, 2020, 04:28:07 AM »
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

  • Senior
  • ****
  • Posts: 392
Re: Dealing with Focus Pixels in raw video
« Reply #708 on: May 04, 2020, 08:57:10 AM »
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

  • Contributor
  • Hero Member
  • *****
  • Posts: 6698
Re: Dealing with Focus Pixels in raw video
« Reply #709 on: May 04, 2020, 09:11:45 AM »
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

  • Senior
  • ****
  • Posts: 392
Re: Dealing with Focus Pixels in raw video
« Reply #710 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.

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 6698
Re: Dealing with Focus Pixels in raw video
« Reply #711 on: May 04, 2020, 09:50:40 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

  • Senior
  • ****
  • Posts: 392
Re: Dealing with Focus Pixels in raw video
« Reply #712 on: May 04, 2020, 09:53:48 AM »
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

  • Contributor
  • Hero Member
  • *****
  • Posts: 6698
Re: Dealing with Focus Pixels in raw video
« Reply #713 on: May 04, 2020, 10:00:43 AM »
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

  • Senior
  • ****
  • Posts: 392
Re: Dealing with Focus Pixels in raw video
« Reply #714 on: May 04, 2020, 10:15:01 AM »
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

  • Contributor
  • Hero Member
  • *****
  • Posts: 6698
Re: Dealing with Focus Pixels in raw video
« Reply #715 on: May 04, 2020, 10:52:29 AM »
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

  • Senior
  • ****
  • Posts: 392
Re: Dealing with Focus Pixels in raw video
« Reply #716 on: May 04, 2020, 01:31:39 PM »
Great,what would have to be changed ?

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 6698
Re: Dealing with Focus Pixels in raw video
« Reply #717 on: May 04, 2020, 03:05:42 PM »
I think @masc or dfort is better suited to answer that.

masc

  • Contributor
  • Hero Member
  • *****
  • Posts: 1616
Re: Dealing with Focus Pixels in raw video
« Reply #718 on: May 04, 2020, 06:08:18 PM »
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

  • Contributor
  • Hero Member
  • *****
  • Posts: 6698
Re: Dealing with Focus Pixels in raw video
« Reply #719 on: May 04, 2020, 06:16:49 PM »
Or ler's just put in all coordinates for borh crop and non crop into the same map file?

masc

  • Contributor
  • Hero Member
  • *****
  • Posts: 1616
Re: Dealing with Focus Pixels in raw video
« Reply #720 on: May 04, 2020, 06:21:01 PM »
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

  • Contributor
  • Hero Member
  • *****
  • Posts: 6698
Re: Dealing with Focus Pixels in raw video
« Reply #721 on: May 04, 2020, 06:37:09 PM »
I think we need to consult the "dotdoctor" himself.

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3751
Re: Dealing with Focus Pixels in raw video
« Reply #722 on: May 04, 2020, 07:32:24 PM »
I've been following the discussion but haven't had the time to get into it very far yet.

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.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

2blackbar

  • Senior
  • ****
  • Posts: 392
Re: Dealing with Focus Pixels in raw video
« Reply #723 on: May 04, 2020, 07:41:23 PM »
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

  • Contributor
  • Hero Member
  • *****
  • Posts: 6698
Re: Dealing with Focus Pixels in raw video
« Reply #724 on: May 04, 2020, 07:44:44 PM »
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...