What filter do I need? Is this artifact halo?

This forum is for questions and discussion of all the aspects of handling your footage. If you have questions about capturing/ripping footage, AviSynth, or compression/encoding/converting, look here.

Re: What filter do I need? Is this artifact halo?

Postby mikansei » Mon Apr 04, 2011 1:04 pm

>Cannonaire

Cannonaire wrote:I think you're confusing image geometry with aspect ratio. Geometry refers to whether the objects within the frame are correct or stretched - like my previous example of a circle being oval. Aspect ratio can refer to a few different things, but in this case your aspect ratio at 640x480 would be 4:3 exactly. If you use the script I gave you, it will give you correct geometry, and the geometry will not change even if you crop it again, thereby changing the aspect ratio.


I may be confusing these 2 terms and even resolution too XD
I've read your link and several other sources on aspect ratios and resolution but still, there's something I'm not getting about all this stuff which makes me get confused about geometry, cropping and resolution. Thanks to your link and few other links I looked at now a part of the doubt is solved but still there's still something I don't understand. From my understading, giving the output video the same resolution (e.g. 640x480), depending on how much you crop the output is going to keep the original aspect ratio of the input video or you are going to deform more and more the image in order to keep a specific resolution. If you crop a little (8px let's say), then people won't notice, but if you cut 50px in width and only 2px in hight, then the picture's aspect ratio (?) is going to get deformed... or not? This is what I was trying to ask w

Cannonaire wrote:Maybe I should stop caring about this so much. All it does is give me grief and confuse people. It's not even the best way to handle stuff unless you mix a lot of sources. :oops:

If it's a yes/no answer the one to my question above I'd be happy 'cause is something that is causing me a lot of confusion. If it requires a lot of explanation nevermind :) I've asked a lot already :sweat:
Anyway, thank you a lot for all the help you have given me with the script and my doubts, sensei :D


>mirkosp
mirkosp wrote:http://ps-auxw.de/cgi-bin/ar-calc.pl

In order to keep the geometry you'll need to make sure you're doing a good cropping and keep in mind the active area etc... there's quite a bit of stuff behind it, so doing it by hand can be a bit tricky. I suggest you use that site to do the math.

Thank you for the link! I already checked it out.
I've learnt how to use the calculator. Now there's just understanding the concepts behind it left ~_~

Mister Hatt wrote:camembert().naa().ttempsmoothf(maxr=2)
Actually that string was only a suggestion rather than an actual recommendation. I meant for you to tweak it. As I wrote it, it'd only be good for de-ringing rather than dehaloing.


Oh, ok! I had no clue about that. I don't know how to tweak that to get dehalo instead of deringing. I'm just getting started with learning avisynth's filters in depth. Until now I just followed guidelines. Can you give me a tip, please?


Ok, and now, the result of the script as of now (using dehalo_alpha):
Ta-da! It looks lovely IMO ^^
Image

Image

Now here's the question... When played at full screen i get this aliasing even though I've put antialiasing in the script. I just want to know if it's natural for the video to get alising when played at full screen, or if there's something I can add to the script to soften the aliasing.

Here are the full screen images of the samples above:
ImageImage
mikansei
 
Joined: 21 Mar 2011

Re: What filter do I need? Is this artifact halo?

Postby mikansei » Mon Apr 04, 2011 1:06 pm

The script of the images posted above is this one:
Code: Select all
TFM(order=-1, field=-1, mode=1, PP=0, chroma=false)
TDecimate(mode=1, cycleR=1, cycle=5, rate=23.976, hybrid=0)
CanDerainE(str=255 , dstr=80, thr=2.0, radius=6, rthr=90, mask=false)
dehalo_alpha(darkstr=0,brightstr=0.6,rx=2,ry=2)
dehalo_alpha(darkstr=0,brightstr=0.8,rx=2,ry=2)
mergechroma(awarpsharp2(depth=32))
MCTemporalDenoise(settings="low") 
LSFmod(100)
Crop(6, 2, -8, -2)
spline36resize(640, 480)
maa()
mikansei
 
Joined: 21 Mar 2011

Re: What filter do I need? Is this artifact halo?

Postby Mister Hatt » Mon Apr 04, 2011 6:58 pm

Any particular reason for that TFM line btw? I assume someone has suggested it to you but it is awfully strange. The rest looks sane enough.
Mister Hatt
 
Joined: 25 Dec 2007
Status: better than you

Re: What filter do I need? Is this artifact halo?

Postby Cannonaire » Mon Apr 04, 2011 11:23 pm

Mister Hatt wrote:Any particular reason for that TFM line btw? I assume someone has suggested it to you but it is awfully strange. The rest looks sane enough.

Blame me for that one. I copied it from another script I wrote many months ago and it worked on the sample, so I decided not to tweak it.
Image Think millionaire, but with cannons. || Resident Maaya Sakamoto fan.
User avatar
Cannonaire
 
