Fixing VHS rips

Discuss just about anything else
User avatar
Hallfiry
7-bit super nerd
Posts: 210
Joined: March 20th, 2012, 10:41 am
Contact:

Re: Fixing VHS rips

Post by Hallfiry »

developertn wrote:What is important is that I took the time out and cared enough to share something that is very special to me just like you share your CD collections with the world.
The difference is that my CD collection wasn't already out there...
developertn wrote:I was reading a book to try to understand the sexes better. It says men and women communicate differently so they tend to "miscommunicate".
You are aware that I'm a man, right?
Aside from that, most differences between men and women are cultural and are held up by people who don't realize how conservative they actually are and how much they force other people and themselves to obey arbitrary rules that they think stem from instantly-righteous and correct tradion, or from what they percieve as nature which is usually just their misudnerstanding of science in general, but mostly math and its areas like game theory, statistics.


But mainly I'm vexed, because you intentionally sabotage my thread by spamming it with informationless posts instead of keeping it at a reasonable level of information density. You decided to talk about anything else but the topic, just because you think that is necessary to thank a pile of people and especially jesus for whatever they might have or might not have done for or to you, while I was hoping for at least a trace of niveau.

Your first post was ok, talking about how the low level math that I mentioned is still worth a lot.
The second was pure spam.
Then you went over to just declaring my project nonesense and suggested going the silly way of cropping, which was obviously what I wanted to avoid by starting the project.
The next post started with a good oneline about the ideals of preservation, and then drifted off into a wall of text cntaining nothing.
Next Malvineous was friendly enough to confirm my idea of simple interpolation by pulling lines down into empty areas.
Then you were on the right track again and wanted to do some conversation about the math things I mentioned. Not quite on the spot of the topic, but at least related.
Then you posted two more posts of pure spam.
Then came your bible copy crop scan thing.
And then you went back to what was actually talked and tried to justify your actions. I do not condemn your try of defense.
Magazine cover disk catalog:
http://www.kultcds.com/Catalog/
User avatar
Hallfiry
7-bit super nerd
Posts: 210
Joined: March 20th, 2012, 10:41 am
Contact:

Re: Fixing VHS rips

Post by Hallfiry »

I've reached (man, I wish reach was a strong verb so I could write raught) a point where I have no idea how to proceed.

I'll quickly describe what my algorithm actually does:
for the last n lines of an iamge (a good value is 18) is checks if the line is jiggly, by looking if the variance is over a certain value (ignoring pixels that were interpolated or shoved outside in later parts of the algorithm).
If the line is jiggly, it chooses full length, if it is smooth, it chooses short length.
Then it moves the line to the left, and comapres the pixels in the area from the left edge of the iamge up to the length that was determined.
The value of a comparison works like this:
sum (P element pixels) {1/(compare(P,Pabove)²+1)}
with compare being a function that gets bigger when the difference gets bigger.
When the remaining length to check is shorter than bestsumYet - x, then the current shift can already be skipped, because all pixel values will be 1 or smaller and thus the best sum can't be crossed anymore anyway if the comparison already went so bad. (this last part is a dramatic speedup when having a fairly good startguess for the position).
The x-shift with the highest value will win and the line will be shifted accordingly.

