interpolate two angles

Blitz3D Forums/Blitz3D Programming/interpolate two angles

In case you wonder: for purposes of compression the MiniDV Format, used by common video cameras, is not storing color information for every pixel, but only for every fourth pixel. There are two system: PAL uses 4:2:0 and NTSC uses 4:1:1. Professional equipment is using a 4:4:4 Format, so every pixel has the complete information, luminance, hue and saturation. In the 4:2:0 format the (3 of 4) pixels without color information will use interpolated colors, using their neighbour colors.
For ordinary movies this looks ok, but when you want to use chroma-keying (greenscreen background that will be replaced by an other movie), the lack of accurate color information for 75% of the pixels will result in messy, blocky outlines of the masked areas (aka Matte Line). An intelligent interpolation would now try to detect contours by changes in luminance and decide if the color should be taken from one side (in case of a detected contour), instead of the ordinary interpolation that would be used when no contour is detected.