Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or try DVDFab Passkey and remove Blu-ray and DVD protection! :)

# Separate visualization of Y,U and V fields

1. Hi guys, I saw this code on Digital Faq, but I can't make it work

Code:
```Mpeg2Source("F:\Svaghi\Video Editing\Report e Guide\Avisynth Guide\[Provati]\[Filtraggio Selettivo]\Registrazione - 0001.d2v", CPU2="ooooxx", Info=3).converttoYV12()
AssumeTFF()
SeparateFields()

# Got this from Jagabo at Videohelp
# Show Luma and map Chroma to luma in separate clips so we can see each plane.
Y=ColorYUV(off_u=-256, off_v=-256).ColorYUV(off_u=128, off_v=128)
U=UtoY()
V=VtoY()

StackHorizontal(Y, U, V)```
AvsPMod says StackHorizontal: image heights don't match. How can I solve it? Your help is highly appreciated.
2. Your source is probably YV12 so the U and V channels are half the size (each dimension) of the Y channel. So you need to resize them or stack differently:

Code:
```Mpeg2Source("F:\Svaghi\Video Editing\Report e Guide\Avisynth Guide\[Provati]\[Filtraggio Selettivo]\Registrazione - 0001.d2v", CPU2="ooooxx", Info=3).converttoYV12()
AssumeTFF()
SeparateFields()

# Got this from Jagabo at Videohelp
# Show Luma and map Chroma to luma in separate clips so we can see each plane.
Y=ColorYUV(off_u=-256, off_v=-256).ColorYUV(off_u=128, off_v=128)
U=UtoY().BilineaResize(Y.width, Y.height)
V=VtoY().BilineaResize(Y.width, Y.height)

StackHorizontal(Y, U, V)```
Or:

Code:
```Mpeg2Source("F:\Svaghi\Video Editing\Report e Guide\Avisynth Guide\[Provati]\[Filtraggio Selettivo]\Registrazione - 0001.d2v", CPU2="ooooxx", Info=3).converttoYV12()
AssumeTFF()
SeparateFields()

# Got this from Jagabo at Videohelp
# Show Luma and map Chroma to luma in separate clips so we can see each plane.
Y=ColorYUV(off_u=-256, off_v=-256).ColorYUV(off_u=128, off_v=128)
U=UtoY()
V=VtoY()

StackHorizontal(Y, StackVertical(U, V))```
Since U and V are half the height of Y, stacking them vertically makes the stack the same height as Y.
3. U = UtoY()
V = VtoY()
StackHorizontal(U,V)
Histogram(mode="luma") #
It's best like this if you don't use the luma mode of histogram you can't see much things just a blurry grayscale presentation of U&V
4. Thanks to the both of you
5. To see more chroma detail I usually prefer to increase the saturation of the colors before splitting out the chroma or increase the contrast after:

Code:
```Mpeg2Source("F:\Svaghi\Video Editing\Report e Guide\Avisynth Guide\[Provati]\[Filtraggio Selettivo]\Registrazione - 0001.d2v", CPU2="ooooxx", Info=3).converttoYV12()
AssumeTFF()
SeparateFields()

# Got this from Jagabo at Videohelp
# Show Luma and map Chroma to luma in separate clips so we can see each plane.
Y=ColorYUV(off_u=-256, off_v=-256).ColorYUV(off_u=128, off_v=128)
U=UtoY().ColorYUV(cont_y=500)
V=VtoY().ColorYUV(cont_y=500)

StackHorizontal(Y, StackVertical(U, V))```
6. Actually, this is was what I was looking for: I wanted to know which field has more noise, especially the chroma one. Thanks again.
7. But why U and V fields are in greyscale? Is it possible to see the colors?
8. U and V represent colors that are added or subtracted from the greyscale (Y) value. So you can't view them correctly on their own. You can get a sense of the colors by using a flat, medium, greyscale value but you won't see real colors:

Code:
```Mpeg2Source("F:\Svaghi\Video Editing\Report e Guide\Avisynth Guide\[Provati]\[Filtraggio Selettivo]\Registrazione - 0001.d2v", CPU2="ooooxx", Info=3).converttoYV12(interlaced=true)
AssumeTFF()
SeparateFields()

Y = ColorYUV(cont_u=-256, cont_v=-256) # flatten U and V, leaving only Y
U = ColorYUV(cont_y=-256, cont_v=-256) # flatten Y and V, leaving only U
V = ColorYUV(cont_y=-256, cont_u=-256) # flatten Y and U, leaving only V

StackHorizontal(Y, U, V)```
I didn't notice this before but Mpeg2source() should be giving you YV12 to start with so calling ConvertToYV12 shouldn't be needed here. If it isn't giving YV12 for some reason and your source is interlaced the ConvertToYV12() needs to specify interlaced=true or the chroma of the two fields will bet blended together.
9. Thanks!
10. hmm yeah i prefer histogram=luma at least i can better see if there is blocking, to each his own i guess

Statistics