# Patent

## Title
Methods and systems for computing an alpha channel value

## Abstract

Methods and systems for computing an alpha channel value are provided. In one embodiment, a set of parameters is obtained based on an effect (transformation) to be applied to a source image. A value is also obtained that defines a uniform width of an area that borders at least one boundary of the transformed source image in the target image. For a target image pixel coordinate in the area, a corresponding source pixel coordinate is computed that is within another non-uniform area bordering the source image. An alpha channel value defining semi-transparency of a pixel associated with the target image pixel coordinate is computed as a function of a location of the corresponding source pixel coordinate in the another area bordering the source image.

## Background
FIELD
The following relates to computing alpha channel values for use in defining the boundaries of a transformed digital video or digital image.
BACKGROUND
In digital video, an alpha channel is used to define the transparency of the video when that video is mixed with a background image or background video. For example, a source video may undergo a transformation in video production equipment to produce an effect (e.g. the shrinking and/or rotating of the source video), and then the resultant transformed source video may be layered on top of a background image or background video. The alpha channel defines the transparency of the transformed source video when it is layered on top of the background image or background video. For example, an alpha channel can be used to make the transformed source video semi-transparent.
A shaping alpha is an alpha channel that defines the boundaries of the transformed source video when the transformed source video is layered on top of a background image or video. In particular, it has been found to be aesthetically pleasing to a human eye to have the transformed source video fade into the background image or background video at the boundaries of the transformed source video. This may be achieved through the use of a shaping alpha that defines the semi-transparency of the transformed source video at or around its boundaries.
Methods and systems for computing the shaping alpha in video production equipment are desired.
SUMMARY
Methods and systems for computing an alpha channel value are provided below.
In one embodiment, a set of parameters is obtained based on an effect (transformation) to be applied to a source image. A value is also obtained that defines a uniform width of an area that borders at least one boundary of the transformed source image in the target image. For a target image pixel coordinate in the area, a corresponding source pixel coordinate is computed that is within another non-uniform area bordering the source image. An alpha channel value defining semi-transparency of a pixel associated with the target image pixel coordinate is computed as a function of a location of the corresponding source pixel coordinate in the another area bordering the source image.
More particularly, in one example embodiment, the method is performed by a computational device, and the method is performed as part of transforming a source digital image into a digital object in a target digital image. The source digital image and the target digital image each comprise a plurality of pixels. The method comprises the following steps: (i) receiving an indication of an effect to be applied to the source digital image; (ii) obtaining a set of parameters based on the indication of the effect; (iii) obtaining a value defining a width of an area that borders at least one boundary of the digital object in the target digital image; the width of the area is uniform along the at least one boundary of the digital object; (iv) for a pixel coordinate (xt,yt) of the target digital image that is within the area that borders the at least one boundary of the digital object, computing, using the pixel coordinate (xt,yt) of the target digital image and at least some of the parameters, a corresponding source pixel coordinate (xs,ys) that is within another area bordering the source digital image; the another area has a width that is non-uniform along a boundary of the source digital image; and (v) computing an alpha channel value defining semi-transparency of a pixel associated with the pixel coordinate (xt,yt) of the target digital image. The alpha channel value is computed as a function of a location of the corresponding source pixel coordinate (xs,ys) in the another area bordering the source digital image.
A digital video effects (DVE) device for performing the methods herein is also disclosed. Also disclosed is a computer readable storage medium having instructions stored thereon that, when executed, cause a computational device to perform the methods herein.
For example, in another embodiment, there is provided a digital video effects (DVE) device for transforming a source digital image in source video into a digital object in a target digital image in target video, where the source digital image and the target digital image each comprise a plurality of pixels. The DVE device comprises memory to store the source digital image when received by the DVE, and to store a value defining a width of an area that borders at least one boundary of the digital object in the target digital image. The width of the area is uniform along the at least one boundary of the digital object. The DVE device also comprises a user interface to receive an indication of an effect to be applied to the source digital image. The DVE device also comprises circuitry to perform operations including: obtaining a set of parameters based on the indication of the effect; for a pixel coordinate (xt,yt) of the target digital image that is within the area that borders the at least one boundary of the digital object, computing, using the pixel coordinate (xt,yt) of the target digital image and at least some of the parameters, a corresponding source pixel coordinate (xs,ys) that is within another area bordering the source digital image, the another area having a width that is non-uniform along a boundary of the source digital image; and computing an alpha channel value defining semi-transparency of a pixel associated with the pixel coordinate (xt,yt) of the target digital image. The alpha channel value is computed as a function of a location of the corresponding source pixel coordinate (xs,ys) in the another area bordering the source digital image.
In another embodiment, there is provided a computer readable storage medium having stored thereon computer executable instructions for transforming a source digital image into a digital object in a target digital image, where the source digital image and the target digital image each comprise a plurality of pixels. The computer executable instructions, when executed by a computational device, cause the computational device to perform operations comprising: receiving and storing the source digital image in a memory; receiving from a user interface an indication of an effect to be applied to the source digital image; obtaining a set of parameters based on the indication of the effect; obtaining a value defining a width of an area that borders at least one boundary of the digital object in the target digital image, where the width of the area is uniform along the at least one boundary of the digital object; for a pixel coordinate (xt,yt) of the target digital image that is within the area that borders the at least one boundary of the digital object, computing, using the pixel coordinate (xt,yt) of the target digital image and at least some of the parameters, a corresponding source pixel coordinate (xs,ys) that is within another area bordering the source digital image, the another area having a width that is non-uniform along a boundary of the source digital image; and computing an alpha channel value defining semi-transparency of a pixel associated with the pixel coordinate (xt,yt) of the target digital image. The alpha channel value is computed as a function of a location of the corresponding source pixel coordinate (xs,ys) in the another area bordering the source digital image.



BRIEF DESCRIPTION
Embodiments of the present application will be described, by way of example only, with reference to the accompanying figures wherein:
FIG. 1 illustrates a picture portion of a digital image of a digital video;
FIG. 2 illustrates a process of layering four video images from bottom to top;
FIG. 3 illustrates a video image undergoing a sequence of 3-D manipulations;
FIG. 4 illustrates forward mapping and inverse mapping;
FIG. 5 illustrates a system for performing digital video effects (DVE) and a mixer for performing video layering;
FIG. 6 illustrates a magnified portion of a target image around a left boundary;
FIG. 7 illustrates an example implementation of mixer;
FIG. 8 illustrates an example implementation of a DVE device;
FIG. 9 illustrates a source image with a softness area of uniform width bordering the boundaries of the source image;
FIG. 10 illustrates an example mapping of target pixel coordinates to source pixel coordinates;
FIGS. 11 and 12 illustrate areas of non-uniform softness;
FIG. 13 illustrates an example anti-aliasing technique;
FIG. 14 illustrates the results of a post-filtering image processing technique;
FIG. 15 illustrates a source image with a non-uniform softness area corresponding to a target image having a uniform softness area;
FIG. 16 illustrates mapping relationships between source boundary lines and target boundary lines, as well as mapping relationships between source cropping lines and target cropping lines;
FIG. 17 illustrates a source image cropped by the left, right, top, and bottom cropping boundary lines;
FIG. 18 illustrates the same intercept change being applied to a right edge boundary and a bottom edge boundary, but with each intercept change resulting in a different spatial margin;
FIGS. 19 to 21 illustrate mappings of target pixel coordinates to corresponding source pixel coordinates;
FIG. 22 illustrates the meaning of inward ramping versus outward ramping;
FIG. 23 illustrates some pixel coordinates mapped from a target image to a source image;
FIG. 24 illustrates another example DVE device;
FIG. 25 illustrates an example perspective transform engine;
FIG. 26 illustrates an example shaping alpha generator;
FIG. 27 illustrates an implementation of an arithmetic minimum fuzzy logic AND;
FIG. 28 illustrates an implementation of an arithmetic multiplication fuzzy logic AND;
FIGS. 29 to 32 illustrate results showing uniform softness;
FIG. 33 illustrates another example DVE device;
FIG. 34 illustrates the effect of the initial offset value;
FIG. 35 illustrates a full-sized picture area with softness outside the picture area;
FIG. 36 illustrates the problem of extreme protruding corners;
FIG. 37 illustrates the result when an initial offset value is applied to suppress protruding corners;
FIG. 38 illustrates a shaping alpha clipped to form a shaping alpha with different global transparency;
FIG. 39 illustrates a shaping alpha modified via arithmetic multiplication to form a shaping alpha with different global transparency;
FIG. 40 illustrates an example shaping alpha generator further modified to apply an initial offset value effect and a global transparency effect;
FIG. 41 illustrates mapping of a pixel coordinate from a target image to a source image;
FIG. 42 illustrates an example method of computing an alpha channel value; and
FIG. 43 illustrates another mapping of a pixel coordinate from a target image to a source image.



Like reference numerals are used in different figures to denote similar elements.
DETAILED DESCRIPTION
For illustrative purposes, specific example embodiments will now be explained in greater detail below in conjunction with the figures.
The embodiments set forth herein represent information sufficient to practice the claimed subject matter and illustrate the best way of practicing such subject matter. Upon reading the following description in light of the accompanying figures, those of sufficient skill will understand the concepts of the claimed subject matter and will recognize applications of these concepts not particularly addressed herein. It should be understood that these concepts and applications fall within the scope of the disclosure and the accompanying claims.
Moreover, it will be appreciated that any module, component, or device exemplified herein that executes instructions may include or otherwise have access to a non-transitory computer/processor readable storage medium or media for storage of information, such as computer/processor readable instructions, data structures, program modules, and/or other data. A non-exhaustive list of examples of non-transitory computer/processor readable storage media includes magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, optical disks such as CD-ROM, DVDs, Blu-ray, or other optical storage, volatile and non-volatile, removable and non-removable media implemented in any method or technology, RAM, ROM, EEPROM, flash memory or other memory technology. Any such non-transitory computer/processor storage media may be part of a device or accessible or connectable thereto. Any application or module herein described may be implemented using computer/processor readable/executable instructions that may be stored or otherwise held by such non-transitory computer/processor readable storage media.
Turning now to the figures, some specific example embodiments will be described.
Digital video comprises a series of digital images displayed in rapid succession. Each digital image includes a picture portion, which is what is displayed, and typically some ancillary information (e.g. audio, metadata, etc.). FIG. 1 illustrates the picture portion 102 of a digital image of a digital video. The picture portion 102 comprises an (m+1)×(n+1) grid of pixels, where each pixel has a location coordinate (x,y) on the picture 102 and a corresponding pixel value Y(x,y). The pixel value Y(x,y) is the visual information of the pixel at coordinate (x,y). For example, pixel value Y(x,y) may be the information designating what colour is to be displayed by that pixel and/or the luminance of the pixel. The notation Y(x,y) is used herein to designate the pixel value. It will be appreciated that the pixel value Y(x,y) may include multiple components, for example, the following 3 components: either a set of three numbers respectively representing red, blue, and green (RBG), or a set of three numbers respectively representing luminance, colour difference of blue, and colour difference of red. For example, Y(x,y) may comprise three separate numbers: one representing the luminance of the pixel, and two representing colour differences. When “pixel value Y(x,y)” is used herein, it will be understood to encompass all of the different components that make up the pixel value (e.g. the luminance and the colour difference values), unless indicated otherwise. When an operation is performed on a pixel value Y(x,y) (e.g. Y(x,y) is multiplied by a shaping alpha value α), it will be understood that the operation is being performed on each component of the pixel value (e.g. the luminance component and each colour difference value component).
FIG. 1 is somewhat simplified for ease of explanation. For example, it could be the case in some implementations that the coordinates (x,y) may not start at (0,0). Also, although the word “pixel” is used herein, what is meant more generally is an addressable element of a display device.
Digital video may be manipulated. One type of manipulation is video layering. Video layering may also be referred to as video compositing or video keying in production switchers. Video layering is a process which combines a sequence of separate video sources into a single video. For example, FIG. 2 illustrates a process of layering four video images from bottom to top. The four layers (bottom, 2nd, 3rd, and top in FIG. 2) each represent a respective video image and are layered to form a composite video image.
A digital video may also (or instead) be manipulated by a digital video effects (DVE) device to produce a digital video effect such as resizing, rotation, translation, and/or distortion of the video. A “DVE device” is sometimes also referred to as a “DVE system” or just a “DVE”. Often, a video source undergoing digital video effects in a DVE device is further layered over other video images using video layering.
A digital video effect is a visual effect which provides comprehensive video image manipulations in 3-D space, primarily dealing with resizing, rotation, translation or distortion of a source visual image. For example, FIG. 3 illustrates a process of a video image undergoing a sequence of 3-D manipulations, specifically, resizing, followed by y-rotation, followed by z-rotation.
One way to perform the digital video effect in the DVE device is to apply a geometric transformation (or mapping) to each digital image of the digital video. Such geometric transformations are also referred to as geometrical coordinates mapping. A geometrical mapping is called forward mapping if coordinates of a source video image are transformed into coordinates of a target video image. Conversely, a geometrical mapping is called an inverse mapping if a transform starts from a target video image and ends at a source image. FIG. 4 illustrates forward mapping and inverse mapping. As shown in FIG. 4, the center of the first block 111 in the source image 112 is mapped to a place between blocks in a target image 114. This is forward mapping. Conversely, the top boundary edge of the fourth target block 113 in the target image 114 is mapped onto a top boundary edge in the source image 112. This is inverse mapping. In the embodiments described with reference to the figures below, inverse mapping is used. Specifically, each coordinate of a transformed video image (target image) is mapped to a corresponding coordinate in the source video image.
With reference now to FIG. 5, there is illustrated a system 120 for performing DVE and a mixer 118 for performing video layering. As discussed in more detail below, the DVE device 120 and the mixer 118 may be implemented, for example, by one or more field programmable gate arrays (FPGAs) and/or one or more application specific integrated circuits (ASICs) and/or one or more processors in a computational device (e.g. a central processing unit, a graphics processing unit, and/or a general-purpose computing on graphics processing units).
In operation, the DVE device 120 receives as an input a source video Vsource comprising a series of source images (source image 122 being illustrated). The DVE device 120 outputs the manipulated video, which will be referred to as the “target video” Vtarget. The target video Vtarget comprises a series of target images (target image 124 being illustrated). The mixer 118 layers the target video Vtarget on top of a background video or image Vbackground to produce an output video Vout.
When the source video Vsource undergoes manipulation in the DVE device 120, a shaping alpha αshp may also be created. The shaping alpha αshp is an alpha channel associated with the video that defines the resultant boundaries of the transformed source video in the target video Vtarget. The shaping alpha αshp is particularly useful for situations like that illustrated in FIG. 5, in which the target video Vtarget is layered on top of a background video or image Vbackground. Specifically, the shaping alpha αshp may allow for a smooth transition between the boundaries of the transformed source video and the background Vbackground.
As shown in FIG. 5, a source video Vsource has left, right, top, and bottom boundaries, respectively denoted as L, R, T, and B. In the illustrated embodiment, the source video Vsource undergoes a manipulation by the DVE device 120 to generate the target video Vtarget. The manipulation illustrated involves moving the source video Vsource farther away from viewers and rotation around the z-axis in the x-y plane. There is an area O in the target video Vtarget that is outside the original source video Vsource. The DVE device 120 can set each target video pixel value Y(x,y) in area O to have a value equal to the value of the closest boundary pixel (i.e. the closest pixel on a boundary L, R, T, or B), although this is implementation specific.
The source video Vsource is manipulated on an image-by-image basis, and so the target video Vtarget is created on an image-by-image basis and is layered on top of the background on an image-by-image basis. Therefore, in the remaining discussion, “source image” and “target image” will be used, it being understood that in the context of digital video, each “image” is a video image (e.g. a frame or field) of a digital video. Also, in the following discussion, “background image” will be used, it being understood that this may be a stand-alone image or a video image (e.g. frame or field) of a background digital video.
Therefore, for each source image 122, the DVE device 120 creates a corresponding target image 124 that includes an object 123 representing the transformed source image 122. In general, some of the pixels of the target image 124 will be within source bounds (i.e. within object 123) and others will be outside source bounds (i.e. in area O). This scenario is illustrated in FIG. 5, it being understood that this is a generality. It could be the case, for example, that the object 123 encompasses all of target image 124.
For each target image 124, the DVE device 120 also creates a shaping alpha αshp. The shaping alpha αshp comprises a plurality of values, each one of the values of the shaping alpha αshp corresponding to a respective pixel in the target image 124. Each one of the shaping alpha values of the shaping alpha αshp will therefore be denoted as αshp(xt,yt). Generally, each value αshp(xt,yt) in the shaping alpha will range from zero to one (i.e. 0≦αshp (xt,yt)≦1). A value of zero indicates that the corresponding target image pixel is out of bounds of the source image (i.e. the pixel of the target image 124 is in area O), and therefore when the target image 124 is layered on top of a background image 126, that pixel of the target image will be completely transparent, such that only the background 126 is seen. On the other hand, a shaping alpha value αshp(xt,yt) of one indicates that the corresponding target image pixel is within the bounds of the source image (i.e. the pixel of the target image 124 is within the area defined by L, R, T, and B), and therefore when the target image 124 is layered on top of the background 126, that pixel of the target image will be completely opaque in the sense that it will not show any of the background image and only show the target image. A shaping alpha value αshp(xt,yt) between zero and one indicates a boundary condition (a border area of the object 123) in which partial transparency (semi-transparency) is present to allow for a smooth transition between the edge of the object 123 and the background image 126. The closer the shaping alpha value αshp (xt,yt) is to 1, the more the object 123 will show, and the closer the shaping alpha value is to zero, the more the background image 126 will show. By using the shaping alpha αshp, the transformed source image (i.e. the object 123) may be made to fade out gradually into the background image 126 at edge boundaries L, R, T, and B, which is typically more aesthetically pleasing to a human eye.
The shaping alpha αshp corresponding to the target image 124 is shown as 128 in FIG. 5. It may also be thought of as an “image” in the sense that, as explained above, it has an alpha value αshp(xt,yt) associated with each pixel (xt,yt) in the target image 124. As explained above, each alpha value αshp(xt,yt) in the shaping alpha αshp is either zero or one or some number in between. The shaping alpha αshp defines all boundaries of the target object 123 (i.e. of the manipulated source video) and helps layering the target image 124 on top of the background image 126. In FIG. 5, the black area of the shaping alpha 128 represents shaping alpha values of zero (outside the source bounds), the white area of the shaping alpha 128 represents shaping alpha values of one (inside the source bounds), and the cross-hatched area 127 of the shaping alpha 128 represents shaping alpha values between zero and one (defining semi-transparency of the boundaries of the transformed source image).
As a simple example to further help illustrate the principle of the shaping alpha αshp, consider FIG. 6, which illustrates a magnified portion of target image 124 around left boundary L, and which shows each pixel in the magnified portion. Each pixel has a coordinate (x,y) (e.g. (102,74)) and a corresponding pixel value Y(xt,yt) (e.g. Y(102,74)). Also shown for each pixel is the corresponding shaping alpha value αshp(x,y). The bold lines represent the boundary L. In this example, the boundary L is two pixels in width, and the shaping alpha values on the boundary L are between zero and one. This will cause the pixels on the boundary L to be semi-transparent, so that some of the background image 126 at the boundary L will be seen, when the background image 126 is layered underneath the target image 124. This two-pixel area/range in which the shaping alpha αshp values are between zero and one is referred to as the “softness” range (or softness zone or softness margin). The pixels that are not on the boundary L (i.e. not in the softness range), will either be completely transparent and therefore show only the background image 126, or completely opaque so that only the target image 124 is seen and not the background image 126.
For example, target image pixel (103,74) is outside the boundary L and specifically in area O of the target image 124. Therefore, this pixel has a corresponding shaping alpha value of zero (αshp(103,74)=0). This means that this pixel will be completely transparent in that it will only show the background image 126 at this pixel location when the background image 126 is layered underneath the target image 124. That is, no matter what the target image pixel value Y(103,74) is, it will not be displayed. Instead, only the pixel value of the background image 126 layered underneath the target image 124 will be displayed. On the other hand, target image pixel (106,74) is within the boundaries of the source image and has a corresponding shaping alpha value of one (αshp(106,74)=1). This means that this pixel will be completely opaque in that it will only show the target image 124 at this pixel location when the background image 126 is layered underneath the target image 124. That is, Y(106,74) will be displayed with no corresponding background image pixel being shown. Target image pixel (105,74) is on the boundary L (specifically in the softness range) and therefore has a corresponding shaping alpha value that is between zero and one and specifically 0.8 in this example (αshp(105,74)=0.8). This means that this pixel of the target image 124 will have semi-transparency in that it will show some of the background image 126 at this pixel location when the background image 126 is layered underneath the target image 124. That is, no matter what the target image pixel value Y(105,74), the pixel value of the background image 126 layered underneath the target image 124 at this point will still also be partially displayed. Similarly, target image pixel (104,74) is also on the boundary L and therefore has a corresponding shaping alpha value that is between zero and one and specifically 0.5 in this example (αshp(104,74)=0.5). This means that this pixel of the target image 124 will also have semi-transparency in that it will show some of the background image 126 at this pixel location when the background image 126 is layered underneath the target image 124. Since 0.5 is closer to 0 than 0.8, the pixel value Y(104,74) will be more transparent than the pixel value Y(105,74). As mentioned above, a primary purpose of the shaping alpha is to cause the transformed source image (i.e. the object 123 in the target image 124) to fade out gradually into the background image 126 at edge boundaries of the object 123 (e.g. at boundary L), which is typically more aesthetically pleasing to a human eye.
One way to apply the shaping alpha αshp is to multiply each pixel value Y(xt,yt) in the target image with its corresponding shaping alpha value αshp(xt,yt). The examples illustrated herein use this method, which is one reason why αshp(xt,yt)=0 is used to denote full transparency of the target image pixel and αshp(xt,yt)=1 is used to denote full opaqueness of the target image pixel. Specifically, when αshp(xt,yt)=0, then Y(xt,yt)×αshp(xt,yt)=Y(xt,yt)×0=0, which means that the target image pixel displays no value and hence is fully transparent, and when αshp(xt,yt)=1, then Y(xt,yt)×αshp(xt,yt)=Y(xt,yt)×1=Y(xt,yt), which means the target image pixel displays its full value.
FIG. 7 illustrates an example implementation of mixer 118. The example shown in FIG. 7 includes two input ports labelled Port A and Port B, multipliers 142 and 144, adder 146, and an output port 147. The input and output ports may be implemented, for example, by addressable memory (e.g. the target image 124 may be fed to Port A by writing the target image 124 to a designated memory location). The multipliers and adders may be implemented, for example, using digital logic multiplying and adding circuits (e.g. in the case of a multiplier a digital logic circuit that receives two digital inputs and multiplies them together, and in the case of an adder a digital logic circuit that received two digital inputs and adds them together). The mixer 118 also includes a computational block 143 for computing a complementary shaping alpha 1−αshp. This may be implemented, for example, by a digital logic circuit that subtracts the input value αshp (x,y) from the value “1” for each shaping alpha value αshp(x,y).
In operation, the mixer 118 multiplies each pixel value Y(xt,yt) in the target image with its corresponding shaping alpha value αshp(x,y), as per above. As shown in FIG. 7, the complementary shaping alpha value, that is 1−αshp, is applied to the background image 126, so that the background image pixels are completely transparent when the corresponding target image pixels are completely opaque, and vice versa, and so that a complementary amount of semi-transparency is applied to each background image pixel corresponding to a semi-transparent target image pixel.
More specifically, with reference to FIG. 7, the “Port A” receives two inputs: the target image 124 and the shaping alpha value αshp, and the “Port B” receives a single input: the background image 126. The shaping alpha value αshp is applied to the target image 124 by multiplying the target image 124 with the shaping alpha value αshp, as at multiplier 142. More specifically, each pixel value Y(xt,yt) in the target image is multiplied with its corresponding shaping alpha value αshp(xt,yt). The complementary shaping alpha value 1−αshp is applied to the background image 126 in the same manner, as at multiplier 144. Then the two images are added, as at adder 146, to form the layered output image. Thus, it can be said that the mixer 118 in this example embodiment implements the function Omix=Aα+B*(1−α), where A is the target video and B is the background. This is referred to as A/B mixing. The background B may be, for example, a solid video picture or a composite video produced from multiple layered videos.
Returning to FIG. 5, the DVE device 120 receives source image 122 as an input and produces as an output the target image 124 and its corresponding shaping alpha αshp. FIG. 8 illustrates an example implementation of DVE device 120.
As shown in FIG. 8, the example implementation of the DVE device 120 includes a pre-filter 202, memory 204, a raster-scan counter 206, a perspective transform engine 208, a CPU 212, a user interface 214, an interpolator 216, an address generator 218, and a shaping alpha generator 220. The pre-filter 202 may be implemented, for example, by a digital filter implemented by a general processing device (e.g. a processor) and/or a specific integrated circuit. The raster-scan counter 206 may be implemented, for example, by (or using) a digital counter circuit. The perspective transform engine 208, interpolator 216, address generator 218, and shaping alpha generator 220 may each be implemented, for example, using a general processing device (e.g. processor) and/or a specific integrated circuit configured to perform the specific operations discussed herein. The user interface 214 may be implemented, for example, using a graphical user interface and/or knobs and/or keys and/or other physical devices that allow a user to interface with the DVE device 120 and input commands.
In operation, and as shown in FIG. 8, the source image 122 may first be subject to the pre-filtering 202 (e.g. to reduce alias artifacts caused by down-sampling), and is then stored in memory 204. The raster-scan counter 206 can be used to write the source image 122 into the memory 204 on a pixel-by-pixel basis.
The corresponding target image 124 is then also generated on a pixel-by-pixel basis as follows.
Assume the picture portion of the target image 124 comprises an (m+1)×(n+1) grid of pixels, where each target pixel has a location (xt,yt) and an associated pixel value Yt(xt,yt). The raster-scan counter 206 begins at (xt,yt)=(0,0) and counts up to (xt,yt)=(m,n). That is, the raster-scan counter 206 generates each geometrical target pixel coordinate (xt,yt). For each target pixel coordinate (xt,yt), the target coordinate values xt and yt are input into the perspective transform engine 208, which computes the corresponding source pixel coordinate (xs,ys) of the source image 122 stored in memory 204. The source pixel coordinate (xs,ys) corresponding to the target pixel coordinate (xt,yt) is a function of the manipulation being applied by the DVE device 120 and is guided by parameters 210. For example, in one embodiment, to obtain the corresponding x-coordinate of the source pixel (i.e. xs) for a given target pixel coordinate (xt,yt), the following computation is performed by the perspective transform engine 208:




  
    
      
        
          x
          s
        
        =
        
          
            T
            d
          
          +
          
            
              
                (
                
                  
                    
                      T
                      a
                    
                    ⁢
                    
                      x
                      t
                    
                  
                  +
                  
                    
                      T
                      b
                    
                    ⁢
                    
                      y
                      t
                    
                  
                  +
                  
                    
                      T
                      c
                    
                    ⁢
                    f
                  
                
                )
              
              ⁢
              
                P
                d
              
            
            
              
                
                  P
                  a
                
                ⁢
                
                  x
                  t
                
              
              +
              
                
                  P
                  b
                
                ⁢
                
                  y
                  t
                
              
              +
              
                
                  P
                  c
                
                ⁢
                f
              
            
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          1
        
        )
      
    
  




To obtain the corresponding y-coordinate of the source pixel (i.e. ys) for a given target pixel (xt,yt), the following computation is performed by the perspective transform engine 208:





  
    
      
        
          y
          s
        
        =
        
          
            T
            h
          
          +
          
            
              
                
                  (
                  
                    
                      
                        T
                        e
                      
                      ⁢
                      
                        x
                        t
                      
                    
                    +
                    
                      
                        T
                        f
                      
                      ⁢
                      
                        y
                        t
                      
                    
                    +
                    
                      
                        T
                        g
                      
                      ⁢
                      f
                    
                  
                  )
                
                ⁢
                
                  P
                  d
                
              
              
                
                  
                    P
                    a
                  
                  ⁢
                  
                    x
                    t
                  
                
                +
                
                  
                    P
                    b
                  
                  ⁢
                  
                    y
                    t
                  
                
                +
                
                  
                    P
                    c
                  
                  ⁢
                  f
                
              
            
            .
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          2
        
        )
      
    
  




Equations 1 and 2 are based on mapping of a target pixel coordinate to a corresponding source pixel coordinate using the following inverse mapping function (geometric transformation):





  
    
      
        
          
            M
            
              -
              1
            
          
          =
          
            [
            
              
                
                  
                    T
                    a
                  
                
                
                  
                    T
                    b
                  
                
                
                  
                    T
                    c
                  
                
                
                  
                    T
                    d
                  
                
              
              
                
                  
                    T
                    e
                  
                
                
                  
                    T
                    f
                  
                
                
                  
                    T
                    g
                  
                
                
                  
                    T
                    h
                  
                
              
              
                
                  
                    P
                    a
                  
                
                
                  
                    P
                    b
                  
                
                
                  
                    P
                    c
                  
                
                
                  
                    -
                    
                      P
                      d
                    
                  
                
              
              
                
                  0
                
                
                  0
                
                
                  0
                
                
                  1
                
              
            
            ]
          
        
        ,
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          3
        
        )
      
    
  




where M−1 is a homogeneous matrix, inverse to a forward mapping M, where a 4×4 homogeneous matrix represents a geometrical transformation. The value f represents a focus distance between the viewer and the target screen.

In this example, Ta, Tb, Tc, Td, Te, Tf, Tg, Th, Pa, Pb, Pc, Pd, and f are the parameters 210, and their values are set by the CPU 212 based on the specific effect requested by the user via the user interface 214. For example, if a user indicated via the user interface 214 that it was desired to rotate the image by 15 degrees and shrink the image to half its size, then the user interface 214 would electronically forward this request to the CPU 212, which would compute the corresponding values of the parameters 210, and forward these specific parameter values 210 to the perspective transform engine 208 via a parameter bus.
One way to compute the parameters is as follows. A matrix M=Mt×My×Mz is computed where




  
    
      M
      t
    
    =
    
      [
      
        
          
            1
          
          
            0
          
          
            0
          
          
            x
          
        
        
          
            0
          
          
            1
          
          
            0
          
          
            y
          
        
        
          
            0
          
          
            0
          
          
            1
          
          
            z
          
        
        
          
            0
          
          
            0
          
          
            0
          
          
            1
          
        
      
      ]
    
  
  ,




