COLOUR LEGALISATION

Abstract: In video signal processing, a colour legalisation process replaces an illegal input colour by an output colour derived by determining the intersection with the cube of legal RGB of a straight line extending between the input colour and a reference colour. The reference colour may be mid-grey or may more generally lie on a reference line extending between reference black and reference white. The position of the reference colour on this line may depend on the input colour.

Description: COLOUR LEGALISATION This invention relates to the processing of digital video signals and is particularly concerned with the concept of "legal" and "illegal" colours and a colour-legalisation process. By illegal colours there should be understood such combinations of Y, Cr and Cb values, (or Y, U, and V or indeed other luminance and colour difference signals) which after matrix transformation into R,G,B (or other primary colour domain) leave at least one of R, G, or B values outside an allowed range between a reference black level and a reference white level. Hence, the legal RGB values are limited by the surface of the so-called legal RGB cube. There are a number of ways in which illegal colours can be arrived at. For example:- i) excess of light energy input combined with insufficient protective clipping within video camera hardware; ii) misalignment of video equipment, e.g. setting of Master-Black control too low, or setting of Video Gain and/or Saturation controls too high; and iii) deliberate change of picture colours in a digital video effects (DVE) device or in a video graphic workstation for the purpose of creating artistic effects. The conventional approach to colour legalisation replaces an illegal colour by a colour having the same brightness. The main drawback of this prior-art solution is a significant reduction of colour saturation under certain circumstances. For example, an illegal super-bright yellow input colour will, according to the prior art, be converted to the legal colour having the same brightness. However, the only such colour is white, which is significantly and visibly different from the input colour. Hence, the prior art processing can create visible artefacts in solid areas of certain colours. Accordingly, it is an object of this invention is to provide colour legalisation processes and hardware which offer an improvement in the handling of illegal combinations of Y, Cr and Cb (or Y, U, V) components with the purpose to convert them into the nearest (in subjective picture quality sense) legal colour. In one aspect, the present invention consists in a colour legalisation process wherein an input colour lying outside the volume which defines legal colours in a colour space is replaced by an output colour derived by determining the intersection with the boundary of said volume of a straight line extending between the input colour point in the colour space and a reference point on a reference line in the colour space which extends between reference black and reference white. Advantageously, the reference point on said reference line is determined by the luminance of the input colour. In one form of the invention, the reference point on said reference line corresponds with the colour mid-grey. In another aspect, the present invention consists in a colour legalisation process, comprising the steps of: a) calculating the 3D vector in RGB space, linking the colour of the current pixel and a reference colour inside the legal RGB cube, for example 50% grey; b) calculating the coordinates of the point where the vector crosses the surface of the legal RGB cube, with the absence of such a crossing point implying that the input colour is legal and no correction is necessary; and c) if correction is necessary, substituting the input illegal colour values by the legal values defined by the crossing point co-ordinates. The invention will now be described by way of example with reference to the SUBSTITUTE SHEET {RULE 26) accompanying drawings, in which:- Figure 1 is a schematic diagram illustrating apparatus performing colour legalisation according to one embodiment of the present invention; Figure 2 is a block diagram illustrating a modification; and Figure 3 is a detailed diagram of apparatus performing colour legalisation according to a further embodiment of this invention. The preferred approach to colour legalisation according to the present invention can be generally be viewed as including the steps of: (i) checking whether each of R,G & B are within legal limits; (ii) deriving a reference point (which may be fixed at mid-grey but which is preferably dependent on the input colour and more particularly the luminance of the input colour); (iii) calculating the correction required to return each of R, G & B to the cube of legal colours and taking the maximum of these corrections; and (iv) cross-fading to the degree determined by this maximum correction between the input colour and the reference point. In one arrangement, all these calculation stages mentioned above can be performed with acceptable resulting picture quality within a 16 bit look up table (LUT). This may for example have as address values 6 bits of luminance signal Y and 5 bits of each Cr and Cb colour difference signals. The LUT can in one arrangement have separate pages for outgoing Y, Cr and Cb as shown in Figure 1 ; in another arrangement Cr and Cb can be multiplexed from a single LUT. The outgoing corrected Y values and the multiplex of corrected Cr, Cb 8 bit values will be the quantized approximation of the necessary values. This is not however a practical defect because the input colours anyway are illegal and must be substituted by different colours. In an alternative arrangement, the LUT is used to derive a correction signal which is added to a YUV signal which is maintained at full resolution (e.g. 30 bits) in a parallel path. This is illustrated in Figure 2, which shows relatively low resolution Y, Cr and Cb signals from a quantizer (20) passing to three LUT's (22, 23 & 24) which derive respective correction signals for addition in adders (26) to the full resolution Y, Cr and Cb signals. The advantage of this approach is that a legal input colour is passed transparently with no loss of resolution. In this modification, the legalisation process is combined with a matrix operation and corrected RGB values are output from the Y:Cr:Cb to R:G:B matrix (28). The example will now be taken of a 17 bit luminance look up table "LUT-Y" with an address "x" combining data of: Y (7 bits), Cr and Cb, (5 bits each). The output of the LUT-Y is a correction signal for addition to the input Y value. There are corresponding and identically addressed Cr and Cb LUT's. From the address x, normalised RGB values are calculated. LUT address splitting and scaling functions are defined: sy, scr & scb, giving normalised values of Y (assumed nominal range is 0.0 to 1.0), Cr and Cb (nominal range is -0.5 to 0.5). Conventional matrix transformation of Y, Cr and Cb values into RGB values (nominal range of R,G and B is assumed to be 0.0 to 1.0) produces:- R( x) = sy(x) + 1.40200*scr(x) G( x) ≡ sy(x) - 0.714137*scr(x) - 0.34414*scb(x) B( x) ≡ sy(x) +1.77200*scb(x) The normalised RGB values are then checked for legality. The Upper (U) and Lower (L) limits of legal RGB values should be set with some realistic headroom, for example 20 mV with reference to the Nominal Black and White Levels of 0 mV and 700 mV. Thus the U and L limits, in normalised values, are set at U ≡ 720/700 = 1.029 L = -20/700 = -0.029 It is then necessary to pick a reference point. This could be chosen as R=0.5, G=0.5, B =0.5, which would allow saturation adjustment together with luminance gain and lift. However, in highlight areas of the picture it is preferable to have a reduction in luminance gain without saturation decrease. Similarly, for lowlights it is desirable to have luminance signal lift without saturation reduction. Hence better subjective results could be achieved if the reference point is adjusted in accordance with the current pixel luminance value. The reference point O(x) is accordingly defined as: where P is gain control factor for the reference point correction. An 0(x) = 0.5 + P *(sy(x) - 0.5) appropriate value for P is -0.9. Calculation is required to check the partial excess factors for the point at which a vector linking the input colour and the reference point O, intersects the legal cube defined by the U and L limits. For the upper limit, the partial excess factors for the RGB channels are; R(x) - U KR v (x) \R(x) ■ ■ 0(x)\ G(x) - U KGu(x) = \G(x) - 0(x)\ B(x) - U KBu(x) \B(x) - 0(x)\ Similarly, for the lower limit: L - R(x) ΛM.L iXf - \R(x) - 0(x)\ L - G(x) KG L (x) = \G(x) - 0(x)\ L - B(x) KB L (x) = \B(x) - 0(x)\ A correction gain K(x) is then determined as the largest of these six values. A value of K(x) which is negative implies that no crossing point exists and correction is therefore unnecessary. Finally, a correction is applied in the form of a cross fade from the input colour to the reference point O(x) with the weighting K(x). The calculated corrected values are designated as RC, GC and BC: RC(x) ≡ R(x) + K(x)*(0(x) - R(x)) GC(x) ≡ G(x) + K(x)*(0(x) - G(x)) BC(x) = B(x) + K(x)*(0(x) - B(x)) For example, if the input colour is super-bright yellow with parameters values as R(x) = 0.993, G(x) = 1.185, B(x) = 0.227, then calculations by the above formulae give: 0(x) = 0.034, K(x) = 0.136 which means that optimal reference point O(x) is almost at the black level and a slight reduction in colour intensity by about 13 % makes the colour legal, so the outgoing corrected colour is legal bright yellow. The corrected RGB values are matrixed to produce, in this case of LUT-Y, a corrected Y value and from this is subtracted the input Y value to produce a Y correction signal: δY(x) =0.297 RC (x) + 0.598 GC(x) + 0.114 BC(x) - sy(x) The calculation of δCr(x) and δCb(x) values in the two remaining LUT's will be analogous to the above and need not be described here. An alternative to employing three LUT's is of course to use one LUT having three times the data word length and multiplexing between appropriate bits of the LUT output. An example of apparatus according to the invention will now be described with reference to Figure 3. The figure shows the block diagram of a system having as its input a parallel, multiplexed, 27 MHz word rate, 4:2:2 colour component signal in accordance with CCIR Recommendation 656. The outputs of the system are gamut-corrected luminance and chrominance data streams. The 10-bit-wide input data is demultiplexed in Y/C demultiplexer (30) into separate luminance and chrominance streams at a 13.5 MHz word rate. The chrominance stream comprises co-sited Cb and Cr samples during alternate clock periods; and the luminance stream alternates between samples which are co-sited with the chrominance samples, and samples which have no corresponding chrominance samples. This chrominance stream, after truncation to 5 bits in truncate block (32) is further demultiplexed in Cb/Cr demultiplexer (34) to Cb and Cr streams, each at a 6.75 MHz rate. These two streams are each inputted into a luminance correction lookup table (36) and a chrominance correction lookup table (38), these lookup tables carrying out the colour gamut legalisation in accordance with the invention. The luminance correction table (36) also receives the demultiplexed luminance data which is delayed in a compensating delay (40) so that luminance samples having co-sited chrominance samples are presented to the table at the same time as the corresponding chrominance samples. The luminance data also passes through truncate block (42) which performs a truncation to 7 bits. The table is programmed to output zero when no correction to the luminance data is required, and to output the corrected luminance value in other cases. An OR-gate (44) detects when the table output is non-zero and causes a switch (46) to route the table output to the system's luminance output terminal. When no correction is required, the table output is zero, the output of OR-gate (44) is low and the switch (46) routes the luminance from the compensating delay (40) directly to the output. The chrominance correction table (38) receives from a latch (48) only those luminance samples which are co-sited with its chrominance inputs. The latch also carries out a further truncation of the luminance data to 6 bits. An additional input to the table (38) controls whether its output corresponds to Cb or Cr data. A second OR-gate (50) controls a second switch (52) which routes either corrected chrominance from the table (38) or uncorrected chrominance appropriately delayed in a compensating delay (54) to match the corrected chrominance and the luminance. As Figure 3 shows, the inputs to the look-up tables have reduced word size so as to enable readily available and thus less expensive components to be used. The luminance table uses seven bits of luminance and ten bits of chrominance at its input and delivers an eight-bit-wide output. The chrominance table has only six bits of input luminance so as to allow for the bit which selects Cb or Cr output. These word sizes have been found to be satisfactory for general use although it would of course be possible to use higher resolution in critical applications. A further improvement to the system shown would be to include an interpolator to increase the chrominance sampling rate at the input to luminance correction table to 13.5 MHz. Apparatus according to this invention may take the form of a discrete colour legaliser; alternately, circuitry according to this invention may be provided within apparatus performing a related function, such as a colour decoder. It will also be useful in certain circumstances to provide a process according to this invention as an option in video signal processing apparatus. Thus in a digital video effects system or other apparatus where an operator has the opportunity to create illegal colours, it will be helpful to provide a routine which identifies and then replaces any colour which is illegal. This "replacement" may be temporary in the sense that the operator will be given a display of the corrected colours so that he may judge the effect artistically. The uncorrected signal may nonetheless be output. It should be understood that this invention has been described by way of example only and that a wide variety of modifications are possible without departing from the claimed scope of the invention.

