EFFECTS PROCESSOR FOR EFFECTS MODULE

Abstract: An effects processor for an effects module. The effects processor comprises an RISC processor, a DSP for fast integer multiplication and a small memory. The processor uses VARK language and a lookup table of VARK scripts to apply a variety of effects to images stored outside the effects module. The effects processor includes a serial bus interface which communicates with the Serial Bus of a compact printer system comprising one or more further modules. The Serial Bus communicates power and data between the effects module and one or more of the further modules. Methods of compositing, convolving, warping and color substitution are described.

Description: EFFECTS PROCESSOR FOR EFFECTS MODULE FIELD OF THE INVENTION The invention relates to a compact pπnter system able to pπnt full-color, business card size documents from a device about the size of a pen The system includes vaπous hot-connectable modules that provide a range of functions In particular the invention relates to an effects processor for an effects module Reference may be had to co-pendmg applications claiming pnoπty from Australian Provisional Patent Application number PQ0560 dated 25 May 1999 The co-pending applications descπbe related modules and methods for implementing the compact pπnter system The co-pending applications are as follows BACKGROUND OF THE INVENTION Microelectronic manufactuπng techniques have led to the mimatuπzation of numerous devices Mobile phones, personal digital assistant devices, and digital cameras are very common examples of the mimatuπzation trend One device that has not seen the advantage of microelectronic manufactuπng techniques is the pπnter Commercially available pπnters are large compared to many of the devices they could support For instance, it is impractical to carry a color pπnter for the purpose of instantly pπnting photographs taken with known compact digital cameras A compact pπnthead has been descπbed in co-pending Patent Cooperation Treaty applications filed simultaneously to the present application and hereby incorporated by cross reference SUMMARY OF THE INVENTION In one form, the invention resides in a method of processing a stored image by an effects module, said method including the steps of reading said stored image from a storage location to an image processor, applying a selected effect to said stored image, wπting a resultant image to said storage location Further features of the invention will be evident from the following descπption BRIEF DESCRIPTION OF THE DRAWINGS In order to assist with descπb g preferred embodiments of the invention, reference will be made to the following figures in which FIG 1 is a pπnter module, FIG 2 is a camera module, FIG 3 is a memory module, FIG 4 is a communication module, FIG 5 is a flash module, FIG 6 is a timer module, FIG 7 is a laser module, FIG 8 is an effects module, FIG 9 is a characters module, FIG 10 is an adaptor module, FIG 11 is a pen module, FIG 12 is a dispenser module, FIG 13 is a first compact pπnter configuration, FIG 14 is a second compact pπnter configuration, FIG 15 is a third compact pπnter configuration, FIG 16 is a fourth compact pπnter configuration, FIG 17 is a block schematic diagram of the central processor for the effects module; FIG 18 is a schematic diagram illustrating pixel span calculation for a warping effect, FIG 19 is a schematic diagram representing a corresponding point on two levels of an image pyramid; and FIG 20 is a schematic diagram representing tπ-hnear interpolation DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Referπng to FIGs 1 to 12, there are shown vaπous modules that together form a compact pπnter system Individual modules can be attached and detached from the compact pnnter configuration to allow a user-definable solution to business card- sized pπnting Images can also be transfeπed from one compact pπnter to another without the use of a secondary computer system Modules have a minimal user-interface to allow straightforward interaction A compact pπnter system configuration consists of a number of compact pπnter modules connected together Each compact pπnter module has a function that contπbutes to the overall functionality of the particular compact pπnter configuration Each compact pπnter module is typically shaped like part of a pen, physically connecting with other compact pπnter modules to form the complete pen-shaped device The length of the compact pπnter device depends on the number and type of compact pπnter modules connected The functionality of a compact pπnter configuration depends on the compact pπnter modules in the given configuration The compact pπnter modules connect both physically and logically The physical connection allows modules to be connected in any order, and the logical connection is taken care of by the compact pπnter Seπal Bus - a bus that provides power, allows the modules to self configure and provides for the transfer of data In terms of physical connection, most compact pπnter modules consist of a central body, a male connector at one end, and a female connector at the other Since most modules have both a male and female connector, the modules can typically be connected in any order Certain modules only have a male or a female connector, but this is determined by the function of the module Adaptor modules allow these single-connector modules to be connected at either end of a given compact pπnter configuration A four wire physical connection between all the compact pπnter modules provides the logical connection between them in the form of the compact pπnter Seπal Bus The compact pπnter Seπal Bus provides power to each module, and provides the means by which data is transferred between modules Importantly, the compact pπnter Seπal Bus and accompanying protocol provides the means by which the compact pπnter system auto-configures, reducing the user-interface burden on the end-user Compact pπnter modules can be grouped into three types • image processing modules including a Pπnter Module (FIG 1), a Camera Module (FIG 2), and a Memory Module (FIG 3) Image processing modules are pπmaπly what sets the compact pπnter system apart from other pen-like devices Image processing modules capture, pπnt, store or manipulate photographic images, • housekeeping modules including an Adapter Module (FIG 10), an Effects Module (FIG 8), a Communications Module (FIG 4), and a Timer Module (FIG 6) Housekeeping modules provide services to other modules or extended functionality to other modules, and • isolated modules including a Pen Module (FIG 11) and a Laser Module (FIG 7) Isolated modules are those that attach to the compact pπnter system but are completely independent of any other module They do not necessaπly require power, and may even provide their own power Isolated Modules are defined because the functionality they provide is typically incorporated into other pen-like devices Although housekeeping modules and isolated modules are useful components in a compact pπnter system, they are extras in a system dedicated to image processing and photographic manipulation. Life size (1 1) illustrations of the compact pπnter modules are shown in FIGs 1 to 12, and example configurations produced by connecting vaπous modules together are shown in FIGs 13 to 16 FIG 1 shows a pπnter module that incorporates a compact pπnthead descπbed in co-pending United States Patent Applications listed in the Background section of this application, incorporated herewith by reference, and referred to herewith as a Memjet pπnthead The Memjet pπnthead is a drop-on-demand 1600 dpi Inkjet pπnter that produces bi- level dots in up to 4 colors to produce a pπnted page of a particular width Since the pπnthead pπnts dots at 1600 dpi, each dot is approximately 22 5μm in diameter, and spaced 15 875μm apart Because the pπnting is bi-level, the input image should be dithered or error-diffused for best results Typically a Memjet pπnthead for a particular application is page- width This enables the pπnthead to be stationary and allows the paper to move past the pπnthead A Memjet pπnthead is composed of a number of identical 1/2 inch Memjet segments The pπnter module 10 compπses a body 11 housing the Memjet pπnthead Power is supplied by a three volt battery housed in battery compartment 12 The pπnthead is activated to commence pπnting when a business card (or similar sized pπntable media) is inserted into slot 13 Male connector 14 and female connector 15 facilitate connection of other modules to the pπnter module 10 FIG 2 shows a camera module 20 The camera module provides a point-and-shoot camera component to the compact pπnter system as a means of captuπng images The camera module compπses a body 21 having a female connector 22 A lens 23 directs an image to an image sensor and specialized image processing chip within the camera 24 A conventional view finder 25 is provided as well as a lens cap 26 An image is captured when the Take button 27 is pushed Captured images are transferred to the Pπnter Module 10 for subsequent pπnting, manipulation, or storage The Camera Module also contains a self-timer mode similar to that found on regular cameras FIG 3 shows a Memory Module 30 composing a body 31 , LCD 32, IN button 33, OUT button 34 and SELECT button 35 The Memory Module 30 is a standard module used for stoπng photographic images captured by the Camera 20 T e memory module stores 48 images, each of which can be accessed either at full resolution or at thumbnail resolution Full resolution provides read and wπte access to individual images, and thumbnail resolution provides read access to 16 images at once in thumbnail form The Memory Module 30 attaches to other modules via a female connector 36 or male connector 37 The male and female connectors allow the module to be connected at either end of a configuration Power is provided from the Pπnter Module 10 via the Seπal Bus A Communications Module 40 is shown in FIG 4 The communications module 40 consists of a connector 41 and a cable 42 that terminates in an appropπate connector for a computer port, such as a USB port, RS232 seπal port or parallel port The Communications Module 40 allows the compact pπnter system to be connected to a computer When so connected, images can be transferred between the computer and the vaπous modules of the compact pπnter system The communications module allows captured images to be downloaded to the computer, and new images for pπnting to be uploaded into the pπnter module 10 A Flash Module 50 is shown in FIG 5 The Rash Module 50 is used to generate a flash with flash cell 51 when taking photographs with the Camera Module 20 The Flash Module attaches to other modules via female connector 52 and male connector 53 It contains its own power source The Flash Module is automatically selected by the Camera Module when required A simple switch allows the Flash Module to be explicitly turned off to maximize battery life FIG 6 shows a Timer Module 60 that is used to automate the taking of multiple photos with the Camera Module 20, each photo separated by a specific time interval The captured photos are stored in Memory Module 30 Any flash requirements are handled by the Camera Module 20, and can therefore be ignored by the Timer Module The Timer Module 60 consists of a body 61 housing a LCD 62, START/STOP button 63 and UNITS button 64 A SELECT button 65 allows the user to select time units and the number of units are set by UNITS button 64 The Timer Module 60 includes a male connector 66 and female connector 67 The Timer Module takes its power from the Pπnter Module 10 via the Seπal Bus A Laser Module 70 is shown in FIG 7 The Laser Module 70 consists of a body 71 containing a conventional laser pointer operated by button 72 As the Laser Module is a terminal module it only has one connector, which in the example is a male connector 73 The Laser Module is an isolated module, in that it does not perform any image capture, storage, or processing It exists as a functional addition to the compact pπnter system It is provided because laser pointer services are typically incorporated into other pen-like devices The Laser Module contains its own power supply and does not appear as a device on the Seπal Bus The Effects Module shown in FIG 8 is an image processing module It allows a user to select a number of effects and applies them to the current image stored m the Pπnter Module 10 The effects include borders, clip-art, captions, warps, color changes, and painting styles The Effects Module compπses a body 81 housing custom electronics and a LCD 82 A CHOOSE button 83 allows a user to choose between a number of different types of effects A SELECT button 84 allows the user to select one effect from the number of effects of the chosen type Pressing the APPLY button 85 applies the effect to image stored in the Pπnter Module 10 The Effects Module obtains power from the Seπal Bus Male connector 86 and female connector 87 allow the Effects Module to be connected to other compact pπnter system modules FIG 9 shows a Character Module 90 that is a special type of Effects Module (descπbed above) that only contains character clip-art effects of a given topic or genre Examples include The Simpsons ® . Star Wars ® , Batman ® , and Dilbert ® as well as company specific modules for McDonalds ® etc As such it is an image processing module It consists of a body 91 housing custom electronics and a LCD 92 SELECT button 93 allows the user to choose the effect that is to be applied with APPLY button 94 The Character Module obtains power from the Seπal Bus through male connector 95 and female connector 96 The Adaptor Module 100, shown in FIG 10, is a female/female connector that allows connection between two modules that terminate in male connectors A male/male connector (not shown) allows connection between two modules that terminate in female connectors The Adaptor Module is a housekeeping module, m that it facilitates the use of other modules, and does not perform any specific processing of its own All "through ' modules have a male connector at one end, and a female connector at the other end The modules can therefore be chained together, with each module connected at either end of the chain However some modules, such as the Laser Module 70, are terminating modules, and therefore have either a male or female connector only Such single- connector modules can only be connected at one end of the chain If two such modules are to be connected at the one time, an Adaptor Module 100 is required FIG 11 shows a Pen Module 1 10 which is a pen in a module form It is an isolated module in that it attaches to the compact pπnter system but is completely independent of any other module It does not consume or require any power The Pen Module is defined because it is a convenient extension of a pen shaped, pen sized device It may also come with a cap 1 11 The cap may be used to keep terminating connectors clean in the case where the chain ends with a connector rather than a terminating module To assist with accurately feeding a business card sized pπnt media into slot 13 of the pπnter module 10, a dispenser module 120 is provided as shown in FIG 12 The dispenser module 120 compπses a body 121 that holds a store of business card sized pπnt media A Pπnter Module 10 locates into socket 122 on the dispenser module 120 When correctly aligned, a card dispensed from the dispenser module by slider 123 enters slot 13 and is pπnted. In the sense that a minimum configuration compact pπnter system must be able to pπnt out photos, a minimum compact pπnter configuration contains at least a Pπnter Module 10 The Pπnter Module holds a single photographic image that can be pπnted out via its Memjet pπnter. It also contains the 3V battery required to power the compact pπnter system In this minimum configuration, the user is only able to pπnt out photos Each time a user inserts a business card 130 into the slot in the Pπnter Module, the image in the Pπnter Module is pπnted onto the card The same image is pπnted each time a business card is inserted into the pπnter In this minimum configuration there is no way for a user to change the image that is pπnted The dispenser module 120 can be used to feed cards 130 into the Pπnter Module with a minimum of fuss, as shown in FIG 13 By connecting a Camera Module 20 to the minimum configuration compact pπnter system the user now has an instant pπnting digital camera in a pen, as shown in FIG 14 The Camera Module 20 provides the mechanism for captuπng images and the Pπnter Module 10 provides the mechanism for pπnting them out The battery in the Pπnter Module provides power for both the camera and the pπnter When the user presses the "Take" button 27 on the Camera Module 20, the image is captured by the camera 24 and transferred to the Pπnter Module 10 Each time a business card is inserted into the pπnter the captured image is pπnted out If the user presses "Take" on the Camera Module again, the old image in the Pπnter Module is replaced by the new image If the Camera Module is subsequently detached from the compact pπnter system, the captured image remains in the Pπnter Module, and can be printed out as many times as desired The Camera Module is simply there to capture images to be placed in the Pπnter Module FIG 15 shows a further configuration in which a Memory Module 30 is connected to the configuration of FIG 14 In the embodiment of FIG 15, the user has the ability to transfer images between the Pπnter Module 10 and a storage area contained in the Memory Module 30 The user selects the image number on the Memory Module, and then either sends that image to the Pπnter Module (replacing whatever image was already stored there), or bπngs the current image from the Pπnter Module to the specified image number in the Memory Module The Memory Module also provides a way of sending sets of thumbnail images to the Pπnter Module Multiple Memory Modules can be included in a given system, extending the number of images that can be stored A given Memory Module can be disconnected from one compact pπnter system and connected to another for subsequent image pπnting With the Camera Module 20 attached to a Memory Module/Pπnter Module compact pnnter system as shown in FIG 15, the user can "Take" an image with the Camera Module, then transfer it to the specified image number in the Memory Module The captured images can then be pπnted out in any order By connecting a Communications Module 40 to the minimum configuration compact pπnter system, the user gams the ability to transfer images between a PC and the compact pπnter system FIG 16 shows the configuration of FIG 15 with the addition of a Communications Module 40 The Communications Module makes the Pπnter Module 10 and any Memory Modules 30 visible to an external computer system This allows the download or uploading of images The communications module also allows computer control of any connected compact pπnter modules, such as the Camera Module 20 In the general case, the Pπnter Module holds the "current" image, and the other modules function with respect to this central repository of the current image The Pπnter Module is therefore the central location for image interchange in the compact pπnter system, and the Pπnter Module provides a service to other modules as specified by user interaction A given module may act as an image source It therefore has the ability to transfer an image to the Pπnter Module A different module may act as an image store It therefore has the ability to read the image from the Pπnter Module Some modules act as both image store and image source These modules can both read images from and wπte images to the Pπnter Module's current image The standard image type has a single conceptual definition The image definition is deπved from the physical attπbutes of the pπnthead used m the Pπnter Module The pπnthead is 2 inches wide and pπnts at 1600dpi in cyan, magenta and yellow bi-level dots Consequently a pnnted image from the compact pπnter system is 3200 bi-level dots The compact pπnter system pπnts on business card sized pages (85mm x 55mm) Since the pπnthead is 2 inches wide, the business cards are pπnted such that 1 line of dots is 2 inches 2 inches is 508mm, leaving a 2mm edge on a standard business-card sized page The length of the image is deπved from the same card size with a 2mm edge Consequently the pπnted image length is 81mm, which equals 5100 1600dpi dots The pπnted area of a page is therefore 81mm x 51mm, or 5100 x 3200 dots To obtain an integral contone to bi-level ratio a contone resolution of 267 ppi (pixels per inch) is chosen This yields a contone CMY page size of 850 x 534, and a contone to bi-level ratio of 1 6 in each dimension This ratio of 1 6 provides no perceived loss of quality since the output image is bi-level The pπnthead pπnts dots in cyan, magenta, and yellow ink The final output to the pπnted page must therefore be in the gamut of the pπnthead and take the attπbutes of the inks into account It would at first seem reasonable to use the CMY color space to represent images However, the pπnter' s CMY color space does not have a linear response This is definitely true of pigmented inks, and partially true for dye-based inks The individual color profile of a particular device (input and output) can vary considerably Image capture devices (such as digital cameras) typically work in RGB (red green blue) color space, and each sensor will have its own color response characteπstics Consequently, to allow for accurate conversion, as well as to allow for future image sensors, inks, and pπnters, the CIE L*a*b* color model [CIE, 1986, CIE 15 2 Coloπmetry Technical Report (2 nd Edition), Commission Internationale De I'Eclairage] is used for the compact pπnter system L*a*b* is well defined, perceptually linear, and is a superset of other traditional color spaces (such as CMY, RGB, and HSV) The Pπnter Module must therefore be capable of converting L*a*b* images to the particular pecuhaπties of its CMY color space However, since the compact pπnter system allows for connectivity to PCs, it is quite reasonable to also allow highly accurate color matching between screen and pπnter to be performed on the PC However the pπnter dnver or PC program must output L*a*b* Each pixel of a compact pnnter image is therefore represented by 24 bits 8 bits each of L*, a*, and b* The total image size is therefore 1,361,700 bytes (850 x 534 x 3) Each image processing module is able to access the image stored in the Pπnter Module The access is either to read the image from the Pπnter Module, or to wπte a new image to the Pπnter Module The communications protocol for image access to the Pπnter Module provides a choice of internal image organization Images can be accessed either as 850 x 534 or as 534 x 850 They can also be accessed in interleaved or planar format When accessed as interleaved, each pixel in the image is read or wπtten as 24 bits 8 bits each of L*, a*, b* When accessed as planar, each of the color planes can be read or wπtten independently The entire image of L* pixels, a* pixels or b* pixels can be read or wπtten at a time The elements of the Effects Module Central Processor (EMCP) are shown in FIG 17 EMCP 350 is a single chip containing a standard RISC processor core 351 with DSP 352 for fast integer multiplication and a small memory, scratch RAM 353 The software running on the EMCP is a limited subset of the VARK language and a lookup table of VARK scπpts for image manipulation as descπbed in co-pend g United States Patent Applications whose USSNs are as follows The subset of VARK includes compositing, convolving, filters, warps, color manipulation, tiling, and brushing It does not include lighting effects Since the effects are coupled with the VARK implementation, there is no specific future-proofing required The exact implementation will depend on the RISC processor chosen, although the clock speed is expected to be around the order of 48 MHz (a multiple of the Seπal Bus speed of the compact pπnter system) Although VARK is processor independent, time-cπtical functions benefit from being specifically accelerated for a given processor The following sections provide decomposition of an example set of VARK functions, complete with timings specific for image parameters in the compact pπnter system The VARK language is descπbed in the co-pending United States Patent Applications whose USSNs are listed in the preceding table, and a complete example of accelerating VARK for a specific CPU is descπbed in co-pending United States Patent Application 09/1 13,060 entitled " Digital Instant Pπntmg Camera with Image Processing Capability ' and co-pending United States Patent Application 09/112,786 entitled ' Digital Camera System Containing a VLIW Vector Processor " The majoπty of Effects Module processing is simple compositing, involving the overlaying of a masked image over the background oπginal stored image Compositing is used to apply the borders characters and captions effects of the Effects Module 80 The process of compositing involves adding a foreground image to a background image using a matte or a channel to govern the appropnate proportions of background and foreground in the final image Two styles of compositing are supported regular compositing and associated compositing The rules for the two styles are Regular composite new value = Background + (Foreground - Background) α Associated composite new value = Foreground + (1-α) Background The difference then, is that with associated compositing, the foreground has been pre-multiplied with the matte, while in regular compositing it has not Note that the α channel has values from 0 to 255 coπesponding to the range 0 to 1 The compositing process is memory bound, requinng a maximum of 4 memory accesses for each pixel Read Alpha (α) • Read Background (stored image) • Read Foreground Wπte Result When the value is 0, the background is unchanged and the number of cycles to process the pixel is 1 (read α) For a 850 x 534 pixel x 3 color image, the total number of pixels is 1,361,700 At 4 cycles per pixel, the total number of cycles is 5,446,800 If the resultant image is not stored locally, but instead transfeπed immediately to the Pπnter Module 10, the compositing process is less than a simplistic* 8 cycles per pixel transfer time, and can therefore be performed on-the-fly It is absorbed in the transmission time and therefore effectively takes 0 seconds (* 8 cycles is simplistic because it does not take any transmission overhead into account For the transmission of 8 bits over the Seπal Bus, a more likely transfer time is 10 cycles However, if the process can be performed fewer than 8 cycles, it can certainly be performed in less than 10 cycles ) The process of convolving will now be descπbed A convolve is a weighted average around a center pixel The average may be a simple sum, a sum of absolute values, the absolute value of a sum, or sums truncated at 0 The image convolver is a general-purpose convolver, allowing a vaπety of functions to be implemented by varying the values within a vaπable-sized coefficient kernel In this descπption, the kernel sizes supported are 3x3, 5x5 and 7x7 only The coefficient kernel is a table in DRAM The kernel is aπanged with coefficients m the same order as the pixels to be processed Each table entry is an 8 bit coefficient The convolve process involves 9 reads and 1 wπte for a 3x3 convolve, 25 reads and 1 wnte for a 5x5 convolve, and 49 reads and 1 wπte for a 7x7 convolve For building an image pyramid (as descπbed later herein), a 3x3 convolve is all that is required The DSP allows a single cycle multiply/accumulate The CPU must therefore generate the addresses (fixed offsets from each pixel location) and read the pixels from DRAM This gives a minimum set of timings as shown in Table 1 It is often desirable to transform an image in terms of color Simple color effects include removal of color to produce a grey-scale image or a sepia tone image More complex effects include exaggeration of certain colors, substitution of one color for another and the like One of the simplest ways to transform the color of a pixel is to encode an arbitraπly complex transform function into a lookup table The component color value of the pixel is used to lookup the new component value of the pixel For each pixel read from the image, its new value is read from the lookup table, and wntten back to the image The input image is in the L*a*b* color space, with the luminance channel separated from the chrominance channels The L*a*b* color space is particularly conducive to good use of replacement of color Examples include desaturation for grey-scale (leaving L* alone and making a* and b* constant), bπghtening or darkening of an image, exaggeration of particular colors and the like If the lookup table starts at an appropnate address, the whole process takes 3 cycles per pixel one to read the old value, one to read the new value from the lookup table, and one to wπte the new value back to the image The lookup table required is 256 bytes. For a 850 x 534 pixel x 3 color image, the total number of pixels is 1 ,361,700 At 3 cycles per pixel, the total number of cycles is 4,085,100 The 3 lookup tables consume a total of 768 bytes. If the resultant image is not stored locally, but instead transferred immediately to the Pπnter Module, the compositing process is less than a simplistic 8 cycles per pixel transfer time, and can therefore be performed on-the-fly It is absorbed in the transmission time and therefore effectively takes 0 seconds Rather than perform arbitraπly complex color transformations exhaustively, excellent results can be obtained via a tπ-linear conversion based on 3 sets of 3D lookup tables. The lookup tables contain the resultant transformations for the specific entry as indexed by L*a*b* Three tables are required one mapping L*a*b* to the new L*, one mapping L*a*b* to the new a*, and one mapping L*a*b* to the new b* The size of the lookup table required depends on the hneanty of the transformation The recommended size for each table in this application is 17 x 17 x 17, with each entry 8 bits. A 17 x 17 x 17 table is 4913 bytes (less than 5KB) Although a 17 x 17 x 17 table will give excellent results, it is envisaged that a 9 x 9 x 9 conversion table (729 bytes) may be sufficient The exact size can be determined by simulation The 5KB conservative-but-definite-results approach was chosen for the purposes of this example To index into the 17-per-dιmensιon tables, the 8-bit input color components are treated as fixed-point numbers (4 4) The 4 bits of integer give the index, and the 4 bits of fraction are used for interpolation For those entnes not included in the tables, tπ-lmear interpolation can be used to give the final result Tπ-linear interpolation requires reading 8 values from the lookup table, and performing 7 linear interpolations (4 in the first dimension. 2 in the second, and 1 in the third) High precision can be used for the intermediate values, although the output value is only 8 bits Tπ-hnear interpolation takes 1 1 cycles Table reading can occur concurrently and takes 8 cycles Likewise, the 1 cycle output pixel wπte can occur concurrently Note that this 11 cycle time must occur once for each color, thereby totaling 33 cycles For a 3 color 850 x 534 pixel image, the elapsed time is 44,936,100 cycles For a 48 MHz processor, the entire color conversion process takes 0 93 seconds Several functions, such as warping, tiling and brushing, require the average value of a given area of pixels Rather than calculate the value for each area given, these functions make use of an image pyramid An image pyramid is effectively a multi-resolution pixel-map The onginal image is a 1 1 representation Sub-sampling by 2 1 in each dimension produces an image 1/4 the onginal size This process continues until the entire image is represented by a single pixel An image pyramid is constructed from an onginal image, and consumes 1/3 of the size taken up by the onginal image ( 1/4 + 1/16 + 1/64 + ) For an oπginal image of 850 x 534 the coπespondmg image pyramid is approximately 1/2 MB The image pyramid is constructed via a 3x3 convolve performed on 1 in 4 input image pixels (advance center of convolve kernel by 2 pixels each dimension) A 3x3 convolve results in higher accuracy than simply averaging 4 pixels, and has the added advantage that coordinates on different pyramid levels differ only by shifting 1 bit per level The construction of an entire pyramid relies on a software loop that calls the pyramid level construction function once for each level of the pyramid Note that the start address of each level of the image pyramid should be on a 64-byte boundary to take advantage of addressing mode redundancy The timing to produce a level of the pyramid is that for a 3x3 as descπbed previously herein The standard timing is 10 cycles per output pixel For this function, we are always outputting an image 1/4 the size of the input image Thus for a 850 x 534 image timing to produce level 1 of pyramid = 10 x 425 x 267 = 1,134,750 cycles • timing to produce level 2 of pyramid = 10 x 213 x 134 = 285,420 cycles • timing to produce level 3 of pyramid = 10 x 107 x 67 = 71 ,690 cycles Etc. The total time is 10/3 cycles per oπginal image pixel (The generated levels of the image pyramid total 1/3 of the onginal image size, and each pixel takes 10 cycles to be calculated) In the case of a 850 x 534 image the total is 1,513,000 cycles Multiplying this number by 3 for the 3 color channels gives a total time of 4,539,000 cycles. With a CPU operating frequency of 48 MHz, the timing is just less than 0 1 seconds The image warper of the EMCP performs several tasks in order to warp an image • Construct image pyramid • Scale the waφ map to match the image size • Determine the span of input image pixels represented in each output pixel • Calculate the output pixel via tπ-linear interpolation from the input image pyramid The construction of an image pyramid has already been descπbed. The scaling of a warp map follows In a data dπven waφ, there is the need for a waφ map that descπbes, for each output pixel, the center of the corresponding input image map Instead of having a single waφ map containing interleaved information, X and Y coordinates are treated as separate channels Consequently there are two waφ maps an X waφ map showing the waφing of X coordinates, and a Y waφ map, showing the waφing of Y coordinates. The waφ maps can have a different spatial resolution than the image they are scaling (for example a 32 x 20 waφ map may adequately descnbe a waφ for a 850 x 534 image) In addition, the waφ maps can be represented by 8 or 16 bit values that coπespond to the size of the image being waφed There are several steps involved in producing points in the input image space from a given waφ map • Determine the coπesponding position in the waφ map for the output pixel • Fetch the values from the waφ map for the next step (this can require scaling in the resolution domain if the waφ map is only 8 bit values) • Bi-hnear mteφolation of the waφ map to determine the actual value Scaling the value to correspond to the input image domain The first step can be accomplished by multiplying the current X/Y coordinate in the ouφut image by a scale factor (which can be different in X & Y) For example, if the output image was 850 x 534, and the waφ map was 85 x 54, we scale both X & Y by 1/10 This can also simply be accomplished by using the scale factors as simple deltas Fetching the values from the waφ map requires access to 2 lookup tables One lookup table indexes into the X waφ-map, and the other indexes into the Y waφ map The lookup table either reads 8 or 16 bit entπes from the lookup table The next step is to bi-hnearly mteφolate the looked-up waφmap values Finally the result from the bi-hnear interpolation is scaled to place it in the same domain as the image to be waφed Thus, if the waφ map range was 0-255, we scale X by 850/255, and Y by 534/255 Table 2 lists the constants required for scaling a waφ map Table 3 lists the lookup tables used Given [X,Y] the 4 entπes required for bi-hnear interpolation are returned Even if entπes are only 8 bit, they are returned as 16 bit (high 8 bits = 0) Since we move along space in the output image, it is a simple matter to add XScale and YScale to the offset within the w-upmaps Transfer time is 4 entπes at 16 bits per entry, with 16 bits transferred per cycle for a total of 4 cycles This is done twice, once for each waφmap for a total of 8 cycles Note that all 3 colors are waφed using the same waφmap, so the total waφmap calculation time is 8 cycles per output pixel For a 850 x 534 pixel image, the elapsed time is 3,631 ,200 cycles The points from the waφ map locate centers of pixel regions in the input image The distance between the centers of the pixel regions indicates the size of the regions, and we approximate this distance via a span With reference to FIG 18, take a given point in the waφ map PI The previous point on the same line is called P0, and the previous line's point at the same position is called P2 We determine the absolute distance in X & Y between PI and P0, and between PI and P2 The maximum distance in X or Y becomes the span - a square approximation of the actual shape Since we are processing the points in the sequential output order, P0 is the previous point on the same line, and P2 is the previous line's point (kept in a history buffer) P0, PI, and P2 are all 32 bit quantities PI is placed in the history buffer, and taken out again at the same pixel on the following row as the new P2 Therefore 2 cycles are required transfer of P2 from the buffer, and transfer of PI to the buffer The transfer of PI to P0, normally a third cycle, can be masked by other activity Since this must be done for both X and Y coordinates, the total time taken is 4 cycles A further 2 cycles are required for the subtraction and compaπson Since both coordinates must be subtracted and compared, this leads to 4 cycles and a total of 8 (including history access) Note that all 3 colors are waφed using the same waφmap, so the total span calculation time is 8 cycles per ouφut pixel For a 850 x 534 pixel image, the elapsed time is 3,631,200 cycles We know the center and span of the area from the input image to be averaged, so the final part of the waφ process is to determine the value of the output pixel Since a single output pixel could theoretically be represented by the entire input image, it is potentially too time-consuming to actually read and average the specific area of the input image Instead, we approximate the pixel value by using an image pyramid of the input image FIG 18 shows the same point on two levels of an image pyramid If the span is 1 or less, we only need to read the onginal image's pixels around the given coordinate, and perform bi-hnear interpolation If the span is greater than 1 , we must read two appropnate levels of the image pyramid and perform tπ-hnear inteφolation, as shown in FIG 19 Performing linear interpolation between two levels of the image pyramid is not stπctly correct, but gives acceptable results (it errs on the side of blurπng the resultant image) Generally speaking, for a given span s, we need to read image pyramid levels given by ln2s and ln2s+l Ln2s is simply decoding the highest set bit of s We must bi-hnear interpolate to determine the value for the pixel value on each of the two levels of the pyramid, and then inteφolate between them Tπ-hnear inteφolation takes 1 1 cycles Image pyramid transfer time can occur concurrently and takes 8 cycles Likewise, the 1 cycle output pixel wπte can occur concuπently Note that this 1 1 cycle time must occur once for each color, thereby totaling 33 cycles For a 3 color 850 x 534 pixel image, the elapsed time is 44,936.100 cycles The entire waφ process is summaπzed in Table 4 below At a processor speed of 48 MHz, the time taken to waφ a 3 color image is 1 18 seconds ROM requirements for waφing are directly related to the size of the waφ maps, which in turn depend on the waφ complexity For simple waφs, a waφmap size of 9 KBytes is sufficient (85 x 54 x 2 coordinates x 8-bit components) For more complex waφs, a waφmap size of 73 KBytes is required (170 x 108 x 2 coordinates x 16-bit components) Throughout the specification the aim has been to descπbe the prefeπed embodiments of the invention without limiting the invention to any one embodiment or specific collection of features Persons skilled in the relevant art may realize vaπations from the specific embodiments that will nonetheless fall within the scope of the invention