About the sum(1/(1+compare²) formula: I had to find a formula that still has proper values when shifting a lot outside the picture, but will not overestimate the quality of a match when say only 1 or 2 black pixels at the border match and the rest flies out of the window. 1/(1+x²) is quite a fancy way to always get valid values and having an upper bound. Also it doesn't weight pixels too much, but at the same time gives a little penatly fir shifting many pixels outside. So I picked this one. there might be a few tweaks that I could use, like 1/(1+a*(x²)^b) but I'm not sure if that will really help so much...

I forgot what I wanted to ask.
Magazine cover disk catalog:
http://www.kultcds.com/Catalog/
Malvineous
8-bit mega nerd
Posts: 293
Joined: March 17th, 2007, 6:40 pm
Location: Brisbane, Australia
Contact:

Re: Fixing VHS rips

Post by Malvineous »

So what limitations are there in the algorithm at the moment? Are you stuck trying to figure out how to solve a specific flaw or you aren't sure how to detect the presence of that flaw?
User avatar
Hallfiry
7-bit super nerd
Posts: 210
Joined: March 20th, 2012, 10:41 am
Contact:

Re: Fixing VHS rips

Post by Hallfiry »

Malvineous wrote:So what limitations are there in the algorithm at the moment? Are you stuck trying to figure out how to solve a specific flaw or you aren't sure how to detect the presence of that flaw?
Hard to explain, but I'll try again:
At the left border of each line, I can expect a dark border to be (in the current type of rip that I'm fixing). This dark border is useful for alignment, but it can lead to wrong alignment if similar dark borders appear within the line that needs to be fixed. So I have to decide whether a line is likely to have such fake borders or not.
That's the first type of mismatch.

The second type of mismatch is on lines with smooth color gradients. When checking over the full length of the line, the color gradient can sometimes match perfectly in a shifted position and have more influence on the alignment than the border.

This means that jiggly lines are usually shifted too far left and smooth lines too far right when mismatched.
But I have no idea how to fix that for all cases.

I'll probably try to today to work out a different solution, namely trying both mathing variants and then comparing the lines with a different measure than the one used for the algorithm itself and then choosing from those two, which is better.
Magazine cover disk catalog:
http://www.kultcds.com/Catalog/
Malvineous
8-bit mega nerd
Posts: 293
Joined: March 17th, 2007, 6:40 pm
Location: Brisbane, Australia
Contact:

Re: Fixing VHS rips

Post by Malvineous »

Ah, I understand. Does the original video have a similar amount of shifting between frames for each line, or does each line's shifted amount change a lot between frames? I am wondering whether you could have an algorithm that says if line X is shifted by 10 pixels in frame 1, then in frame 2 it should only be shifted by 9, 10 or 11 pixels. This additional restriction could assist for cases where the current algorithm is unable to come up with a definite answer. But this would only work if each line jiggles horizontally by only a small amount between frames.
User avatar
Hallfiry
7-bit super nerd
Posts: 210
Joined: March 20th, 2012, 10:41 am
Contact:

Re: Fixing VHS rips

Post by Hallfiry »

The idea is pretty good, but the program is designed to work on single frames and I must admit that I want to keep it that way for now.
Magazine cover disk catalog:
http://www.kultcds.com/Catalog/
developertn
9-bit ubernerd
Posts: 833
Joined: March 23rd, 2015, 4:23 pm

Re: Fixing VHS rips

Post by developertn »

Jesus Christ!hehe

Well, I'm still checking the website from time to time.

So I haven't gone anywhere really.

You can find me over at WWW.DOSGAMES.COM if you need anything.

However, I just wanted to say keep up the good work.

I know my real friends always encourages me when I am down.

Although I don't have many, the small group of people who do love me never put me down.

So Malvineous - congratulations.

Also, thank you for the CD website, I did manage at one point to download one. :D
User avatar
Hallfiry
7-bit super nerd
Posts: 210
Joined: March 20th, 2012, 10:41 am
Contact:

Re: Fixing VHS rips

Post by Hallfiry »

I haven't worked much on the algorithm since I last posted here, but I've got a use for it upcoming:
I'll try to get my hands on a VHS player next week and digitize a few of my old VHS tapes.
I'm not heading for copyright infringement there, but for preservation. For example I happen to own a couple of TV recordings of the Western movie "The Hallelujah Trail" each with a different opening. So I will make those digital, restore as much image information as I can and upload those currently lost openings to Youtube.
With those recordings from TV come some classic advertisements, like the coffee ad with a monkey operating a coffee squeezer. I will upload those aswell. It will all be in German however.
I might also do a little comparison of the different versions of movies that I got, so I can contribute to Schnittberichte.com. Maybe I've got some rare scenes missing from usual versions, or at least some alternate title cards (The Hallelujah Trail for example has an intermission in the middle of the movie that might be different in the German TV version).
EDIT: Also some of the commercial VHS tapes that I've got, contain rare trailers for movies and such that might still be missing from public access.
Magazine cover disk catalog:
http://www.kultcds.com/Catalog/
developertn
9-bit ubernerd
Posts: 833
Joined: March 23rd, 2015, 4:23 pm

Re: Fixing VHS rips

Post by developertn »

Looking forward to see your works. I'm always interested in others looking at my works and giving me feedbacks, so I guess I'll do the same for you! I would just suggest to be yourself though. Don't worry if it doesn't come professional at first. You know people all have to start somewhere. When I started out programming I didn't know how to program. I had to start with BASIC, which is the lowest programming language level you can get. Then 30 years later I was able to successfully program in Assembly language. However I'm not there yet. I still have to get to pure coding in ones and zeroes. I don't know if I have the talent for doing it in that mode all the time. Then again I've heard stranger things happening hehe

So, yeah. Just do your best and God takes care of the rest in my opinion. I'm a firm believer that you have to start from the bottom of the ladder principle. Well, maybe you can skip the first ladder if it is low enough (stupid joke huh? :lol: )
Post Reply