Claims: CLAIMS 1. A colour legalisation process wherein an input colour lying outside the volume which defines legal colours in a colour space is replaced by an output colour derived by determining the intersection with the boundary of said volume of a straight line extending between the input colour point in the colour space and a reference point on a reference line in the colour space which extends between reference black and reference white. 2. A colour legalisation process according to Claim 1 , wherein the reference point on said reference line is determined by the luminance of the input colour. 3. A colour legalisation process according to Claim 1 , wherein the reference point on said reference line corresponds with the colour mid- grey. 4. A colour legalisation process, comprising the steps of: a) calculating the 3D vector in RGB space, linking the colour of the current pixel and a reference colour inside the legal RGB cube; b) calculating the coordinates of the point where the vector crosses the surface of the legal RGB cube, with the absence of such a crossing point implying that the input colour is legal and no correction is necessary; and c) if correction is necessary, substituting the input illegal colour values by the legal values defined by the crossing point co-ordinates. 5. Colour legalisation apparatus comprising a digital video input; a digital video output and processing means wherein an input colour lying outside the volume which defines legal colours in a colour space is replaced by an output colour derived by determining the intersection with the boundary of said volume of a straight line extending between the input colour point in the colour space and a reference point on a reference line in the colour space which extends between reference black and reference white. 6. Apparatus according to Claim 5, wherein said processing means comprises a look up table. 7. Apparatus according to Claim 6, wherein each look up table provides a corrected component output according to an address derived from a luminance input and two colour difference inputs.

Inventors: STEINBERG AVIGDOR, STEINBERG, AVIGDOR
Applicants: SNELL & WILCOX LTD, STEINBERG AVIGDOR, SNELL & WILCOX LIMITED, STEINBERG, AVIGDOR
Application year: 1998
Main classification: H04N1
IPC codes: G06T1, H04N1, H04N9