View Full Version : Removing Black bars from Uneven, Dynamic Sources
salehin
26th October 2007, 15:37
(I apologise if I have posted this in the wrong section of the forum)
I was wondering if there is any tool that would automatically detect black bars from sources with dynamic and uneven resolution- in other words, the source is combination of different sources.
If there is none, is there any alternative way of doing it? I'd be grateful if you could also tell me how to do it.
R3Z
28th October 2007, 13:59
Black lines as in interference or dopouts? or something different?
salehin
28th October 2007, 18:54
I'm referring to programmes with various resolution (if you remove the black bars). It might be due to filming with different cameras with different res or something else.
scharfis_brain
28th October 2007, 22:13
and how do you intend to handle the different aspect rations?
you could crop away the black bars dynamically, but you have to use a fixed size output.
so if you are cropping too much you also need to crop the sides (ie zoom the source)
salehin
29th October 2007, 00:12
you could crop away the black bars dynamically, but you have to use a fixed size output.
That's what I want to know :)
so if you are cropping too much you also need to crop the sides (ie zoom the source)
I can always choose the lowest common resolution after cropping- in such case, I won't have to blow the image up. The AR shouldn't be an issue either
salehin
1st November 2008, 01:03
I was hoping someone could kindly reply to this old query of mine- a script example would be really helpful as I'm not that good in programming. I'm bumping it after a long time- hope it is ok :)
Sagekilla
1st November 2008, 06:08
One way is to look for which sections of the movie require the greatest cropping, and set the Crop values to that. I.e. if one portion requires Crop(0,30,-4,-42) just use that one line for the whole movie, so everything will be cropped by that.
Not very hard at all.
thetoof
1st November 2008, 06:55
Yes, but from what I can understand, salehin is asking if someone could write a script that'd recognize the black bars, crop them and crop any additional amount needed to respect the AR and then resize to some resolution.
With this, the stream will have no black bars and, for every scene, "optimal crop" will have been applied (no pixels are discarded for nothing since the cropping is adapting to the different black bars sizes).
Though imo you can do that manually and it's not that hard/long, since there shouldn't be that much variation in that area...
kemuri-_9
1st November 2008, 07:57
it would be best to have that as a filter,
it would most likely need to use loops and per pixel (depending on colorspace) analysis for determining which lines to crop on a per frame basis.
could give thresholds as to answer 'what is black?', as the bars aren't usually just pure solid black (0x000000 RGB),
but within a range of some sort due to the noise/grain.
but the problem that could arise from such a method is that in scenes that would require variant crop values,
the scene will look distorted from the different stretching applied to reach a common size after the variable sized crops.
Sagekilla
1st November 2008, 20:25
One other thing to consider is if you're working with raw YV12 (That hasn't been converted to RGB24/32 with proper levels) Black should be any values from 0 - 16, because of the whole TV levels = Y: 16-235, UV: 16-240 crap.
mikeytown2
2nd November 2008, 10:47
This might help
http://forum.doom9.org/showthread.php?p=1111789#post1111789
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.