CN1882084A - Cartoon compression method for wireless network and wireless hand-held apparatus - Google Patents

Cartoon compression method for wireless network and wireless hand-held apparatus Download PDF

Info

Publication number
CN1882084A
CN1882084A CN 200510077105 CN200510077105A CN1882084A CN 1882084 A CN1882084 A CN 1882084A CN 200510077105 CN200510077105 CN 200510077105 CN 200510077105 A CN200510077105 A CN 200510077105A CN 1882084 A CN1882084 A CN 1882084A
Authority
CN
China
Prior art keywords
frame
png
file
difference
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN 200510077105
Other languages
Chinese (zh)
Inventor
吕殿伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Priority to CN 200510077105 priority Critical patent/CN1882084A/en
Publication of CN1882084A publication Critical patent/CN1882084A/en
Pending legal-status Critical Current

Links

Landscapes

  • Processing Or Creating Images (AREA)
  • Information Transfer Between Computers (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention relates to a cartoon compression method used in wireless network and wireless hand-held device, wherein it uses Flash document as data source, to obtain the original; extracts the key frame based on the color transformation of original frame; differentially processing the key frame; storing the result as PNG pack; then packs the PNG document with player. With said invention, the compressed cotton image data can be transmitted on wireless communication network, and the wireless hand-held device can play the received cotton.

Description

The cartoon compressing method that is used for wireless network and radio hand-held equipment
Technical field
The present invention relates to a kind of cartoon compressing method, especially relate to a kind of cartoon compressing method that is applicable to radio hand-held equipments such as wireless network and PDA, mobile phone, PDA mobile phone.
Background technology
Image is extremely important medium in the multimedia, and image plays an important role in information interchange, but the data volume behind the image digitization is very big; 24bit color image data amount as one 640 * 480 intermediate-resolution reaches 920k bits, and with respect to current limited wireless communication bandwidth, this data volume is very surprising, so must compress image.In existing animated image compression method, as the GIF cartoon compressing method, it uses quite extensive on the WEB page, is considered to the most friendly with browser, the most compatible picture format; It mainly compresses by optimizing three processes in global optimization, interframe optimization, the frame.When global optimization, for whole animation is sought the number that best palette also reduces frame as far as possible; Interframe optimization mainly is to remove the interframe redundancy, only preserves different difference part between frame and the frame; In frame, be optimized at last.The advantage of GIF animation compression is that compression, decompress(ion) simply are easy to realize, basic free of losses; But its fatal shortcoming is that minimizing the generation of animation of no rate controlled, number of colours is restricted, because the reliability that existing wireless network broadband is limited, long wait is delayed time, connect is lower, so GIF animation compress technique is difficult to be adopted by the multimedia application based on wireless network.
As the MPEG-4 cartoon compressing method, all obtain breakthrough in many aspects in addition, also considered some problems in the wireless network communication; It has adopted based on the coding of object (Objeet-Based), based on the coding techniquess such as coding of model (Model-based), object is meant the entity that can visit and handle in a scene, can divide object according to different textures, motion, shape, model and high-level semantic, so this is a kind of content-based data compression mode, just remove in the frame with former compression method and to compare with the redundancy of interframe, MPEG-4 then requires image and video are made more analysis, or even understands.As with image segmentation being moving object object and actionless background object plane, and these two objects are handled respectively.Background object employing compression ratio is higher, the bigger way of loss is encoded, and the moving object object adopts the way that compression ratio is lower, loss is smaller, so just obtains balance preferably between compression efficiency and decoded image quality; The MPEG-4 cartoon compressing method mainly comprises the management of synthetic, object of extraction, the object of object.But the MPEG-4 standard is huge, the difficulty of object extraction own is big, process is handled complicated, because the CPU disposal ability of existing radio hand-held equipment is lower, memory headroom is less, power consumption can not be too high, with existing radio hand-held equipment resource is the demand that is difficult to satisfy the MPEG-4 cartoon compressing method, so the MPEG-4 cartoon compressing method is also impracticable on radio hand-held equipment.Therefore can only transmit information such as sound, numeral, still image on the portable equipments such as existing wireless network and PDA, mobile phone, PDA mobile phone, can't transmit such as continuous media information such as animations.
Summary of the invention
The object of the present invention is to provide a kind of cartoon compressing method, make that the animated image data after its compression can be transmitted on wireless communication networks, and can on radio hand-held equipment, show the animated image that receives.
Purpose of the present invention can realize by following technical measures: may further comprise the steps successively:
1, is data source with the Flash file, therefrom extracts primitive frame, and preserve these primitive frames with the form of colored BMP image file;
2, the colored BMP picture inversion that generates in the step 1 is become the BMP image of 256 gray scales;
3, from the primitive frame of the BMP image that converts 256 gray scales to, extract key frame: at first will calculate the ratio that the pixel of each gray scales be occupied in this frame to all gray scales images; Since second frame ratio value and the corresponding ratio value of former frame of this frame compared and draw this difference value then, at last this difference value and predefined limit value are made comparisons, if more than or equal to limit value, then this frame is a key frame.
4, key frame is carried out difference processing and obtain the difference image, and save as BMP difference image file with the naming method of appointment;
5, become the PNG image file with generating the file conversion of BMP difference image in the step 4; This PNG file is called 1_f_x_y.PNG, and wherein PNG represents file type, and f represents that by 1 beginning this file is to belong to which frame, and x, y represent the coordinate in the upper left corner of this difference pictures in this frame respectively;
6, PNG image file sequence is carried out assembly unit again, generated a big PNG image file and relevant image data tabulation thereof; Again should big PNG image file, data list and animation player pack in the lump.
The step of obtaining the difference image among the present invention is: obtain corresponding difference matrix according to two images, when the difference of the corresponding points in certain point in first images and another images during greater than the limit value of appointment, then the elements corresponding value is 1 in the difference matrix; Otherwise element value is 0; Draw a circle to approve those containing element values in the difference matrix then and be 1 maximum region, and the imperial palace that writes down these zones connects the upper left corner coordinate and the lower right corner coordinate of rectangle; Should in connect the image that rectangular set draws a circle to approve and be the difference image.
Among the present invention PNG image file sequence again the step of assembly unit be: the little rectangle PNG picture that the generates size by the long limit of rectangle is sorted, take out the wherein rectangle of size maximum earlier, the rectangle that size is second largest carries out the combination of limit welt by the various possible situations and the rectangle of size maximum, chooses the polygon of area minimum in the various combinations; Again that size is the third-largest rectangle carries out the combination of limit welt on the polygonal basis of above-mentioned area minimum, choose the polygon of area minimum in the various combinations; Combination constantly finally forms one and has comprised all little rectangle PNG pictures and the polygon of its boundary rectangle area minimum successively, and the zone that this polygon is drawn a circle to approve is the big PNG image file that assembly unit generates.
The present invention has following advantage: (1) Flash file is little, the expression animation effect is outstanding, by processing to the Flash file, obtain a color animation frame sequence easily, form with the BMP file is preserved, and colored BMP file conversion is become the BMP file of 256 gray scales, the gray scale image is littler than color image data amount, reaches compression effects, and the gray scale image is fit to show on LCDs deceiving of portable equipment such as existing PDA, mobile phone, PDA mobile phone.(2) extraction of key frame is that primitive frame is screened and accepts or rejects, and has reached compression effects once more; In leaching process, combine factors such as the key frame time interval and the contrast of pixel difference, improved the effect and the fidelity of gathering, can realize the data acquisition customization according to customer requirements like this; Simultaneously the blanking time by setting frame, always gather parameters such as frame number, broadcast window size, also can customize various multi-medium datas for different user easily.(3) after having obtained the key frame sequence, when not reducing display quality, utilize difference matrix to ask for difference image subsection in the image sequence, the difference image that only need transmit former frame and back one frame and former frame like this when transmitting front and back two frame images gets final product the content of original two frame images of expressed intact, greatly compress again the data volume of animation, reduced the redundant data amount of redundant data transmissions effectively.(4) PNG filename form has been made regulation, when packing, just added by file the frame number under each file and the information such as relative position of demonstration so automatically, make between the play sequence of animation frame and PNG filename sequence and set up corresponding relation, that is to say and utilize the PNG filename that relative time and the relative position information of playing is incorporated in the PNG file bag, realized animation, thereby both utilized the advantage of the memory image aspect of PNG, and also made the PNG file format can realize animation effect.(5) adopted the types of image file formats of PNG to preserve to final image, simultaneously that each is little PNG set of pictures is dressed up a big PNG file, and makes its rectangular area minimum that takies, and has realized further compression.
Can show also that from concrete experimental data the application of the present invention radio hand-held equipment is quite effective.Be generally used for the about 100K byte of initial Flash file size of animation operation, need other Flash animation playout software, about 360K byte could be play on PC.Through after the processing of the present invention, can generate the PNG file of an about 25K byte, can generate the Jar file bag of about 40K byte after the packing, be adapted at transmitting on the prior wireless network; Download in the portable equipment, can generate the file of about 90K byte through decompress(ion), in the memory headroom that is no more than the 200K byte, can realize the animation broadcast, radio hand-held equipments such as existing PDA, mobile phone, PDA mobile phone are enough to satisfy its demand, make PDA, mobile phone, PDA mobile phone can realize the transmission of continuous media information.
Description of drawings
Fig. 1 is an animation compression process block diagram of the present invention.
Embodiment
From the animation compression process block diagram of Fig. 1 as can be seen, the present invention is a data source with the Flash file, therefrom obtains primitive frame.On the basis of primitive frame being carried out color conversion, therefrom extract key frame.Afterwards key frame is carried out difference processing, the result is preserved with the PNG packet format, and PNG file and player are packed together.Below the present invention is described in further detail, present embodiment comprises the steps: successively
1, is data source with the Flash file, therefrom extracts primitive frame, and preserve these primitive frames with the form of colored BMP image file.Extract primitive frame and can call the sectional drawing module, select the SWF file of a needs conversion, open broadcast then automatically, and intercept and capture the play content in the broadcast window, play content is saved as continuous picture file with the interval of appointment by the user.In this operation, will have four parameters/options to set, be respectively blanking time (ms), always intercept frame number, set to play size and whether after opening file, begin sectional drawing automatically; Connotation is respectively interval between per twice screen printing, stops the size of the client area after the maximum frame number that intercepts and Flash Player window occur automatically.If begin sectional drawing automatically after setting opens file, then will after successfully opening the SWF broadcast window, begin sectional drawing immediately automatically.Parameter that sets and option, come into force in the time of will creating timer in the back that opens file blanking time, always intercept frame number and promptly come into force after beginning to record, and whether begin to record option automatically and come into force after opening after opening file.
2, the colored BMP picture inversion that generates in the step 1 is become the BMP image of 256 gray scales.The gray scale image is littler than color image data amount, and can show user's acceptable image effect on the black-and-white crystal display screen of current main-stream.The final result of this step is the BMP image that obtains some 256 gray scales, has reached compression effects.
3,, from the primitive frame of the BMP image that converts 256 gray scales to, extract key frame according to the ratio difference of the picture element of each gray scale in the frame.Owing to influenced by the vision time delay of display device resource limit and human eye, show that on portable equipment an animation does not need to play all frames in extracting in the first step, because difference is little, under the situation of resource-constrained, it can be ignored between some consecutive frame.The yardstick of weighing difference size between frame and the frame is the ratio of counting in entire frame to be occupied of each gray scale in this frame.If the picture element composition difference of each gray scale is very big in two frames, then the difference of this two frame is very big, when their difference surpasses certain limit value, just when the difference between them has enough greatly, just thinks that they are key frames.First frame in the primitive frame and last frame have irreplaceable effect in addition, and they are natural key frames.Can other frame be selected in key frame and then judge by calculating, the ratio that the pixel of all each gray scales of gray scales image calculating at first will going on foot second be occupied in this frame, since second frame ratio value and the corresponding ratio value of former frame of this frame compared and obtains this difference value then, at last this difference value and predefined limit value are made comparisons, if more than or equal to limit value, then this frame is a key frame, otherwise this frame is not a key frame.So just can draw all key frames.Just original frame is screened and accepts or rejects by this step operation, objectively also reached compression effectiveness.
4, key frame is carried out difference processing and obtain the difference image, and save as BMP difference image file with the naming method of appointment.When animation is play before and after continuous two between the frames difference sudden change is seldom arranged, it is identical bigger a part of image content being arranged in two frames before and after promptly, repetition, the sub-fraction in the just frame of variation.Adopt the method for calculated difference image to make the part that as far as possible reduces above-mentioned repetition in the file of compression back, this has important meaning to promoting compression effectiveness.Call the difference rectangular module, at first obtain corresponding difference matrix according to two images, when the difference of the corresponding points in certain point in first images and another images during greater than the limit value of appointment, then the elements corresponding value is 1 in the difference matrix; Otherwise element value is 0.Draw a circle to approve those containing element values in the difference matrix afterwards and be 1 maximum region, and the imperial palace that writes down these zones connects the upper left corner coordinate and the lower right corner coordinate of rectangle, connecing the image that rectangular set draws a circle to approve in this is exactly said difference image.The difference image that only need transmit former frame and back one frame and former frame like this when transmitting front and back two frame images gets final product the content of original two frame images of expressed intact, has greatly compressed the data volume of animation.
5, become the PNG image file with generating the file conversion of BMP difference image in the step 4.Conversion PNG file can call BMP2PNG pixel format modular converter, simultaneously the PNG filename form that converts to has been made special regulation, filename is defined as l_f_x_y.PNG, wherein PNG represents file type, f is by 1 beginning, represent that this file is to belong to which frame, x, y represent the coordinate in the upper left corner of this picture in this frame respectively.Like this, when packing, just added by file the frame number under each file and the information such as relative position of demonstration automatically, between the play sequence of animation frame and PNG filename sequence, set up corresponding relation, that is to say and utilize the PNG filename that relative time and the relative position information of playing is incorporated in the PNG file bag, realized animation, thereby both utilized the advantage of the memory image aspect of PNG, and also made the PNG file format can realize animation effect.
6, PNG image file sequence is carried out assembly unit again, generated a big PNG image file and relevant image data tabulation thereof; Again should big PNG image file, data list and animation player pack in the lump.Call the picture assembling module, the size that the little rectangle picture that generates in the step 5 is grown the limit by rectangle sorts, take out the wherein rectangle of size maximum (name and be rectangle A), allow size time little rectangle (name and be rectangle B) carry out the combination of limit welt by various possible situations and rectangle A, different combinations will produce different polygons, calculate and will select the compound mode of this polygonal boundary rectangle area minimum and produce a new polygon (name and be polygon C); That is to say that rectangle A and rectangle B carry out limit welt combination, form a new polygon C, the boundary rectangle of polygon C is the area minimum in various combinations.By the order that size is successively decreased remaining rectangle is carried out similar operation, their combinations constantly on the basis of polygon C generate new polygon, form a polygon (name and be polygon P) the most at last.Polygon P has comprised all little pictures that generate in the 5th step, and its boundary rectangle area minimum.The zone that this boundary rectangle is drawn a circle to approve is exactly a big PNG file that finally generates, and has realized further compression like this, only needs big picture of maintenance just can finish various the operation.Also generate a data tabulation when assembly unit, it has write down position and the filename thereof of each little PNG picture in big PNG picture; The transmission of this data list, big PNG file and animation player can being packed in the lump at last.Present embodiment calls Jar bag generation module under the KJava platform, should big PNG file, data list, the packing of animation decoding broadcast instrument generate the Jar file, and the packing Jar file that generates in animation compression back is put into appointed website and supplies the user's download broadcast like this.
When player plays, earlier with the compressed data packet decompress(ion), and utilize data list that the PNG file division is become a series of little PNG file, pictures, its filename is also specified by data list.Earlier find animation first frame according to the PNG filename; Utilize filename to find the file of second frame afterwards, these files are difference images of second frame and first frame, so this difference image is covered on the specified coordinate of first frame, coordinate figure is provided by the PNG filename, has so just obtained second frame of actual animation.Just can show all key frames in the animation bag in the same way, reduce the relative time and the relative position information of each picture, play these frames and just produced animation effect.Above-mentioned Jar file is downloaded to as in these portable equipments based on the KJava platform of Motorola6288, carry out Jar and unpack, big picture file decomposes, and utilizes subsidiary broadcast instrument can play this animation then.

Claims (3)

1, a kind of cartoon compressing method that is used for wireless network and radio hand-held equipment is characterized in that may further comprise the steps successively:
(1) is data source with the Flash file, therefrom extracts primitive frame, and preserve these primitive frames with the form of colored BMP image file;
(2) the colored BMP picture inversion that generates in the step 1 is become the BMP image of 256 gray scales;
(3) from the primitive frame of the BMP image that converts 256 gray scales to, extract key frame: at first will calculate the ratio that the pixel of each gray scales be occupied in this frame to all gray scales images; Since second frame ratio value and the corresponding ratio value of former frame of this frame compared and draw this difference value then, at last this difference value and predefined limit value are made comparisons, if more than or equal to limit value, then this frame is a key frame;
(4) key frame is carried out difference processing and obtain the difference image, and save as BMP difference image file with the naming method of appointment;
(5) become the PNG image file with generating the file conversion of BMP difference image in the step 4; This PNG file is called 1_f_x_y.PNG, and wherein PNG represents file type, and f represents that by 1 beginning this file is to belong to which frame, and x, y represent the coordinate in the upper left corner of this difference pictures in this frame respectively;
(6) PNG image file sequence is carried out assembly unit again, generated a big PNG image file and relevant image data tabulation thereof; Again should big PNG image file, data list and animation player pack in the lump.
2, the cartoon compressing method that is used for wireless network and radio hand-held equipment according to claim 1, it is characterized in that the step of obtaining the difference image is: obtain corresponding difference matrix according to two images, when the difference of the corresponding points in certain point in first images and another images during greater than the limit value of appointment, then the elements corresponding value is 1 in the difference matrix; Otherwise element value is 0; Draw a circle to approve those containing element values in the difference matrix then and be 1 maximum region, and the imperial palace that writes down these zones connects the upper left corner coordinate and the lower right corner coordinate of rectangle; Should in connect the image that rectangular set draws a circle to approve and be the difference image.
3, the cartoon compressing method that is used for wireless network and radio hand-held equipment according to claim 1, it is characterized in that PNG image file sequence again the step of assembly unit be: the little rectangle PNG picture that the generates size by the long limit of rectangle is sorted, take out the wherein rectangle of size maximum earlier, the rectangle that size is second largest carries out the combination of limit welt by the various possible situations and the rectangle of size maximum, chooses the polygon of area minimum in the various combinations; Again that size is the third-largest rectangle carries out the combination of limit welt on the polygonal basis of above-mentioned area minimum, choose the polygon of area minimum in the various combinations; Combination constantly finally forms one and has comprised all little rectangle PNG pictures and the polygon of its boundary rectangle area minimum successively, and the zone that this polygon is drawn a circle to approve is the big PNG image file that assembly unit generates.
CN 200510077105 2005-06-14 2005-06-14 Cartoon compression method for wireless network and wireless hand-held apparatus Pending CN1882084A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200510077105 CN1882084A (en) 2005-06-14 2005-06-14 Cartoon compression method for wireless network and wireless hand-held apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200510077105 CN1882084A (en) 2005-06-14 2005-06-14 Cartoon compression method for wireless network and wireless hand-held apparatus

Publications (1)

Publication Number Publication Date
CN1882084A true CN1882084A (en) 2006-12-20

Family

ID=37520032

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200510077105 Pending CN1882084A (en) 2005-06-14 2005-06-14 Cartoon compression method for wireless network and wireless hand-held apparatus

Country Status (1)

Country Link
CN (1) CN1882084A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111294600A (en) * 2020-03-17 2020-06-16 广州致远电子有限公司 Compression method, decompression method and device for video sequence frame
CN113986174A (en) * 2021-10-28 2022-01-28 无锡华普微电子有限公司 Motorcycle starting animation display control method, control device and display system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111294600A (en) * 2020-03-17 2020-06-16 广州致远电子有限公司 Compression method, decompression method and device for video sequence frame
CN113986174A (en) * 2021-10-28 2022-01-28 无锡华普微电子有限公司 Motorcycle starting animation display control method, control device and display system

Similar Documents

Publication Publication Date Title
CN1136730C (en) Cartoon compressing method for radio network and hand-held radio equipment
CN110351592B (en) Animation presentation method and device, computer equipment and storage medium
CN1856819B (en) System and method for network transmission of graphical data through a distributed application
CN101796842B (en) An efficient image compression scheme to minimize storage and bus bandwidth requirements
WO2021208247A1 (en) Mimic compression method and apparatus for video image, and storage medium and terminal
CN111899322B (en) Video processing method, animation rendering SDK, equipment and computer storage medium
CN1065702C (en) Adaptive video decompression
JP2002533012A (en) Web-based video editing method and system using high performance multimedia software library
CN1407510A (en) Cartoon image compression method
CN106937113A (en) Method for compressing image and device based on mixing colourity sample rate
CN113946402A (en) Cloud mobile phone acceleration method, system, equipment and storage medium based on rendering separation
CN108111859A (en) H.264 video coding-decoding method and device based on JetsonTX1 platforms
US6757432B2 (en) Apparatus for transmitting and/or receiving stream data and method for producing the same
CN102917157A (en) Image compression system and method based on human visual system
CN112118449B (en) Method and device for compressing and decompressing image
KR102238091B1 (en) System and method for 3d model compression and decompression
CN1882084A (en) Cartoon compression method for wireless network and wireless hand-held apparatus
CA2352962A1 (en) Web-based video-editing method and system
CN113223100B (en) Picture compression and decompression processing method
CN115941965A (en) Cloud desktop coding method, reconstruction method, display method and display system
CN109803157A (en) A kind of sequence frame picture transmission method, system and electronic equipment based on video
JP2004356998A (en) Apparatus and method for dynamic image conversion, apparatus and method for dynamic image transmission, as well as programs therefor
CN115250335A (en) Video processing method, device, equipment and storage medium
KR20060056558A (en) Encoding and decoding method for video
CA2368890A1 (en) Improved recognition of a pre-defined region on a transmitted image

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication