Removing sensor dust on video

Rich Parry wrote on 6/6/2011, 7:25 AM
Using my Canon 5DM2 with big DOF resulted in a visible dust spot on a video clip. How can I remove or mask the spot?

A similar problem discussed on this forum suggested “duplicating the track” and using “motion tracking”, but I was hoping for a little more detail. The video clip below shows the dust spot on the extreme left, slightly below center.

http://www.vimeo.com/24720453

CPU Intel i9-13900K Raptor Lake

Heat Sink Noctua  NH-D15 chromas, Black

MB ASUS ProArt Z790 Creator WiFi

OS Drive Samsung 990 PRO  NVME M.2 SSD 1TB

Data Drive Samsung 870 EVO SATA 4TB

Backup Drive Samsung 870 EVO SATA 4TB

RAM Corsair Vengeance DDR5 64GB

GPU ASUS NVDIA GeForce GTX 1080 Ti

Case Fractal Torrent Black E-ATX

PSU Corsair HX1000i 80 Plus Platinum

OS MicroSoft Windows 11 Pro

Rich in San Diego, CA

Comments

johnmeyer wrote on 6/6/2011, 10:31 AM
If you can get the video into VirtualDub, you can use Delogo. This is designed to remove station "bugs," timecodes, and other such things, but works almost perfectly for removing small dust spots. I've used it many times.

You'll find discussions about this and other ways to remove spots in these threads:

Filter avail to remove raindrops on lens?

Any Dead Pixel Masking Scripts out there?

Speck Removal

You can search in this forum on "delogo" if you want to find more information about using it inside of Vegas (it is a unique word, so it is easy to search). Here's one such post:

DeLogo and Logoaway inside Vegas
johnmeyer wrote on 6/6/2011, 10:59 AM
Here's the result of applying the delogo filter to your clip:

Improved clip

Link good for seven days.

Here's a (relatively) low-res YouTube version. I magnified the before/after image in order to make it easier to see the spot. The "before" image is the left 20% of the frame; everything else is "after."

Rich Parry wrote on 6/7/2011, 12:03 PM
John,

Thank you for the hint and explanation as well as the example showing that Delogo will do the job. I have installed both VirtualDub and Delogo filter and have read the delogo manual a few times but the procedure isn't clear. Below is an overview of what I have done, perhaps I could ask for a little more help, I think I am almost there.

1. Grabbed a frame of video with dust spot and saved as JPEG
2. Opened the JPEG in Windows Paint, painted the dust spot red and saved as BMP
3. Opened VirtualDub and load bad AVI video file
4. Opened Delogo filter in VirtualDub
5. From Mask properties I selected LOAD to load BMP image
6. Selected “Show Preview”
7. Not sure what I am supposed to see but don’t see anything indicating progress.

I suppose I will eventually get the workflow correct, but I’m currently out of ideas. Even if you can’t help, thanks again for pointing me in the right direction.

Rich

CPU Intel i9-13900K Raptor Lake

Heat Sink Noctua  NH-D15 chromas, Black

MB ASUS ProArt Z790 Creator WiFi

OS Drive Samsung 990 PRO  NVME M.2 SSD 1TB

Data Drive Samsung 870 EVO SATA 4TB

Backup Drive Samsung 870 EVO SATA 4TB

RAM Corsair Vengeance DDR5 64GB

GPU ASUS NVDIA GeForce GTX 1080 Ti

Case Fractal Torrent Black E-ATX

PSU Corsair HX1000i 80 Plus Platinum

OS MicroSoft Windows 11 Pro

Rich in San Diego, CA

Ros wrote on 6/7/2011, 12:15 PM
You can use BCC7 Pixel Fixer or Wire Remover.

I gave it a quick try on your footage and it works quite well.

Rob
johnmeyer wrote on 6/7/2011, 2:06 PM
I created a very simple "tutorial" on how to use the Delogo within VirtualDub. It is not meant to show you all the nuances, but rather just to show the basic workflow. You can play around with the three controls (Depth, Power, and Pixel Aspect) in order to achieve optimal results. All the settings under "Mask Construction Parameters" are only used when you are trying to remove a semi-transparent ("alpha") logo or "bug" and are not used when removing non transparent objects. Having said that, I suppose that if some of the video does show through the spot, you might be able to use this feature. However, the spot is so small that the simple blending algorithm works pretty darned well.