which represents the translation or shift in 3D space by (x, y, z), where





  
    
      M
      y
    
    =
    
      [
      
        
          
            
              cos
              ⁢
              
                
              
              ⁢
              β
            
          
          
            0
          
          
            
              
                -
                sin
              
              ⁢
              
                
              
              ⁢
              β
            
          
          
            0
          
        
        
          
            0
          
          
            1
          
          
            0
          
          
            0
          
        
        
          
            
              sin
              ⁢
              
                
              
              ⁢
              β
            
          
          
            0
          
          
            
              cos
              ⁢
              
                
              
              ⁢
              β
            
          
          
            0
          
        
        
          
            0
          
          
            0
          
          
            0
          
          
            1
          
        
      
      ]
    
  
  ,




which represents the rotation at angle β around the y-axis, and where





  
    
      M
      z
    
    =
    
      [
      
        
          
            
              cos
              ⁢
              
                
              
              ⁢
              φ
            
          
          
            
              
                -
                sin
              
              ⁢
              
                
              
              ⁢
              φ
            
          
          
            0
          
          
            0
          
        
        
          
            
              sin
              ⁢
              
                
              
              ⁢
              φ
            
          
          
            
              cos
              ⁢
              
                
              
              ⁢
              φ
            
          
          
            0
          
          
            0
          
        
        
          
            0
          
          
            0
          
          
            1
          
          
            0
          
        
        
          
            0
          
          
            0
          
          
            0
          
          
            1
          
        
      
      ]
    
  
  ,




which represents a rotation at angle φ around the z-axis. M−1 is then the inverse of M. Therefore, for a given effect, the translation and rotation angles around the y and z axis are determined. Then, M=Mt×My×Mz is computed, which gives the effect of rotation around the z-axis first, then rotation around the y-axis, and then translation. Either in parallel to computing M (or from M), the inverse matrix M−1 is computed to determine parameters Ta, Tb, Tc, Td, Te, Tf, Tg, Th, Pa, Pb, Pc, Pd. Also, the focus f is determined, which is representative of the rotation around the x-axis. Then, Equations (1) and (2) above may be computed for each target pixel coordinate (xt,yt).

Equations (1) and (2) relate to the parameters from matrix M−1 as follows. Subjected to perspective projection, the depth of a point in 3-D space may be expressed in terms of a target pixel coordinate (xt,yt) such that




  
    
      z
      _
    
    =
    
      
        (
        
          z
          f
        
        )
      
      =
      
        
          P
          d
        
        
          
            
              P
              a
            
            ⁢
            
              x
              t
            
          
          +
          
            
              P
              b
            
            ⁢
            
              y
              t
            
          
          +
          
            
              P
              c
            
            ⁢
            f
          
        
      
    
  
  ,




where z is unified depth in terms of focus. The inverse mapped x-coordinate in a source image space is then expressed in terms of target coordinates such that xs=z(Taxt+Tbyt+Tc f)+Td, which is equal to Equation (1). The inverse mapped y-coordinate in a source image space is expressed in terms of target coordinates such that ys=z(Text+Tfyt+Tgf)+Th, which is equal to Equation (2).

Equations (1) and (2) may also be rearranged to instead be in terms of unified source coordinates




  
    
      x
      _
    
    s
  
  ⁢
  
    
  
  ⁢
  and
  ⁢
  
    
  
  ⁢
  
    
      y
      _
    
    s
  
  ⁢
  
    :
  
  ⁢
  
    
  
  ⁢
  
    {
    
      
        
          
            
              
                
                  x
                  _
                
                s
              
              =
              
                
                  
                    
                      x
                      s
                    
                    -
                    
                      T
                      d
                    
                  
                  
                    P
                    d
                  
                
                =
                
                  
                    
                      
                        T
                        a
                      
                      ⁢
                      
                        x
                        t
                      
                    
                    +
                    
                      
                        T
                        b
                      
                      ⁢
                      
                        y
                        t
                      
                    
                    +
                    
                      
                        T
                        c
                      
                      ⁢
                      f
                    
                  
                  
                    
                      
                        P
                        a
                      
                      ⁢
                      
                        x
                        t
                      
                    
                    +
                    
                      
                        P
                        b
                      
                      ⁢
                      
                        y
                        t
                      
                    
                    +
                    
                      
                        P
                        c
                      
                      ⁢
                      f
                    
                  
                
              
            
          
        
        
          
            
              
                
                  y
                  _
                
                s
              
              =
              
                
                  
                    
                      y
                      s
                    
                    -
                    
                      T
                      h
                    
                  
                  
                    P
                    d
                  
                
                =
                
                  
                    
                      
                        T
                        e
                      
                      ⁢
                      
                        x
                        t
                      
                    
                    +
                    
                      
                        T
                        f
                      
                      ⁢
                      
                        y
                        t
                      
                    
                    +
                    
                      
                        T
                        g
                      
                      ⁢
                      f
                    
                  
                  
                    
                      
                        P
                        a
                      
                      ⁢
                      
                        x
                        t
                      
                    
                    +
                    
                      
                        P
                        b
                      
                      ⁢
                      
                        y
                        t
                      
                    
                    +
                    
                      
                        P
                        c
                      
                      ⁢
                      f
                    
                  
                
              
            
          
        
      
      .
    
  




The parameters above (i.e. the parameters in matrix M−1, and the value of f) are computed on an image-by-image basis, although this need not be the case (particularly if the effect does not change between video images). Also, in an alternative embodiment, the user of the DVE device 120 could also (or instead) be provided with pre-selected effects, with corresponding pre-computed parameters stored in memory and retrieved by the CPU 212, rather than computed.
In the matrix M−1, the parameters in the first two rows (Ta, Tb, Tc, Td, Te, Tf, Tg, Tb) generally relate to providing the transform, whereas the parameters in the third row (Pa, Pb, Pc, Pd) generally relate to providing the perspective.
In the illustrated embodiments, the parameters 210 are pre-calculated per image (field or frame) before the raster-scan counter 206 begins counting target pixel coordinate values (xt,yt).
As discussed above, the perspective transform engine 208 computes a corresponding source pixel coordinate (xs,ys) for each target pixel coordinate (xt,yt). In general, the target pixel value Yt(xt,yt) will then be set as the corresponding source pixel value Ys(xs,ys) which is stored in and retrieved from memory 204. However, there is a caveat. In general, the corresponding source pixel coordinate (xs,ys) computed by the perspective transform engine 208 for a given target pixel coordinate (xt,yt) will not be an integer, but will be a fractional value. For example, if (xt,yt)=(12,14) is input into the perspective transform engine 208, then the corresponding source pixel coordinate (xs,ys) (computed using Equations 1 and 2, for example) may be (xs,ys)=(23.63, 17.27). Therefore, to compute the target pixel value Yt(xt,yt) interpolation is used. In one embodiment, bilinear interpolation is used as follows: assume a source pixel coordinate of (xs,ys)=(i+u, j+v) where (i,j) is the integer and (u,v) is the fraction. For example, in the example above of (xs,ys)=(23.63, 17.27), then i=23, u=0.63, j=17, and v=0.27. The source pixel values neighbouring (xs,ys)=(i+u, j+v) are therefore Ys(i,j), Ys(i+1, j), Ys(i, j+1), and Ys(i+1, j+1). The target pixel value Yt(xt,yt) is then computed as Yt(xt,yt)=Yj×(1−v)+Yj+1×v, where Yj=Y(i,j)×(1−u)+Y(i+1, j)×u and where Yj+1=Y(i, j+1)×(1−u)+Y(i+1, j+1)×u. To perform interpolation of this nature, the DVE device 120 includes the interpolator 216. It will be appreciated that another type of interpolation could be performed instead (e.g. a higher order of interpolation that uses a higher order of polynomial in the x-axis and y-axis).
As shown in FIG. 8, the DVE device 120 also includes the address generator 218, which uses the computed source pixel coordinate (xs,ys) (e.g. (xs,ys)=(23.63, 17.27)) to generate the addresses of the source pixels to be used for the interpolation (e.g. (23, 17), (23, 18), (24, 17), and (24, 18)). The corresponding source pixel values indicated by the address generator 218 are then read from memory 204 and forwarded to interpolator 216. The fractional values of the computed source pixel coordinate (xs,ys) (e.g. 0.63 and 0.27) are also forwarded to the interpolator. The output of interpolator 216 is the target pixel value Yt(xt,yt).
The process above is repeated for each target image coordinate (xt,yt) such that the target image 124 is created on a pixel-by-pixel basis. In this example, in the cases in which a given target pixel coordinate (xt,yt) maps to a corresponding source pixel coordinate (xs,ys) that is out of source bounds, then the target pixel value Yt(xt,yt) is set to the source pixel value Ys(xs,ys) of the closest source boundary pixel. For example, assume that the effect being applied to the source image 122 includes reducing the size of the image 122 so that the transformed source image (i.e. the object 123) is smaller than the source image 122. In this case, there will be some target pixel coordinates that will be outside of the transformed source image (i.e. in area O in FIG. 5). In this case, the corresponding source pixel coordinate (xs,ys) will (in general) be out of bounds of the source image 122, and in such a case the target pixel value Yt(xt,yt) is set to the source pixel value Ys(xs,ys) of the closest source boundary pixel (i.e. the closest source pixel on a boundary L, R, T, or B of the source image 122).
The DVE device 120 also includes the shaping alpha generator 220. Computation of the shaping alpha αshp for the target image 124 is discussed below.
There are different ways to compute the shaping alpha αshp for the target image 124. One method to compute the shaping alpha αshp assumes a fixed (uniform) range of softness around each of boundary edges L, R, T, and B of the source image 122 (that is, a fixed pixel width around each of the boundary edges L, R, T, and B in which the shaping alpha value is between zero and one). An example of this is shown in FIG. 9 in which a uniform width Δs around the boundaries of the source image 122 is defined, which in this example is 3 pixels wide. When a target pixel coordinate (xt,yt) maps to a corresponding source pixel coordinate (xs,ys) that is within the area bounded by boundary edges L, R, T, and B (as at 250 in FIG. 9), then the shaping alpha αshp value for that target pixel coordinate (xt,yt) is set to one (i.e. fully opaque since the target pixel coordinate maps within the source image and so the background image layered underneath should not be seen at this pixel location). When the target pixel coordinate (xt,yt) maps to a corresponding pixel coordinate (xs,ys) outside of the area bounded by softness range Δs (as at 260 in FIG. 9), then the shaping alpha αshp value for that target pixel coordinate (xt,yt) is set to zero (i.e. fully transparent since the target pixel coordinate maps outside the source image and so only the background image layered underneath should be seen at this pixel location). When the target pixel coordinate (xt,yt) maps to a corresponding pixel coordinate (xs,ys) within the softness range Δs (as at 270 in FIG. 9), then the shaping alpha αshp value for that target pixel coordinate (xt,yt) is set to a value between zero and one (i.e. semi-transparent since it is desired to show a smooth transition between the manipulated source image boundary and the background layered underneath).
Depending on how the source image 122 has been manipulated by the perspective transform engine 208, a pixel of the target image on the boundary of the manipulated source image could map outside of the softness range Δs in some places, as shown at 280 in FIG. 9. When pixels of the target image on the boundary of the manipulated source image map outside of the softness range Δs in some places, but not in others, then this may result in jagged edges showing abrupt changes between the boundary of the manipulated source image and the background image over which the manipulated source image is layered. For example, in FIG. 10, along the right boundary R, pixels 1, 2, and 3 have a smooth transition since pixel 1 has a corresponding shaping alpha value αshp equal to 1 (inside the right boundary), pixel 2 has a corresponding shaping alpha value αshp between zero and one, such as 0.5 (inside softness range Δs), and pixel 3 has a corresponding shaping alpha value αshp equal to zero (outside softness range Δs). However, none of pixels 4, 5, and 6 fall within softness range Δs, and so the appearance of a jagged edge may occur. Area A defines a more desirable (non-uniform) softness range around the source image to mitigate the appearance of jagged edges. However, instead the area A outside of the softness range Δs is in the “hard-switch” area (i.e. the shaping alpha value αshp equals zero in this area).
With the mapping shown in FIG. 10, it may be the case that all target pixels around the right boundary edge, inversely mapped onto (for example) 9 top source lines, may lose softness, with only the bottom right corner with some softness.
One reason for jagged edges may be as follows: when a source image is rotated around the x-axis and moved away from a viewer, perspective effect makes the top area of the target image squeezed more than the bottom area. With a uniform softness range defined around the source image 122, a mapping such as that shown in FIG. 10 can cause the target pixels 4, 5, and 6 at the top of the image to no longer take on preferred respective alpha channel values of 1 (inside the source boundaries), 0.5 (or another value between 0 and 1, which is in the softness range), and 0 (outside the boundaries).
Jagged or step boundary edges, such as that described above with reference to FIG. 10, are often visible in some DVE devices. As an example, FIG. 11 illustrates a mapping such as that discussed above in relation to FIG. 10, in which a picture is subjected to x-y rotations with a constant source softness range Δs of 1.2 pixels wide. As can be seen from FIG. 11, the edges do not have uniform softness. Specifically, the transition is relatively smooth on the near edge, as shown at 253, and jagged at the far edge, as shown at 255. FIG. 12 illustrates a constant source softness range Δs of 12.5 pixels instead, with the same mapping discussed above with reference to FIG. 10. Still, the edges do not have uniform softness. Specifically, the transition is appropriately smooth at the far edge, as shown at 257, but now overly soft on the near edge, as shown at 259.
One method to address the jagged edges discussed above is to use anti-aliasing techniques. For example, an anti-alias method may be used employing super-samples or multi-samples, for example, 4×4 multiple samples in one normal square pixel area, as illustrated in FIG. 13. An average or weighted average is applied to all of the super samples and taken as a value for a pixel of interest. However, a disadvantage of this method is that it may result in high cost on hardware resources and/or computing time, primarily because of two reasons: (1) boundary detection on the target image is typically required to identify the pixel cross-edges, and (2) there is increased calculation time for a single pixel at an edge (specifically by N×N, where N is a the number of horizontal or vertical samples), which is generally undesirable for raster-scan based video data processing.
Another method to address the jagged edges problem discussed above is to use post-filtering image processing techniques to filter the jagged alpha to smooth the boundary edges. This method also has disadvantages relating to cost (computational resources and/or time) and quality. For example, boundary edge detection of the object in the target image is still required, and good quality filtering typically requires 2-D filtering techniques, which has a higher cost in terms of computational resources. Also, the post-filter bandwidth may be required to be dynamically changed in order to smooth different jagged edges. This is shown in FIG. 14, in which a first filter (filter 1) filters an image 263 to generate a softness area 2.5 pixels wide, and a second filter (filter 2) filters the image 263 to generate a softness area 10 pixels wide. The softness area 2.5 pixels wide (caused by filter 1) does not seem to be enough, whereas the softness area 10 pixels wide (caused by filter 2) appears to be overly soft. If different edges in the image 263 were to be jagged in different degrees, then a general spatial-invariant filter may not achieve consistent quality for all jagged edges.
In contrast to the methods described with reference to FIGS. 10 to 14, embodiments described below instead construct a shaping alpha αshp with uniform softness around the transformed source image (i.e. object 123 in FIG. 5), rather than around the source image 122. As described below, a constant range of softness around the object 123 is defined, and corresponding expressions for spatial-variant or dynamic source ranges for softness are derived and implemented to generate the alpha channel value. The area of softness bordering the source image 122 therefore varies, rather than being a fixed area. This is shown in FIG. 15. The parameter Δtgt may be controllable by the user and defines how much softness there will be at the edge of object 123, and more particularly, the width of the softness area bordering object 123. The larger the parameter Δtgt, the more gradually the object 123 will fade into the background image. The parameter Δsrc defines the extent of the corresponding softness area bordering the source image 122 that is required to result in the desired target softness area. Note that the source softness range is spatial-variant or dynamic. That is, the value of Δsrc changes along each boundary due to the softness area bordering the object 123 being uniform. Also note that both Δtgt>0 and Δsrc>0.
One method of creating a shaping alpha αshp to result in a uniform softness around the transformed source image (i.e. object 123) in the target image 124 is explained below.
In the embodiments described below, the parameters 210 and inverse mapping function M−1 discussed above will be assumed, such that Equations 1 and 2 represent the relationship between the source pixel coordinates and the target pixel coordinates. That is, to obtain the corresponding source pixel coordinate (xs,ys) for a given target pixel coordinate (xt,yt), the following computation is performed by the perspective transform engine 208:



  
    
      
        x
        s
      
      =
      
        
          T
          d
        
        +
        
          
            
              
                (
                
                  
                    
                      T
                      a
                    
                    ⁢
                    
                      x
                      t
                    
                  
                  +
                  
                    
                      T
                      b
                    
                    ⁢
                    
                      y
                      t
                    
                  
                  +
                  
                    
                      T
                      c
                    
                    ⁢
                    f
                  
                
                )
              
              ⁢
              
                P
                d
              
            
            
              
                
                  P
                  a
                
                ⁢
                
                  x
                  t
                
              
              +
              
                
                  P
                  b
                
                ⁢
                
                  y
                  t
                
              
              +
              
                
                  P
                  c
                
                ⁢
                f
              
            
          
          ⁢
          
            
          
          ⁢
          
            (
            
              
                i
                .
                e
                .
                
                  
                
                ⁢
                Equation
              
              ⁢
              
                
              
              ⁢
              1
            
            )
          
        
      
    
    ,
    and
  




  
    
      y
      s
    
    =
    
      
        T
        h
      
      +
      
        
          
            
              (
              
                
                  
                    T
                    e
                  
                  ⁢
                  
                    x
                    t
                  
                
                +
                
                  
                    T
                    f
                  
                  ⁢
                  
                    y
                    t
                  
                
                +
                
                  
                    T
                    g
                  
                  ⁢
                  f
                
              
              )
            
            ⁢
            
              P
              d
            
          
          
            
              
                P
                a
              
              ⁢
              
                x
                t
              
            
            +
            
              
                P
                b
              
              ⁢
              
                y
                t
              
            
            +
            
              
                P
                c
              
              ⁢
              f
            
          
        
        ⁢
        
          
        
        ⁢
        
          
            (
            
              
                i
                .
                e
                .
                
                  
                
                ⁢
                Equation
              
              ⁢
              
                
              
              ⁢
              2
            
            )
          
          .
        
      
    
  



Generally, a valid source image picture area is defined by the four boundary lines left (L), right (R), top (T), and bottom (B). However, in many applications, the source image may be further limited through a cropping effect, as shown in FIG. 16. Specifically, FIG. 16 illustrates mapping relationships between source boundary lines and target boundary lines, as well as mapping relationships between source cropping lines and target cropping lines. After perspective projection, those horizontal or vertical lines in source space may be tilted to certain degrees in target space, as is shown in the slopes of FIG. 16.
Given that cropping can be applied to the source image, the source image will therefore be considered to be defined by four lines (left, right, top, and bottom), which will be designated as left cropping boundary line CL, right cropping boundary line CR, top cropping boundary line CT, and bottom cropping boundary line CB. This is shown in FIG. 17, which illustrates a source image 122 cropped by the left, right, top, and bottom cropping boundary lines. However, it will be appreciated that more generally these cropping boundary lines are boundary lines.
A cropping boundary line can be denoted as:




  
    
      
        
          C
          i
        
        =
        
          {
          
            
              
                
                  
                    C
                    L
                  
                
                
                  
                    i
                    =
                    L
                  
                
              
              
                
                  
                    C
                    R
                  
                
                
                  
                    i
                    =
                    R
                  
                
              
              
                
                  
                    C
                    T
                  
                
                
                  
                    i
                    =
                    T
                  
                
              
              
                
                  
                    C
                    B
                  
                
                
                  
                    i
                    =
                    B
                  
                
              
            
            .
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          4
        
        )
      
    
  




Another way to denote these cropping lines is as follows:

    horizontal cropping:






  
    C
    H
  
  =
  
    {
    
      
        
          
            
              C
              L
            
          
        
        
          
            
              C
              R
            
          
        
      
      ;
    
  




     and
    vertical cropping:






  
    C
    V
  
  =
  
    {
    
      
        
          
            
              C
              T
            
          
        
        
          
            
              C
              B
            
          
        
      
      .
    
  




Consider horizontal cropping first. In this case, on the cropping line (CL or CR), the source x-coordinate xs will be a constant xs=CH.
By substituting xs=CH into Equation 1 and we have:




  
    
      
        
          C
          H
        
        =
        
          
            T
            d
          
          +
          
            
              
                
                  (
                  
                    
                      
                        T
                        a
                      
                      ⁢
                      
                        x
                        t
                      
                    
                    +
                    
                      
                        T
                        b
                      
                      ⁢
                      
                        y
                        t
                      
                    
                    +
                    
                      
                        T
                        c
                      
                      ⁢
                      f
                    
                  
                  )
                
                ⁢
                
                  P
                  d
                
              
              
                
                  
                    P
                    a
                  
                  ⁢
                  
                    x
                    t
                  
                
                +
                
                  
                    P
                    b
                  
                  ⁢
                  
                    y
                    t
                  
                
                +
                
                  
                    P
                    c
                  
                  ⁢
                  f
                
              
            
            .
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          5
        
        )
      
    
  




    Equation 5 can be rearranged to have the form:






  
    
      
        
          
            
              
                (
                
                  
                    
                      P
                      a
                    
                    ⁢
                    W
                  
                  -
                  
                    T
                    a
                  
                
                )
              
              ⁢
              
                x
                t
              
            
            +
            
              
                (
                
                  
                    
                      P
                      b
                    
                    ⁢
                    W
                  
                  -
                  
                    T
                    b
                  
                
                )
              
              ⁢
              
                y
                t
              
            
            +
            
              
                (
                
                  
                    
                      P
                      c
                    
                    ⁢
                    W
                  
                  -
                  
                    T
                    c
                  
                
                )
              
              ⁢
              f
            
          
          =
          0.
        
        ⁢
        
          

        
        ⁢
        
          
            In
            ⁢
            
              
            
            ⁢
            Equation
            ⁢
            
              
            
            ⁢
            6
          
          ,
          
            W
            =
            
              
                
                  
                    C
                    H
                  
                  -
                  
                    T
                    d
                  
                
                
                  P
                  d
                
              
              .
            
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          6
        
        )
      
    
  




Therefore, the horizontal crop line xs=CH in the source image 122 has the corresponding horizontal crop line in the target image 124 defined by Equation 6. Note that Equation 6 is a linear function (geometric line) in target space, which includes two extreme cases:




  
    y
    t
  
  =
  
    
      
        -
        
          
            
              (
              
                
                  
                    P
                    c
                  
                  ⁢
                  W
                
                -
                
                  T
                  c
                
              
              )
            
            ⁢
            f
          
          
            (
            
              
                
                  P
                  b
                
                ⁢
                W
              
              -
              
                T
                b
              
            
            )
          
        
      
      ⁢
      
        
      
      ⁢
      when
      ⁢
      
        
      
      ⁢
      
        (
        
          
            
              P
              a
            
            ⁢
            W
          
          -
          
            T
            a
          
        
        )
      
    
    =
    0
  




(which means that the target line is completely horizontal), and





  
    x
    t
  
  =
  
    -
    
      
        
          (
          
            
              
                P
                c
              
              ⁢
              W
            
            -
            
              T
              c
            
          
          )
        
        ⁢
        f
      
      
        (
        
          
            
              P
              a
            
            ⁢
            W
          
          -
          
            T
            a
          
        
        )
      
    
  




when (PbW−Tb)=0 (which means that the target line is completely vertical).

Equation 6 can be expressed in slope intercept form in two different ways:

yt=φxtxt+τyt  (Equation 7)

or

xt=φytyt+τxt  (Equation 8)

Note that:



  
    
      
        
          φ
          
            x
            t
          
        
        ⁢
        
          φ
          
            y
            t
          
        
      
      =
      1
    
    ,
    
      
        φ
        
          x
          t
        
      
      =
      
        
          
            -
            
              (
              
                
                  
                    P
                    a
                  
                  ⁢
                  W
                
                -
                
                  T
                  a
                
              
              )
            
          
          
            (
            
              
                
                  P
                  b
                
                ⁢
                W
              
              -
              
                T
                b
              
            
            )
          
        
        =
        
          
            dy
            t
          
          
            dx
            t
          
        
      
    
    ,
    
      

    
    ⁢
    
      
        φ
        
          y
          t
        
      
      =
      
        
          
            -
            
              (
              
                
                  
                    P
                    b
                  
                  ⁢
                  W
                
                -
                
                  T
                  b
                
              
              )
            
          
          
            (
            
              
                
                  P
                  a
                
                ⁢
                W
              
              -
              
                T
                a
              
            
            )
          
        
        =
        
          
            dx
            t
          
          
            dy
            t
          
        
      
    
    ,
    
      
        τ
        
          y
          t
        
      
      =
      
        
          
            -
            
              (
              
                
                  
                    P
                    c
                  
                  ⁢
                  W
                
                -
                
                  T
                  c
                
              
              )
            
          
          ⁢
          f
        
        
          (
          
            
              
                P
                b
              
              ⁢
              W
            
            -
            
              T
              b
            
          
          )
        
      
    
    ,
    and
  




  
    
      τ
      
        x
        t
      
    
    =
    
      
        
          
            -
            
              (
              
                
                  
                    P
                    c
                  
                  ⁢
                  W
                
                -
                
                  T
                  c
                
              
              )
            
          
          ⁢
          f
        
        
          (
          
            
              
                P
                a
              
              ⁢
              W
            
            -
            
              T
              a
            
          
          )
        
      
      .
    
  



Equations 7 and 8 are equivalent. Which one of Equations 7 and 8 to use in the computations is decided on an image-by-image basis. Specifically, for each target image, and therefore for each set of parameters Ta to Th, Pa to Pd, and f, the Equation 7 or 8 used depends upon which one has the smallest slope (φxt or φyt). That is, the equation having the smallest slope is used. The consideration of both of equations 7 and 8, with a selection of which one to use during operation on an image-by-image basis, is to accommodate cases in which the target image boundary line defined by Equation 6 is completely vertical or horizontal (since when the target image boundary line is completely horizontal one of equations 7 and 8 will have an infinite slope and cannot be used and vice versa). Also, the analysis below is based on the assumption that there is a small parallel shift in the target image boundary line to define the softness area, and so the equation that has the smallest slope will mean that the intercept (τxt or τyt) dominates, such that a relatively small change in the intercept (τxt or τyt) results in a relatively larger parallel shift in the target image boundary line. Also, it will therefore be appreciated that it is the absolute value of the slope of the target image boundary line (i.e. |φxt| or |φyt|) that is of interest to determine which equation to use.

Therefore, for each target image, and therefore set of parameters Ta to Th, Pa to Pd, and f, Equation 6 is expressed as Equation 7 when




  
    
    
      φ
      
        x
        t
      
    
    
  
  =
  
    
      
      
        
          -
          
            (
            
              
                
                  P
                  a
                
                ⁢
                W
              
              -
              
                T
                a
              
            
            )
          
        
        
          (
          
            
              
                P
                b
              
              ⁢
              W
            
            -
            
              T
              b
            
          
          )
        
      
      
    
    =
    
      
        
          
          
            
              
                P
                a
              
              ⁢
              W
            
            -
            T
          
          
        
        
          
          
            
              
                P
                b
              
              ⁢
              W
            
            -
            T
          
          
        
      
      ≤
      1
    
  




(which means |φyt|≧1), and Equation 6 is instead expressed as Equation 8 when |φxt|>1 (which means |φyt|<1).

Therefore Equation 6 in slope intercept form is:




  {
  
    
      
        
          
            
              
                y
                t
              
              =
              
                
                  
                    φ
                    
                      x
                      t
                    
                  
                  ⁢
                  
                    x
                    t
                  
                
                +
                
                  τ
                  
                    y
                    t
                  
                
              
            
            ,
          
        
        
          
            
              if
              ⁢
              
                
              
              ⁢
              
                
                
                  
                    
                      P
                      a
                    
                    ⁢
                    W
                  
                  -
                  
                    T
                    a
                  
                
                
              
            
            ≤
            
              
              
                
                  
                    P
                    b
                  
                  ⁢
                  W
                
                -
                
                  T
                  b
                
              
              
            
          
        
      
      
        
          
            
              
                x
                t
              
              =
              
                
                  
                    φ
                    
                      y
                      t
                    
                  
                  ⁢
                  
                    y
                    t
                  
                
                +
                
                  τ
                  
                    x
                    t
                  
                
              
            
            ,
          
        
        
          else
        
      
    
    .
  




Consider now the vertical cropping. In this case, on the cropping line (CT or CB), the source y-coordinate ys will be a constant ys=CV.
By substituting ys=CV into Equation 2 and we have:




  
    
      
        
          C
          V
        
        =
        
          
            T
            h
          
          +
          
            
              
                
                  (
                  
                    
                      
                        T
                        e
                      
                      ⁢
                      
                        x
                        t
                      
                    
                    +
                    
                      
                        T
                        f
                      
                      ⁢
                      
                        y
                        t
                      
                    
                    +
                    
                      
                        T
                        g
                      
                      ⁢
                      f
                    
                  
                  )
                
                ⁢
                
                  P
                  d
                
              
              
                
                  
                    P
                    a
                  
                  ⁢
                  
                    x
                    t
                  
                
                +
                
                  
                    P
                    b
                  
                  ⁢
                  
                    y
                    t
                  
                
                +
                
                  
                    P
                    c
                  
                  ⁢
                  f
                
              
            
            .
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          9
        
        )
      
    
  




    Equation 9 can be rearranged to have the form:






  
    
      
        
          
            
              
                (
                
                  
                    
                      P
                      a
                    
                    ⁢
                    W
                  
                  -
                  
                    T
                    e
                  
                
                )
              
              ⁢
              
                x
                t
              
            
            +
            
              
                (
                
                  
                    
                      P
                      b
                    
                    ⁢
                    W
                  
                  -
                  
                    T
                    f
                  
                
                )
              
              ⁢
              
                y
                t
              
            
            +
            
              
                (
                
                  
                    
                      P
                      c
                    
                    ⁢
                    H
                  
                  -
                  
                    T
                    g
                  
                
                )
              
              ⁢
              f
            
          
          =
          0.
        
        ⁢
        
          

        
        ⁢
        
          
            In
            ⁢
            
              
            
            ⁢
            Equation
            ⁢
            
              
            
            ⁢
            10
          
          ,
          
            H
            =
            
              
                
                  
                    C
                    V
                  
                  -
                  
                    T
                    h
                  
                
                
                  P
                  d
                
              
              .
            
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          10
        
        )
      
    
  