Joined: 05 May 2010
Location: Oregon
Status: OVERLOAD

Re: What filter do I need? Is this artifact halo?

Postby Cannonaire » Mon Apr 04, 2011 11:39 pm

mikansei wrote:
Code: Select all
Crop(6, 2, -8, -2)
spline36resize(640, 480)

Sorry for another double post, but the cropping and resize lines you have chosen are really odd. The final resolution isn't as important as preservation of detail and image geometry, and by resizing back to 480 vertical pixels you're unnecessarily hurting the detail and raising the final file size of your video. If you are using the AR calc, you can still have correct image geometry assuming you use the correct DAR when you mux, but that kind of ruins the point of using the AR calc to begin with.

If you are using the AR calc and you want to preserve as much detail as possible, it would be best to simply crop and enter the DAR on mux without resizing in avisynth. If you're trying to save space/bitrate by resizing beforehand, it would be best to resize precisely to square pixels and forgo the AR calc and DAR altogether. At least, that is how I see things. Mostly it just seems odd to me to resize back to 480 after cropping 4 pixels.
Image Think millionaire, but with cannons. || Resident Maaya Sakamoto fan.
User avatar
Cannonaire
 
Joined: 05 May 2010
Location: Oregon
Status: OVERLOAD

Re: What filter do I need? Is this artifact halo?

Postby Rice » Wed Apr 06, 2011 5:56 pm

LOL damn thats hard to see, are you an individual frame inspector? O: :up:
Image
User avatar
Rice
TheRiceWhisperer
 
Joined: 21 Nov 2009
Location: Canada
Status: OP

Re: What filter do I need? Is this artifact halo?

Postby Cannonaire » Wed Apr 06, 2011 7:12 pm

nivekov123 wrote:LOL damn thats hard to see, are you an individual frame inspector? O: :up:

It is often difficult or impossible to see the difference, but I say why be close when you can be exact with a single, pre-written line? It's not like it takes any extra effort. On the other hand, think of this highly contrived example: You want to use a circle cookie-cutter effect on a circle part of your footage. If you don't have the correct image geometry, it won't look right. But like I said, this is highly contrived.

In any case, I didn't mean to derail this thread. Aspect ratio and image geometry would be better as its own thread because it applies to everything we do around here.
Image Think millionaire, but with cannons. || Resident Maaya Sakamoto fan.
User avatar
Cannonaire
 
Joined: 05 May 2010
Location: Oregon
Status: OVERLOAD

Re: What filter do I need? Is this artifact halo?

Postby mikansei » Wed Apr 20, 2011 7:15 am

Cannonaire wrote:
mikansei wrote:
Code: Select all
Crop(6, 2, -8, -2)
spline36resize(640, 480)

Sorry for another double post, but the cropping and resize lines you have chosen are really odd. The final resolution isn't as important as preservation of detail and image geometry, and by resizing back to 480 vertical pixels you're unnecessarily hurting the detail and raising the final file size of your video. If you are using the AR calc, you can still have correct image geometry assuming you use the correct DAR when you mux, but that kind of ruins the point of using the AR calc to begin with.

If you are using the AR calc and you want to preserve as much detail as possible, it would be best to simply crop and enter the DAR on mux without resizing in avisynth. If you're trying to save space/bitrate by resizing beforehand, it would be best to resize precisely to square pixels and forgo the AR calc and DAR altogether. At least, that is how I see things. Mostly it just seems odd to me to resize back to 480 after cropping 4 pixels.


How do I know if I'm keeping the correct geometry?

Well, I tried using 2 AR calculators and got 2 different results:

So the original DVD source is: NTSC 4:3 720x480

Let's say I want to crop using these values: Crop(8, 6, -10, -0)

If I use http://ps-auxw.de/cgi-bin/ar-calc.pl

So I fill in the fields…
Code: Select all
Source: 720x480 NTSC (Active Picture: 710.86X486)
Source AR : 4:3
1.   Transform : Crop : 702, 474 because I want to Crop(8, 6, -10, -0)
2.     Transform : Scale: 640x480


I have cropped substracting from 720x480 values. Is that correct or when you crop you have to substract from 710.86x486?

And I get these results:
Code: Select all
[b]Numbers[/b]
Source resolution: 720x480
Source AR: Fullscreen
Final resolution: 640x480
Final PAR: 379080/374381 = 1.01255138481921
Final display resolution: 648x480
Final DAR (square pixels): 505440/374381 = 1.35006851309228

[b]Transforms[/b]
   1. Crop: 702, 474
   2. Scale: 640, 480


So looking at final display resolution I should resize to 648x480 but final DAR is 1.35...


If I use AVsPmod:

In the avisynth script there’s Crop(8, 6, -10, -0). So the video resolution as of now is 702x474, which is what gets loaded automatically in the AR calculator:

Input (filled in automatically):
» video resolution: 702x474
» PAR: 8:9
My doubt is: is the PAR the right one or I need to change it to NTSC 4:3 – 10:11?