farss wrote on 6/7/2011, 9:20 PM
" I was hoping for a little more detail"

Duplicate track.
Add soft mask around offending pixel(s)
Use track motion to move lower track just enough to move a clean area under the borked pixel(s). You might need to keframe the track motion so the replacement fits as the waves change.

Bob.
Rich Parry wrote on 6/8/2011, 5:17 PM
John,

I am thankful as well as a little embarrassed I needed such detailed instructions, you did a great job on the video. I successfully removed dust spots from two video clips using your instructions.

Thanks again for putting it on line and thank you for not calling it "The Idiots Guide to DeLogo".

In my defense, I discovered the paint program I used to create the "red" mask was not true red; 255,0,0 ... it sure looked red. Anyway, it has a happy ending, thanks.

Rich

CPU Intel i9-13900K Raptor Lake

Heat Sink Noctua  NH-D15 chromas, Black

MB ASUS ProArt Z790 Creator WiFi

OS Drive Samsung 990 PRO  NVME M.2 SSD 1TB

Data Drive Samsung 870 EVO SATA 4TB

Backup Drive Samsung 870 EVO SATA 4TB

RAM Corsair Vengeance DDR5 64GB

GPU ASUS NVDIA GeForce GTX 1080 Ti

Case Fractal Torrent Black E-ATX

PSU Corsair HX1000i 80 Plus Platinum

OS MicroSoft Windows 11 Pro

Rich in San Diego, CA

Rich Parry wrote on 6/8/2011, 5:25 PM
Bob,

When I couldn't get DeLogo to work, I did exactly what you suggested. Dup track, create mask, move lower track, etc.

It worked fine when both clips were 100% opacity (middle of clip), however, during the fade in and fade out sections (about 1 second at beginning and end of clip), the dust spot was visible.

I may spend more time on this, but thought I would respond and thank you for taking the time to make the suggestion.

Rich

CPU Intel i9-13900K Raptor Lake

Heat Sink Noctua  NH-D15 chromas, Black

MB ASUS ProArt Z790 Creator WiFi

OS Drive Samsung 990 PRO  NVME M.2 SSD 1TB

Data Drive Samsung 870 EVO SATA 4TB

Backup Drive Samsung 870 EVO SATA 4TB

RAM Corsair Vengeance DDR5 64GB

GPU ASUS NVDIA GeForce GTX 1080 Ti

Case Fractal Torrent Black E-ATX

PSU Corsair HX1000i 80 Plus Platinum

OS MicroSoft Windows 11 Pro

Rich in San Diego, CA

johnmeyer wrote on 6/8/2011, 5:31 PM
It worked fine when both clips were 100% opacity (middle of clip), however, during the fade in and fade out sections (about 1 second at beginning and end of clip), the dust spot was visible.You have to do all the restoration (removing the dust spot) on the original clip, before you import into Vegas. Once you do anything in Vegas (such as fading), the technology will fail because it assumes a constant, unchanging "blemish."
farss wrote on 6/8/2011, 7:05 PM
Quickest solution without me straining the old grey cells is to create one project to fix the problem and then nest that project into the main one. Then the complete composite which is being done in a child project will fade as a whole in the parent.

Bob.
Former user wrote on 6/8/2011, 7:07 PM
If you are fading to black or a solid color, add a new video track above your tracks and put a black or color event. Fade that iin and out.

Dave T2
ushere wrote on 6/8/2011, 8:40 PM
often do what davet2 does when i have a multitude of composited tracks below.... simplest option to avoid bleed through....
gjesion wrote on 6/9/2011, 9:43 AM
I have a similar problem with bad pixels on video I shot. I used the VD delogo filter and the results are very good. I do have one issue tho. The output brightness etc. has changed. And the file size is pretty large. What settings should be used to get as close to the original DV as possible?

Regards,
Jerry

edit: fix typo
Rich Parry wrote on 6/9/2011, 9:59 PM
Jerry,

