PinkDotRemover tool 650D

Started by foorgol, June 15, 2013, 08:51:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dsagilles

I just uploaded a new RAW Video test I made, where - unfortunately - we can see a lot of aliasing & artifacts.
I used the raw2dng_cs2x2_ahdlike_noise to extract the frames (and tried the original raw2dng to compare but the quality was quite the same - except there was the focus pink dot pattern of course).
Canon 650d |  Sigma 18-200 II DC OS HSM | Auto-Chinon 50mm f/1.9 | Minolta 35-70mm
DSLR Videos, photos and tutorials on http://www.gna-productions.com

maxotics

I thought it looked nice.  BTW, A1ex was the one who added chroma smoothing algos to the raw2dng.  However, he doesn't have a camera with the focus pixel (pink dot) problem, so is handicapped by how much he can address that specific problem.  There is the Java PDR software, but it doesn't always work (long story).  I've been working on algos for the focus pixel problem and hope that if I'm onto something A1ex can make it sing. 

My thinking is we

1. Detect general pattern in frame if we can
2. Run the following idea on all pixels most likely to be focus pixels based on above.  The routine always works pretty well on all pixels.  By targeting known pixels and lowering the threshold I think the problem will be nailed.

After the focus pixel problem is taken care of, film-makers can use A1ex's smoothing routines for low-light shots mostly, my guess. 

The main point, dsagilles, is some people are putting a lot of effort into making your camera kick butt ;)



  // Interpolate METHOD 2
                if (cboFocusDotRemovalMethod.SelectedIndex == 1)
                {
                    // ***
                    // REDS ONLY!
                    // ***
                    for (int x = 2; x < Footer.xRes-2; x += 2)
                    {
                        for (int y = 2; y < Footer.yRes-2; y +=2 )
                        {
                            // Let's nail our suspect onto a cross of red pixels
                            CP = (double)PixelData[y, x]; // Center pixel
                            LP = (double)PixelData[y, x-2]; // Left
                            RP = (double)PixelData[y, x+2]; // Right
                            TP = (double)PixelData[y+2, x]; // Top
                            BP = (double)PixelData[y-2, x]; // Bottom

                            AvgLR = (LP + RP) / 2; // average horizontal
                            AvgTB = (TP + BP) / 2; // average vertical

                            // If all surrounding pixels are lighter or darker, we could do simple interpolatation
                            // with any neighboring red pixel.
                            // BUT IF THERE IS an "edge/line" to left, right, top, or bottom, the pixel might end up
                            // incorrectly smoothed and show up as an artifact to that edge
                            // Therefore, we want to detect any edges, and if found
                            // try to smooth into pixel row ALONGSIDE edge

                            // For example, if a focus dot is next to a flag pole, on right, against the sky, nd we use the
                            // pole's red pixel to interpolate, we'd end up with a red pixel next to the pole
                            // that has the pole's chroma.  It will look like a dot stuck next to pole
                            // We'd want to interpolate with the sky pixels, top, bottom.

                            CPInterpolated = 0;
                            // If differs by more then 10% left right
                            if (Math.Abs((CP / AvgLR) - 1) > 0.10)
                            {
                                // Remember, we interpolate using the perpindicular line (top/bottom), assuminge this might be a line
                                CPInterpolated = (ushort)AvgTB;
                            }

                            // If differs by more then 10% left right
                            if (Math.Abs((CP / AvgTB) - 1) > 0.10)
                            {
                                // Perpindicular cross line
                                CPInterpolated = (ushort)AvgLR;
                            }

                            //We found a distortion so blend in...
                            if (CPInterpolated > 0)
                                { PixelData[y, x] = CPInterpolated; }
                         }
                    }

                        // ***
                        // Blue ONLY!
                        // ***
                        for (int x = 3; x < Footer.xRes - 3; x += 2)
                        {
                            for (int y = 3; y < Footer.yRes - 3; y += 2)
                            {
                                // Let's nail our suspect onto a cross of red pixels
                                CP = (double)PixelData[y, x]; // Center pixel
                                LP = (double)PixelData[y, x - 2]; // Left
                                RP = (double)PixelData[y, x + 2]; // Right
                                TP = (double)PixelData[y + 2, x]; // Top
                                BP = (double)PixelData[y - 2, x]; // Bottom

                                AvgLR = (LP + RP) / 2; // average horizontal
                                AvgTB = (TP + BP) / 2; // average vertical

                                CPInterpolated = 0;
                                // If differs by more then 10% left right
                                if (Math.Abs((CP / AvgLR) - 1) > 0.09)
                                {
                                    CPInterpolated = (ushort)AvgTB;
                                }

                                // If differs by more then 10% left right
                                if (Math.Abs((CP / AvgTB) - 1) > 0.09)
                                {
                                    // Perpindicular cross line
                                    CPInterpolated = (ushort)AvgLR;
                                }

                                //We found a distortion so blend in...
                                if (CPInterpolated > 0)
                                { PixelData[y, x] = CPInterpolated; }
                            }
                       

                    }
                } // false?