Claims: CLAIMS 1 A method of processing a stored image by an effects module, said method including the steps of reading said stored image from a storage location to an image processor, applying a selected effect to said stored image, wntmg a resultant image to said storage location 2 The method of claim 1 wherein the step of applying an effect compπses the process of compositing a foreground image with said stored image 3 The method of claim 2 wherein said compositing process includes the steps of reading an α channel value, reading said stored image, reading said foreground, combining a proportion of said stored image and a proportion of said foreground to produce said resultant image The method of claim 3 wherein said α channel has values from 0 to 255 corresponding to a range 0 to 1 The method of claim 2 or 3 wherein said compositing process produces a Regular Composite, wherein said resultant image = stored image + (foreground - stored ιmage)α The method of claim 2 or 3 wherein said compositing process produces an Associated Composite, wherein said resultant image = foreground + (1- ) stored image The method of claim 1 wherein the step of applying an effect compπses the process of convolving pixel values of said stored image with a coefficient kernel The method of claim 7 wherein said coefficient kernel is a table in DRAM with coefficients arranged in the same order as said stored image pixels to be processed The method of claim 7 or 8 wherein said kernel is vaπable m size and supports the sizes 3x3, 5x5 and 7x7 0 The method of claim 1 wherein the step of applying an effect compπses the process of color replacement which includes the steps of reading a component color value of a pixel from said stored image, looking up a new component value from a lookup table for each pixel, wπting said new value to said resultant image 1 The method of claim 1 wherein the step of applying an effect compπses the process of complex color transformation which includes the steps of reading an L*a*b* indexed color component of a pixel from said stored image, looking up resultant transformations in lookup tables for each of said L*a*b* indexed pixel components, wπting an output pixel to said resultant image 2 The method of claim 11 wherein said looking up step further compπses the steps of reading said resultant transformations in a first lookup table to map said L*a*b* color components to new L* values, reading said resultant transformations in a second lookup table to map said L*a*b* color components to new a* values, and reading said resultant transformations in a third lookup table to map said L*a*b* color components to new b* values 3 The method of claim 11 or 12 wherein, for any resultant transformations not included in said lookup tables, said output pixel value may be obtained by tn-hnear interpolation 4 The method of claim 1 wherein the step of applying an effect compπses the process of image waφing which includes the steps of constructing an image pyramid, scaling a waφ map to match said stored image, calculating a span of said stored image pixels represented in each output pixel, and calculating a value of an output pixel from said image pyramid The method of claim 14 wherein the step of constructing an image pyramid includes the step of performing a 3x3 convolve on 1 in 4 of said stored image pixels The method of claim 14 wherein the step of scaling a waφ map includes the steps of determining a corresponding position in said waφ map for said output pixel, reading said corresponding position values from lookup tables, bi-hnearly inteφolating said corresponding position values to determine an actual value, and scaling said actual values to place them in the same domain as said stored image The method of claim 16 wherein said reading step further compπses reading X values from an X waφ-map lookup table and reading Y values from an Y waφ-map lookup table The method of claim 17 wherein said X and Y waφ-maps have a different spatial resolution from said stored image The method of claim 14, 16, 17 or 18 wherein said waφ maps are represented by 8 or 16 bit values that correspond to said stored image size The method of claim 14 wherein said span calculation step includes the steps of determining the absolute distance in X and Y between one point in said waφ map and two other such points, taking a maximum of said absolute distances to be said span The method of claim 14 wherein said output pixel calculation step includes the steps of for said span s, where s < 1 , reading pixel values of said stored image around a given point and performing bilinear interpolation, or for said span s, where s > 1, reading pixel values of said stored image around a given point on two appropnate levels of said image pyramid and performing tπ-linear interpolation An effects processor for an effects module that applies effects to stored images, said effects processor compπsmg a central processing unit, a fast integer multiplication unit, program memory associated with said central processing unit, said program memory stonng program steps for execution by said central processing unit to apply effects to said stored images, an interface unit communicating with components of said effects unit, and a seπal bus interface for reception of stored images and transmission of resultant images The effects processor of claim 22 wherein said effects processor is an integrated circuit The effects processor of claim 22 wherein said central processing unit is a RISC processor core running at 48 MHz The effects processor of claim 22 wherein said fast integer multiplication unit is a DSP The effects processor of claim 22 further compπsing scratch memory associated with said central processing unit for vaπable storage The effects processor of claim 22 wherein said program memory compnses VARK language software The effects processor of claim 22 wherein said seπal bus interface communicates with a Serial Bus of a compact pπnter system including one or more further modules, said Serial Bus communicating power and data between said effects module and said one or more further modules The effects processor of claim 22 wherein said interface unit is a parallel interface communicating with a plurality of buttons for selecting and applying effects to said stored images, said parallel interface also communicating with a LCD for providing feedback to a user The effects processor of claim 22 wherein said stored images are stored in a pπnter module of a compact pnnter system

Inventors: LAPSTUN PAUL, SILVERBROOK KIA, WALMSLEY SIMON ROBERT, LAPSTUN, PAUL, SILVERBROOK, KIA, WALMSLEY, SIMON, ROBERT
Applicants: LAPSTUN PAUL, SILVERBROOK KIA, SILVERBROOK RES PTY LTD, WALMSLEY SIMON ROBERT, LAPSTUN, PAUL, SILVERBROOK RESEARCH PTY LTD, SILVERBROOK, KIA, WALMSLEY, SIMON, ROBERT
Application year: 2000
Main classification: G06T5
IPC codes: B41J2, B41J3, B41J13, B41J23, B41J29, H04N1, H04N5