Therefore, the vertical crop line ys=CV in the source image 122 has the corresponding crop line in the target image 124 defined by Equation 10. Note that Equation 10 is a linear function (geometric line) in target space, which includes two extreme cases:





  
    y
    t
  
  =
  
    -
    
      
        
          (
          
            
              
                P
                c
              
              ⁢
              H
            
            -
            
              T
              g
            
          
          )
        
        ⁢
        f
      
      
        (
        
          
            
              P
              b
            
            ⁢
            H
          
          -
          
            T
            f
          
        
        )
      
    
  




when (PaH−Te)=0 (which means that the target line is completely horizontal), and





  
    x
    t
  
  =
  
    -
    
      
        
          (
          
            
              
                P
                c
              
              ⁢
              H
            
            -
            
              T
              g
            
          
          )
        
        ⁢
        f
      
      
        (
        
          
            
              P
              a
            
            ⁢
            H
          
          -
          
            T
            e
          
        
        )
      
    
  




when (PbH−Tf)=0 (which means that the target line is completely vertical).

Equation 10 can also be expressed in slope intercept form in two different ways:

yt=φxtxt+τyt  (Equation 11)

or

xt=φytyt+τxt  (Equation 12).

Note that:





  
    
      
        φ
        
          x
          t
        
      
      ⁢
      
        φ
        
          y
          t
        
      
    
    =
    1
  
  ,
  
    
      φ
      
        x
        t
      
    
    =
    
      
        
          -
          
            (
            
              
                
                  P
                  a
                
                ⁢
                H
              
              -
              
                T
                e
              
            
            )
          
        
        
          (
          
            
              
                P
                b
              
              ⁢
              H
            
            -
            
              T
              f
            
          
          )
        
      
      =
      
        
          dy
          t
        
        
          dx
          t
        
      
    
  
  ,
  
    

  
  ⁢
  
    
      φ
      
        y
        t
      
    
    =
    
      
        
          -
          
            (
            
              
                
                  P
                  b
                
                ⁢
                H
              
              -
              
                T
                f
              
            
            )
          
        
        
          (
          
            
              
                P
                a
              
              ⁢
              H
            
            -
            
              T
              e
            
          
          )
        
      
      =
      
        
          dx
          t
        
        
          dy
          t
        
      
    
  
  ,
  
    

  
  ⁢
  
    
      τ
      
        y
        t
      
    
    =
    
      
        
          -
          
            (
            
              
                
                  P
                  c
                
                ⁢
                H
              
              -
              
                T
                g
              
            
            )
          
        
        ⁢
        f
      
      
        (
        
          
            
              P
              b
            
            ⁢
            H
          
          -
          
            T
            f
          
        
        )
      
    
  
  ,
  
    
      and
      ⁢
      
        
      
      ⁢
      
        τ
        
          x
          t
        
      
    
    =
    
      
        
          
            -
            
              (
              
                
                  
                    P
                    c
                  
                  ⁢
                  H
                
                -
                
                  T
                  g
                
              
              )
            
          
          ⁢
          f
        
        
          (
          
            
              
                P
                a
              
              ⁢
              H
            
            -
            
              T
              e
            
          
          )
        
      
      .
    
  




Equations 11 and 12 are equivalent. As was the case for horizontal cropping, for vertical cropping which one of Equations 11 and 12 to use in the computations is decided on an image-by-image basis. Specifically, for each target image, and therefore for each set of parameters Ta to Th, Pa to Pd, and f, the Equation 11 or 12 used depends upon which one has the smallest slope (φxt or φyt). That is, the equation having the smallest slope is used.

Therefore, for each target image, and therefore set of parameters Ta to Th, Pa to Pd, and f, Equation 10 is expressed as Equation 11 when




  
    
    
      φ
      
        x
        t
      
    
    
  
  =
  
    
      
      
        
          -
          
            (
            
              
                
                  P
                  a
                
                ⁢
                H
              
              -
              
                T
                e
              
            
            )
          
        
        
          (
          
            
              
                P
                b
              
              ⁢
              H
            
            -
            
              T
              f
            
          
          )
        
      
      
    
    =
    
      
        
        
          
            
              
                P
                a
              
              ⁢
              H
            
            -
            
              T
              e
            
          
          
            
              
                P
                b
              
              ⁢
              H
            
            -
            
              T
              f
            
          
        
        
      
      ≤
      1
    
  




(which means |φyt|≧1), and Equation 10 is instead expressed as Equation 12 when |φxt|>1 (which means |φyt|<1).

Therefore Equation 10 in slope intercept form is:




  {
  
    
      
        
          
            
              
                y
                t
              
              =
              
                
                  
                    φ
                    
                      x
                      t
                    
                  
                  ⁢
                  
                    x
                    t
                  
                
                +
                
                  τ
                  
                    y
                    t
                  
                
              
            
            ,
          
        
        
          
            
              if
              ⁢
              
                
              
              ⁢
              
                
                
                  
                    
                      P
                      a
                    
                    ⁢
                    H
                  
                  -
                  
                    T
                    e
                  
                
                
              
            
            ≤
            
              
              
                
                  
                    P
                    b
                  
                  ⁢
                  H
                
                -
                
                  T
                  f
                
              
              
            
          
        
      
      
        
          
            
              
                x
                t
              
              =
              
                
                  
                    φ
                    
                      y
                      t
                    
                  
                  ⁢
                  
                    y
                    t
                  
                
                +
                
                  τ
                  
                    x
                    t
                  
                
              
            
            ,
          
        
        
          else
        
      
    
    .
  




Therefore, in summary, a target image boundary line mapped from a source cropping image line is expressed as either:




  
    
      
        
          y
          t
        
        =
        
          
            
              
                φ
                
                  x
                  t
                
              
              ⁢
              
                x
                t
              
            
            +
            
              τ
              
                y
                t
              
            
          
          =
          
            {
            
              
                
                  
                    
                      
                        
                          
                            
                              
                                -
                                
                                  
                                    (
                                    
                                      
                                        
                                          P
                                          a
                                        
                                        ⁢
                                        W
                                      
                                      -
                                      
                                        T
                                        a
                                      
                                    
                                    )
                                  
                                  
                                    (
                                    
                                      
                                        
                                          P
                                          b
                                        
                                        ⁢
                                        W
                                      
                                      -
                                      
                                        T
                                        b
                                      
                                    
                                    )
                                  
                                
                              
                              ⁢
                              
                                x
                                t
                              
                            
                            -
                            
                              
                                
                                  (
                                  
                                    
                                      
                                        P
                                        c
                                      
                                      ⁢
                                      W
                                    
                                    -
                                    
                                      T
                                      c
                                    
                                  
                                  )
                                
                                
                                  (
                                  
                                    
                                      
                                        P
                                        b
                                      
                                      ⁢
                                      W
                                    
                                    -
                                    
                                      T
                                      b
                                    
                                  
                                  )
                                
                              
                              ⁢
                              f
                            
                          
                          ,
                        
                      
                      
                        
                          
                            
                              
                                horizontal
                                ⁢
                                
                                  
                                
                                ⁢
                                source
                              
                            
                          
                          
                            
                              boundary
                            
                          
                        
                      
                    
                    
                      
                        
                          
                            
                              
                                -
                                
                                  
                                    (
                                    
                                      
                                        
                                          P
                                          a
                                        
                                        ⁢
                                        H
                                      
                                      -
                                      
                                        T
                                        e
                                      
                                    
                                    )
                                  
                                  
                                    (
                                    
                                      
                                        
                                          P
                                          b
                                        
                                        ⁢
                                        H
                                      
                                      -
                                      
                                        T
                                        f
                                      
                                    
                                    )
                                  
                                
                              
                              ⁢
                              
                                x
                                t
                              
                            
                            -
                            
                              
                                
                                  (
                                  
                                    
                                      
                                        P
                                        c
                                      
                                      ⁢
                                      H
                                    
                                    -
                                    
                                      T
                                      g
                                    
                                  
                                  )
                                
                                
                                  (
                                  
                                    
                                      
                                        P
                                        b
                                      
                                      ⁢
                                      H
                                    
                                    -
                                    
                                      T
                                      f
                                    
                                  
                                  )
                                
                              
                              ⁢
                              f
                            
                          
                          ,
                        
                      
                      
                        
                          
                            
                              
                                vertical
                                ⁢
                                
                                  
                                
                                ⁢
                                source
                              
                            
                          
                          
                            
                              boundary
                            
                          
                        
                      
                    
                  
                  ⁢
                  
                    

                  
                  ⁢
                  
                    
                  
                  ⁢
                  when
                  ⁢
                  
                    
                  
                  ⁢
                  
                    
                    
                      φ
                      
                        x
                        t
                      
                    
                    
                  
                
                ≤
                1
              
              ,
              or
            
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          13
        
        )
      
    
  
  
    
      
        
          x
          t
        
        =
        
          
            
              
                φ
                
                  y
                  t
                
              
              ⁢
              
                y
                t
              
            
            +
            
              τ
              
                x
                t
              
            
          
          =
          
            {
            
              
                
                  
                    
                      
                        
                          
                            
                              -
                              
                                
                                  (
                                  
                                    
                                      
                                        P
                                        b
                                      
                                      ⁢
                                      W
                                    
                                    -
                                    
                                      T
                                      b
                                    
                                  
                                  )
                                
                                
                                  (
                                  
                                    
                                      
                                        P
                                        a
                                      
                                      ⁢
                                      W
                                    
                                    -
                                    
                                      T
                                      a
                                    
                                  
                                  )
                                
                              
                            
                            ⁢
                            
                              y
                              t
                            
                          
                          -
                          
                            
                              
                                (
                                
                                  
                                    
                                      P
                                      c
                                    
                                    ⁢
                                    W
                                  
                                  -
                                  
                                    T
                                    c
                                  
                                
                                )
                              
                              
                                (
                                
                                  
                                    
                                      P
                                      a
                                    
                                    ⁢
                                    W
                                  
                                  -
                                  
                                    T
                                    a
                                  
                                
                                )
                              
                            
                            ⁢
                            f
                          
                        
                        ,
                      
                    
                    
                      
                        
                          
                            
                              horizontal
                              ⁢
                              
                                
                              
                              ⁢
                              source
                            
                          
                        
                        
                          
                            boundary
                          
                        
                      
                    
                  
                  
                    
                      
                        
                          
                            
                              -
                              
                                
                                  (
                                  
                                    
                                      
                                        P
                                        b
                                      
                                      ⁢
                                      H
                                    
                                    -
                                    
                                      T
                                      f
                                    
                                  
                                  )
                                
                                
                                  (
                                  
                                    
                                      
                                        P
                                        a
                                      
                                      ⁢
                                      H
                                    
                                    -
                                    
                                      T
                                      e
                                    
                                  
                                  )
                                
                              
                            
                            ⁢
                            
                              y
                              t
                            
                          
                          -
                          
                            
                              
                                (
                                
                                  
                                    
                                      P
                                      c
                                    
                                    ⁢
                                    H
                                  
                                  -
                                  
                                    T
                                    g
                                  
                                
                                )
                              
                              
                                (
                                
                                  
                                    
                                      P
                                      a
                                    
                                    ⁢
                                    H
                                  
                                  -
                                  
                                    T
                                    e
                                  
                                
                                )
                              
                            
                            ⁢
                            f
                          
                        
                        ,
                      
                    
                    
                      
                        
                          
                            
                              vertical
                              ⁢
                              
                                
                              
                              ⁢
                              source
                            
                          
                        
                        
                          
                            boundary
                          
                        
                      
                    
                  
                
                ⁢
                
                  

                
                ⁢
                
                  
                
                ⁢
                when
                ⁢
                
                  
                
                ⁢
                
                  
                  
                    φ
                    
                      x
                      t
                    
                  
                  
                
              
              >
              
                1
                ⁢
                
                  
                    (
                    
                      
                        
                        
                          φ
                          
                            y
                            t
                          
                        
                        
                      
                      <
                      1
                    
                    )
                  
                  .
                
              
            
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          14
        
        )
      
    
  




As mentioned above, a smaller slope lets the intercept dominate the softness on the target plane. This is illustrated in FIG. 18, in which the right source boundary edge R is mapped onto the target plane with a smaller slope, and the bottom boundary edge B with a larger slope. The same intercept change is applied to the right edge and bottom edge, but they give a different spatial margin. Specifically, the right source boundary, which has the smaller slope in the target plane, means a larger shift (as shown at 273) compared to the shift in the bottom source boundary (as shown at 275). This is why the smaller slope is used.
Also, since (as described above) φxtφyt=1, the smaller slope must be less than one and the other bigger than one. The exception is where φxt=φyt=1, where which one is chosen will give the same result.
Analysis leading to the construction of the shaping alpha value will now be described.
A constant spatial softness area of width Δtgt around the target object provides for uniform softness. Therefore, each boundary of the target object is parallel-shifted by an amount Δtgt. When this shift Δtgt is inversely mapped onto the source image space, it appears as non-uniform spatial area of width Δsrc, as previously shown in FIG. 15. The non-uniform spatial area of width Δsrc bordering the source image is used to define the shaping alpha channel. The computation of this non-uniform spatial area of width Δsrc is as follows.
Consider first the case where it is a horizontal cropping (therefore xs=CH), and assume that |φxt|≧1 (φxt≦φyt) and therefore the corresponding target cropping line is




  
    y
    t
  
  =
  
    
      
        
          φ
          
            x
            t
          
        
        ⁢
        
          x
          t
        
      
      +
      
        τ
        
          y
          t
        
      
    
    =
    
      
        
          -
          
            
              (
              
                
                  
                    P
                    a
                  
                  ⁢
                  W
                
                -
                
                  T
                  a
                
              
              )
            
            
              (
              
                
                  
                    P
                    b
                  
                  ⁢
                  W
                
                -
                
                  T
                  b
                
              
              )
            
          
        
        ⁢
        
          x
          t
        
      
      -
      
        
          
            (
            
              
                
                  P
                  c
                
                ⁢
                W
              
              -
              
                T
                c
              
            
            )
          
          
            (
            
              
                
                  P
                  b
                
                ⁢
                W
              
              -
              
                T
                b
              
            
            )
          
        
        ⁢
        
          f
          .
        
      
    
  




We are interested in the case where there is a small change in τyt, since that represents the parallel shift in the target image horizontal boundary. More specifically, we are interested in the change in the corresponding source horizontal cropping boundary xs with respect to the change in the target image horizontal boundary





  
    τ
    
      y
      t
    
  
  ⁢
  
    
  
  ⁢
  
    
      (
      
        i
        .
        e
        .
        
          
        
        ⁢
        
          
            dx
            s
          
          
            d
            ⁢
            
              
            
            ⁢
            
              τ
              
                y
                t
              
            
          
        
      
      )
    
    .
  




Therefore, the differential





  
    dx
    s
  
  
    d
    ⁢
    
      
    
    ⁢
    
      τ
      
        y
        t
      
    
  




is to be computed.

Let




  
    
      x
      _
    
    s
  
  =
  
    
      
        
          x
          s
        
        -
        
          T
          d
        
      
      
        P
        d
      
    
    .
  




Therefore,





  
    
      
        
          
            x
            _
          
          s
        
        =
        
          
            
              
                
                  T
                  a
                
                ⁢
                
                  x
                  t
                
              
              +
              
                
                  T
                  b
                
                ⁢
                
                  y
                  t
                
              
              +
              
                
                  T
                  c
                
                ⁢
                f
              
            
            
              
                
                  P
                  a
                
                ⁢
                
                  x
                  t
                
              
              +
              
                
                  P
                  b
                
                ⁢
                
                  y
                  t
                
              
              +
              
                
                  P
                  c
                
                ⁢
                f
              
            
          
          .
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          15
        
        )
      
    
  




The differential





  
    dx
    s
  
  
    d
    ⁢
    
      
    
    ⁢
    
      τ
      
        y
        t
      
    
  




can be expressed as





  
    
      d
      ⁢
      
        
      
      ⁢
      
        x
        s
      
    
    
      d
      ⁢
      
        
      
      ⁢
      
        τ
        
          y
          t
        
      
    
  
  =
  
    
      
        
          dx
          s
        
        
          d
          ⁢
          
            
              x
              _
            
            s
          
        
      
      ⁢
      
        
          d
          ⁢
          
            
              x
              _
            
            s
          
        
        
          d
          ⁢
          
            
          
          ⁢
          
            τ
            
              y
              t
            
          
        
      
    
    =
    
      
        P
        d
      
      ⁢
      
        
          d
          ⁢
          
            
              x
              _
            
            s
          
        
        
          d
          ⁢
          
            
          
          ⁢
          
            τ
            
              y
              t
            
          
        
      
    
  




(since rearranging the equation





  
    
      x
      _
    
    s
  
  =
  
    
      
        x
        s
      
      -
      
        T
        d
      
    
    
      P
      d
    
  




in terms of xs and then computing





  
    dx
    s
  
  
    d
    ⁢
    
      
        x
        _
      
      s
    
  




results in





  
    
      
        
          dx
          s
        
        
          d
          ⁢
          
            
              x
              _
            
            s
          
        
      
      =
      
        P
        d
      
    
    )
  
  .




Therefore, substitute yt=φxtxt+τyt into Equation 15




  
    (
    
      
        
          x
          _
        
        s
      
      =
      
        
          
            
              T
              a
            
            ⁢
            
              x
              t
            
          
          +
          
            
              T
              b
            
            ⁡
            
              (
              
                
                  
                    φ
                    
                      x
                      t
                    
                  
                  ⁢
                  
                    x
                    t
                  
                
                +
                
                  τ
                  
                    y
                    t
                  
                
              
              )
            
          
          +
          
            
              T
              c
            
            ⁢
            f
          
        
        
          
            
              P
              a
            
            ⁢
            
              x
              t
            
          
          +
          
            
              P
              b
            
            ⁡
            
              (
              
                
                  
                    φ
                    
                      x
                      t
                    
                  
                  ⁢
                  
                    x
                    t
                  
                
                +
                
                  τ
                  
                    y
                    t
                  
                
              
              )
            
          
          +
          
            
              P
              c
            
            ⁢
            f
          
        
      
    
    )
  
  ,




and taking the differential





  
    d
    ⁢
    
      
        x
        _
      
      s
    
  
  
    d
    ⁢
    
      
    
    ⁢
    
      τ
      
        y
        t
      
    
  




(using the quotient rule for derivatives):





  
    
      
        
          
            d
            ⁢
            
              
                x
                _
              
              s
            
          
          
            d
            ⁢
            
              
            
            ⁢
            
              τ
              
                y
                t
              
            
          
        
        =
        
          
            
              
                T
                b
              
              -
              
                
                  P
                  b
                
                ⁢
                
                  
                    x
                    _
                  
                  s
                
              
            
            
              
                
                  P
                  a
                
                ⁢
                
                  x
                  t
                
              
              +
              
                
                  P
                  b
                
                ⁡
                
                  (
                  
                    
                      
                        φ
                        
                          x
                          t
                        
                      
                      ⁢
                      
                        x
                        t
                      
                    
                    +
                    
                      τ
                      y
                    
                  
                  )
                
              
              +
              
                
                  P
                  c
                
                ⁢
                f
              
            
          
          =
          
            
              
                
                  T
                  b
                
                -
                
                  
                    P
                    b
                  
                  ⁢
                  
                    
                      x
                      _
                    
                    s
                  
                
              
              
                
                  
                    P
                    a
                  
                  ⁢
                  
                    x
                    t
                  
                
                +
                
                  
                    P
                    b
                  
                  ⁢
                  
                    y
                    t
                  
                
                +
                
                  
                    P
                    c
                  
                  ⁢
                  f
                
              
            
            .
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          16
        
        )
      
    
  




The range in softness at the horizontal source boundary edge W is the absolute value of Equation 16 when xs=W:





  
    
      
        
          
            
            
              
                d
                ⁢
                
                  
                    x
                    _
                  
                  s
                
              
              
                d
                ⁢
                
                  
                
                ⁢
                
                  τ
                  
                    y
                    t
                  
                
              
            
            
          
          
            
              
                x
                _
              
              s
            
            =
            W
          
        
        =
        
          
            
            
              
                
                  T
                  b
                
                -
                
                  
                    P
                    b
                  
                  ⁢
                  W
                
              
              
                
                  
                    P
                    a
                  
                  ⁢
                  
                    x
                    t
                  
                
                +
                
                  
                    P
                    b
                  
                  ⁢
                  
                    y
                    t
                  
                
                +
                
                  
                    P
                    c
                  
                  ⁢
                  f
                
              
            
            
          
          =
          
            
              
                
                
                  
                    T
                    b
                  
                  -
                  
                    
                      P
                      b
                    
                    ⁢
                    W
                  
                
                
              
              
                
                
                  
                    
                      P
                      a
                    
                    ⁢
                    
                      x
                      t
                    
                  
                  +
                  
                    
                      P
                      b
                    
                    ⁢
                    
                      y
                      t
                    
                  
                  +
                  
                    
                      P
                      c
                    
                    ⁢
                    f
                  
                
                
              
            
            .
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          17
        
        )
      
    
  




This defines the change (parallel shift) in the horizontal source cropping line. Recall that





  
    W
    =
    
      
        
          C
          H
        
        -
        
          T
          d
        
      
      
        P
        d
      
    
  
  ,




where CH=CL for left source cropping and CH=CR for right source cropping.

Consider now the case where it is a horizontal cropping still (therefore xs=CH), but assume that |φxt|>1 (φxt>φyt) and therefore the corresponding target cropping line is




  
    x
    t
  
  =
  
    
      
        
          φ
          
            y
            t
          
        
        ⁢
        
          y
          t
        
      
      +
      
        τ
        
          x
          t
        
      
    
    =
    
      
        
          -
          
            
              (
              
                
                  
                    P
                    b
                  
                  ⁢
                  W
                
                -
                
                  T
                  b
                
              
              )
            
            
              (
              
                
                  
                    P
                    a
                  
                  ⁢
                  W
                
                -
                
                  T
                  a
                
              
              )
            
          
        
        ⁢
        
          y
          t
        
      
      -
      
        
          
            (
            
              
                
                  P
                  c
                
                ⁢
                W
              
              -
              
                T
                c
              
            
            )
          
          
            (
            
              
                
                  P
                  a
                
                ⁢
                W
              
              -
              
                T
                a
              
            
            )
          
        
        ⁢
        
          f
          .
        
      
    
  




We are interested in the case where there is a small change in τxt, since that represents the parallel shift in the target image horizontal boundary. More specifically, we are interested in the change in the corresponding horizontal source cropping boundary xs with respect to the change in the target image horizontal boundary





  
    
      τ
      
        x
        t
      
    
    ⁡
    
      (
      
        i
        .
        e
        .
        
          
            dx
            s
          
          
            d
            ⁢
            
              
            
            ⁢
            
              τ
              
                x
                t
              
            
          
        
      
      )
    
  
  .




Therefore, the differential





  
    dx
    s
  
  
    d
    ⁢
    
      
    
    ⁢
    
      τ
      
        x
        t
      
    
  




is to be computed.

The differential




  
    dx
    s
  
  
    d
    ⁢
    
      
    
    ⁢
    
      τ
      
        x
        t
      
    
  




can be expressed as





  
    
      dx
      s
    
    
      d
      ⁢
      
        
      
      ⁢
      
        τ
        
          x
          t
        
      
    
  
  =
  
    
      
        
          dx
          s
        
        
          d
          ⁢
          
            
              x
              _
            
            s
          
        
      
      ⁢
      
        
          d
          ⁢
          
            
              x
              _
            
            s
          
        
        
          d
          ⁢
          
            
          
          ⁢
          
            τ
            
              x
              t
            
          
        
      
    
    =
    
      
        P
        d
      
      ⁢
      
        
          
            d
            ⁢
            
              
                x
                _
              
              s
            
          
          
            d
            ⁢
            
              
            
            ⁢
            
              τ
              
                x
                t
              
            
          
        
        .
      
    
  




Therefore, substitute xt=φytyt+τxt into Equation 15




  
    (
    
      
        
          x
          _
        
        s
      
      =
      
        
          
            
              T
              a
            
            ⁡
            
              (
              
                
                  
                    φ
                    
                      y
                      t
                    
                  
                  ⁢
                  
                    y
                    t
                  
                
                +
                
                  τ
                  
                    x
                    t
                  
                
              
              )
            
          
          +
          
            
              T
              b
            
            ⁢
            
              y
              t
            
          
          +
          
            
              T
              c
            
            ⁢
            f
          
        
        
          
            
              P
              a
            
            ⁡
            
              (
              
                
                  
                    φ
                    
                      y
                      t
                    
                  
                  ⁢
                  
                    y
                    t
                  
                
                +
                
                  τ
                  
                    x
                    t
                  
                
              
              )
            
          
          +
          
            
              P
              b
            
            ⁢
            
              y
              t
            
          
          +
          
            
              P
              c
            
            ⁢
            f
          
        
      
    
    )
  
  ,




and taking the differential





  
    d
    ⁢
    
      
        x
        _
      
      s
    
  
  
    d
    ⁢
    
      
    
    ⁢
    
      τ
      
        x
        t
      
    
  




(using the quotient rule for derivatives):





  
    
      
        
          
            d
            ⁢
            
              
                x
                _
              
              s
            
          
          
            d
            ⁢
            
              
            
            ⁢
            
              τ
              
                x
                t
              
            
          
        
        =
        
          
            
              
                T
                a
              
              -
              
                
                  P
                  a
                
                ⁢
                
                  
                    x
                    _
                  
                  s
                
              
            
            
              
                
                  P
                  a
                
                ⁡
                
                  (
                  
                    
                      
                        φ
                        
                          y
                          t
                        
                      
                      ⁢
                      
                        y
                        t
                      
                    
                    +
                    
                      τ
                      
                        x
                        t
                      
                    
                  
                  )
                
              
              +
              
                
                  P
                  b
                
                ⁢
                
                  y
                  t
                
              
              +
              
                
                  P
                  c
                
                ⁢
                f
              
            
          
          =
          
            
              
                
                  T
                  a
                
                -
                
                  
                    P
                    a
                  
                  ⁢
                  
                    
                      x
                      _
                    
                    s
                  
                
              
              
                
                  
                    P
                    a
                  
                  ⁢
                  
                    x
                    t
                  
                
                +
                
                  
                    P
                    b
                  
                  ⁢
                  
                    y
                    t
                  
                
                +
                
                  
                    P
                    c
                  
                  ⁢
                  f
                
              
            
            .
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          18
        
        )
      
    
  




The range for softness at the horizontal source boundary edge W is the absolute value of Equation 18 when xs=W:





  
    
      
        
          
            
            
              
                d
                ⁢
                
                  
                    x
                    _
                  
                  s
                
              
              
                d
                ⁢
                
                  
                
                ⁢
                
                  τ
                  
                    y
                    t
                  
                
              
            
            
          
          
            
              
                x
                _
              
              s
            
            =
            W
          
        
        =
        
          
            
            
              
                
                  T
                  a
                
                -
                
                  
                    P
                    a
                  
                  ⁢
                  W
                
              
              
                
                  
                    P
                    a
                  
                  ⁢
                  
                    x
                    t
                  
                
                +
                
                  
                    P
                    b
                  
                  ⁢
                  
                    y
                    t
                  
                
                +
                
                  
                    P
                    c
                  
                  ⁢
                  f
                
              
            
            
          
          =
          
            
              
                
                
                  
                    T
                    a
                  
                  -
                  
                    
                      P
                      a
                    
                    ⁢
                    W
                  
                
                
              
              
                
                
                  
                    
                      P
                      a
                    
                    ⁢
                    
                      x
                      t
                    
                  
                  +
                  
                    
                      P
                      b
                    
                    ⁢
                    
                      y
                      t
                    
                  
                  +
                  
                    
                      P
                      c
                    
                    ⁢
                    f
                  
                
                
              
            
            .
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          19
        
        )
      
    
  




This defines the change (parallel shift) in the horizontal source cropping line.

Consider now the case where it is a vertical cropping (therefore ys=CV), and assume that |φxt|≦1 (φxt≦φyt) and therefore the corresponding target cropping line is




  
    y
    t
  
  =
  
    
      
        
          φ
          
            x
            t
          
        
        ⁢
        
          x
          t
        
      
      +
      
        τ
        
          y
          t
        
      
    
    =
    
      
        
          -
          
            
              (
              
                
                  
                    P
                    a
                  
                  ⁢
                  H
                
                -
                
                  T
                  e
                
              
              )
            
            
              (
              
                
                  
                    P
                    b
                  
                  ⁢
                  H
                
                -
                
                  T
                  f
                
              
              )
            
          
        
        ⁢
        
          x
          t
        
      
      -
      
        
          
            (
            
              
                
                  P
                  c
                
                ⁢
                H
              
              -
              
                T
                g
              
            
            )
          
          
            (
            
              
                
                  P
                  b
                
                ⁢
                H
              
              -
              
                T
                f
              
            
            )
          
        
        ⁢
        
          f
          .
        
      
    
  




We are interested in the case where there is a small change in τyt, since that represents the parallel shift in the target image vertical boundary. More specifically, we are interested in the change in the corresponding source vertical cropping boundary ys with respect to the change in the target image vertical boundary





  
    
      τ
      
        y
        t
      
    
    ⁡
    
      (
      
        i
        .
        e
        .
        
          
            dy
            s
          
          
            d
            ⁢
            
              
            
            ⁢
            
              τ
              
                y
                t
              
            
          
        
      
      )
    
  
  .




Therefore, the differential





  
    dy
    s
  
  
    d
    ⁢
    
      
    
    ⁢
    
      τ
      
        y
        t
      
    
  




is to be computed.





  
    Let
    ⁢
    
      
    
    ⁢
    
      
        y
        _
      
      s
    
  
  =
  
    
      
        
          y
          s
        
        -
        
          T
          h
        
      
      
        P
        d
      
    
    .
  




Therefore,





  
    
      
        
          
            y
            _
          
          s
        
        =
        
          
            
              
                
                  T
                  e
                
                ⁢
                
                  x
                  t
                
              
              +
              
                
                  T
                  f
                
                ⁢
                
                  y
                  t
                
              
              +
              
                
                  T
                  g
                
                ⁢
                f
              
            
            
              
                
                  P
                  a
                
                ⁢
                
                  x
                  t
                
              
              +
              
                
                  P
                  b
                
                ⁢
                
                  y
                  t
                
              
              +
              
                
                  P
                  c
                
                ⁢
                f
              
            
          
          .
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          20
        
        )
      
    
  




The differential





  
    dy
    s
  
  
    d
    ⁢
    
      
    
    ⁢
    
      τ
      
        y
        t
      
    
  