I click at configure…
Target pixel ratio: I choose 1:1

I go to results…
Results:
» If I keep PAR at 8:9, the final resolution is either 528x400 or the next possible value is 736x560.
» If I change PAR to 10:11 (NTSC 4:3), the final resolution with the closest height to 480 is 624x464. Other options are 560x416 and 688x512. So if we do as AVTech says and I stick to the closest value to 480 I should resize to 624x464.

Now, have I used both calculators correctly? If so, using 624x464 (AVsPmod) would be more accurate because DAR 1.34 is closer to 1.33.
- http://ps-auxw.de/cgi-bin/ar-calc.pl: 648x480 (DAR 1.35)
- AVsPmod: 624x464 (DAR 1.34)
mikansei
 
Joined: 21 Mar 2011

Re: What filter do I need? Is this artifact halo?

Postby mirkosp » Wed Apr 20, 2011 7:45 am

As a rule of thumb, unless you use some very specific values, cropping changes DAR and SAR, while resizing changes PAR.
Having the exact same DAR of your input isn't really necessary, it isn't important at all, as long as the geometry of your output is correct. You could be overcropping to 16:9 for whatever reason, but with the right math it'd still have the correct geometry, while on the other hand you could crop some random values and resize to 640x480 and have a perfect 4:3 DAR with wrong geometry, so you can easily see how having a 1.33 DAR means really nothing.
Just crop as much as needed and then resize to the proper resolution for your geometry and don't mind the fact that it could not be some common value, because that's not really what matters here.
In other words, I'd say the first solution (Crop(8, 6, -10, -0) and resize to 648x480) is perfectly fine and you shouldn't feel bad about it.
Image
User avatar
mirkosp
MODkip
 
Joined: 24 Apr 2006
Location: Gallarate (VA), Italy
Status: (」・ワ・)」(⊃・ワ・)⊃

Re: What filter do I need? Is this artifact halo?

Postby mikansei » Thu Apr 21, 2011 6:17 am

mirkosp wrote:Just crop as much as needed and then resize to the proper resolution for your geometry and don't mind the fact that it could not be some common value, because that's not really what matters here.
In other words, I'd say the first solution (Crop(8, 6, -10, -0) and resize to 648x480) is perfectly fine and you shouldn't feel bad about it.


Thanks mirkosp. I think I understand everything you explained me about the DAR and PAR. The only doubt I have is how do I know if I have the proper resolution for the geometry, how do I know if the geometry is correct? I mean... AR Calculator is used for calculating the output resolution but... how can I know if I have calculated it properly? Is there any tool that allowes me to know I've got the correct geometry in my output video, or the only tool is looking with my eyes for a rounded object which used to be ovaled in the input video?


As for my post from yesterday, the doubt I had was if the results from the 2 different calculators I used where correct, as the results were quite different one from another. Getting those so different results I wonder if I'm getting the right geometry. Any tips?
mikansei
 
Joined: 21 Mar 2011

Re: What filter do I need? Is this artifact halo?

Postby mirkosp » Thu Apr 21, 2011 6:42 am

The ar-calc.pl will have perfect geometry provided you correctly state what kind of input you have (NTSC/PAL/HD and Widescreen or Fullscreen). AVSP's calculator OTOH prolly isn't quite as good since it doesn't take into consideration things like active area and so on.
But yes, aside from that, looking for round objects and such is the best way to check if the ar is correct, though with very small ar differences it might hard to notice.
Image
User avatar
mirkosp
MODkip
 
Joined: 24 Apr 2006
Location: Gallarate (VA), Italy
Status: (」・ワ・)」(⊃・ワ・)⊃

Re: What filter do I need? Is this artifact halo?

Postby mikansei » Wed May 25, 2011 5:49 am

@mirkosp:
Thank you :)

I just have one doubt left regarding that:
Let's say I crop width= 20px, height=6px.

At the "crop" box I have to enter the values width and the height values, so do I have to substracting those pixels from 720x480 or from the active area values (710.86x486)? I mean, is it "700, 474" or "690.86, 480" the values I have to enter?

@everyone that helped me:
Thank you for your time and tips helping me!
mikansei
 
Joined: 21 Mar 2011

Re: What filter do I need? Is this artifact halo?

Postby mirkosp » Wed May 25, 2011 7:34 am

you put the amount you cropped from 720x480 so yes 700,474. :)
Image
User avatar
mirkosp
MODkip
 
Joined: 24 Apr 2006
Location: Gallarate (VA), Italy
Status: (」・ワ・)」(⊃・ワ・)⊃

Re: What filter do I need? Is this artifact halo?

Postby mikansei » Thu May 26, 2011 5:51 am

Thank you, mirkosp! :D
mikansei
 
Joined: 21 Mar 2011

Previous

Return to Footage Help

Who is online

Users browsing this forum: No registered users and 2 guests