gary2013

Can we get PDR to allow us to drag and drop all the new raw files from the card to PDR. Then PDR creates a folder with the current date as the name for all these new raw files and places the files there. Then it makes subfolders for all the new raw files with each named from the raw file name. Then it processes all the new copies of raw files with PDR and then it runs raw2dng (or whatever raw2dng file we choose to use inside PDR). All one drag and drop and then it's finished with every thing we have to now do manually. Make it so we have to setup the options first, like crop, non crop for EOS M and the location for the first folder (or use the location from the last time we used PDR) and which raw2dng we want to use. Then we do the drag n drop of all new raw files from the card. 

Max, maybe you know this already and are working on it. I just wanted to make another request for an easier workflow. You also probably want one more step at the end for converting DNG to Cineform file. or DNxHD or ProRes. I would be happy to just get the DNG sequences for now. I am aware of Batchelor and Rawinizer, but they lack a few things like making copies of original raw files for bakup, allow new choice of raw2dng.exe , etc.

Gary

maxotics

Hi Gary, I'm working on it.  We can do all the things you mentioned, and more, once I get past the problem of saving the interpolated pixels back to the RAW file, like PDR does it.  g3gg0's C# code doesn't have a write routine, PDR's is in Java and Alex's is in C and meant to write to dng.  None of this code is what I would call trivial.  Because these raw values are in 14 bits, you have to chop, slice and move around all the bits in 8/16 bit chunks.  What a pain!  But pressing on!

gary2013


gary2013

i also had a new problem with some raw i shot the other day. I have a bunch of random very bright green pixels that I can't get rid of with pdr or neat video filter in PPro?? Never seen the green things before like this. I think i also shot it in non crop instead of crop like I usually use. Maybe the non crop had something to do with it??

gary2013

why can't i pin the PinkDotRemover.jar to the taskbar or start menu for easier opening of the program? I always have to dig thru explorer folders to find and double click on PinkDotRemover.jar

maxotics

Quote from: gary2013 on November 03, 2013, 07:50:44 PM
i also had a new problem with some raw i shot the other day. I have a bunch of random very bright green pixels that I can't get rid of with pdr

I get the green dots in similar situations with my 50d.  Usually sunlight through trees.  It is from poor debayering (like the one included in the RAW to Cineform converter). 

What is your workflow?  PDR will not deal with it, it isn't a focus pixel problem I believe.

gary2013

Quote from: maxotics on November 03, 2013, 08:04:10 PM
I get the green dots in similar situations with my 50d.  Usually sunlight through trees.  It is from poor debayering (like the one included in the RAW to Cineform converter). 

What is your workflow?  PDR will not deal with it, it isn't a focus pixel problem I believe.
Sorry I answered.  :)

maxotics

Sorry I asked ;)  Can you post an image with the green dot problem?  Or email it to me at max at maxotics com and I'll post it for you.

gary2013



gary2013

Max, here is a screen grab from PPro CC showing the green dots from the DNG I last sent here.
https://www.transferbigfiles.com/ecb1ee61-113d-40cb-aeae-55b6425c4a9a/otIaHrJgcit4Slrwc4qxQQ2

Gary

demetrisag

Any news on the Pink dots effort? Too much silence in here :)

maxotics

Quote from: demetrisag on November 21, 2013, 12:54:09 AM
Any news on the Pink dots effort? Too much silence in here :)

Too few developers  :-[ 

demetrisag

Shame, wish i  knew a thing our two about these staff, all i know is how to be patient and wait.

Rewind

Quote from: demetrisag on November 21, 2013, 08:16:25 AM
Shame, wish i  knew a thing our two about these staff, all i know is how to be patient and wait.

But what are you waiting for exactly? PDR kinda works, right?

demetrisag

Quote from: Rewind on November 21, 2013, 10:01:47 AM
But what are you waiting for exactly? PDR kinda works, right?
Well, like you said it

Kinda, under perfectly controllable case scenarios and specific resolutions should be ok.

Real world scenarios not so much :)