When I just selected "Save to AVI", the resulting file was huge, more than 10 times larger (1,000%) which is what I guess you are seeing.

However, when I selected "Compression" codec identical to the original, the resulting file was only 10% larger. John mentions the need to select the correct codec at the edit of his tutorial video.

I'm going to guess that you need to do what I did, make sure you select the compression codec that is identical to the original file.

In case you wanted to know I use Cineform Neoscene AVI codec for both the original and the newly rendered video.

Rich

CPU Intel i9-13900K Raptor Lake

Heat Sink Noctua  NH-D15 chromas, Black

MB ASUS ProArt Z790 Creator WiFi

OS Drive Samsung 990 PRO  NVME M.2 SSD 1TB

Data Drive Samsung 870 EVO SATA 4TB

Backup Drive Samsung 870 EVO SATA 4TB

RAM Corsair Vengeance DDR5 64GB

GPU ASUS NVDIA GeForce GTX 1080 Ti

Case Fractal Torrent Black E-ATX

PSU Corsair HX1000i 80 Plus Platinum

OS MicroSoft Windows 11 Pro

Rich in San Diego, CA

johnmeyer wrote on 6/10/2011, 9:07 AM
The output brightness etc. has changed. And the file size is pretty large. What settings should be used to get as close to the original DV as possible?
With any video editing program -- Vegas, VirtualDub, whatever -- you have to wisely choose the codec you use when rendering. For this particular workflow, you have three general choices that will work, and one class of choices that won't. The three classes that will work are:

Uncompressed. This is what you get in VirtualDub if you don't specifically choose a codec. Uncompressed video will have no loss whatsoever, and should look identical to the original video. However, as was pointed out, the files are huge. That is because the video is, well, not compressed.

Lossless. There are several codecs which do compress video, but which don't throw away any information. If you use these codecs, you can often cut file sizes in half -- sometimes more -- compared to uncompressed. What's more, some of these are free, such as HuffYUV and Lagarith. Since there is almost no downside to using these, they are almost always a better choice for this sort of workflow compared to using uncompressed.

Editable codecs. This class of codecs is a little harder to define, and not everyone will agree with my definition. Generally speaking, however, these codecs perform lossy compression, but do so in a way that even if you render the results, and then later render the results of the first render -- like making a Xerox copy of a copy of a copy, etc. -- the 2nd, 3rd, or even the 4th generation will still look almost as good as the original. What's more, these formats are usually very "editor friendly," meaning that they play well on the timeline. Examples include the DV codec, which is used by most SD camcorders (even though it uses a rather limited colorspace), motion JPEG (MJPEG), and Cineform.

Highly compressed "delivery" codecs should be avoided for this workflow. These include MPEG-2 (used for DVD delivery); H.264 and all other variations used by MP4 files; DivX and its cousin XVID; WMV; and anything else which produces really small files.

So, if you do everything correctly, using the correct codec, you should be able to put the original video on the first timeline in Vegas, and the corrected video, without the spot, on the second timeline in Vegas and when you do a A/B compare (by, for instance, muting and un-muting the first track), the only change you should be able to detect is the presence or absence of the spot or logo which you have removed. You should not see any other artifacts, and if you enable the 'scopes in Vegas, you should not see any levels or color shifts whatsoever.

gjesion wrote on 6/12/2011, 5:20 AM
So, if you do everything correctly, using the correct codec, you should be able to put the original video on the first timeline in Vegas, and the corrected video, without the spot, on the second timeline in Vegas and when you do a A/B compare (by, for instance, muting and un-muting the first track), the only change you should be able to detect is the presence or absence of the spot or logo which you have removed. You should not see any other artifacts, and if you enable the 'scopes in Vegas, you should not see any levels or color shifts whatsoever.


Hmmmm. I don't mean to seem dim, but I cannot get this to work with the DV-AVI footage I am using. The closest that I can come is to use "autoselect" for the decompression format, and "Same as decompression format" for Color Depth along with uncompressed. This gives something that truncates the values from 16 to 235. I am running 10d on Win 7 64 bit.

Regards,
Jerry