can be expressed as





  
    
      dy
      s
    
    
      d
      ⁢
      
        
      
      ⁢
      
        τ
        
          y
          t
        
      
    
  
  =
  
    
      
        
          dy
          s
        
        
          d
          ⁢
          
            
          
          ⁢
          
            
              y
              _
            
            s
          
        
      
      ⁢
      
        
          d
          ⁢
          
            
              y
              _
            
            s
          
        
        
          d
          ⁢
          
            
          
          ⁢
          
            τ
            
              y
              t
            
          
        
      
    
    =
    
      
        P
        d
      
      ⁢
      
        
          d
          ⁢
          
            
              y
              _
            
            s
          
        
        
          d
          ⁢
          
            
          
          ⁢
          
            τ
            
              y
              t
            
          
        
      
      ⁢
      
        
          (
          
            
              since
              ⁢
              
                
              
              ⁢
              
                
                  dy
                  s
                
                
                  d
                  ⁢
                  
                    
                      y
                      _
                    
                    s
                  
                
              
            
            =
            
              P
              d
            
          
          )
        
        .
      
    
  




Therefore, substitute yt=φxtxt+τyt into Equation 20




  
    (
    
      
        
          y
          _
        
        s
      
      =
      
        
          
            
              T
              e
            
            ⁢
            
              x
              t
            
          
          +
          
            
              T
              f
            
            ⁡
            
              (
              
                
                  
                    φ
                    
                      x
                      t
                    
                  
                  ⁢
                  
                    x
                    t
                  
                
                +
                
                  τ
                  
                    y
                    t
                  
                
              
              )
            
          
          +
          
            
              T
              g
            
            ⁢
            f
          
        
        
          
            
              P
              a
            
            ⁢
            
              x
              t
            
          
          +
          
            
              P
              b
            
            ⁡
            
              (
              
                
                  
                    φ
                    
                      x
                      t
                    
                  
                  ⁢
                  
                    x
                    t
                  
                
                +
                
                  τ
                  
                    y
                    t
                  
                
              
              )
            
          
          +
          
            
              P
              c
            
            ⁢
            f
          
        
      
    
    )
  
  ,




and taking the differential





  
    d
    ⁢
    
      
        y
        _
      
      s
    
  
  
    d
    ⁢
    
      
    
    ⁢
    
      τ
      
        y
        t
      
    
  




(using the quotient rule for derivatives):





  
    
      
        
          
            d
            ⁢
            
              
                y
                _
              
              s
            
          
          
            d
            ⁢
            
              
            
            ⁢
            
              τ
              
                y
                t
              
            
          
        
        =
        
          
            
              
                T
                f
              
              -
              
                
                  P
                  b
                
                ⁢
                
                  
                    y
                    _
                  
                  s
                
              
            
            
              
                
                  P
                  a
                
                ⁢
                
                  x
                  t
                
              
              +
              
                
                  P
                  b
                
                ⁡
                
                  (
                  
                    
                      
                        φ
                        
                          x
                          t
                        
                      
                      ⁢
                      
                        x
                        t
                      
                    
                    +
                    
                      τ
                      y
                    
                  
                  )
                
              
              +
              
                
                  P
                  c
                
                ⁢
                f
              
            
          
          =
          
            
              
                
                  T
                  f
                
                -
                
                  
                    P
                    b
                  
                  ⁢
                  
                    
                      y
                      _
                    
                    s
                  
                
              
              
                
                  
                    P
                    a
                  
                  ⁢
                  
                    x
                    t
                  
                
                +
                
                  
                    P
                    b
                  
                  ⁢
                  
                    y
                    t
                  
                
                +
                
                  
                    P
                    c
                  
                  ⁢
                  f
                
              
            
            .
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          21
        
        )
      
    
  




The range for softness at the vertical source boundary edge H is the absolute value of Equation 21 when ys=H:





  
    
      
        
          
            
            
              
                d
                ⁢
                
                  
                    y
                    _
                  
                  s
                
              
              
                d
                ⁢
                
                  
                
                ⁢
                
                  τ
                  
                    y
                    t
                  
                
              
            
            
          
          
            
              
                y
                _
              
              s
            
            =
            H
          
        
        =
        
          
            
            
              
                
                  T
                  f
                
                -
                
                  
                    P
                    b
                  
                  ⁢
                  H
                
              
              
                
                  
                    P
                    a
                  
                  ⁢
                  
                    x
                    t
                  
                
                +
                
                  
                    P
                    b
                  
                  ⁢
                  
                    y
                    t
                  
                
                +
                
                  
                    P
                    c
                  
                  ⁢
                  f
                
              
            
            
          
          =
          
            
              
                
                
                  
                    T
                    f
                  
                  -
                  
                    
                      P
                      b
                    
                    ⁢
                    H
                  
                
                
              
              
                
                
                  
                    
                      P
                      a
                    
                    ⁢
                    
                      x
                      t
                    
                  
                  +
                  
                    
                      P
                      b
                    
                    ⁢
                    
                      y
                      t
                    
                  
                  +
                  
                    
                      P
                      c
                    
                    ⁢
                    f
                  
                
                
              
            
            .
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          22
        
        )
      
    
  




This defines the change (parallel shift) in the vertical source cropping line.

Consider now the case where it is a vertical cropping still (therefore ys=CV), but assume that |φxt|>1 (φxt≦φyt) and therefore the corresponding target cropping line is




  
    x
    t
  
  =
  
    
      
        
          φ
          
            y
            t
          
        
        ⁢
        
          y
          t
        
      
      +
      
        τ
        
          x
          t
        
      
    
    =
    
      
        
          -
          
            
              (
              
                
                  
                    P
                    b
                  
                  ⁢
                  H
                
                -
                
                  T
                  f
                
              
              )
            
            
              (
              
                
                  
                    P
                    a
                  
                  ⁢
                  H
                
                -
                
                  T
                  e
                
              
              )
            
          
        
        ⁢
        
          y
          t
        
      
      -
      
        
          
            (
            
              
                
                  P
                  c
                
                ⁢
                H
              
              -
              
                T
                g
              
            
            )
          
          
            (
            
              
                
                  P
                  a
                
                ⁢
                H
              
              -
              
                T
                e
              
            
            )
          
        
        ⁢
        
          f
          .
        
      
    
  




We are interested in the case where there is a small change in τxt, since that represents the parallel shift in the target image vertical boundary. More specifically, we are interested in the change in the corresponding source vertical cropping boundary ys with respect to the change in the target image vertical boundary





  
    
      τ
      
        x
        t
      
    
    ⁡
    
      (
      
        i
        .
        e
        .
        
          
        
        ⁢
        
          
            dy
            s
          
          
            d
            ⁢
            
              
            
            ⁢
            
              τ
              
                x
                t
              
            
          
        
      
      )
    
  
  .




Therefore, the differential





  
    dy
    s
  
  
    d
    ⁢
    
      
    
    ⁢
    
      τ
      
        x
        t
      
    
  




is to be computed.

The differential




  
    dy
    s
  
  
    d
    ⁢
    
      
    
    ⁢
    
      τ
      
        x
        t
      
    
  




can be expressed as





  
    
      dy
      s
    
    
      d
      ⁢
      
        
      
      ⁢
      
        τ
        
          x
          t
        
      
    
  
  =
  
    
      
        
          dy
          s
        
        
          d
          ⁢
          
            
              y
              _
            
            s
          
        
      
      ⁢
      
        
          d
          ⁢
          
            
              y
              _
            
            s
          
        
        
          d
          ⁢
          
            
          
          ⁢
          
            τ
            
              x
              t
            
          
        
      
    
    =
    
      
        P
        d
      
      ⁢
      
        
          
            d
            ⁢
            
              
                y
                _
              
              s
            
          
          
            d
            ⁢
            
              
            
            ⁢
            
              τ
              
                x
                t
              
            
          
        
        .
      
    
  




Therefore, substitute xt=φytyt+τxt into Equation 20




  
    (
    
      
        
          y
          _
        
        s
      
      =
      
        
          
            
              T
              e
            
            ⁡
            
              (
              
                
                  
                    φ
                    
                      y
                      t
                    
                  
                  ⁢
                  
                    y
                    t
                  
                
                +
                
                  τ
                  
                    x
                    t
                  
                
              
              )
            
          
          +
          
            
              T
              f
            
            ⁢
            
              y
              t
            
          
          +
          
            
              T
              g
            
            ⁢
            f
          
        
        
          
            
              P
              a
            
            ⁡
            
              (
              
                
                  
                    φ
                    
                      y
                      t
                    
                  
                  ⁢
                  
                    y
                    t
                  
                
                +
                
                  τ
                  
                    x
                    t
                  
                
              
              )
            
          
          +
          
            
              P
              b
            
            ⁢
            
              y
              t
            
          
          +
          
            
              P
              c
            
            ⁢
            f
          
        
      
    
    )
  
  ,




and taking the differential





  
    d
    ⁢
    
      
        y
        _
      
      s
    
  
  
    d
    ⁢
    
      
    
    ⁢
    
      τ
      
        x
        t
      
    
  




(using the quotient rule for derivatives):





  
    
      
        
          
            d
            ⁢
            
              
                y
                _
              
              s
            
          
          
            d
            ⁢
            
              
            
            ⁢
            
              τ
              
                x
                t
              
            
          
        
        =
        
          
            
              
                T
                e
              
              -
              
                
                  P
                  a
                
                ⁢
                
                  
                    y
                    _
                  
                  s
                
              
            
            
              
                
                  P
                  a
                
                ⁡
                
                  (
                  
                    
                      
                        φ
                        
                          y
                          t
                        
                      
                      ⁢
                      
                        y
                        t
                      
                    
                    +
                    
                      τ
                      
                        x
                        t
                      
                    
                  
                  )
                
              
              +
              
                
                  P
                  b
                
                ⁢
                
                  y
                  t
                
              
              +
              
                
                  P
                  c
                
                ⁢
                f
              
            
          
          =
          
            
              
                
                  T
                  e
                
                -
                
                  
                    P
                    a
                  
                  ⁢
                  
                    
                      y
                      _
                    
                    s
                  
                
              
              
                
                  
                    P
                    a
                  
                  ⁢
                  
                    x
                    t
                  
                
                +
                
                  
                    P
                    b
                  
                  ⁢
                  
                    y
                    t
                  
                
                +
                
                  
                    P
                    c
                  
                  ⁢
                  f
                
              
            
            .
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          23
        
        )
      
    
  




The range for softness at the vertical source boundary edge H is the absolute value of Equation 23 when ys=H:





  
    
      
        
          
            
            
              
                d
                ⁢
                
                  
                    y
                    _
                  
                  s
                
              
              
                d
                ⁢
                
                  
                
                ⁢
                
                  τ
                  
                    x
                    t
                  
                
              
            
            
          
          
            
              
                y
                _
              
              s
            
            =
            H
          
        
        =
        
          
            
            
              
                
                  T
                  e
                
                -
                
                  
                    P
                    a
                  
                  ⁢
                  H
                
              
              
                
                  
                    P
                    a
                  
                  ⁢
                  
                    x
                    t
                  
                
                +
                
                  
                    P
                    b
                  
                  ⁢
                  
                    y
                    t
                  
                
                +
                
                  
                    P
                    c
                  
                  ⁢
                  f
                
              
            
            
          
          =
          
            
              
                
                
                  
                    T
                    e
                  
                  -
                  
                    
                      P
                      a
                    
                    ⁢
                    H
                  
                
                
              
              
                
                
                  
                    
                      P
                      a
                    
                    ⁢
                    
                      x
                      t
                    
                  
                  +
                  
                    
                      P
                      b
                    
                    ⁢
                    
                      y
                      t
                    
                  
                  +
                  
                    
                      P
                      c
                    
                    ⁢
                    f
                  
                
                
              
            
            .
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          24
        
        )
      
    
  




This defines the change (parallel shift) in the vertical source cropping line.