maxotics

Quote from: demetrisag on November 21, 2013, 12:33:53 PM
Well, like you said it

Kinda, under perfectly controllable case scenarios and specific resolutions should be ok.

Real world scenarios not so much :)

Which is why I built my own version in C#.  It needs to be tweaked a little bit for sensitivity to exposure and I missed a couple of rows of dots.  The Java version of PDR is 90% there.  Rewind always shoots within that 90% :)  Anyway, there is now a Java and C# open-source version. 

I was looking at a lot of my old footage, that was properly exposed, and used PDR.  Looks great to me.




Rewind

Quote from: demetrisag on November 21, 2013, 12:33:53 PM
Well, like you said it

Kinda, under perfectly controllable case scenarios and specific resolutions should be ok.

Real world scenarios not so much :)

Then may be you should be more specific, because I use my 650D for commercial work now quite fine, PDR does it's dedicated job nicely, that's why I don't bother updating or fixing it.
If you tell me scenarios, when it doesn't work, then there will be a point to deal with it.

maxotics

Quote from: Rewind on November 21, 2013, 02:47:55 PM
Then may be you should be more specific, because I use my 650D for commercial work now quite fine, PDR does it's dedicated job nicely, that's why I don't bother updating or fixing it.
If you tell me scenarios, when it doesn't work, then there will be a point to deal with it.

Rewind, I said it a gazillion times!  If you shoot anything with clipped/overexposed parts of the frame the dots re-appear.  You may be using a workflow that interpolates around them, so I'm not saying you're not wrong, for your use.  (BTW Do you shoot outdoors?) It usually works perfectly for me too. And I know you're trying to help!  And have!  What would be really helpful is a new version with the latest good settings.  Right now, I have to switch back and forth.  I did look into it.  Seems to me they punted a bit in the code, so not that easy.  Anyway, once that's done, I can probably help out with fine-tuning any of the dot matrixes.

Also, now that I've worked with this stuff in serious depth there are some lines of dots that do not fit a formula.

Here's a video where you can see the problems.  The dots appear in over-exposed sections of the frame.


Rewind

PDR tool is for removing focusing pixels. These green dots in overexposed areas has different nature. They do not belong common pattern, so you should remove them with bad pixel removal functions of any raw processor in order to remove them only in overexposed areas, and not all over the image.

It is not so hard to drag a single slider in your raw app ;)

apefos

download this, it is a free (old) plugin, but it can inspire you...

http://www.apefos.com/dualiso/svpr.rar

maxotics

They aren't green pixels.  However, there may be pixels that PDR would have removed.  Rewind, I can't remember if that clip was processed before or after you fixed the patterns.  But I did see them again in footage I shot a few days ago, but am not going to put up on Vimeo.  In any case, I want a tool that takes care of all "fixed-pattern" problem pixels.  It's why I wrote FocusPixelFixer.   Like PDR, it can work 100%.  Just too much work for me to do at moment.

Apefox, thanks for posting the plugin.  However, without source code, doesn't help me.

I just bought a BMPCC.  I still believe in the EOS-M, and other Canon cameras, but I haven't been able to get anyone involved in ML to get more professional.  If you use ML professionally, Remind, I commend you!  I don't need this stuff professionally.  This is a hobby for me.  Even as that, I find it too aggravating.  It's hard enough trying to fix the focus pixel issues with these camera AND wrestle with bugs.  This isn't anyone's fault.  It's a collective failure.

Again, I've gotten pretty good at Photivo, a lot because of Rewinds help!  So if someone gets the Java PDR into a single more usable code base going forward, i can handle the EOS-M camera settings, which I have. 

But Rewind, I'm not asking you!  God knows you've done enough.  We need someone with dev skills beside you and I!  Anyone?

Letni

Hey user of an 650D,

I just got a test crop video shot with 12.5 fps @ 1920x1074.

First I unpacked the RAW file with raw2dng_cs3x3_ahdlike_noise.
But the result was not satisfactory, because I got weird green dot's in the white lights.



Then I tried it with PDR and crop mode, whereupon the green dot's disappeared, but the normal pink Focus pixel not disappeared.



Now is not very important, because you can not turn really nice video with 12.5 fps, but it has me then puzzled.