Constructing the shaping alpha αshp will now be described.
A constant spatial softness area bordering the target object provides for uniform softness. Therefore, each boundary of the target object is parallel-shifted by an amount Δtgt. This is a user-controllable parameter, and the corresponding change in the source image is Δsrc. The value Δsrc is determined by multiplying the amount Δtgt in the target space by the absolute value of the value that represents the change in the corresponding source cropping boundary with respect to the change in the target image boundary. That is, for the horizontal boundary:




  
    
      
        
          
            
              
                Δ
                src
                x
              
              =
              
              ⁢
              
                {
                
                  
                    
                      
                        
                          
                            Δ
                            tgt
                          
                          ⁢
                          
                            
                              
                              
                                
                                  dx
                                  s
                                
                                
                                  d
                                  ⁢
                                  
                                    
                                  
                                  ⁢
                                  
                                    τ
                                    
                                      y
                                      t
                                    
                                  
                                
                              
                              
                            
                            
                              
                                x
                                s
                              
                              =
                              
                                C
                                H
                              
                            
                          
                        
                        ,
                      
                    
                    
                      
                        
                          if
                          ⁢
                          
                            
                          
                          ⁢
                          
                            
                            
                              φ
                              
                                x
                                t
                              
                            
                            
                          
                        
                        ≤
                        1
                      
                    
                  
                  
                    
                      
                        
                          
                            Δ
                            tgt
                          
                          ⁢
                          
                            
                              
                              
                                
                                  dx
                                  s
                                
                                
                                  d
                                  ⁢
                                  
                                    
                                  
                                  ⁢
                                  
                                    τ
                                    
                                      x
                                      t
                                    
                                  
                                
                              
                              
                            
                            
                              
                                x
                                s
                              
                              =
                              
                                C
                                H
                              
                            
                          
                        
                        ,
                      
                    
                    
                      else
                    
                  
                
              
            
          
        
        
          
            
              =
              
              ⁢
              
                {
                
                  
                    
                      
                        
                          
                            Δ
                            tgt
                          
                          ⁢
                          
                            
                              
                              
                                
                                  P
                                  d
                                
                                ⁢
                                
                                  
                                    d
                                    ⁢
                                    
                                      
                                        x
                                        _
                                      
                                      s
                                    
                                  
                                  
                                    d
                                    ⁢
                                    
                                      
                                    
                                    ⁢
                                    
                                      τ
                                      
                                        y
                                        t
                                      
                                    
                                  
                                
                              
                              
                            
                            
                              
                                
                                  x
                                  _
                                
                                s
                              
                              =
                              W
                            
                          
                        
                        ,
                      
                    
                    
                      
                        
                          if
                          ⁢
                          
                            
                          
                          ⁢
                          
                            
                            
                              φ
                              
                                x
                                t
                              
                            
                            
                          
                        
                        ≤
                        1
                      
                    
                  
                  
                    
                      
                        
                          
                            Δ
                            tgt
                          
                          ⁢
                          
                            
                              
                              
                                
                                  P
                                  d
                                
                                ⁢
                                
                                  
                                    d
                                    ⁢
                                    
                                      
                                        x
                                        _
                                      
                                      s
                                    
                                  
                                  
                                    d
                                    ⁢
                                    
                                      
                                    
                                    ⁢
                                    
                                      τ
                                      
                                        x
                                        t
                                      
                                    
                                  
                                
                              
                              
                            
                            
                              
                                
                                  x
                                  _
                                
                                s
                              
                              =
                              W
                            
                          
                        
                        ,
                      
                    
                    
                      else
                    
                  
                
              
            
          
        
        
          
            
              =
              
              ⁢
              
                {
                
                  
                    
                      
                        
                          
                            
                              
                              
                                
                                  P
                                  d
                                
                                ⁡
                                
                                  (
                                  
                                    
                                      T
                                      b
                                    
                                    -
                                    
                                      
                                        P
                                        b
                                      
                                      ⁢
                                      W
                                    
                                  
                                  )
                                
                              
                              
                            
                            ⁢
                            
                              Δ
                              tgt
                            
                          
                          
                            
                            
                              
                                
                                  P
                                  a
                                
                                ⁢
                                
                                  x
                                  t
                                
                              
                              +
                              
                                
                                  P
                                  b
                                
                                ⁢
                                
                                  y
                                  t
                                
                              
                              +
                              
                                
                                  P
                                  c
                                
                                ⁢
                                f
                              
                            
                            
                          
                        
                        ,
                      
                    
                    
                      
                        
                          if
                          ⁢
                          
                            
                          
                          ⁢
                          
                            
                            
                              
                                
                                  P
                                  a
                                
                                ⁢
                                W
                              
                              -
                              
                                T
                                a
                              
                            
                            
                          
                        
                        ≤
                        
                          
                          
                            
                              
                                P
                                b
                              
                              ⁢
                              W
                            
                            -
                            
                              T
                              b
                            
                          
                          
                        
                      
                    
                  
                  
                    
                      
                        
                          
                            
                              
                              
                                
                                  P
                                  d
                                
                                ⁡
                                
                                  (
                                  
                                    
                                      T
                                      a
                                    
                                    -
                                    
                                      
                                        P
                                        a
                                      
                                      ⁢
                                      W
                                    
                                  
                                  )
                                
                              
                              
                            
                            ⁢
                            
                              Δ
                              tgt
                            
                          
                          
                            
                            
                              
                                
                                  P
                                  a
                                
                                ⁢
                                
                                  x
                                  t
                                
                              
                              +
                              
                                
                                  P
                                  b
                                
                                ⁢
                                
                                  y
                                  t
                                
                              
                              +
                              
                                
                                  P
                                  c
                                
                                ⁢
                                f
                              
                            
                            
                          
                        
                        ,
                      
                    
                    
                      else
                    
                  
                
              
            
          
        
        
          
            
              =
              
              ⁢
              
                {
                
                  
                    
                      
                        
                          
                            
                              
                                
                                  
                                    
                                    
                                      
                                        
                                          P
                                          d
                                        
                                        ⁢
                                        
                                          T
                                          b
                                        
                                      
                                      -
                                    
                                  
                                
                              
                              
                                
                                  
                                    
                                      
                                        
                                          P
                                          b
                                        
                                        ⁡
                                        
                                          (
                                          
                                            
                                              C
                                              H
                                            
                                            -
                                            
                                              T
                                              d
                                            
                                          
                                          )
                                        
                                      
                                      
                                    
                                    ⁢
                                    
                                      Δ
                                      tgt
                                    
                                  
                                
                              
                            
                            
                              
                              
                                
                                  
                                    P
                                    a
                                  
                                  ⁢
                                  
                                    x
                                    t
                                  
                                
                                +
                                
                                  
                                    P
                                    b
                                  
                                  ⁢
                                  
                                    y
                                    t
                                  
                                
                                +
                                
                                  
                                    P
                                    c
                                  
                                  ⁢
                                  f
                                
                              
                              
                            
                          
                          ,
                        
                      
                      
                        
                          
                            
                              
                                
                                  if
                                  ⁢
                                  
                                    
                                  
                                  ⁢
                                  
                                    
                                    
                                      
                                        
                                          P
                                          a
                                        
                                        ⁡
                                        
                                          (
                                          
                                            
                                              C
                                              H
                                            
                                            -
                                            
                                              T
                                              d
                                            
                                          
                                          )
                                        
                                      
                                      -
                                      
                                        
                                          P
                                          d
                                        
                                        ⁢
                                        
                                          T
                                          a
                                        
                                      
                                    
                                    
                                  
                                
                                ≤
                              
                            
                          
                          
                            
                              
                                
                                
                                  
                                    
                                      P
                                      b
                                    
                                    ⁡
                                    
                                      (
                                      
                                        
                                          C
                                          H
                                        
                                        -
                                        
                                          T
                                          d
                                        
                                      
                                      )
                                    
                                  
                                  -
                                  
                                    
                                      P
                                      d
                                    
                                    ⁢
                                    
                                      T
                                      b
                                    
                                  
                                
                                
                              
                            
                          
                        
                      
                    
                    
                      
                        
                          
                            
                              
                                
                                  
                                    
                                    
                                      
                                        
                                          P
                                          d
                                        
                                        ⁢
                                        
                                          T
                                          a
                                        
                                      
                                      -
                                    
                                  
                                
                              
                              
                                
                                  
                                    
                                      
                                        
                                          P
                                          a
                                        
                                        ⁡
                                        
                                          (
                                          
                                            
                                              C
                                              H
                                            
                                            -
                                            
                                              T
                                              d
                                            
                                          
                                          )
                                        
                                      
                                      
                                    
                                    ⁢
                                    
                                      Δ
                                      tgt
                                    
                                  
                                
                              
                            
                            
                              
                              
                                
                                  
                                    P
                                    a
                                  
                                  ⁢
                                  
                                    x
                                    t
                                  
                                
                                +
                                
                                  
                                    P
                                    b
                                  
                                  ⁢
                                  
                                    y
                                    t
                                  
                                
                                +
                                
                                  
                                    P
                                    c
                                  
                                  ⁢
                                  f
                                
                              
                              
                            
                          
                          ,
                        
                      
                      
                        else
                      
                    
                  
                  .
                
              
            
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          25
        
        )
      
    
  




For the vertical boundary:





  
    
      
        
          
            
              
                Δ
                src
                y
              
              =
              
              ⁢
              
                {
                
                  
                    
                      
                        
                          
                            Δ
                            tgt
                          
                          ⁢
                          
                            
                              
                              
                                
                                  dy
                                  s
                                
                                
                                  d
                                  ⁢
                                  
                                    
                                  
                                  ⁢
                                  
                                    τ
                                    
                                      y
                                      t
                                    
                                  
                                
                              
                              
                            
                            
                              
                                y
                                s
                              
                              =
                              
                                C
                                V
                              
                            
                          
                        
                        ,
                      
                    
                    
                      
                        
                          if
                          ⁢
                          
                            
                          
                          ⁢
                          
                            
                            
                              φ
                              
                                x
                                t
                              
                            
                            
                          
                        
                        ≤
                        1
                      
                    
                  
                  
                    
                      
                        
                          
                            Δ
                            tgt
                          
                          ⁢
                          
                            
                              
                              
                                
                                  dy
                                  s
                                
                                
                                  d
                                  ⁢
                                  
                                    
                                  
                                  ⁢
                                  
                                    τ
                                    
                                      x
                                      t
                                    
                                  
                                
                              
                              
                            
                            
                              
                                y
                                s
                              
                              =
                              
                                C
                                V
                              
                            
                          
                        
                        ,
                      
                    
                    
                      else
                    
                  
                
              
            
          
        
        
          
            
              =
              
              ⁢
              
                {
                
                  
                    
                      
                        
                          
                            Δ
                            tgt
                          
                          ⁢
                          
                            
                              
                              
                                
                                  P
                                  d
                                
                                ⁢
                                
                                  
                                    d
                                    ⁢
                                    
                                      
                                        y
                                        _
                                      
                                      s
                                    
                                  
                                  
                                    d
                                    ⁢
                                    
                                      
                                    
                                    ⁢
                                    
                                      τ
                                      
                                        y
                                        t
                                      
                                    
                                  
                                
                              
                              
                            
                            
                              
                                
                                  y
                                  _
                                
                                s
                              
                              =
                              H
                            
                          
                        
                        ,
                      
                    
                    
                      
                        
                          if
                          ⁢
                          
                            
                          
                          ⁢
                          
                            
                            
                              φ
                              
                                x
                                t
                              
                            
                            
                          
                        
                        ≤
                        1
                      
                    
                  
                  
                    
                      
                        
                          
                            Δ
                            tgt
                          
                          ⁢
                          
                            
                              
                              
                                
                                  P
                                  d
                                
                                ⁢
                                
                                  
                                    d
                                    ⁢
                                    
                                      
                                        y
                                        _
                                      
                                      s
                                    
                                  
                                  
                                    d
                                    ⁢
                                    
                                      
                                    
                                    ⁢
                                    
                                      τ
                                      
                                        x
                                        t
                                      
                                    
                                  
                                
                              
                              
                            
                            
                              
                                
                                  y
                                  _
                                
                                s
                              
                              =
                              H
                            
                          
                        
                        ,
                      
                    
                    
                      else
                    
                  
                
              
            
          
        
        
          
            
              =
              
              ⁢
              
                {
                
                  
                    
                      
                        
                          
                            
                              
                              
                                
                                  P
                                  d
                                
                                ⁡
                                
                                  (
                                  
                                    
                                      T
                                      f
                                    
                                    -
                                    
                                      
                                        P
                                        b
                                      
                                      ⁢
                                      H
                                    
                                  
                                  )
                                
                              
                              
                            
                            ⁢
                            
                              Δ
                              tgt
                            
                          
                          
                            
                            
                              
                                
                                  P
                                  a
                                
                                ⁢
                                
                                  x
                                  t
                                
                              
                              +
                              
                                
                                  P
                                  b
                                
                                ⁢
                                
                                  y
                                  t
                                
                              
                              +
                              
                                
                                  P
                                  c
                                
                                ⁢
                                f
                              
                            
                            
                          
                        
                        ,
                      
                    
                    
                      
                        
                          if
                          ⁢
                          
                            
                          
                          ⁢
                          
                            
                            
                              
                                
                                  P
                                  a
                                
                                ⁢
                                H
                              
                              -
                              
                                T
                                e
                              
                            
                            
                          
                        
                        ≤
                        
                          
                          
                            
                              
                                P
                                b
                              
                              ⁢
                              H
                            
                            -
                            
                              T
                              f
                            
                          
                          
                        
                      
                    
                  
                  
                    
                      
                        
                          
                            
                              
                              
                                
                                  P
                                  d
                                
                                ⁡
                                
                                  (
                                  
                                    
                                      T
                                      e
                                    
                                    -
                                    
                                      
                                        P
                                        a
                                      
                                      ⁢
                                      H
                                    
                                  
                                  )
                                
                              
                              
                            
                            ⁢
                            
                              Δ
                              tgt
                            
                          
                          
                            
                            
                              
                                
                                  P
                                  a
                                
                                ⁢
                                
                                  x
                                  t
                                
                              
                              +
                              
                                
                                  P
                                  b
                                
                                ⁢
                                
                                  y
                                  t
                                
                              
                              +
                              
                                
                                  P
                                  c
                                
                                ⁢
                                f
                              
                            
                            
                          
                        
                        ,
                      
                    
                    
                      else
                    
                  
                
              
            
          
        
        
          
            
              =
              
              ⁢
              
                {
                
                  
                    
                      
                        
                          
                            
                              
                                
                                  
                                    
                                    
                                      
                                        
                                          P
                                          d
                                        
                                        ⁢
                                        
                                          T
                                          f
                                        
                                      
                                      -
                                    
                                  
                                
                              
                              
                                
                                  
                                    
                                      
                                        
                                          P
                                          b
                                        
                                        ⁡
                                        
                                          (
                                          
                                            
                                              C
                                              V
                                            
                                            -
                                            
                                              T
                                              h
                                            
                                          
                                          )
                                        
                                      
                                      
                                    
                                    ⁢
                                    
                                      Δ
                                      tgt
                                    
                                  
                                
                              
                            
                            
                              
                              
                                
                                  
                                    P
                                    a
                                  
                                  ⁢
                                  
                                    x
                                    t
                                  
                                
                                +
                                
                                  
                                    P
                                    b
                                  
                                  ⁢
                                  
                                    y
                                    t
                                  
                                
                                +
                                
                                  
                                    P
                                    c
                                  
                                  ⁢
                                  f
                                
                              
                              
                            
                          
                          ,
                        
                      
                      
                        
                          
                            
                              
                                
                                  if
                                  ⁢
                                  
                                    
                                  
                                  ⁢
                                  
                                    
                                    
                                      
                                        
                                          P
                                          a
                                        
                                        ⁡
                                        
                                          (
                                          
                                            
                                              C
                                              V
                                            
                                            -
                                            
                                              T
                                              h
                                            
                                          
                                          )
                                        
                                      
                                      -
                                      
                                        
                                          P
                                          d
                                        
                                        ⁢
                                        
                                          T
                                          e
                                        
                                      
                                    
                                    
                                  
                                
                                ≤
                              
                            
                          
                          
                            
                              
                                
                                
                                  
                                    
                                      P
                                      b
                                    
                                    ⁡
                                    
                                      (
                                      
                                        
                                          C
                                          V
                                        
                                        -
                                        
                                          T
                                          h
                                        
                                      
                                      )
                                    
                                  
                                  -
                                  
                                    
                                      P
                                      d
                                    
                                    ⁢
                                    
                                      T
                                      f
                                    
                                  
                                
                                
                              
                            
                          
                        
                      
                    
                    
                      
                        
                          
                            
                              
                                
                                  
                                    
                                    
                                      
                                        
                                          P
                                          d
                                        
                                        ⁢
                                        
                                          T
                                          e
                                        
                                      
                                      -
                                    
                                  
                                
                              
                              
                                
                                  
                                    
                                      
                                        
                                          P
                                          a
                                        
                                        ⁡
                                        
                                          (
                                          
                                            
                                              C
                                              V
                                            
                                            -
                                            
                                              T
                                              h
                                            
                                          
                                          )
                                        
                                      
                                      
                                    
                                    ⁢
                                    
                                      Δ
                                      tgt
                                    
                                  
                                
                              
                            
                            
                              
                              
                                
                                  
                                    P
                                    a
                                  
                                  ⁢
                                  
                                    x
                                    t
                                  
                                
                                +
                                
                                  
                                    P
                                    b
                                  
                                  ⁢
                                  
                                    y
                                    t
                                  
                                
                                +
                                
                                  
                                    P
                                    c
                                  
                                  ⁢
                                  f
                                
                              
                              
                            
                          
                          ,
                        
                      
                      
                        else
                      
                    
                  
                  .
                
              
            
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          26
        
        )
      
    
  




Δsrcx, and Δsrcy, are spatial-variant ranges or dynamic ranges in the source image space, horizontally and vertically respectively.

In the equations above, absolute values of differentiations are used because mathematically, increments dτx t and dτy t could cause dxs and dys to extend in an uncertain direction (positive or negative). It is the absolute ranges that are of interest, not the direction.
To construct the shaping alpha value αshp(xt,yt) for each target pixel (xt,yt) mapped to a corresponding source pixel (xs,ys), a pre-alpha value α′i(xs,ys) is first computed as




  
    
      
        
          
            α
            i
            ′
          
          ⁡
          
            (
            
              
                x
                s
              
              ,
              
                y
                s
              
            
            )
          
        
        =
        
          
            
              Δ
              ⁢
              
                
              
              ⁢
              
                D
                i
              
            
            
              Δ
              src
              i
            
          
          =
          
            {
            
              
                
                  
                    
                      
                        
                          Δ
                          ⁢
                          
                            
                          
                          ⁢
                          x
                        
                        
                          Δ
                          src
                          x
                        
                      
                      =
                      
                        {
                        
                          
                            
                              
                                
                                  
                                    
                                      
                                        x
                                        s
                                      
                                      -
                                      
                                        C
                                        L
                                      
                                    
                                    
                                      Δ
                                      src
                                      L
                                    
                                  
                                  ⁢
                                  i
                                
                                =
                                
                                  L
                                  ⁢
                                  
                                    
                                  
                                  ⁢
                                  
                                    (
                                    
                                      left
                                      ⁢
                                      
                                        
                                      
                                      ⁢
                                      edge
                                    
                                    )
                                  
                                
                              
                            
                          
                          
                            
                              
                                
                                  
                                    
                                      
                                        C
                                        R
                                      
                                      -
                                      
                                        x
                                        s
                                      
                                    
                                    
                                      Δ
                                      src
                                      R
                                    
                                  
                                  ⁢
                                  i
                                
                                =
                                
                                  R
                                  ⁢
                                  
                                    
                                  
                                  ⁢
                                  
                                    (
                                    
                                      right
                                      ⁢
                                      
                                        
                                      
                                      ⁢
                                      edge
                                    
                                    )
                                  
                                
                              
                            
                          
                        
                      
                    
                  
                
                
                  
                    
                      
                        
                          Δ
                          ⁢
                          
                            
                          
                          ⁢
                          y
                        
                        
                          Δ
                          src
                          y
                        
                      
                      =
                      
                        {
                        
                          
                            
                              
                                
                                  
                                    
                                      
                                        y
                                        s
                                      
                                      -
                                      
                                        C
                                        T
                                      
                                    
                                    
                                      Δ
                                      src
                                      T
                                    
                                  
                                  ⁢
                                  i
                                
                                =
                                
                                  T
                                  ⁢
                                  
                                    
                                  
                                  ⁢
                                  
                                    (
                                    
                                      top
                                      ⁢
                                      
                                        
                                      
                                      ⁢
                                      edge
                                    
                                    )
                                  
                                
                              
                            
                          
                          
                            
                              
                                
                                  
                                    
                                      
                                        C
                                        B
                                      
                                      -
                                      
                                        y
                                        s
                                      
                                    
                                    
                                      Δ
                                      src
                                      B
                                    
                                  
                                  ⁢
                                  i
                                
                                =
                                
                                  B
                                  ⁢
                                  
                                    
                                  
                                  ⁢
                                  
                                    (
                                    
                                      bottom
                                      ⁢
                                      
                                        
                                      
                                      ⁢
                                      edge
                                    
                                    )
                                  
                                
                              
                            
                          
                        
                      
                    
                  
                
              
              ,
            
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          27
        
        )
      
    
  




where ΔDi is a distance difference between a source coordinate and a cropping line (boundary line in the source image), and Δx and Δy are horizontal and vertical distance differences respectively.

The shaping alpha value on each source boundary is then constructed by the following clipping function:




  
    
      
        
          
            a
            i
          
          ⁡
          
            (
            
              
                x
                s
              
              ,
              
                y
                s
              
            
            )
          
        
        =
        
          {
          
            
              
                
                  0
                  ,
                
              
              
                
                  
                    
                      α
                      i
                      ′
                    
                    ⁡
                    
                      (
                      
                        
                          x
                          s
                        
                        ,
                        
                          y
                          s
                        
                      
                      )
                    
                  
                  <
                  0
                
              
            
            
              
                
                  1
                  ,
                
              
              
                
                  
                    
                      α
                      i
                      ′
                    
                    ⁡
                    
                      (
                      
                        
                          x
                          s
                        
                        ,
                        
                          y
                          s
                        
                      
                      )
                    
                  
                  >
                  1
                
              
            
            
              
                
                  
                    
                      α
                      i
                      ′
                    
                    ⁡
                    
                      (
                      
                        
                          x
                          s
                        
                        ,
                        
                          y
                          s
                        
                      
                      )
                    
                  
                  ,
                
              
              
                else
              
            
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          28
        
        )
      
    
  




where i=L, R, T, B.

To assist in understanding Equations 27 and 28, please consider FIGS. 19 to 21. In these figures, the softness area bordering the image is within the crop lines (CL, CR, CT, and CB). The softness area has inward ramping. This is to illustrate a variation compared to FIG. 15 in which the softness area bordering the image is outside the crop lines and has outward ramping. Equation 27 is specific to an inward ramping implementation, it being understood that the equation could be modified in a straight-forward way for the FIG. 15 outward ramping implementation instead.
With reference first to FIG. 19, a target pixel coordinate (xt,yt) is mapped to a corresponding source pixel coordinate (xs,ys) inside the softness area by the DVE device 120 (via Equations 1 and 2 in this example embodiment). The pre-alpha value for the top boundary α′T(xs,ys) is (via Equation 27):




  
    
      α
      T
      ′
    
    ⁡
    
      (
      
        
          x
          s
        
        ,
        
          y
          s
        
      
      )
    
  
  =
  
    
      
        Δ
        ⁢
        
          
        
        ⁢
        y
      
      
        Δ
        src
        y
      
    
    =
    
      
        
          
            y
            s
          
          -
          
            C
            T
          
        
        
          Δ
          src
          T
        
      
      .
    
  




Note that 0<α′T (xs,ys)<1 in this example since ys−CT<ΔsrcT. The shaping alpha value αT(xs,ys) for the top boundary for source pixel coordinate (xs,ys) is therefore αT(xs,ys)=α′T(xs,ys). The pre-alpha value for the left boundary α′L(xs,ys) is (via Equation 27):





  
    α
    L
    ′
  
  =
  
    
      
        Δ
        ⁢
        
          
        
        ⁢
        x
      
      
        Δ
        src
        x
      
    
    =
    
      
        
          
            x
            s
          
          -
          
            C
            L
          
        
        
          Δ
          src
          L
        
      
      .
    
  




Note that 0<α′L(xs,ys)<1 in this example since xs−CL<ΔsrcL. The shaping alpha value αL(xs,ys) for the left boundary for source pixel coordinate (xs,ys) is therefore αL(xs,ys)=α′L(xs,ys). The shaping alpha value for the bottom boundary (αB(xs,ys)) and the right boundary (αR(xs,ys)) are computed in a similar manner.

Now consider the situation in FIG. 20 in which a target pixel coordinate (xt,yt) is mapped to a corresponding source pixel coordinate (xs,ys) that is outside the softness area. The pre-alpha value for the top boundary α′T(xs,ys) is (via Equation 27):




  
    
      α
      T
      ′
    
    ⁡
    
      (
      
        
          x
          s
        
        ,
        
          y
          s
        
      
      )
    
  
  =
  
    
      
        Δ
        ⁢
        
          
        
        ⁢
        y
      
      
        Δ
        src
        y
      
    
    =
    
      
        
          
            y
            s
          
          -
          
            C
            T
          
        
        
          Δ
          src
          T
        
      
      .
    
  




Note that α′T(xs,ys)<0 in this example since CT>ys. The shaping alpha αT(xs,ys) for the top boundary for source pixel coordinate (xs,ys) is therefore αT(xs,ys)=0. Similarly, the shaping alpha αL(xs,ys) for the left boundary for source pixel coordinate (xs,ys) is also αL(xs,ys)=0 since a′L(xs,ys)<0. The shaping alpha value for the bottom boundary αB(xs,ys)) and the right boundary (αR(xs,ys)) are computed in a similar manner.

As a third example, consider the situation in FIG. 21 in which a target pixel coordinate (xt,yt) is mapped to a corresponding source pixel coordinate (xs,ys) that is inside the source image boundaries. The pre-alpha value for the top boundary α′T(xs,ys) is (via Equation 27):




  
    
      α
      T
      ′
    
    ⁡
    
      (
      
        
          x
          s
        
        ,
        
          y
          s
        
      
      )
    
  
  =
  
    
      
        Δ
        ⁢
        
          
        
        ⁢
        y
      
      
        Δ
        src
        y
      
    
    =
    
      
        
          
            y
            s
          
          -
          
            C
            T
          
        
        
          Δ
          src
          T
        
      
      .
    
  




Note that α′T(xs,ys)>1 in this example since ys>CT and ys−CT>ΔsrcT. The shaping alpha αT(xs,ys) for the top boundary for source pixel coordinate (xs,ys) is therefore αT(xs,ys)=1 as per Equation 28. Similarly, the shaping alpha αL(xs,ys) for the left boundary for source pixel coordinate (xs,ys) is also αL(xs,ys)=1 since xs>CL and xs−CL>ΔsrcL. The shaping alpha value for the bottom boundary (αB(xs,ys)) and the right boundary (αR(xs,ys)) are computed in a similar manner.

As mentioned above, the Equation 27 is specific to an inward ramping implementation. This is in contrast to outward ramping. Outward ramping would require a straight-forward modification to Equation 27 to instead be:




  
    
      α
      i
      ′
    
    ⁡
    
      (
      
        
          x
          s
        
        ,
        
          y
          s
        
      
      )
    
  
  =
  
    
      
        Δ
        ⁢
        
          
        
        ⁢
        
          D
          i
        
      
      
        Δ
        src
        i
      
    
    =
    
      {
      
        
          
            
              
                
                  
                    Δ
                    ⁢
                    
                      
                    
                    ⁢
                    x
                  
                  
                    Δ
                    src
                    x
                  
                
                =
                
                  {
                  
                    
                      
                        
                          
                            
                              
                                
                                  C
                                  L
                                
                                -
                                
                                  x
                                  s
                                
                              
                              
                                Δ
                                src
                                L
                              
                            
                            ⁢
                            i
                          
                          =
                          
                            L
                            ⁢
                            
                              
                            
                            ⁢
                            
                              (
                              
                                left
                                ⁢
                                
                                  
                                
                                ⁢
                                edge
                              
                              )
                            
                          
                        
                      
                    
                    
                      
                        
                          
                            x
                            ⁢
                            
                              
                                
                                  x
                                  s
                                
                                -
                                
                                  C
                                  R
                                
                              
                              
                                Δ
                                src
                                R
                              
                            
                            ⁢
                            i
                          
                          =
                          
                            R
                            ⁢
                            
                              
                            
                            ⁢
                            
                              (
                              
                                right
                                ⁢
                                
                                  
                                
                                ⁢
                                edge
                              
                              )
                            
                          
                        
                      
                    
                  
                
              
            
          
          
            
              
                
                  
                    Δ
                    ⁢
                    
                      
                    
                    ⁢
                    y
                  
                  
                    Δ
                    src
                    y
                  
                
                =
                
                  {
                  
                    
                      
                        
                          
                            
                              
                                
                                  C
                                  T
                                
                                -
                                
                                  y
                                  s
                                
                              
                              
                                Δ
                                src
                                T
                              
                            
                            ⁢
                            i
                          
                          =
                          
                            T
                            ⁢
                            
                              
                            
                            ⁢
                            
                              (
                              
                                top
                                ⁢
                                
                                  
                                
                                ⁢
                                edge
                              
                              )
                            
                          
                        
                      
                    
                    
                      
                        
                          
                            
                              
                                
                                  y
                                  s
                                
                                -
                                
                                  C
                                  B
                                
                              
                              
                                Δ
                                src
                                B
                              
                            
                            ⁢
                            i
                          
                          =
                          
                            B
                            ⁢
                            
                              
                            
                            ⁢
                            
                              (
                              
                                bottom
                                ⁢
                                
                                  
                                
                                ⁢
                                edge
                              
                              )
                            
                          
                        
                      
                    
                  
                
              
            
          
        
        .
      
    
  




FIG. 22 illustrates the meaning of inward ramping and outward ramping. In FIG. 22, inward ramping produces a direct shaping alpha value, while outward ramping produces a complementary shaping alpha. That is, if inward ramping produces a, then outward ramping produces complementary alpha αc=1−α. If computing 1−α using outward ramping, then α is determined from 1−α to obtain the shaping alpha used for the target image in mixing the target image with the background.

In the method above, for each target pixel coordinate (xt,yt) that is mapped to a corresponding source pixel coordinate (xs,ys), four boundary shaping alpha values are computed (one for each boundary, i.e. αL(xs,ys), αR(xs,ys), αT(xs,ys), and αB(xs,ys)). The shaping alpha value αshp(xt,yt) is generated from (or based on) these four boundary shaping alpha values αL(xs,ys), αR(xs,ys), αT(xs,ys), and αB(xs,ys). One way to achieve this is to use a fuzzy logic function, such as:




  
    
      
        
          
            
              α
              shp
            
            ⁡
            
              (
              
                
                  x
                  t
                
                ,
                
                  y
                  t
                
              
              )
            
          
          =
          
            
              ⋂
              
                
                  i
                  =
                  L
                
                ,
                R
                ,
                T
                ,
                B
              
            
            ⁢
            
              
                α
                i
              
              ⁡
              
                (
                
                  
                    x
                    s
                  
                  ,
                  
                    y
                    s
                  
                
                )
              
            
          
        
        ,
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          29
        
        )
      
    
  




where ∩ is fuzzy logic AND. One example way of computing this fuzzy logic AND is as follows:

αshp(xt,yt)=min{αL(xs,ys),αR(xs,ys),αT(xs,ys),αB(xs,ys)}   (Equation 30).

Another example way of computing this fuzzy logic AND is as follows:

αshp(xt,yt)=αL(xs,ys)×αR(xs,ys)×αT(xs,ys)×αB(xs,ys)   (Equation 31).

Therefore, for each target pixel coordinate (xt,yt) that is mapped to a corresponding source pixel coordinate (xs,ys), a corresponding shaping alpha value αshp(xt,yt) may be computed in the manner described above. The shaping alpha αshp for the target image comprises the set of shaping alpha values: {αshp(xt,yt)}; i.e. a set comprising one shaping alpha value αshp(xt,yt) for each pixel coordinate (xt,yt) in the target image.
Note that if using outward ramping instead to produce the complementary alpha (αc=1−α), the fuzzy logic AND of Equation 29 would be replaced with a fuzzy logic OR (e.g. which may be implemented, for example, as αcshp(xt,yt)=max{αcL(xs,ys), αcR(xs,ys), αcT(xs,ys), αcB(xs,ys)}).
The method described above may be considered a “slope-preserved” method. This is because the spatial range Δsrc in the source image is derived under the condition of the target line slope being preserved. More specifically, a uniform softness around the transformed source image (in the target image) is defined, to result in a non-uniform (or spatial variant) softness range around the source image (e.g. as is shown in FIG. 15). To compare this to the alternative method of keeping the softness range around the source image uniform (as in FIG. 10), consider FIG. 23. FIG. 23 illustrates pixel coordinates 1, 2, 3, 4, 5, and 6 mapped from the target image 124 to the source image 122. If a uniform softness were defined around the source image 122, as shown by Δs, then pixels 5 and 6 would be mapped outside the softness range resulting in a jagged edge. However, the “slope-preserved” method described above instead causes softness boundary edge 291 in the target image 124 to be mapped to softness boundary edge 293 bordering the source image 122, which results in a non-uniform area A bordering the source image 122. This non-uniform area A results in more uniform softness around the transformed source image in the target image. For example, as illustrated, pixel 5 (on the top line) and pixel 2 (on the bottom line) both have a shaping alpha value of 1⁄2 so that instances of jagged edges are mitigated. As can be seen from FIG. 23, the top line has a softness range larger than the bottom line. The “slope-preserved” method may therefore provide an anti-alias effect.
Turning now to FIG. 24, another example DVE device 320 is disclosed that, for each source image, computes a corresponding target image, as well as an associated shaping alpha αshp in the manner described above.
As shown in FIG. 24, the example DVE device 320 includes a pre-filter 302, memory 304, a raster-scan counter 306, a perspective transform engine 308, a CPU 312, a user interface 314, an interpolator 316, an address generator 318, and a shaping alpha generator 326. The pre-filter 302 may be implemented, for example, by a digital filter implemented by a general processing device (e.g. a processor) and/or a specific integrated circuit. The raster-scan counter 306 may be implemented, for example, by (or using) a digital counter circuit. The perspective transform engine 308, interpolator 316, address generator 318, and shaping alpha generator 326 may each be implemented, for example, using a general processing device (e.g. processor) and/or a specific integrated circuit configured to perform the specific operations discussed herein. The user interface 314 may be implemented, for example, using a graphical user interface and/or knobs and/or keys and/or other physical devices that allow a user to interface with the DVE device 320 and input commands.
In operation, the DVE device 320 receives as an input source image 322 and produces as an output the target image 324 and its corresponding shaping alpha αshp. The source image 322 may first be subject to pre-filtering 302 (e.g. to reduce alias artifacts caused by down-sampling), and is then stored in the memory 304. The raster-scan counter 306 can be used to write the source image 322 into the memory 304 on a pixel-by-pixel basis.
The corresponding target image 324 is then also generated on a pixel-by-pixel basis as follows.
The raster-scan counter 306 begins at (xt,yt)=(0,0) and counts up to (xt,yt)=(m,n) (assuming the target image 324 comprises an (m+1)×(n+1) grid of pixels). For each target pixel coordinate (xt,yt), the target coordinate values xt and yt are input into the perspective transform engine 308, which computes the corresponding source pixel coordinate (xs,ys) of the source image 322 stored in memory 304. The source pixel coordinate (xs,ys) corresponding to the target pixel coordinate (xt,yt) is a function of the manipulation being applied by the DVE device 320 and is defined by parameters 310. In this embodiment, to obtain the corresponding x-coordinate of the source pixel (i.e. xs) for a given target pixel coordinate (xt,yt), the following computation is performed by the perspective transform engine 308:




  
    x
    s
  
  =
  
    
      T
      d
    
    +
    
      
        
          
            (
            
              
                
                  T
                  a
                
                ⁢
                
                  x
                  t
                
              
              +
              
                
                  T
                  b
                
                ⁢
                
                  y
                  t
                
              
              +
              
                
                  T
                  c
                
                ⁢
                f
              
            
            )
          
          ⁢
          
            P
            d
          
        
        
          
            
              P
              a
            
            ⁢
            
              x
              t
            
          
          +
          
            
              P
              b
            
            ⁢
            
              y
              t
            
          
          +
          
            
              P
              c
            
            ⁢
            f
          
        
      
      ⁢
      
        
      
      ⁢
      
        (
        
          
            i
            .
            e
            .
            
              
            
            ⁢
            Equation
          
          ⁢
          
            
          
          ⁢
          1
          ⁢
          
            
          
          ⁢
          above
        
        )
      
    
  




To obtain the corresponding y-coordinate of the source pixel (i.e. ys) for a given target pixel (xt,yt), the following computation is performed by the perspective transform engine 308:





  
    y
    s
  
  =
  
    
      T
      h
    
    +
    
      
        
          
            (
            
              
                
                  T
                  e
                
                ⁢
                
                  x
                  t
                
              
              +
              
                
                  T
                  f
                
                ⁢
                
                  y
                  t
                
              
              +
              
                
                  T
                  g
                
                ⁢
                f
              
            
            )
          
          ⁢
          
            P
            d
          
        
        
          
            
              P
              a
            
            ⁢
            
              x
              t
            
          
          +
          
            
              P
              b
            
            ⁢
            
              y
              t
            
          
          +
          
            
              P
              c
            
            ⁢
            f
          
        
      
      ⁢
      
        
      
      ⁢
      
        
          (
          
            
              i
              .
              e
              .
              
                
              
              ⁢
              Equation
            
            ⁢
            
              
            
            ⁢
            2
            ⁢
            
              
            
            ⁢
            above
          
          )
        
        .
      
    
  




As discussed earlier, Equations 1 and 2 are based on mapping of a target pixel coordinate to a corresponding source pixel coordinate using the following inverse mapping function:





  
    M
    
      -
      1
    
  
  =
  
    
      [
      
        
          
            
              T
              a
            
          
          
            
              T
              b
            
          
          
            
              T
              c
            
          
          
            
              T
              d
            
          
        
        
          
            
              T
              e
            
          
          
            
              T
              f
            
          
          
            
              T
              g
            
          
          
            
              T
              h
            
          
        
        
          
            
              P
              a
            
          
          
            
              P
              b
            
          
          
            
              P
              c
            
          
          
            
              -
              
                P
                d
              
            
          
        
        
          
            0
          
          
            0
          
          
            0
          
          
            1
          
        
      
      ]
    
    ⁢
    
      
    
    ⁢
    
      
        (
        
          
            i
            .
            e
            .
            
              
            
            ⁢
            Equation
          
          ⁢
          
            
          
          ⁢
          3
        
        )
      
      .
    
  




In this example, Ta, Tb, Tc, Td, Te, Tf, Tg, Th, Pa, Pb, Pc, Pd, and f are the parameters 310, and their specific values are computed by the CPU 312 based on the specific effect requested by the user via user interface 314. For example, if a user indicated via the user interface 314 that it was desired to rotate the source image 322 by 15 degrees and shrink the source image 322 to half its size, then the user interface 314 would electronically forward this request to the CPU 312, which would compute the corresponding values of the parameters 310, and forward these specific parameter values 310 to the perspective transform engine 308. There is also now an additional parameter Δtgt. Specifically, the user may also control the width of the softness area bordering the target object by setting the value Δtgt (either directly or indirectly) via the user interface 314.
In general, the target pixel value Yt(xt,yt) will be set as the corresponding source pixel value Ys(xs,ys), which is stored in and retrieved from memory 304. However, the corresponding source pixel coordinate (xs,ys) computed by the perspective transform engine 308 for a given target pixel coordinate (xt,yt) will (in general) not be an integer, but will be a fractional value. For example, if (xt,yt)=(12, 14) is input into the perspective transform engine 308, then the corresponding source pixel coordinate (xs,ys) may be, for example, (xs,ys)=(23.63, 17.27). Therefore, to compute the target pixel value Yt (xt,yt), interpolation is used, as described earlier. To perform such interpolation, the DVE device 320 includes the interpolator 316.
As shown in FIG. 24, the DVE device 320 also includes the address generator 318, which uses the computed source pixel coordinate (xs,ys) (e.g. (xs,ys)=(23.63, 17.27)) to generate the addresses of the source pixels to be used for the interpolation (e.g. (23, 17), (23, 18), (24, 17), and (24, 18)). The corresponding source pixel values indicated by the address generator 318 are then read from memory 304 and fed to interpolator 316. The fractional values of the computed source pixel coordinate (xs,ys) (e.g. 0.63 and 0.27) are also forwarded to the interpolator 316. The output of interpolator 316 is the target pixel value Yt (xt,yt).
The process above is repeated for each target image coordinate (xt,yt) such that the target image 324 is created on a pixel-by-pixel basis. In this embodiment, in the cases in which a given target pixel coordinate (xt,yt) maps to a corresponding source pixel coordinate (xs,ys) that is out of source bounds, then the target pixel value Yt(xt,yt) is set to the source pixel value Ys (xs,ys) of the closest source boundary pixel.
FIG. 25 illustrates in more detail an example perspective transform engine, which could be implemented as the perspective transform engine 308. Specifically, FIG. 25 illustrates the computations performed to obtain corresponding source pixel coordinate (xs,ys) from a given target image coordinate (xt,yt). As shown in FIG. 25, the perspective transform engine 308 includes computational blocks 402, 404, and 406 for respectively computing intermediary values ΣX, ΣY, and ΣP. The perspective transform engine 308 also includes divider 408, multipliers 410 and 414, and adders 412 and 416. The computational blocks 402, 404, and 406 may be implemented, for example, using digital adders and multipliers. The adders, multipliers, and divider may be implemented, for example, using digital logic for adding two inputs (in the case of the adders) or digital logic for multiplying two inputs (in the case of the multipliers) or digital logic for dividing two inputs (in the case of the divider).
As discussed above, the parameters 310 include Ta, Tb, Tc, Td, Te, Tf, Tg, Th, Pa, Pb, Pc, Pd, and f. In operation of the perspective transform engine 308, the parameters Ta, Tb, Tc, and f are combined with target image coordinates xt and yt to compute ΣX=Taxt+Tbyt+Tcf, as per computational block 402. The parameters Te, Tf, Tg, and f are combined with target image coordinates xt and yt to compute ΣY=Text+Tfyt+Tgf, as per computational block 404. The parameters Pa, Pb, Pc, and f are combined with target image coordinates xt and yt to compute ΣP=Paxt+Pbyt+Pcf, as per computational block 406. The parameter Pd is divided by ΣP=Paxt+Pbyt+Pcf to generate




  
    
      P
      d
    
    
      
        
          P
          a
        
        ⁢
        
          x
          t
        
      
      +
      
        
          P
          b
        
        ⁢
        
          y
          t
        
      
      +
      
        
          P
          c
        
        ⁢
        f
      
    
  
  ,




as per divider 408. The value





  
    P
    d
  
  
    
      
        P
        a
      
      ⁢
      
        x
        t
      
    
    +
    
      
        P
        b
      
      ⁢
      
        y
        t
      
    
    +
    
      
        P
        c
      
      ⁢
      f
    
  




is then multiplied with ΣX=Taxt+Tbyt+Tcf at multiplier 410 and this result subsequently added to parameter Td at adder 412 to generate





  
    x
    s
  
  =
  
    
      T
      d
    
    +
    
      
        
          (
          
            
              
                T
                a
              
              ⁢
              
                x
                t
              
            
            +
            
              
                T
                b
              
              ⁢
              
                y
                t
              
            
            +
            
              
                T
                c
              
              ⁢
              f
            
          
          )
        
        ⁢
        
          P
          d
        
      
      
        
          
            P
            a
          
          ⁢
          
            x
            t
          
        
        +
        
          
            P
            b
          
          ⁢
          
            y
            t
          
        
        +
        
          
            P
            c
          
          ⁢
          f
        
      
    
  




(i.e. Equation 1). Similarly, the value





  
    P
    d
  
  
    
      
        P
        a
      
      ⁢
      
        x
        t
      
    
    +
    
      
        P
        b
      
      ⁢
      
        y
        t
      
    
    +
    
      
        P
        c
      
      ⁢
      f
    
  




is multiplied with ΣY=Text+Tfyt+Tgf at multiplier 414 and this result subsequently added to parameter Th at adder 416 to generate





  
    y
    s
  
  =
  
    
      T
      h
    
    +
    
      
        
          (
          
            
              
                T
                e
              
              ⁢
              
                x
                t
              
            
            +
            
              
                T
                f
              
              ⁢
              
                y
                t
              
            
            +
            
              
                T
                g
              
              ⁢
              f
            
          
          )
        
        ⁢
        
          P
          d
        
      
      
        
          
            P
            a
          
          ⁢
          
            x
            t
          
        
        +
        
          
            P
            b
          
          ⁢
          
            y
            t
          
        
        +
        
          
            P
            c
          
          ⁢
          f
        
      
    
  




(i.e. Equation 2).

In the illustrated embodiment, the perspective transform engine 308 additionally includes overflow/underflow circuitry 418, which detects any overflow or underflow or data out-of-range conditions, such as situations in which ΣP=Paxt+Pbyt+Pcf=0 (e.g. a singularity that occurs when the target object is located at a vanishing line), or an effect causing an invisibility (e.g. unified depth z<0, which corresponds to the object behind the viewers).
Returning to FIG. 24, the DVE device 320 also includes the shaping alpha generator 326, which computes the shaping alpha αshp for the target image 322 in the manner described above. As described above, the shaping alpha αshp comprises the set of shaping alpha values {αshp(xt,yt)}, i.e. a set comprising one shaping alpha value αshp(xt,yt) for each pixel coordinate (xt,yt) in the target image 324. As described above, a shaping alpha value αshp(xt,yt) for a pixel coordinate (xt,yt) in the target image may be computed via Equation 29, that is:




  
    
      
        α
        shp
      
      ⁡
      
        (
        
          
            x
            t
          
          ,
          
            y
            t
          
        
        )
      
    
    =
    
      
        ⋂
        
          
            i
            =
            L
          
          ,
          R
          ,
          T
          ,
          B
        
      
      ⁢
      
        
          α
          i
        
        ⁡
        
          (
          
            
              x
              s
            
            ,
            
              y
              s
            
          
          )
        
      
    
  
  ,




where ∩ is fuzzy logic AND and (xs,ys) is the source pixel coordinate corresponding to the target image pixel coordinate (xt,yt). That is, (xs,ys) is the output of the perspective transform engine 308, which is why these coordinates are fed to the shaping alpha generator 326 in the DVE device 320. As described above, each αi(xs,ys) may be computed via Equation 28, that is:





  
    
      α
      i
    
    ⁡
    
      (
      
        
          x
          s
        
        ,
        
          y
          s
        
      
      )
    
  
  =
  
    {
    
      
        
          
            
              0
              ,
            
          
          
            
              
                
                  α
                  i
                  ′
                
                ⁡
                
                  (
                  
                    
                      x
                      s
                    
                    ,
                    
                      y
                      s
                    
                  
                  )
                
              
              <
              0
            
          
        
        
          
            
              1
              ,
            
          
          
            
              
                
                  α
                  i
                  ′
                
                ⁡
                
                  (
                  
                    
                      x
                      s
                    
                    ,
                    
                      y
                      s
                    
                  
                  )
                
              
              >
              1
            
          
        
        
          
            
              
                
                  α
                  i
                  ′
                
                ⁡
                
                  (
                  
                    
                      x
                      s
                    
                    ,
                    
                      y
                      s
                    
                  
                  )
                
              
              ,
            
          
          
            else
          
        
      
      ,
    
  




where α′i(xs,ys) is the pre-alpha value defined via Equation 27, that is:





  
    
      α
      i
      ′
    
    ⁡
    
      (
      
        
          x
          s
        
        ,
        
          y
          s
        
      
      )
    
  
  =
  
    
      
        Δ
        ⁢
        
          
        
        ⁢
        
          D
          i
        
      
      
        Δ
        src
        i
      
    
    =
    
      {
      
        
          
            
              
                
                  
                    Δ
                    ⁢
                    
                      
                    
                    ⁢
                    x
                  
                  
                    Δ
                    src
                    x
                  
                
                =
                
                  {
                  
                    
                      
                        
                          
                            
                              
                                
                                  x
                                  s
                                
                                -
                                
                                  C
                                  L
                                
                              
                              
                                Δ
                                src
                                L
                              
                            
                            ⁢
                            i
                          
                          =
                          
                            L
                            ⁢
                            
                              
                            
                            ⁢
                            
                              (
                              
                                left
                                ⁢
                                
                                  
                                
                                ⁢
                                edge
                              
                              )
                            
                          
                        
                      
                    
                    
                      
                        
                          
                            
                              
                                
                                  C
                                  R
                                
                                -
                                
                                  x
                                  s
                                
                              
                              
                                Δ
                                src
                                R
                              
                            
                            ⁢
                            i
                          
                          =
                          
                            R
                            ⁢
                            
                              
                            
                            ⁢
                            
                              (
                              
                                right
                                ⁢
                                
                                  
                                
                                ⁢
                                edge
                              
                              )
                            
                          
                        
                      
                    
                  
                
              
            
          
          
            
              
                
                  
                    Δ
                    ⁢
                    
                      
                    
                    ⁢
                    y
                  
                  
                    Δ
                    src
                    y
                  
                
                =
                
                  {
                  
                    
                      
                        
                          
                            
                              
                                
                                  y
                                  s
                                
                                -
                                
                                  C
                                  T
                                
                              
                              
                                Δ
                                src
                                T
                              
                            
                            ⁢
                            i
                          
                          =
                          
                            T
                            ⁢
                            
                              
                            
                            ⁢
                            
                              (
                              
                                top
                                ⁢
                                
                                  
                                
                                ⁢
                                edge
                              
                              )
                            
                          
                        
                      
                    
                    
                      
                        
                          
                            
                              
                                
                                  C
                                  B
                                
                                -
                                
                                  y
                                  s
                                
                              
                              
                                Δ
                                src
                                B
                              
                            
                            ⁢
                            i
                          
                          =
                          
                            B
                            ⁢
                            
                              
                            
                            ⁢
                            
                              (
                              
                                bottom
                                ⁢
                                
                                  
                                
                                ⁢
                                edge
                              
                              )
                            
                          
                        
                      
                    
                  
                
              
            
          
        
        .
      
    
  




The value Δsrcx is defined via Equation 25, that is:





  
    Δ
    src
    x
  
  =
  
    {
    
      
        
          
            
              
                
                  
                    
                    
                      
                        
                          P
                          d
                        
                        ⁢
                        
                          T
                          b
                        
                      
                      -
                      
                        
                          P
                          b
                        
                        ⁡
                        
                          (
                          
                            
                              C
                              H
                            
                            -
                            
                              T
                              d
                            
                          
                          )
                        
                      
                    
                    
                  
                  ⁢
                  
                    Δ
                    tgt
                  
                
                
                  
                  
                    
                      
                        P
                        a
                      
                      ⁢
                      
                        x
                        t
                      
                    
                    +
                    
                      
                        P
                        b
                      
                      ⁢
                      
                        y
                        t
                      
                    
                    +
                    
                      
                        P
                        c
                      
                      ⁢
                      f
                    
                  
                  
                
              
              ,
            
          
          
            
              
                
                  
                    
                      if
                      ⁢
                      
                        
                      
                      ⁢
                      
                        
                        
                          
                            
                              P
                              a
                            
                            ⁡
                            
                              (
                              
                                
                                  C
                                  H
                                
                                -
                                
                                  T
                                  d
                                
                              
                              )
                            
                          
                          -
                          
                            
                              P
                              d
                            
                            ⁢
                            
                              T
                              a
                            
                          
                        
                        
                      
                    
                    ≤
                  
                
              
              
                
                  
                    
                    
                      
                        
                          P
                          b
                        
                        ⁡
                        
                          (
                          
                            
                              C
                              H
                            
                            -
                            
                              T
                              d
                            
                          
                          )
                        
                      
                      -
                      
                        
                          P
                          d
                        
                        ⁢
                        
                          T
                          b
                        
                      
                    
                    
                  
                
              
            
          
        
        
          
            
              
                
                  
                    
                    
                      
                        
                          P
                          d
                        
                        ⁢
                        
                          T
                          a
                        
                      
                      -
                      
                        
                          P
                          a
                        
                        ⁡
                        
                          (
                          
                            
                              C
                              H
                            
                            -
                            
                              T
                              d
                            
                          
                          )
                        
                      
                    
                    
                  
                  ⁢
                  
                    Δ
                    tgt
                  
                
                
                  
                  
                    
                      
                        P
                        a
                      
                      ⁢
                      
                        x
                        t
                      
                    
                    +
                    
                      
                        P
                        b
                      
                      ⁢
                      
                        y
                        t
                      
                    
                    +
                    
                      
                        P
                        c
                      
                      ⁢
                      f
                    
                  
                  
                
              
              ,
            
          
          
            else
          
        
      
      .
    
  




In other words, for the left edge (i=L), then:





  
    Δ
    src
    x
  
  =
  
    
      Δ
      src
      L
    
    =
    
      {
      
        
          
            
              
                
                  
                    
                      
                      
                        
                          
                            P
                            d
                          
                          ⁢
                          
                            T
                            b
                          
                        
                        -
                        
                          
                            P
                            b
                          
                          ⁡
                          
                            (
                            
                              
                                C
                                L
                              
                              -
                              
                                T
                                d
                              
                            
                            )
                          
                        
                      
                      
                    
                    ⁢
                    
                      Δ
                      tgt
                    
                  
                  
                    
                    
                      
                        
                          P
                          a
                        
                        ⁢
                        
                          x
                          t
                        
                      
                      +
                      
                        
                          P
                          b
                        
                        ⁢
                        
                          y
                          t
                        
                      
                      +
                      
                        
                          P
                          c
                        
                        ⁢
                        f
                      
                    
                    
                  
                
                ,
              
            
            
              
                
                  
                    
                      
                        if
                        ⁢
                        
                          
                        
                        ⁢
                        
                          
                          
                            
                              
                                P
                                a
                              
                              ⁡
                              
                                (
                                
                                  
                                    C
                                    L
                                  
                                  -
                                  
                                    T
                                    d
                                  
                                
                                )
                              
                            
                            -
                            
                              
                                P
                                d
                              
                              ⁢
                              
                                T
                                a
                              
                            
                          
                          
                        
                      
                      ≤
                    
                  
                
                
                  
                    
                      
                      
                        
                          
                            P
                            b
                          
                          ⁡
                          
                            (
                            
                              
                                C
                                L
                              
                              -
                              
                                T
                                d
                              
                            
                            )
                          
                        
                        -
                        
                          
                            P
                            d
                          
                          ⁢
                          
                            T
                            b
                          
                        
                      
                      
                    
                  
                
              
            
          
          
            
              
                
                  
                    
                      
                      
                        
                          
                            P
                            d
                          
                          ⁢
                          
                            T
                            a
                          
                        
                        -
                        
                          
                            P
                            a
                          
                          ⁡
                          
                            (
                            
                              
                                C
                                L
                              
                              -
                              
                                T
                                d
                              
                            
                            )
                          
                        
                      
                      
                    
                    ⁢
                    
                      Δ
                      tgt
                    
                  
                  
                    
                    
                      
                        
                          P
                          a
                        
                        ⁢
                        
                          x
                          t
                        
                      
                      +
                      
                        
                          P
                          b
                        
                        ⁢
                        
                          y
                          t
                        
                      
                      +
                      
                        
                          P
                          c
                        
                        ⁢
                        f
                      
                    
                    
                  
                
                ,
              
            
            
              else
            
          
        
        ,
      
    
  




and for the right edge (i=R), then:





  
    Δ
    src
    x
  
  =
  
    
      Δ
      src
      R
    
    =
    
      {
      
        
          
            
              
                
                  
                    
                      
                      
                        
                          
                            P
                            d
                          
                          ⁢
                          
                            T
                            b
                          
                        
                        -
                        
                          
                            P
                            b
                          
                          ⁡
                          
                            (
                            
                              
                                C
                                R
                              
                              -
                              
                                T
                                d
                              
                            
                            )
                          
                        
                      
                      
                    
                    ⁢
                    
                      Δ
                      tgt
                    
                  
                  
                    
                    
                      
                        
                          P
                          a
                        
                        ⁢
                        
                          x
                          t
                        
                      
                      +
                      
                        
                          P
                          b
                        
                        ⁢
                        
                          y
                          t
                        
                      
                      +
                      
                        
                          P
                          c
                        
                        ⁢
                        f
                      
                    
                    
                  
                
                ,
              
            
            
              
                
                  
                    
                      
                        if
                        ⁢
                        
                          
                        
                        ⁢
                        
                          
                          
                            
                              
                                P
                                a
                              
                              ⁡
                              
                                (
                                
                                  
                                    C
                                    R
                                  
                                  -
                                  
                                    T
                                    d
                                  
                                
                                )
                              
                            
                            -
                            
                              
                                P
                                d
                              
                              ⁢
                              
                                T
                                a
                              
                            
                          
                          
                        
                      
                      ≤
                    
                  
                
                
                  
                    
                      
                      
                        
                          
                            P
                            b
                          
                          ⁡
                          
                            (
                            
                              
                                C
                                R
                              
                              -
                              
                                T
                                d
                              
                            
                            )
                          
                        
                        -
                        
                          
                            P
                            d
                          
                          ⁢
                          
                            T
                            b
                          
                        
                      
                      
                    
                  
                
              
            
          
          
            
              
                
                  
                    
                      
                      
                        
                          
                            P
                            d
                          
                          ⁢
                          
                            T
                            a
                          
                        
                        -
                        
                          
                            P
                            a
                          
                          ⁡
                          
                            (
                            
                              
                                C
                                R
                              
                              -
                              
                                T
                                d
                              
                            
                            )
                          
                        
                      
                      
                    
                    ⁢
                    
                      Δ
                      tgt
                    
                  
                  
                    
                    
                      
                        
                          P
                          a
                        
                        ⁢
                        
                          x
                          t
                        
                      
                      +
                      
                        
                          P
                          b
                        
                        ⁢
                        
                          y
                          t
                        
                      
                      +
                      
                        
                          P
                          c
                        
                        ⁢
                        f
                      
                    
                    
                  
                
                ,
              
            
            
              else
            
          
        
        .
      
    
  




Recall that CL and CR are the left and right cropping lines respectively defining the left and right boundaries of the source image 322. That is, on the left boundary of the source image 322 the source x-coordinate xs will be a constant xs=CL, and on the right boundary of the source image 322, the x-coordinate xs will be a constant xs=CR.

The value Δsrcy is defined by Equation 26, that is:




  
    Δ
    src
    y
  
  =
  
    {
    
      
        
          
            
              
                
                  
                    
                    
                      
                        
                          P
                          d
                        
                        ⁢
                        
                          T
                          f
                        
                      
                      -
                      
                        
                          P
                          b
                        
                        ⁡
                        
                          (
                          
                            
                              C
                              V
                            
                            -
                            
                              T
                              h
                            
                          
                          )
                        
                      
                    
                    
                  
                  ⁢
                  
                    Δ
                    tgt
                  
                
                
                  
                  
                    
                      
                        P
                        a
                      
                      ⁢
                      
                        x
                        t
                      
                    
                    +
                    
                      
                        P
                        b
                      
                      ⁢
                      
                        y
                        t
                      
                    
                    +
                    
                      
                        P
                        c
                      
                      ⁢
                      f
                    
                  
                  
                
              
              ,
            
          
          
            
              
                
                  
                    
                      if
                      ⁢
                      
                        
                      
                      ⁢
                      
                        
                        
                          
                            
                              P
                              a
                            
                            ⁡
                            
                              (
                              
                                
                                  C
                                  V
                                
                                -
                                
                                  T
                                  h
                                
                              
                              )
                            
                          
                          -
                          
                            
                              P
                              d
                            
                            ⁢
                            
                              T
                              e
                            
                          
                        
                        
                      
                    
                    ≤
                  
                
              
              
                
                  
                    
                    
                      
                        
                          P
                          b
                        
                        ⁡
                        
                          (
                          
                            
                              C
                              V
                            
                            -
                            
                              T
                              h
                            
                          
                          )
                        
                      
                      -
                      
                        
                          P
                          d
                        
                        ⁢
                        
                          T
                          f
                        
                      
                    
                    
                  
                
              
            
          
        
        
          
            
              
                
                  
                    
                    
                      
                        
                          P
                          d
                        
                        ⁢
                        
                          T
                          e
                        
                      
                      -
                      
                        
                          P
                          a
                        
                        ⁡
                        
                          (
                          
                            
                              C
                              V
                            
                            -
                            
                              T
                              h
                            
                          
                          )
                        
                      
                    
                    
                  
                  ⁢
                  
                    Δ
                    tgt
                  
                
                
                  
                  
                    
                      
                        P
                        a
                      
                      ⁢
                      
                        x
                        t
                      
                    
                    +
                    
                      
                        P
                        b
                      
                      ⁢
                      
                        y
                        t
                      
                    
                    +
                    
                      
                        P
                        c
                      
                      ⁢
                      f
                    
                  
                  
                
              
              ,
            
          
          
            else
          
        
      
      .
    
  




In other words, for the top edge (i=T), then:





  
    Δ
    src
    y
  
  =
  
    
      Δ
      src
      T
    
    =
    
      {
      
        
          
            
              
                
                  
                    
                      
                      
                        
                          
                            P
                            d
                          
                          ⁢
                          
                            T
                            f
                          
                        
                        -
                        
                          
                            P
                            b
                          
                          ⁡
                          
                            (
                            
                              
                                C
                                T
                              
                              -
                              
                                T
                                h
                              
                            
                            )
                          
                        
                      
                      
                    
                    ⁢
                    
                      Δ
                      tgt
                    
                  
                  
                    
                    
                      
                        
                          P
                          a
                        
                        ⁢
                        
                          x
                          t
                        
                      
                      +
                      
                        
                          P
                          b
                        
                        ⁢
                        
                          y
                          t
                        
                      
                      +
                      
                        
                          P
                          c
                        
                        ⁢
                        f
                      
                    
                    
                  
                
                ,
              
            
            
              
                
                  
                    
                      
                        if
                        ⁢
                        
                          
                        
                        ⁢
                        
                          
                          
                            
                              
                                P
                                a
                              
                              ⁡
                              
                                (
                                
                                  
                                    C
                                    T
                                  
                                  -
                                  
                                    T
                                    h
                                  
                                
                                )
                              
                            
                            -
                            
                              
                                P
                                d
                              
                              ⁢
                              
                                T
                                e
                              
                            
                          
                          
                        
                      
                      ≤
                    
                  
                
                
                  
                    
                      
                      
                        
                          
                            P
                            b
                          
                          ⁡
                          
                            (
                            
                              
                                C
                                T
                              
                              -
                              
                                T
                                h
                              
                            
                            )
                          
                        
                        -
                        
                          
                            P
                            d
                          
                          ⁢
                          
                            T
                            f
                          
                        
                      
                      
                    
                  
                
              
            
          
          
            
              
                
                  
                    
                      
                      
                        
                          
                            P
                            d
                          
                          ⁢
                          
                            T
                            e
                          
                        
                        -
                        
                          
                            P
                            a
                          
                          ⁡
                          
                            (
                            
                              
                                C
                                T
                              
                              -
                              
                                T
                                h
                              
                            
                            )
                          
                        
                      
                      
                    
                    ⁢
                    
                      Δ
                      tgt
                    
                  
                  
                    
                    
                      
                        
                          P
                          a
                        
                        ⁢
                        
                          x
                          t
                        
                      
                      +
                      
                        
                          P
                          b
                        
                        ⁢
                        
                          y
                          t
                        
                      
                      +
                      
                        
                          P
                          c
                        
                        ⁢
                        f
                      
                    
                    
                  
                
                ,
              
            
            
              else
            
          
        
        ,
      
    
  




and for the bottom edge (i=B), then:





  
    Δ
    src
    y
  
  =
  
    
      Δ
      src
      B
    
    =
    
      {
      
        
          
            
              
                
                  
                    
                      
                      
                        
                          
                            P
                            d
                          
                          ⁢
                          
                            T
                            f
                          
                        
                        -
                        
                          
                            P
                            b
                          
                          ⁡
                          
                            (
                            
                              
                                C
                                B
                              
                              -
                              
                                T
                                h
                              
                            
                            )
                          
                        
                      
                      
                    
                    ⁢
                    
                      Δ
                      tgt
                    
                  
                  
                    
                    
                      
                        
                          P
                          a
                        
                        ⁢
                        
                          x
                          t
                        
                      
                      +
                      
                        
                          P
                          b
                        
                        ⁢
                        
                          y
                          t
                        
                      
                      +
                      
                        
                          P
                          c
                        
                        ⁢
                        f
                      
                    
                    
                  
                
                ,
              
            
            
              
                
                  
                    
                      
                        if
                        ⁢
                        
                          
                        
                        ⁢
                        
                          
                          
                            
                              
                                P
                                a
                              
                              ⁡
                              
                                (
                                
                                  
                                    C
                                    B
                                  
                                  -
                                  
                                    T
                                    h
                                  
                                
                                )
                              
                            
                            -
                            
                              
                                P
                                d
                              
                              ⁢
                              
                                T
                                e
                              
                            
                          
                          
                        
                      
                      ≤
                    
                  
                
                
                  
                    
                      
                      
                        
                          
                            P
                            b
                          
                          ⁡
                          
                            (
                            
                              
                                C
                                B
                              
                              -
                              
                                T
                                h
                              
                            
                            )
                          
                        
                        -
                        
                          
                            P
                            d
                          
                          ⁢
                          
                            T
                            f
                          
                        
                      
                      
                    
                  
                
              
            
          
          
            
              
                
                  
                    
                      
                      
                        
                          
                            P
                            d
                          
                          ⁢
                          
                            T
                            e
                          
                        
                        -
                        
                          
                            P
                            a
                          
                          ⁡
                          
                            (
                            
                              
                                C
                                B
                              
                              -
                              
                                T
                                h
                              
                            
                            )
                          
                        
                      
                      
                    
                    ⁢
                    
                      Δ
                      tgt
                    
                  
                  
                    
                    
                      
                        
                          P
                          a
                        
                        ⁢
                        
                          x
                          t
                        
                      
                      +
                      
                        
                          P
                          b
                        
                        ⁢
                        
                          y
                          t
                        
                      
                      +
                      
                        
                          P
                          c
                        
                        ⁢
                        f
                      
                    
                    
                  
                
                ,
              
            
            
              else
            
          
        
        .
      
    
  




Recall that CT and CB are the top and bottom cropping lines respectively defining the top and bottom boundaries of the source image 322. That is, on the top boundary of the source image 322 the source y-coordinate ys will be a constant ys=CT, and on the bottom boundary of the source image 322, the y-coordinate ys be a constant ys=CB.

Note that in this embodiment, advantageously the term Paxt+Pbyt+Pcf required to compute each shaping alpha value needs to be computed by the perspective transform engine 308 (ΣP=Paxt+Pbyt+Pcf). Therefore, as shown in the DVE device 320 in FIG. 24, the value ΣP=Paxt+Pbyt+Pcf is forwarded from the perspective transform engine 308 to the shaping alpha generator 326. This has the benefit of reducing the number of computations required by the shaping alpha generator 326, as the results of computations in the perspective transform engine 308 (an intermediate result) can be re-used. That is, an intermediary computational result obtained when computing the corresponding source pixel coordinate (xs,ys) can be used in computing the alpha channel value.
FIG. 26 illustrates in more detail an example shaping alpha generator, which could be implemented as the shaping alpha generator 326. As shown in FIG. 26, the shaping alpha generator 326 includes four computational blocks, which may be referred to as processing paths or “channels”. Each processing path computes a respective αi(xs,ys), where i=L, R, T, and B. That is, left alpha path 502 computes left boundary shaping alpha value αL(xs,ys), right alpha path 504 computes right boundary shaping alpha value αR(xs,ys), top alpha path 506 computes top boundary shaping alpha value αT(xs,ys), and bottom alpha path 508 computes bottom boundary shaping alpha value αB(xs,ys). Each of processing paths 502 to 508 are of identical structure, but fed with different parameters. Each processing path is implemented using adders, multipliers, and a clipping function. For example, left alpha processing path 502 includes adder 510, multipliers 512 and 514, and clipper 516. The multipliers and subtractors may be implemented, for example, using digital logic for subtracting two inputs (in the case of the subtractor) or digital logic for multiplying two inputs (in the case of the multiplier). The clipper 516 implements the clipping function




  
    
      a
      L
    
    ⁡
    
      (
      
        
          x
          s
        
        ,
        
          y
          s
        
      
      )
    
  
  =
  
    {
    
      
        
          
            0
            ,
          
        
        
          
            
              
                α
                L
                ′
              
              ⁡
              
                (
                
                  
                    x
                    s
                  
                  ,
                  
                    y
                    s
                  
                
                )
              
            
            <
            0
          
        
      
      
        
          
            1
            ,
          
        
        
          
            
              
                
                  α
                  L
                  ′
                
                ⁡
                
                  (
                  
                    
                      x
                      s
                    
                    ,
                    
                      y
                      s
                    
                  
                  )
                
              
              >
              1
            
            ,
          
        
      
      
        
          
            
              
                α
                L
                ′
              
              ⁡
              
                (
                
                  
                    x
                    s
                  
                  ,
                  
                    y
                    s
                  
                
                )
              
            
            ,
          
        
        
          else
        
      
    
  




for example, using a comparator to evaluate whether α′L(xs,ys) (from multiplier 514) is less then zero, between zero or one, or greater than zero.

The shaping alpha generator 326 further includes fuzzy logic AND blocks 520, 524, and 522, as well as multiplexer 526. The fuzzy logic AND blocks may be implemented using computational circuitry configured to implement the fuzzy logic AND operations described herein (e.g. as described in more detail later with respect to FIGS. 27 and 28).
In operation, the left alpha processing path 502 computes




  
    
      
        α
        L
        ′
      
      ⁡
      
        (
        
          
            x
            s
          
          ,
          
            y
            s
          
        
        )
      
    
    =
    
      
        
          x
          s
        
        -
        
          C
          L
        
      
      
        Δ
        src
        L
      
    
  
  ,




where





  
    Δ
    src
    L
  
  =
  
    {
    
      
        
          
            
              
                
                  
                    
                    
                      
                        
                          P
                          d
                        
                        ⁢
                        
                          T
                          b
                        
                      
                      -
                      
                        
                          P
                          b
                        
                        ⁡
                        
                          (
                          
                            
                              C
                              L
                            
                            -
                            
                              T
                              
                                d
                                ⁢
                                
                                  
                                
                              
                            
                          
                          )
                        
                      
                    
                    
                  
                  ⁢
                  
                    Δ
                    tgt
                  
                
                
                  
                  
                    
                      
                        P
                        a
                      
                      ⁢
                      
                        x
                        t
                      
                    
                    +
                    
                      
                        P
                        b
                      
                      ⁢
                      
                        y
                        t
                      
                    
                    +
                    
                      
                        P
                        c
                      
                      ⁢
                      f
                    
                  
                  
                
              
              ,
            
          
          
            
              
                
                  
                    
                      
                        
                          if
                          ⁢
                          
                            
                          
                          ⁢
                          
                            
                            
                              
                                
                                  P
                                  a
                                
                                ⁡
                                
                                  (
                                  
                                    
                                      C
                                      L
                                    
                                    -
                                    
                                      T
                                      d
                                    
                                  
                                  )
                                
                              
                              -
                              
                                
                                  P
                                  d
                                
                                ⁢
                                
                                  T
                                  a
                                
                              
                            
                            
                          
                        
                        ≤
                      
                      ⁢
                      
                        
                      
                    
                  
                
                
                  
                    
                      
                      
                        
                          
                            P
                            b
                          
                          ⁡
                          
                            (
                            
                              
                                C
                                L
                              
                              -
                              
                                T
                                d
                              
                            
                            )
                          
                        
                        -
                        
                          
                            P
                            d
                          
                          ⁢
                          
                            T
                            b
                          
                        
                      
                      
                    
                  
                
              
              ⁢
              
                
              
            
          
        
        
          
            
              
                
                  
                    
                    
                      
                        
                          P
                          d
                        
                        ⁢
                        
                          T
                          a
                        
                      
                      -
                      
                        
                          P
                          a
                        
                        ⁡
                        
                          (
                          
                            
                              C
                              L
                            
                            -
                            
                              T
                              
                                d
                                ⁢
                                
                                  
                                
                              
                            
                          
                          )
                        
                      
                    
                    
                  
                  ⁢
                  
                    Δ
                    tgt
                  
                
                
                  
                  
                    
                      
                        P
                        a
                      
                      ⁢
                      
                        x
                        t
                      
                    
                    +
                    
                      
                        P
                        b
                      
                      ⁢
                      
                        y
                        t
                      
                    
                    +
                    
                      
                        P
                        c
                      
                      ⁢
                      f
                    
                  
                  
                
              
              ,
            
          
          
            else
          
        
      
      ,
    
  




by subtracting parameter CL from source coordinate xs, as at subtractor 510, and by multiplying |Paxt+Pbyt+Pcf| by parameter SL, as at multiplier 512, and then multiplying xs−CL by |Paxt+Pbyt+Pcf|SL, as at multiplier 514. Note that:





  
    
      
        
          S
          L
        
        =
        
          {
          
            
              
                
                  
                    1
                    
                      
                        
                        
                          
                            
                              P
                              d
                            
                            ⁢
                            
                              T
                              b
                            
                          
                          -
                          
                            
                              P
                              b
                            
                            ⁡
                            
                              (
                              
                                
                                  C
                                  L
                                
                                -
                                
                                  T
                                  
                                    d
                                    ⁢
                                    
                                      
                                    
                                  
                                
                              
                              )
                            
                          
                        
                        
                      
                      ⁢
                      
                        Δ
                        tgt
                      
                    
                  
                  ,
                
              
              
                
                  
                    
                      
                        
                          
                            
                              if
                              ⁢
                              
                                
                              
                              ⁢
                              
                                
                                
                                  
                                    
                                      P
                                      a
                                    
                                    ⁡
                                    
                                      (
                                      
                                        
                                          C
                                          L
                                        
                                        -
                                        
                                          T
                                          d
                                        
                                      
                                      )
                                    
                                  
                                  -
                                  
                                    
                                      P
                                      d
                                    
                                    ⁢
                                    
                                      T
                                      a
                                    
                                  
                                
                                
                              
                            
                            ≤
                          
                          ⁢
                          
                            
                          
                        
                      
                    
                    
                      
                        
                          
                          
                            
                              
                                P
                                b
                              
                              ⁡
                              
                                (
                                
                                  
                                    C
                                    L
                                  
                                  -
                                  
                                    T
                                    d
                                  
                                
                                )
                              
                            
                            -
                            
                              
                                P
                                d
                              
                              ⁢
                              
                                T
                                b
                              
                            
                          
                          
                        
                      
                    
                  
                  ⁢
                  
                    
                  
                
              
            
            
              
                
                  
                    1
                    
                      
                        
                        
                          
                            
                              P
                              d
                            
                            ⁢
                            
                              T
                              a
                            
                          
                          -
                          
                            
                              P
                              a
                            
                            ⁡
                            
                              (
                              
                                
                                  C
                                  L
                                
                                -
                                
                                  T
                                  
                                    d
                                    ⁢
                                    
                                      
                                    
                                  
                                
                              
                              )
                            
                          
                        
                        
                      
                      ⁢
                      
                        Δ
                        tgt
                      
                    
                  
                  ,
                
              
              
                else
              
            
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          32
        
        )
      
    
  
  
    
      
        
          
        
        ⁢
        
          
            so
            ⁢
            
              
            
            ⁢
            that
            ⁢
            
              
            
            ⁢
            
              (
              
                
                  x
                  s
                
                -
                
                  C
                  L
                
              
              )
            
            ⁢
            
              
              
                
                  
                    P
                    a
                  
                  ⁢
                  
                    x
                    t
                  
                
                +
                
                  
                    P
                    b
                  
                  ⁢
                  
                    y
                    t
                  
                
                +
                
                  
                    P
                    c
                  
                  ⁢
                  f
                
              
              
            
            ⁢
            
              S
              L
            
          
          =
          
            
              
                
                  x
                  s
                
                -
                
                  C
                  L
                
              
              
                Δ
                src
                L
              
            
            .
          
        
      
    
    
      
        
      
    
  




As mentioned above, the block 516 represents the clipping function





  
    
      a
      L
    
    ⁡
    
      (
      
        
          x
          s
        
        ,
        
          y
          s
        
      
      )
    
  
  =
  
    {
    
      
        
          
            0
            ,
          
        
        
          
            
              
                α
                L
                ′
              
              ⁡
              
                (
                
                  
                    x
                    s
                  
                  ,
                  
                    y
                    s
                  
                
                )
              
            
            <
            0
          
        
      
      
        
          
            1
            ,
          
        
        
          
            
              
                α
                L
                ′
              
              ⁡
              
                (
                
                  
                    x
                    s
                  
                  ,
                  
                    y
                    s
                  
                
                )
              
            
            >
            1
          
        
      
      
        
          
            
              
                α
                L
                ′
              
              ⁡
              
                (
                
                  
                    x
                    s
                  
                  ,
                  
                    y
                    s
                  
                
                )
              
            
            ,
          
        
        
          else
        
      
    
  




to produce left boundary shaping alpha value αL(xs,ys).

Right alpha processing path 504, top alpha processing path 506, and bottom alpha processing path 508 are of the same structure as left alpha processing path 504, except that different parameter inputs are used to respectively compute right boundary shaping alpha value αR(xs,ys), top boundary shaping alpha value αT(xs,ys), and bottom boundary shaping alpha value αB(xs,ys) as per the equations above. Note that in FIG. 26:




  
    
      
        
          S
          R
        
        =
        
          {
          
            
              
                
                  
                    
                      1
                      
                        
                          
                            
                              
                              
                                
                                  
                                    P
                                    d
                                  
                                  ⁢
                                  
                                    T
                                    b
                                  
                                
                                -
                              
                            
                          
                        
                        
                          
                            
                              
                                
                                  
                                    P
                                    b
                                  
                                  ⁡
                                  
                                    (
                                    
                                      
                                        C
                                        R
                                      
                                      -
                                      
                                        T
                                        
                                          d
                                          ⁢
                                          
                                            
                                          
                                        
                                      
                                    
                                    )
                                  
                                
                                
                              
                              ⁢
                              
                                Δ
                                tgt
                              
                            
                          
                        
                      
                    
                    ,
                  
                
                
                  
                    
                      
                        
                          
                            
                              
                                if
                                ⁢
                                
                                  
                                
                                ⁢
                                
                                  
                                  
                                    
                                      
                                        P
                                        a
                                      
                                      ⁡
                                      
                                        (
                                        
                                          
                                            C
                                            R
                                          
                                          -
                                          
                                            T
                                            d
                                          
                                        
                                        )
                                      
                                    
                                    -
                                    
                                      
                                        P
                                        d
                                      
                                      ⁢
                                      
                                        T
                                        a
                                      
                                    
                                  
                                  
                                
                              
                              ≤
                            
                            ⁢
                            
                              
                            
                          
                        
                      
                      
                        
                          
                            
                            
                              
                                
                                  P
                                  b
                                
                                ⁡
                                
                                  (
                                  
                                    
                                      C
                                      R
                                    
                                    -
                                    
                                      T
                                      d
                                    
                                  
                                  )
                                
                              
                              -
                              
                                
                                  P
                                  d
                                
                                ⁢
                                
                                  T
                                  b
                                
                              
                            
                            
                          
                        
                      
                    
                    ⁢
                    
                      
                    
                  
                
              
              
                
                  
                    
                      1
                      
                        
                          
                            
                              
                              
                                
                                  
                                    P
                                    d
                                  
                                  ⁢
                                  
                                    T
                                    a
                                  
                                
                                -
                              
                            
                          
                        
                        
                          
                            
                              
                                
                                  
                                    P
                                    a
                                  
                                  ⁡
                                  
                                    (
                                    
                                      
                                        C
                                        R
                                      
                                      -
                                      
                                        T
                                        
                                          d
                                          ⁢
                                          
                                            
                                          
                                        
                                      
                                    
                                    )
                                  
                                
                                
                              
                              ⁢
                              
                                Δ
                                tgt
                              
                            
                          
                        
                      
                    
                    ,
                  
                
                
                  else
                
              
            
            ,
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          33
        
        )
      
    
  
  
    
      
        
          S
          T
        
        =
        
          {
          
            
              
                
                  
                    
                      1
                      
                        
                          
                            
                              
                              
                                
                                  
                                    P
                                    d
                                  
                                  ⁢
                                  
                                    T
                                    f
                                  
                                
                                -
                              
                            
                          
                        
                        
                          
                            
                              
                                
                                  
                                    P
                                    b
                                  
                                  ⁡
                                  
                                    (
                                    
                                      
                                        C
                                        T
                                      
                                      -
                                      
                                        T
                                        
                                          h
                                          ⁢
                                          
                                            
                                          
                                        
                                      
                                    
                                    )
                                  
                                
                                
                              
                              ⁢
                              
                                Δ
                                tgt
                              
                            
                          
                        
                      
                    
                    ,
                  
                
                
                  
                    
                      
                        
                          
                            
                              if
                              ⁢
                              
                                
                              
                              ⁢
                              
                                
                                
                                  
                                    
                                      P
                                      a
                                    
                                    ⁡
                                    
                                      (
                                      
                                        
                                          C
                                          T
                                        
                                        -
                                        
                                          T
                                          h
                                        
                                      
                                      )
                                    
                                  
                                  -
                                  
                                    
                                      P
                                      d
                                    
                                    ⁢
                                    
                                      T
                                      e
                                    
                                  
                                
                                
                              
                            
                            ≤
                          
                          ⁢
                          
                            
                          
                        
                      
                    
                    
                      
                        
                          
                          
                            
                              
                                P
                                b
                              
                              ⁡
                              
                                (
                                
                                  
                                    C
                                    T
                                  
                                  -
                                  
                                    T
                                    h
                                  
                                
                                )
                              
                            
                            -
                            
                              
                                P
                                d
                              
                              ⁢
                              
                                T
                                f
                              
                            
                          
                          
                        
                      
                    
                  
                
              
              
                
                  
                    
                      1
                      
                        
                          
                            
                              
                              
                                
                                  
                                    P
                                    d
                                  
                                  ⁢
                                  
                                    T
                                    e
                                  
                                
                                -
                              
                            
                          
                        
                        
                          
                            
                              
                                
                                  
                                    P
                                    a
                                  
                                  ⁡
                                  
                                    (
                                    
                                      
                                        C
                                        T
                                      
                                      -
                                      
                                        T
                                        
                                          h
                                          ⁢
                                          
                                            
                                          
                                        
                                      
                                    
                                    )
                                  
                                
                                
                              
                              ⁢
                              
                                Δ
                                tgt
                              
                            
                          
                        
                      
                    
                    ,
                  
                
                
                  else
                
              
            
            ,
            
              

            
            ⁢
            
              
            
            ⁢
            and
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          34
        
        )
      
    
  
  
    
      
        
          S
          B
        
        =
        
          {
          
            
              
                
                  
                    
                      1
                      
                        
                          
                            
                              
                              
                                
                                  
                                    P
                                    d
                                  
                                  ⁢
                                  
                                    T
                                    f
                                  
                                
                                -
                              
                            
                          
                        
                        
                          
                            
                              
                                
                                  
                                    P
                                    b
                                  
                                  ⁡
                                  
                                    (
                                    
                                      
                                        C
                                        B
                                      
                                      -
                                      
                                        T
                                        
                                          h
                                          ⁢
                                          
                                            
                                          
                                        
                                      
                                    
                                    )
                                  
                                
                                
                              
                              ⁢
                              
                                Δ
                                tgt
                              
                            
                          
                        
                      
                    
                    ,
                  
                
                
                  
                    
                      
                        
                          
                            
                              
                                if
                                ⁢
                                
                                  
                                
                                ⁢
                                
                                  
                                  
                                    
                                      
                                        P
                                        a
                                      
                                      ⁡
                                      
                                        (
                                        
                                          
                                            C
                                            B
                                          
                                          -
                                          
                                            T
                                            h
                                          
                                        
                                        )
                                      
                                    
                                    -
                                    
                                      
                                        P
                                        d
                                      
                                      ⁢
                                      
                                        T
                                        e
                                      
                                    
                                  
                                  
                                
                              
                              ≤
                            
                            ⁢
                            
                              
                            
                          
                        
                      
                      
                        
                          
                            
                            
                              
                                
                                  P
                                  b
                                
                                ⁡
                                
                                  (
                                  
                                    
                                      C
                                      B
                                    
                                    -
                                    
                                      T
                                      h
                                    
                                  
                                  )
                                
                              
                              -
                              
                                
                                  P
                                  d
                                
                                ⁢
                                
                                  T
                                  f
                                
                              
                            
                            
                          
                        
                      
                    
                    ⁢
                    
                      
                    
                  
                
              
              
                
                  
                    
                      1
                      
                        
                          
                            
                              
                              
                                
                                  
                                    P
                                    d
                                  
                                  ⁢
                                  
                                    T
                                    e
                                  
                                
                                -
                              
                            
                          
                        
                        
                          
                            
                              
                                
                                  
                                    P
                                    a
                                  
                                  ⁡
                                  
                                    (
                                    
                                      
                                        C
                                        B
                                      
                                      -
                                      
                                        T
                                        
                                          h
                                          ⁢
                                          
                                            
                                          
                                        
                                      
                                    
                                    )
                                  
                                
                                
                              
                              ⁢
                              
                                Δ
                                tgt
                              
                            
                          
                        
                      
                    
                    ,
                  
                
                
                  else
                
              
            
            .
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          35
        
        )
      
    
  




Each parameter CL, CR, CT, and CB can be considered a crop parameter, and each parameter SL, SR, ST, and SB can be considered a scaling parameter, such that each of processing path 502 to 508 are of identical structure, but fed with a respective different crop and scale parameter.
As can be seen from the above, the output of multiplier 514 in FIG. 26 is simply α′L=SL|ΣP|ΔDL, where ΔDL=xs−CL. In general, for each of the processing path, α′i=Si|ΣP|ΔDi, where i=L, R, T, B and




  
    Δ
    ⁢
    
      
    
    ⁢
    
      D
      i
    
  
  =
  
    {
    
      
        
          
            
              
                
                  x
                  s
                
                -
                
                  C
                  L
                
              
              ,
              
                i
                =
                L
              
            
          
        
        
          
            
              
                
                  C
                  R
                
                -
                
                  x
                  s
                
              
              ,
              
                i
                =
                R
              
            
          
        
        
          
            
              
                
                  y
                  s
                
                -
                
                  C
                  T
                
              
              ,
              
                i
                =
                T
              
            
          
        
        
          
            
              
                
                  C
                  B
                
                -
                
                  y
                  s
                
              
              ,
              
                i
                =
                B
              
            
          
        
      
      .
    
  




The fuzzy logic AND block 518 implements the fuzzy logic AND




  
    
      α
      shp
    
    ⁡
    
      (
      
        
          x
          t
        
        ,
        
          y
          t
        
      
      )
    
  
  =
  
    
      ⋂
      
        
          i
          =
          L
        
        ,
        R
        ,
        T
        ,
        B
      
    
    ⁢
    
      
        
          α
          i
        
        ⁡
        
          (
          
            
              x
              s
            
            ,
            
              y
              s
            
          
          )
        
      
      .
    
  




Note that in this embodiment, the left and right boundary shaping alpha values αL(xs,ys) and αR(xs,ys) are used as the set of inputs for a first fuzzy logic AND





  
    
      ⋂
      
        
          i
          =
          L
        
        ,
        R
      
    
    ⁢
    
      
        α
        i
      
      ⁡
      
        (
        
          
            x
            s
          
          ,
          
            y
            s
          
        
        )
      
    
  
  ,




as at block 520, and the top and bottom boundary shaping alpha values αT(xs,ys) and αB(xs,ys) are used as the set of inputs for a second fuzzy logic AND





  
    
      ⋂
      
        
          i
          =
          T
        
        ,
        B
      
    
    ⁢
    
      
        α
        i
      
      ⁡
      
        (
        
          
            x
            s
          
          ,
          
            y
            s
          
        
        )
      
    
  
  ,




as at block 522, and then these two results are used as the set of inputs for a third fuzzy logic AND, as at block 524, to generate the shaping alpha value αshp(xt,yt) for the pixel coordinate (xt,yt) of the target image. This can be considered parallel or cascade merging of multiple binary operation fuzzy logic ANDs to construct a fuzzy logic AND having more than 2 operands.

Then, as shown at 526, the shaping alpha value αshp(xt,yt) is multiplexed with the value “0”, with the overflow/underflow choosing “0” if there was an overflow/underflow error in the computations. This multiplexer implements a switch that can switch between “0” and the shaping alpha value αshp(xt,yt). By choosing “0”, this results in the pixel being fully transparent if there is an overflow/underflow condition.
One example way to implement the fuzzy logic of block 518 is illustrated in FIG. 27. As shown in FIG. 27, this implementation includes comparators and multiplexers arranged in the manner illustrated. Specifically,
the minimum of left boundary shaping alpha value αL(xs,ys) and right boundary shaping alpha value αR(xs,ys) is selected via comparator 562 and multiplexer 564. Similarly, the minimum of top boundary shaping alpha value αT(xs,ys) and bottom boundary shaping alpha value αB(xs,ys) is selected via comparator 566 and multiplexer 568. The output of each of multiplexers 564 and 568 are then compared using comparator 570 and the smallest value selected using multiplexer 572. The output is then Equation 30, that is:

αshp(xt,yt)=min{αL(xs,ys),αR(xs,ys),αT(xs,ys),αB(xs,ys)}.

Another example way to implement the fuzzy logic of block 518 is illustrated in FIG. 28. As shown in FIG. 28, this implementation includes multipliers arranged in the manner illustrated. Specifically, the left boundary shaping alpha value αL(xs,ys) and the right boundary shaping alpha value αR(xs,ys) are multiplied, as at 582. Similarly, the top boundary shaping alpha value αT(xs,ys) and the bottom boundary shaping alpha value αB(xs,ys) are multiplied, as at 584. The output of each of multipliers 582 and 584 are multiplied, as at 586. The output is then Equation 31, that is:

αshp(xt,yt)=αL(xs,ys)×αR(xs,ys)×αT(xs,ys)×αB(xs,ys).

The FIG. 27 implementation tends to give a sharp-angled corner effect, whereas the FIG. 28 implementation tends to give a rounded corner effect.
Using the example implementation discussed above in relation to FIGS. 24 to 28, different values of Δtgt have been tested (e.g. Δtgt=1.5 and Δtgt=10.5) and softness around a target object in a target image has been obtained that is aesthetically improved as compared to the alternative approach of not defining a uniform softness border Δtgt around the target object, but instead defining a uniform softness border around the source image and then computing the shaping alpha value for each target pixel coordinate in terms of whether the corresponding source pixel coordinate falls within the uniform softness border around the source image.
FIG. 29 shows a shaping alpha generated using the implementation discussed above in relation to FIGS. 24 to 28, with Δtgt=1.5. The black area represents shaping alpha values αshp of 0 (outside the transformed source image), the white area represents shaping alpha values αshp of 1 (inside the transformed source image), and the spaced black dots represent shaping alpha values αshp of between 0 and 1 (on the border of the transformed source image). FIG. 30 is the transformed source image mixed with a white background using the shaping alpha of FIG. 29. FIGS. 31 and 32 respectively correspond to FIGS. 29 and 30, but with Δtgt=10.5 instead. In both cases (Δtgt=1.5 or Δtgt=10.5), all edges of the transformed source object are uniform soft.
It will be appreciated that FIGS. 29 to 32 are black and white drawings meant to represent the actual digital photographs of actual simulated results. These drawings are simplified in some aspects compared to the actual photographs. It should also be appreciated that similar or different results could be obtained under different simulation conditions and/or actual operating conditions.
In the examples described with respect to FIGS. 29 to 32, top and bottom edges of the transformed source image lean on the x-axis and have long ramps horizontally, roughly 10-pixels long for the case of Δtgt=1.5 and more than 40 pixels long for the case of Δtgt=10.5. However, they have suitable sizes for vertical softness range: roughly 1-2 pixels wide for the case of Δtgt=1.5, and roughly 10-11 pixels wide for the case of Δtgt=10.5. The left and right edge of the transformed source image are almost equally inclined to the x-axis and y-axis and the soft areas in both directions are similar: roughly 1-3 pixels wide for the case of Δtgt=1.5, and roughly 10-18 pixels wide for the case of Δtgt=10.5. Both cases use arithmetic multiplication fuzzy logic-AND (FIG. 28), which gives a more rounded corner effect. This is in contrast to arithmetic minimum for fuzzy logic-AND (FIG. 27), which leads to a sharp-angled corner effect.
With reference again to FIGS. 25 to 28, these figures can be considered as illustrating a field programmable gate array (FPGA) or application specific integrated circuit (ASIC) implementation in that separate computation circuitry (e.g. adding/multiplication circuitry) is illustrated. For example, in FIG. 26, four identical computational blocks 502 to 508 are illustrated, one for each boundary of the source image. In an alternative embodiment, the computations above, and in particular the computations performed by the perspective transform engine 308 and shaping alpha generator 326, may instead be performed by a general processor having the relevant parameters stored in memory and instructions stored in memory that, when executed, cause the processor to perform the computations. An example of such a DVE device is illustrated in FIG. 33. As shown in FIG. 33, a DVE device 602 includes a memory 604, a processor 606, and a user interface 608. The memory 604 stores the source image and the parameter values corresponding to the specific effect requested by the user via the user interface 608 (e.g. the specific values of Ta, Tb, Tc, Td, Te, Tf, Tg, Th, Pa, Pb, Pc, Pd, and f for the effect requested by the user). The processor 606 performs the computations to generate the target image and the shaping alpha in the manner described above. For example, the processor 606 can perform the equivalent of the computations performed by filter 302, perspective transform engine 308, shaping alpha generator 326, and interpolator 316 in the DVE device 320 of FIG. 24. The parallel computational blocks, such as blocks 502, 504, 506, and 508 would generally not exist (i.e. the computations would be performed in serial), although depending upon the sophistication of the processor 606, some parallel operations may be possible.
The processor 606 may be, for example, a central processing unit (CPU), a graphics processing unit (GPU), or general-purpose computing on graphics processing units (GPGPU).
The benefit of the field programmable gate array (FPGA) or application specific integrated circuit (ASIC) implementation is that it can generally execute the computations faster, making it more desirable for real-time processing, such as when producing a live video (live production). The general processor implementation shown in FIG. 33 is perhaps better suited for non-real-time video post-production (i.e. not live video production).
Although specific illustrated embodiments have been described above, variations and alternatives will be apparent. Some variations and alternatives are discussed above. Other example variations and alternatives are mentioned below for completeness.
In the embodiments above, it is assumed that each source image and corresponding target image is a component (e.g. a field or frame) of digital video, where the digital video comprises a series of digital images displayed in rapid succession. In a non-video environment, one could perform the methods above with digital images (e.g. a digital picture) to perform an effect on one or more digital images. This may be useful, for example, in a computer graphics application, such as (for example) in polygon rendering or texture mapping around edges in computer graphics to produce an anti-aliasing effect.
In the example shaping alpha computation described above, a pre-alpha value α′i(xs,ys) is first computed via Equation 27 as




  
    
      α
      i
      ′
    
    ⁡
    
      (
      
        
          x
          s
        
        ,
        
          y
          s
        
      
      )
    
  
  =
  
    
      
        Δ
        ⁢
        
          
        
        ⁢
        
          D
          i
        
      
      
        Δ
        src
        i
      
    
    =
    
      {
      
        
          
            
              
                
                  
                    Δ
                    ⁢
                    
                      
                    
                    ⁢
                    x
                  
                  
                    Δ
                    src
                    x
                  
                
                =
                
                  {
                  
                    
                      
                        
                          
                            
                              
                                
                                  x
                                  s
                                
                                -
                                
                                  C
                                  L
                                
                              
                              
                                Δ
                                src
                                L
                              
                            
                            ⁢
                            i
                          
                          =
                          
                            L
                            ⁡
                            
                              (
                              
                                left
                                ⁢
                                
                                  
                                
                                ⁢
                                edge
                              
                              )
                            
                          
                        
                      
                    
                    
                      
                        
                          
                            
                              
                                
                                  C
                                  R
                                
                                -
                                
                                  x
                                  s
                                
                              
                              
                                Δ
                                src
                                R
                              
                            
                            ⁢
                            i
                          
                          =
                          
                            R
                            ⁡
                            
                              (
                              
                                right
                                ⁢
                                
                                  
                                
                                ⁢
                                edge
                              
                              )
                            
                          
                        
                      
                    
                  
                
              
            
          
          
            
              
                
                  
                    Δ
                    ⁢
                    
                      
                    
                    ⁢
                    y
                  
                  
                    Δ
                    src
                    y
                  
                
                =
                
                  {
                  
                    
                      
                        
                          
                            
                              
                                
                                  y
                                  s
                                
                                -
                                
                                  C
                                  T
                                
                              
                              
                                Δ
                                src
                                T
                              
                            
                            ⁢
                            i
                          
                          =
                          
                            T
                            ⁡
                            
                              (
                              
                                top
                                ⁢
                                
                                  
                                
                                ⁢
                                edge
                              
                              )
                            
                          
                        
                      
                    
                    
                      
                        
                          
                            
                              
                                
                                  C
                                  B
                                
                                -
                                
                                  y
                                  s
                                
                              
                              
                                Δ
                                src
                                B
                              
                            
                            ⁢
                            i
                          
                          =
                          
                            B
                            (
                            
                              bottom
                              ⁢
                              
                                
                              
                              ⁢
                              edge
                            
                            )
                          
                        
                      
                    
                  
                
              
            
          
        
        .
      
    
  




In an alternative embodiment, an initial offset value α0 may be added, such that Equation 27 above is instead:





  
    
      
        
          
            α
            i
            ′
          
          ⁡
          
            (
            
              
                x
                s
              
              ,
              
                y
                s
              
            
            )
          
        
        =
        
          
            
              
                Δ
                ⁢
                
                  
                
                ⁢
                
                  D
                  i
                
              
              
                Δ
                src
                i
              
            
            +
            
              α
              0
            
          
          =
          
            {
            
              
                
                  
                    
                      
                        
                          
                            Δ
                            ⁢
                            
                              
                            
                            ⁢
                            x
                          
                          
                            Δ
                            src
                            x
                          
                        
                        +
                        
                          α
                          0
                        
                      
                      =
                      
                        {
                        
                          
                            
                              
                                
                                  
                                    
                                      
                                        x
                                        s
                                      
                                      -
                                      
                                        C
                                        L
                                      
                                    
                                    
                                      Δ
                                      src
                                      L
                                    
                                  
                                  +
                                  
                                    α
                                    0
                                  
                                
                                ,
                                
                                  i
                                  =
                                  
                                    L
                                    ⁡
                                    
                                      (
                                      
                                        left
                                        ⁢
                                        
                                          
                                        
                                        ⁢
                                        edge
                                      
                                      )
                                    
                                  
                                
                              
                            
                          
                          
                            
                              
                                
                                  
                                    
                                      
                                        C
                                        R
                                      
                                      -
                                      
                                        x
                                        s
                                      
                                    
                                    
                                      Δ
                                      src
                                      R
                                    
                                  
                                  +
                                  
                                    α
                                    0
                                  
                                
                                ,
                                
                                  i
                                  =
                                  
                                    R
                                    ⁡
                                    
                                      (
                                      
                                        right
                                        ⁢
                                        
                                          
                                        
                                        ⁢
                                        edge
                                      
                                      )
                                    
                                  
                                
                              
                            
                          
                        
                      
                    
                  
                
                
                  
                    
                      
                        
                          
                            Δ
                            ⁢
                            
                              
                            
                            ⁢
                            y
                          
                          
                            Δ
                            src
                            y
                          
                        
                        +
                        
                          α
                          0
                        
                      
                      =
                      
                        {
                        
                          
                            
                              
                                
                                  
                                    
                                      
                                        y
                                        s
                                      
                                      -
                                      
                                        C
                                        T
                                      
                                    
                                    
                                      Δ
                                      src
                                      T
                                    
                                  
                                  +
                                  
                                    α
                                    0
                                  
                                
                                ,
                                
                                  i
                                  =
                                  
                                    T
                                    ⁡
                                    
                                      (
                                      
                                        top
                                        ⁢
                                        
                                          
                                        
                                        ⁢
                                        edge
                                      
                                      )
                                    
                                  
                                
                              
                            
                          
                          
                            
                              
                                
                                  
                                    
                                      
                                        C
                                        B
                                      
                                      -
                                      
                                        y
                                        s
                                      
                                    
                                    
                                      Δ
                                      src
                                      B
                                    
                                  
                                  +
                                  
                                    α
                                    0
                                  
                                
                                ,
                                
                                  i
                                  =
                                  
                                    B
                                    ⁡
                                    
                                      (
                                      
                                        bottom
                                        ⁢
                                        
                                          
                                        
                                        ⁢
                                        edge
                                      
                                      )
                                    
                                  
                                
                              
                            
                          
                        
                      
                    
                  
                
              
              .
            
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          36
        
        )
      
    
  




The initial offset value α0 is between 0 and 1, and in some embodiments the exact value of the initial offset value α0 may be controlled by the user through the user interface (e.g. user interface 608 or 314). The initial offset value α0 is an effect. Specifically, it causes the softness range to shift inside or outside the target object. For example, when α0=0, the alpha curve (softness range) starts from the source cropping boundary edge and inwardly ramps up, when α0=0.5, the alpha curve (softness range) starts from the outside of the source cropping boundary edge and inwardly ramps up but ends up at the inside of the source image, and when α0=1 the alpha curve (softness range) starts from the outside of the source cropping boundary edge and ends up just at the cropping boundary edge. This is illustrated in FIG. 34.

In short, the initial offset value α0 shifts where the softness area is located relative to the boundary of the target object. The higher the initial offset value α0, the more outwardly extended the softness area is. It will be appreciated that in some embodiments, a different initial offset value α0,i may be chosen for each boundary, if desired.
As mentioned above, the initial offset value α0 can be considered an effect. However, in some embodiments it also plays a role in preventing a warped picture from protruding too much. This is explained below with respect to FIGS. 35 to 37.
A larger positive initial offset value α0 keeps the ramping (softness area) towards the outside of the picture area and therefore leaves pixels near boundaries of the picture intact or with fewer fadeouts. In most cases, it is preferred that all of the picture content is visible, rather than the fading (semi-transparency) happening too much inside the picture boundary and having some of the picture parts fade out. This is shown in FIG. 35, in which a full-sized picture is completely visible and the softness area (i.e. ramping/fadeout) occurs completely outside the picture.
However, in cases in which the picture is extremely warped by an effect, the uniform softness around the target object in the target image (e.g. target object 123) may produce some protruding corners. This is illustrated in FIG. 36, in which left and right bottom corners have softness areas that protrude outwardly with rotation around the x-axis and may produce unacceptable effects. A particularly bad case is illustrated at the bottom of FIG. 36, in which the plane is rotated enough to make both left and right cropping lines almost parallel to the top and bottom, which causes the left and right corners to extend substantially infinitely outwards.
The initial offset value α0 may be used to help address this problem.
One method of using the initial offset value α0 in order to accommodate both “normal” cases (not extreme warping), and “extreme warping” cases is as follows. The initial offset value α0 can be varied between 0 and 1 during operation depending upon the effect (particularly the rotation angle) so that, when necessary, the ramping (the softness area) may be moved completely inside the picture to eliminate extreme protruding corners. By moving the softness area completely inside the picture, the protruding corners would then be outside the softness area and would have an alpha shaping value of zero and so would be transparent. On the other hand, when the effect is such that there is no such problematic protruding corners, the ramping (the softness area) may instead be completely outside the picture to let the entire picture contents display with no fading of any of the picture contents. Depending upon the effect (the amount of protruding corners), the initial offset value α0 can also be chosen as somewhere between 0 and 1.
FIG. 37 illustrates the result when the initial offset value α0 is applied to suppress protruding corners when the effects shown in FIG. 36 are applied.
One way to achieve the above is to compute an appropriate corresponding initial offset value α0 each time the transformation parameters are computed (i.e. each time M−1 and the value of f are computed). One such example computation of the initial offset value α0 for a given set of parameters is as follows.
First define a ratio R as:




  
    
      
        R
        =
        
          {
          
            
              
                
                  
                    
                      
                        
                        
                          
                            
                              P
                              b
                            
                            ⁢
                            W
                          
                          -
                          
                            T
                            b
                          
                        
                        
                      
                      
                        WIDTH
                        /
                        2
                      
                    
                    ,
                  
                
                
                  
                    
                      if
                      ⁢
                      
                        
                      
                      ⁢
                      
                        
                        
                          
                            
                              P
                              a
                            
                            ⁢
                            W
                          
                          -
                          
                            T
                            a
                          
                        
                        
                      
                    
                    <
                    
                      
                        
                        
                          
                            
                              P
                              b
                            
                            ⁢
                            W
                          
                          -
                          
                            T
                            b
                          
                        
                        
                      
                      ⁢
                      
                        
                      
                      ⁢
                      horizontally
                    
                  
                
              
              
                
                  
                    
                      
                        
                        
                          
                            
                              P
                              b
                            
                            ⁢
                            W
                          
                          -
                          
                            T
                            a
                          
                        
                        
                      
                      
                        WIDTH
                        /
                        2
                      
                    
                    ,
                  
                
                
                  else
                
              
              
                
                  
                    
                      
                        
                        
                          
                            
                              P
                              b
                            
                            ⁢
                            H
                          
                          -
                          
                            T
                            f
                          
                        
                        
                      
                      
                        HEIGHT
                        /
                        2
                      
                    
                    ,
                  
                
                
                  
                    
                      if
                      ⁢
                      
                        
                      
                      ⁢
                      
                        
                        
                          
                            
                              P
                              a
                            
                            ⁢
                            H
                          
                          -
                          
                            T
                            e
                          
                        
                        
                      
                    
                    <
                    
                      
                        
                        
                          
                            
                              P
                              b
                            
                            ⁢
                            H
                          
                          -
                          
                            T
                            f
                          
                        
                        
                      
                      ⁢
                      
                        
                      
                      ⁢
                      vertically
                    
                  
                
              
              
                
                  
                    
                      
                        
                        
                          
                            
                              P
                              a
                            
                            ⁢
                            H
                          
                          -
                          
                            T
                            e
                          
                        
                        
                      
                      
                        HEIGHT
                        /
                        2
                      
                    
                    ,
                  
                
                
                  else
                
              
            
            ,
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          37
        
        )
      
    
  




where “WIDTH” is the horizontal resolution and “HEIGHT” is the vertical resolution. The other parameters have been introduced earlier.

Then, the initial offsets for the horizontal and vertical boundaries are determined, respectively, as:




  
    
      
        
          α
          0
          H
        
        =
        
          {
          
            
              
                
                  
                    
                      1
                      -
                      
                        
                          R
                          
                            T
                            min
                          
                        
                        ⁢
                        if
                        ⁢
                        
                          
                        
                        ⁢
                        R
                      
                    
                    <
                    
                      T
                      0
                    
                  
                
                
                  
                    
                      at
                      ⁢
                      
                        
                      
                      ⁢
                      
                        
                        
                          
                            
                              P
                              a
                            
                            ⁢
                            W
                          
                          -
                          
                            T
                            a
                          
                        
                        
                      
                    
                    <
                    
                      
                      
                        
                          
                            P
                            b
                          
                          ⁢
                          W
                        
                        -
                        
                          T
                          b
                        
                      
                      
                    
                  
                
              
              
                
                  0
                
                
                  else
                
              
              
                
                  
                    
                      1
                      -
                      
                        
                          R
                          
                            T
                            max
                          
                        
                        ⁢
                        if
                        ⁢
                        
                          
                        
                        ⁢
                        R
                      
                    
                    <
                    
                      T
                      1
                    
                  
                
                
                  
                    
                      at
                      ⁢
                      
                        
                      
                      ⁢
                      
                        
                        
                          
                            
                              P
                              a
                            
                            ⁢
                            W
                          
                          -
                          
                            T
                            a
                          
                        
                        
                      
                    
                    ≥
                    
                      
                      
                        
                          
                            P
                            b
                          
                          ⁢
                          W
                        
                        -
                        
                          T
                          b
                        
                      
                      
                    
                  
                
              
              
                
                  0
                
                
                  else
                
              
            
            ,
            
              

            
            ⁢
            
              
            
            ⁢
            and
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          38
        
        )
      
    
  
  
    
      
        
          α
          0
          V
        
        =
        
          {
          
            
              
                
                  
                    
                      1
                      -
                      
                        
                          R
                          
                            T
                            min
                          
                        
                        ⁢
                        if
                        ⁢
                        
                          
                        
                        ⁢
                        R
                      
                    
                    <
                    
                      T
                      0
                    
                  
                
                
                  
                    
                      at
                      ⁢
                      
                        
                      
                      ⁢
                      
                        
                        
                          
                            
                              P
                              a
                            
                            ⁢
                            H
                          
                          -
                          
                            T
                            e
                          
                        
                        
                      
                    
                    ≥
                    
                      
                      
                        
                          
                            P
                            b
                          
                          ⁢
                          H
                        
                        -
                        
                          T
                          f
                        
                      
                      
                    
                  
                
              
              
                
                  0
                
                
                  else
                
              
              
                
                  
                    
                      1
                      -
                      
                        
                          R
                          
                            T
                            max
                          
                        
                        ⁢
                        if
                        ⁢
                        
                          
                        
                        ⁢
                        R
                      
                    
                    <
                    
                      T
                      1
                    
                  
                
                
                  
                    
                      at
                      ⁢
                      
                        
                      
                      ⁢
                      
                        
                        
                          
                            
                              P
                              a
                            
                            ⁢
                            H
                          
                          -
                          
                            T
                            e
                          
                        
                        
                      
                    
                    <
                    
                      
                      
                        
                          
                            P
                            b
                          
                          ⁢
                          H
                        
                        -
                        
                          T
                          f
                        
                      
                      
                    
                  
                
              
              
                
                  0
                
                
                  else
                
              
            
            ,
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          39
        
        )
      
    
  




where Tmin, <Tmax. The specific values for Tmin and Tmax are implementation specific and may be determined through experimentation. The thresholds T0 and T1 are also implementation specific. In one implementation, these values are as follows T0=Tmin=0.2 and T1=Tmax=0.5.
Note that the conditions in Equations 38 and 39 are opposite because vertical source boundaries (left and right sides) require a smaller threshold T0 but horizontal source boundaries (top and bottom sides) require a larger threshold T1 when rotation is beyond 45 degrees.
The initial offset value α0 is then chosen as:

α0=min{α0H,α0V}  (Equation 40).

By using as the initial offset value α0 the minimum of α0H and α0V, this prioritizes an alpha shaping ramp inside the picture boundary.

The above is one example way to use and compute an initial offset value α0. More generally, the computation of the initial offset value α0 comprises: for a given effect (set of parameters), computing a ratio R based on the boundary line rotation angle (or more generally, based on the effect chosen by the user, which determines the boundary line rotation angle), and then computing horizontal and vertical offset values using the ratio R, and then choosing as the initial offset value α0 the minimum of the horizontal and vertical offset values.
The variation of having an initial offset value α0 is described above. As another example, in another embodiment there may instead (or in addition) be a global transparency clipping function, which may be combined with the shaping alpha αshp to provide a transparency effect (e.g. for dissolving the target object into the background). This may be applied as follows:




  
    
      
        
          α
          shp
        
        =
        
          {
          
            
              
                
                  
                    
                      α
                      Tran
                    
                    ,
                    
                      
                        α
                        shp
                      
                      >
                      
                        α
                        Tran
                      
                    
                  
                
              
              
                
                  
                    
                      α
                      shp
                    
                    ,
                    
                      
                        α
                        shp
                      
                      ≤
                      
                        α
                        Tran
                      
                    
                  
                
              
            
            ,
          
        
      
    
    
      
        (
        
          Equation
          ⁢
          
            
          
          ⁢
          41
        
        )
      
    
  




where αTran is a value between 0 and 1. In some embodiments the exact value of αTran may be controlled by the user through the user interface (e.g. user interface 608 or 314). The use of αTran is an effect. As is clear from Equation 41, it clips the shaping alpha value so that the shaping alpha value can never be greater than αTran. Therefore, if αTran is less than one, the whole target object will be semi-transparent. If αTran=0 then the target object is completely transparent and only the background is shown. If αTran=1 then no additional effect is provided (i.e. it is as if αTran is not being used).

As an example, FIG. 38 illustrates a shaping alpha αshp clipped by threshold 0.5 and 0.1 to form a shaping alpha with different global transparency.
In other embodiments, the global transparency clipping function may be replaced more generally with a fuzzy logic AND function: αshp=αTran ∩αshp where αTranε[0,1]. Equation 41 above is one implementation of the fuzzy logic AND in which an arithmetic minimum is taken (i.e. αshp=min(αTran,αshp)). Another implementation may be, for example, αshp=αTranαshp (i.e. arithmetic multiplication), which is illustrated with respect to FIG. 39.
FIG. 40 illustrates the FIG. 26 example further modified to also apply the initial offset value α0 effect and the global transparency αTran effect. As can be seen from FIG. 40, it is the same as FIG. 26, except now there is additionally an adder 519 for adding in the initial offset value α0, and a fuzzy logic AND 521 for applying the global transparency effect (e.g. for applying Equation 41 if the fuzzy logic AND is implemented as an arithmetic minimum). In an alternative embodiment in which the initial offset value α0 is individually set for each boundary, then α0 in processing path 502 would be replaced with α0L, which is uniquely set for that processing path, and the same would be the case for the other processing paths (i.e. α0 in processing path 504 would be replaced with a value α0R that is uniquely set for processing path 504, α0 in processing path 506 would be replaced with a value α0T that is uniquely set for processing path 506, and α0 in processing path 508 would be replaced with a value α0B that is uniquely set for processing path 508). In the embodiment in FIG. 40, for each alpha processing path, α′i=Si|ΣP|ΔDi+α0, or, for embodiments in which the initial offset value α0 is individually set for each boundary, then α′i=Si|ΣP|ΔDi+α0,i, where i=L, R, T, B.
The above describes some specific embodiments, including some specific example computations using an assumed set of parameters and mapping function (e.g. M−1).
Please now consider FIG. 41, which is described more generally in view of, and in addition to, the foregoing.
With reference to FIG. 41, a source digital image 1002 is illustrated, which comprises a plurality of pixels. It is transformed by a computational device into a digital object 1004 in a target digital image 1006. The target digital image 1006 also comprises a plurality of pixels. In general, some of the pixels of the target digital image 1006 will be within source bounds (i.e. within object 1004) and others will be outside source bounds (i.e. in area O of the target digital image 1006). This scenario is illustrated in FIG. 41, it being understood that this is a generality. It could be the case, for example, that the object 1004 comprises all of target digital image 1006. For example, in a mixing application, the object 1004 could encompass the whole target digital image 1006 and therefore lie completely over the background (when mixed with a background image or video), with the target image having some semi-transparency to reveal some or all of the background to some degree.
The source digital image 1002 is defined by four boundaries B1, B2, B3, and B4. These boundaries may be boundaries of the original source image, or they may be cropping boundaries from previous cropping of the source image 1002. Each one of these four boundaries respectively corresponds to one of four boundaries of the digital object 1004 in the target digital image 1006.
Bordering a boundary of the digital object 1004 is an area A1 having a width W1 uniform along at least that boundary. This area A1 defines the softness range or softness margin of the boundary of the object 1004. In FIG. 41, the area A1 has a width W1 that is uniform along boundary B1 of the object 1004. Also, in FIG. 41, the uniform width is the same around all boundaries of the object 1004. However, in general, this need not be the case. As one example, the width of the area bordering boundary B2 of the digital object 1004 could be different from width W1. Also, in general, the width of the area bordering the digital object 1004 does not necessarily have to be uniform along all boundaries of the digital object 1004, only along at least one boundary (e.g. boundary B1 of the digital object 1004). Also, in general, it could be the case that not all boundaries of the digital object 1004 have a softness area bordering that boundary, for example, if a softness range is not needed or desired at a particular boundary.
The width W1 of area A1 is uniform in that the number of pixels in the target image 1006 between the boundary B1 of the object 1004 and an edge of the border, measured along a coordinate axis (in this case along the x-coordinate axis), is the same at each point or location along the boundary. This is shown in FIG. 41, in which the width of the area A1 at G and H is the same (W1). The uniform width W1 is defined by a value Δ that in some embodiments may be received by or based upon an input by the user.
A pixel coordinate (xt,yt) of the target image 1006 that is within the area A1 is mapped to a corresponding source pixel coordinate (xs,ys) that is within another area A2 bordering the source digital image 1002. This mapping may involve computing the corresponding source pixel coordinate using parameters obtained based on the effect requested by the user and applying those parameters to the target pixel coordinate. Because of the use of an area A1 of uniform width in the target image 1006, the area A2 bordering the boundary of the source image 1002 has a width that is non-uniform along a corresponding boundary of the source image 1002. This width is non-uniform in that the number of source pixels between the boundary of the source digital image 1002 and an edge of the border, measured along a coordinate axis, is different at two different points (locations) along the boundary of the source digital image 1002. This is shown in FIG. 41, in which the width at points E and F are different (specifically at E the width is W3, and at F the width is W2≠W3).
Area A1 (and corresponding area A2) define a range or area of “softness” around the object 1004. A shaping alpha channel defines the amount of the “softness”. Specifically, each shaping alpha channel value defines the semi-transparency of a respective pixel associated with a pixel coordinate (xt,yt) of the target digital image 1006. In particular, for the target pixel coordinate (xt,yt) in area A1 of the target image 1006, the pixel is mapped to a corresponding source pixel coordinate (xs,ys) in area A2, and the alpha channel value for that target pixel coordinate (xt,yt) is then computed as a function of the location of the corresponding source pixel coordinate (xs,ys) in area A2. For example, in one embodiment, the alpha channel value is computed as a function of: (i) a distance between the corresponding source pixel coordinate (xs,ys) and the boundary of the source digital image 1002 and (ii) the width of area A2 at the location of the corresponding source pixel coordinate (xs,ys). In FIG. 41, the distance between the corresponding source pixel coordinate (xs,ys) and the boundary B1 is measured along the coordinate axis perpendicular to the boundary (which is the x-axis in the FIG. 41 illustrated example this is shown as Δx as an example).
This method of computing the alpha channel value for the target pixel coordinate (xt,yt) can be repeated for each target pixel coordinate in the softness area bordering the target digital object 1004.
By using the approach above to compute the alpha channel values for the target pixels in the softness area bordering the digital object 1004, the result is an ability to have a more uniform range of softness around the object 1004 in the target image 1006, since a uniform area A1 is defined to result in an area of uniform width (e.g. width W1) bordering a boundary of the object 1004, and then the appropriate alpha channel values are computed based on this. Specifically, an alpha channel value for a pixel coordinate (xt,yt) of the target image 1006 in the uniform softness area A1 is computed as a function of the location of the corresponding source pixel coordinate (xs,ys) in the area A2 of non-uniform width bordering the source image 1004).
Example devices for performing the method above are disclosed, for example, in FIGS. 24 and 33. However, it will be appreciated that more generally, a computational device does not have to have all of the specific components shown in the examples of FIGS. 24 and 33. One example method is illustrated in FIG. 42, in which the computational device has a memory, a user interface, and some sort of processing circuitry for performing the computations. This example method is as follows. In step 1050, a source digital image is received and stored in the memory. In step 1052, there is received at the user interface an indication of an effect to be applied to the source digital image. In step 1054, a set of parameters are obtained based on the indication of the effect. In step 1056, a value is obtained that defines a width of an area that borders at least one boundary of the digital object in the target digital image (e.g. area A1). The width of the area is uniform along the at least one boundary of the digital object. In step 1058, for a pixel coordinate (xt,yt) of the target digital image that is within the area that borders the at least one boundary of the digital object, a corresponding source pixel coordinate (xs,ys) that is within another area bordering the source digital image is computed, using the pixel coordinate (xt,yt) of the target digital image and at least some of the parameters. This “another area” (e.g. area A2) has a width that is non-uniform along a boundary of the source digital image. In step 1060, an alpha channel value is computed that defines the semi-transparency of a pixel associated with the pixel coordinate (xt,yt) of the target digital image. As explained above, the alpha channel value is computed as a function of a location of the corresponding source pixel coordinate (xs,ys) in said another area bordering the source digital image.
FIG. 41 assumes outward ramping (like FIG. 15) with the softness area outside the border of the picture. Inward ramping is also possible and the method described above still applies. FIG. 43 shows the inward ramping variation with the softness area inside the boundary of the picture.
Some general embodiments will now be described.
In one embodiment, a method for computing an alpha channel value is provided. In this method, a set of parameters is obtained based on an effect (transformation) to be applied to a source image. A value is also obtained that defines a uniform width of an area that borders at least one boundary of the transformed source image in the target image. For a target image pixel coordinate in the area, a corresponding source pixel coordinate is computed that is within another non-uniform area bordering the source image. An alpha channel value defining semi-transparency of a pixel associated with the target image pixel coordinate is computed as a function of a location of the corresponding source pixel coordinate in the another area bordering the source image.
In one example embodiment, the method is performed by a computational device, and the method is performed as part of transforming a source digital image into a digital object in a target digital image. The source digital image and the target digital image each comprise a plurality of pixels. The method comprises the following steps: (i) receiving an indication of an effect to be applied to the source digital image; (ii) obtaining a set of parameters based on the indication of the effect; (iii) obtaining a value defining a width of an area that borders at least one boundary of the digital object in the target digital image; the width of the area is uniform along the at least one boundary of the digital object; (iv) for a pixel coordinate (xt,yt) of the target digital image that is within the area that borders the at least one boundary of the digital object, computing, using the pixel coordinate (xt,yt) of the target digital image and at least some of the parameters, a corresponding source pixel coordinate (xs,ys) that is within another area bordering the source digital image; the another area has a width that is non-uniform along a boundary of the source digital image; and (v) computing an alpha channel value defining semi-transparency of a pixel associated with the pixel coordinate (xt,yt) of the target digital image. The alpha channel value is computed as a function of a location of the corresponding source pixel coordinate (xs,ys) in the another area bordering the source digital image.
In some embodiments, the value defining the width of the area that borders the at least one boundary of the digital object in the target digital image is controlled by the user via the user interface (e.g. the user inputs a command to the user interface that translates to a specific value of the width of the area that borders the at least one boundary of the digital object in the target digital image).
In some embodiments, the value defining the width of the area that borders the at least one boundary of the digital object in the target digital image may be different for different boundaries of the digital object.
In some embodiments, the effect to be applied to the source digital image is a transformation/modification of the source digital image, such as resizing, rotation, translation, and/or distortion of the source image. The set of parameters obtained based on the indication of the effect are parameters defining the effect (transformation). More specifically, the parameters may define the mapping between target pixel coordinates and source pixel coordinates.
In some embodiments, the “at least one boundary” of the digital object may be all boundaries of the digital object (i.e. a uniform area bordering the entire digital object, as shown in FIG. 41).
In general, the source digital image is defined by four boundaries (e.g. left, right, top, and bottom), and each one of the four boundaries respectively corresponds to one of four boundaries of the digital object in the target digital image.
In some embodiments, the width of the area that borders the at least one boundary of the digital object is defined as the number of pixels in the target image between the at least one boundary of the digital object and an edge of the border, measured along a coordinate axis (e.g. along a coordinate axis perpendicular to the boundary), and the width of said another area that borders the source digital image is defined as the number of source pixels between the boundary of the source digital image and an edge of the border, measured along a coordinate axis (e.g. along a coordinate axis perpendicular to the boundary).
In some embodiments, computing the alpha channel value specifically comprises computing the alpha channel value as a function of: (i) a distance between the corresponding source pixel coordinate (xs,ys) and the boundary of the source digital image, and/or (ii) the width of said another area at the location of the corresponding source pixel coordinate (xs,ys). The distance between the corresponding source pixel coordinate (xs,ys) and the boundary of the source digital image may be measured along a coordinate axis. The coordinate axis may be the coordinate axis that is perpendicular to the boundary.
In some embodiments, the width of said another area at the location of the corresponding source pixel coordinate (xs,ys) is a function of the value defining the width of the area that borders the at least one boundary of the digital object in the target digital image, and/or the target pixel coordinate (xt,yt), and/or at least some of the parameters.
In some embodiments, the width of the area that borders the at least one boundary of the digital object is uniform along the at least one boundary in that: the number of pixels in the target digital image between the at least one boundary and an edge of the area that borders the at least one boundary, measured along a coordinate axis, is the same at each point along the at least one boundary.
In some embodiments, the width of said another area that borders the source digital image is non-uniform along the boundary of the source digital image in that: the number of source pixels between the boundary of the source digital image and an edge of said another area that borders the source digital image, measured along a coordinate axis, is different at two different points along the boundary of the source digital image.
In some embodiments, the computational device performs: computing, for each one of a plurality of pixel coordinates of the target digital image, a respective corresponding source pixel coordinate. Each target pixel coordinate that is within the area that borders the at least one boundary of the digital object in the target digital image has a corresponding source pixel coordinate that is within said another area bordering the source digital image. In some of such embodiments, it may be that an alpha channel value is computed for each one of the plurality of pixel coordinates of the target digital image in said area.
An alpha channel value may, in some embodiments, be computed as a function of a distance between the respective corresponding source pixel coordinate and the boundary of the source digital image.
In some embodiments, computing the alpha channel value comprises: computing four pre-alpha values, one for each of four boundaries of the source digital image, and obtaining the alpha channel value using the four pre-alpha values.
In some embodiments, each one of the four pre-alpha values may be computed as a function of: (i) the distance between the corresponding source pixel coordinate (xs,ys) and a respective one of the four boundaries of the source digital image, and/or (ii) the value defining the width of the area that borders the at least one boundary of the digital object, and/or (iii) the target pixel coordinate (xt,yt), and/or (iv) at least some of the parameters.
In some embodiments, the alpha channel value may be computed using four pre-alpha values as inputs to one or more fuzzy logic functions.
In some embodiments, each one of four pre-alpha values may be computed in parallel.
In some embodiments, computing each one of four pre-alpha values comprises: using computational circuitry that is substantially identical to other computational circuitry used to compute each other of the four pre-alpha values; and inputting into the computational circuitry parameter values that are different from parameter values used to compute each other of the four pre-alpha values.
In some embodiments, each one of four pre-alpha values is a function of an initial alpha offset value. The initial offset value may be between 0 and 1.
In some embodiments, the computational device may obtain an intermediary computational result when computing the corresponding source pixel coordinate (xs,ys), and then use this intermediary computational result in computing the alpha channel value.
In some embodiments, the source digital image discussed herein may be an image in a source digital video, and the target digital image discussed herein may be an image in a target digital video.
In some embodiments, the alpha channel value is a real number in the range 0≦α≦1, where α is the alpha channel value, although more generally, the alpha value does not have to be between zero and one.
In some embodiments, the computational device may compute a pixel value for the pixel coordinate (xt,yt) of the target digital image using one or more pixel values in the source digital image that are obtained based on the corresponding source pixel coordinate (xs,ys).
In some embodiments, the computational device may combine the alpha channel value with a pixel value for the pixel coordinate (xt,yt) of the target digital image to effect transparency of the pixel value and result in a semi-transparent pixel value. The “combining” may comprise multiplying the pixel value for the pixel coordinate (xt,yt) with the corresponding alpha channel value, or some other operation (e.g. divisional, addition, some sort of fuzzy logic, etc.). The semi-transparent pixel value may be mixed with a pixel of a background image.
In some embodiments, the alpha channel value is further modified by a global transparency function.
In some embodiments, computing the alpha channel value further comprises computing an initial offset value. For example, the alpha channel value may be computed as a function of a location of the corresponding source pixel coordinate (xs,ys) in the another area bordering the source digital image and as a function of the initial offset value. As another example, the alpha channel value may be a function of: (i) a distance between the corresponding source pixel coordinate (xs,ys) and the boundary of the source digital image, and (ii) the width of said another area at the location of the corresponding source pixel coordinate (xs,ys), and (iii) the initial offset value. In some embodiments, the initial offset value may be computed at least each time the effect is changed (i.e. when there is a new set of parameters or when one or more of the parameters change). In such embodiments, the initial offset value is a function of at least some of the parameters. The initial offset may be computed at least each time the effect is changed in order to control the softness boundary of a warped picture. In some embodiments, the computation of the initial offset value may comprise: for a given set of parameters, computing a ratio R based on a boundary line rotation angle (or more generally, based on the effect chosen by the user, which defines the set of parameters and which determines the boundary line rotation angle), and then computing horizontal and vertical offset values using the ratio R, and then choosing as the initial offset value α0 the minimum of the horizontal and vertical offset values.
In one embodiment, there is provided a digital video effects (DVE) device for performing any of the methods described herein. In one implementation, the DVE device transforms a source digital image in source video into a digital object in a target digital image in target video, and the DVE device comprises: memory to store the source digital image when received by the DVE device, and to store a value defining a width of an area that borders at least one boundary of the digital object in the target digital image. The width of the area is uniform along the at least one boundary of the digital object. The DVE device can further comprise a user interface to receive an indication of an effect to be applied to said source digital image. The DVE device can further comprise circuitry to perform operations including: (i) obtaining a set of parameters based on the indication of the effect; (ii) for a pixel coordinate (xt,yt) of the target digital image that is within the area that borders the at least one boundary of the digital object, computing, using the pixel coordinate (xt,yt) of the target digital image and at least some of the parameters, a corresponding source pixel coordinate (xs,ys) that is within another area bordering the source digital image, the another area having a width that is non-uniform along a boundary of the source digital image; (iii) computing an alpha channel value defining semi-transparency of a pixel associated with the pixel coordinate (xt,yt) of the target digital image. The alpha channel value may be computed as a function of a location of the corresponding source pixel coordinate (xs,ys) in said another area bordering the source digital image.
In some embodiments, the DVE device may comprise a processor to execute instructions stored in memory in the DVE device. The instructions, when executed by the processor, cause the DVE device to perform the operations discussed herein. In some embodiments, this processor may be part of the “circuitry” referred to in the paragraph above.
In some embodiments, the DVE device may comprise an integrated circuit to perform the operations discussed herein. The integrated circuit may (in some embodiments) comprise a field-programmable gate array (FPGA) or an application-specific integrated circuit (ASIC). In some embodiments, the integrated circuit may be part of the “circuitry” referred to two paragraphs above.
In another embodiment, there is provided a computer readable storage medium having stored thereon computer executable instructions that, when executed by a computational device, cause the computational device to perform the operations discussed herein.
Finally, although boundaries of images are discussed, it will be appreciated that the methods described herein could be adapted to introduce uniform softness along another line or in an area inside an image away from the image boundaries. Such another line or area may be considered as bounded by “boundaries”, and the methods described herein applied as such.
Although the foregoing has been described with reference to certain specific embodiments, various modifications thereof will be apparent to those skilled in the art without departing from the scope of the claims appended hereto.

## Claims

1. A method performed by a computational device as part of transforming a source digital image into a digital object in a target digital image, the source digital image and the target digital image each comprising a plurality of pixels; the method comprising:
receiving and storing the source digital image in memory;
receiving at a user interface an indication of an effect to be applied to said source digital image;
obtaining a set of parameters based on the indication of the effect;
obtaining a value defining a width of an area that borders at least one boundary of the digital object in the target digital image;
the width of the area being uniform along the at least one boundary of the digital object;
for a pixel coordinate (xt, yt) of the target digital image that is within the area that borders the at least one boundary of the digital object, computing, using the pixel coordinate (xt, yt) of the target digital image and at least some of the parameters, a corresponding source pixel coordinate (xs, ys) that is within another area bordering the source digital image, said another area having a width that is non-uniform along a boundary of the source digital image;
computing an alpha channel value defining semi-transparency of a pixel associated with the pixel coordinate (xt, yt) of the target digital image, the alpha channel value computed as a function of:
(i) a distance between the corresponding source pixel coordinate (xs, ys) and the boundary of the source digital image, and
(ii) the width of said another area at the location of the corresponding source pixel coordinate (xs, ys).

2. The method of claim 1, wherein the width of said another area at the location of the corresponding source pixel coordinate (xs, ys) is a function of:
(a) the value defining the width of the area that borders the at least one boundary of the digital object in the target digital image,
(b) the target pixel coordinate (xt, yt), and
(c) at least some of the parameters.

3. The method of claim 1, wherein said computing the alpha channel value comprises obtaining an initial offset value and computing the alpha channel value as a function of the location of the corresponding source pixel coordinate (xs, ys) in the another area bordering the source digital image and as a function of the initial offset value; the method further comprising using a different initial offset value when the effect to be applied to said source digital image changes.

4. The method of claim 1 further comprising: computing, for each one of a plurality of pixel coordinates of the target digital image, a respective corresponding source pixel coordinate; wherein each target pixel coordinate that is within the area that borders the at least one boundary of the digital object in the target digital image has a corresponding source pixel coordinate that is within said another area bordering the source digital image; and wherein an alpha channel value is computed for each one of the plurality of pixel coordinates of the target digital image in said area as a function of a distance between the respective corresponding source pixel coordinate and the boundary of the source digital image.

5. The method of claim 1, wherein said computing the alpha channel value comprises:
computing four pre-alpha values, one for each of four boundaries of the source digital image, and obtaining the alpha channel value using the four pre-alpha values; and
wherein each one of the four pre-alpha values is a function of:
(i) the distance between the corresponding source pixel coordinate (xs, ys) and a respective one of the four boundaries of the source digital image,
(ii) the value defining the width of the area that borders the at least one boundary of the digital object,
(iii) the target pixel coordinate (xt, yt), and
(iv) at least some of the parameters.

6. The method of claim 5, wherein said obtaining the alpha channel value using the four pre-alpha values comprises using the four pre-alpha values as inputs to one or more fuzzy logic functions.

7. The method of claim 5, further comprising computing each one of the four pre-alpha values in parallel; and wherein computing each one of the four pre-alpha values comprises:
using computational circuitry that is substantially identical to other computational circuitry used to compute each other of the four pre-alpha values; and
inputting into the computational circuitry parameter values that are different from parameter values used to compute each other of the four pre-alpha values.

8. The method of claim 1, further comprising obtaining an intermediary computational result when computing the corresponding source pixel coordinate (xs, ys), and then using the intermediary computational result in computing the alpha channel value.

9. The method of claim 1, wherein the source digital image is an image in a source digital video and wherein the target digital image is an image in a target digital video;
wherein the alpha channel value is in the range 0≦α≦1, where α is the alpha channel value; and the method further comprising:
computing a pixel value for the pixel coordinate (xt, yt) of the target digital image using one or more pixel values in the source digital image that are obtained based on the corresponding source pixel coordinate (xs, ys);
combining the alpha channel value with the pixel value for the pixel coordinate (xt, yt) of the target digital image to effect transparency of the pixel value and result in a semi-transparent pixel value.

10. A digital video effects (DVE) device for transforming a source digital image in source video into a digital object in a target digital image in target video, the source digital image and the target digital image each comprising a plurality of pixels; the DVE device comprising:
memory to store the source digital image when received by the DVE device, and to store a value defining a width of an area that borders at least one boundary of the digital object in the target digital image;
the width of the area being uniform along the at least one boundary of the digital object;
a user interface to receive an indication of an effect to be applied to said source digital image; and
circuitry to perform operations including:
obtaining a set of parameters based on the indication of the effect;
for a pixel coordinate (xt, yt) of the target digital image that is within the area that borders the at least one boundary of the digital object, computing, using the pixel coordinate (xt, yt) of the target digital image and at least some of the parameters, a corresponding source pixel coordinate (xs, ys) that is within another area bordering the source digital image, said another area having a width that is non-uniform along a boundary of the source digital image;
computing an alpha channel value defining semi-transparency of a pixel associated with the pixel coordinate (xt, yt) of the target digital image, the alpha channel value computed as a function of:
(i) a distance between the corresponding source pixel coordinate (xs, ys) and the boundary of the source digital image, and
(ii) the width of said another area at the location of the corresponding source pixel coordinate (xs, ys).

11. The DVE device of claim 10, wherein the circuitry comprises a processor to execute instructions stored in the memory; the instructions, when executed by the processor, causing said operations to be performed by the DVE device.

12. The DVE device of claim 10, wherein the circuitry comprises an integrated circuit to perform said operations; wherein said integrated circuit comprises at least one of a field-programmable gate array (FPGA) and an application-specific integrated circuit (ASIC).

13. The DVE device of claim 10, wherein the width of said another area at the location of the corresponding source pixel coordinate (xs, ys) is a function of: (a) the value defining the width of the area that borders the at least one boundary of the digital object in the target digital image, (b) the target pixel coordinate (xt, yt), and (c) at least some of the parameters.

14. The DVE device of claim 10, wherein the circuitry is further to perform operations including: computing, for each one of a plurality of pixel coordinates of the target digital image, a respective corresponding source pixel coordinate; wherein each target pixel coordinate that is within the area that borders the at least one boundary of the digital object in the target digital image has a corresponding source pixel coordinate that is within said another area bordering the source digital image; and wherein an alpha channel value is computed for each one of the plurality of pixel coordinates of the target digital image in said area as a function of a distance between the respective corresponding source pixel coordinate and the boundary of the source digital image.

15. The DVE device of claim 10, wherein the circuitry is to perform said computing the alpha channel value by:
computing four pre-alpha values, one for each of four boundaries of the source digital image, and obtaining the alpha channel value using the four pre-alpha values; and
wherein each one of the four pre-alpha values is a function of:
(i) the distance between the corresponding source pixel coordinate (xs, ys) and a respective one of the four boundaries of the source digital image,
(ii) the value defining the width of the area that borders the at least one boundary of the digital object,
(iii) the target pixel coordinate (xt, yt), and
(iv) at least some of the parameters.

16. The DVE device of claim 15, further comprising four sets of identical computation circuitry for respectively computing each one of the four pre-alpha values in parallel; each one of the sets of computational circuitry for receiving parameter values that are different from parameter values used to compute each other of the four pre-alpha values.

17. The DVE device of claim 10, wherein the circuitry is further to perform operations including: obtaining an intermediary computational result when computing the corresponding source pixel coordinate (xs, ys), and then using the intermediary computational result in computing the alpha channel value.

18. The DVE device of claim 10, wherein the alpha channel value is in the range 0≦α≦1, where αis the alpha channel value; and the circuitry is further to perform operations including:
computing a pixel value for the pixel coordinate (xt, yt) of the target digital image using one or more pixel values in the source digital image that are obtained based on the corresponding source pixel coordinate (xs, ys);
combining the alpha channel value with the pixel value for the pixel coordinate (xt, yt) of the target digital image to effect transparency of the pixel value and result in a semi-transparent pixel value.

19. A computer readable storage medium having stored thereon computer executable instructions for transforming a source digital image into a digital object in a target digital image, the source digital image and the target digital image each comprising a plurality of pixels; the computer executable instructions, when executed by a computational device, cause the computational device to perform operations comprising:
receiving and storing the source digital image in a memory;
receiving from a user interface an indication of an effect to be applied to said source digital image;
obtaining a set of parameters based on the indication of the effect;
obtaining a value defining a width of an area that borders at least one boundary of the digital object in the target digital image; the width of the area being uniform along the at least one boundary of the digital object;
for a pixel coordinate (xt, yt) of the target digital image that is within the area that borders the at least one boundary of the digital object, computing, using the pixel coordinate (xt, yt) of the target digital image and at least some of the parameters, a corresponding source pixel coordinate (xs,ys) that is within another area bordering the source digital image, said another area having a width that is non-uniform along a boundary of the source digital image;
computing an alpha channel value defining semi-transparency of a pixel associated with the pixel coordinate (xt, yt) of the target digital image, the alpha channel value computed as a function of:
(i) a distance between the corresponding source pixel coordinate (xs, ys) and the boundary of the source digital image, and
(ii) the width of said another area at the location of the corresponding source pixel coordinate (xs, ys).