Summary of the invention
The technical problem to be solved in the present invention is, at the method for the single picture of the employing of prior art as the background of menu item, when changing the Aspect Ratio of image, gross distortion will appear in pattern, even complete out of use defective appears, even provide a kind of the stretching to change the Aspect Ratio of picture, the picture stretch processing method of pattern deformation also can not take place.
The technical solution adopted for the present invention to solve the technical problems is: construct a kind of image processing method, comprising:
S1, according to length described picture is divided into the front end rigion picture, stage casing picture and rear end section picture;
S2, the width of described front end rigion picture, stage casing picture and rear end section picture is arranged to stretched width respectively;
S3, based on the length breadth ratio of setting, the length of described front end rigion picture and the length of described rear end section picture are set respectively;
S4, based on the final lengths of the described stage casing of the length computation picture of the length of tensile elongation, described front end rigion picture and described rear end section picture;
S5, handle described stage casing picture based on the final lengths of described stage casing picture;
S6, with described front end rigion picture, the combination of the stage casing picture after the processing and rear end section picture obtains synthesising picture.
In image processing method of the present invention, described step S5 is set to the length of described stage casing picture for the final lengths of direct described stage casing picture.
In image processing method of the present invention, described step S5 comprises:
S51, obtain a plurality of stage casing pictures that duplicate based on the final lengths of described stage casing picture and the current length of described stage casing picture;
S52, with described a plurality of stage casing pictures that duplicate after the stage casing picture is spliced into described processing.
In image processing method of the present invention, described step S5 comprises:
S5a, obtain the mirror image stage casing picture of described stage casing picture;
S5b, described mirror image stage casing picture and described stage casing picture are spliced with the stage casing picture after obtaining to handle.
In image processing method of the present invention, described stretched width and described tensile elongation are set by the user.
Another technical scheme that the present invention solves its technical matters is, constructs a kind of figure piece treating apparatus, comprising:
Picture is divided module, is used for according to length described picture being divided into the front end rigion picture stage casing picture and rear end section picture;
Width is provided with module, is used for the width of described front end rigion picture, described stage casing picture and described rear end section picture is arranged to stretched width respectively;
First length is provided with module, is used for based on the length breadth ratio of setting the length of described front end rigion picture and the length of described rear end section picture being set respectively;
The length computation module is used for the final lengths based on the described stage casing of the length computation picture of the length of tensile elongation, described front end rigion picture and described rear end section picture;
The stage casing picture is provided with module, is used for handling described stage casing picture based on the final lengths of described stage casing picture;
Concatenation module is used for described front end rigion picture, and stage casing picture after the processing and the combination of rear end section picture obtain synthesising picture.
In figure piece treating apparatus of the present invention, the final lengths that described stage casing picture is provided with the directly described stage casing of module picture is set to the length of described stage casing picture.
In figure piece treating apparatus of the present invention, described stage casing picture is provided with module and further comprises:
Copied cells is used for obtaining a plurality of stage casing pictures that duplicate based on the final lengths of described stage casing picture and the current length of described stage casing picture;
First concatenation unit is with described a plurality of stage casing pictures that duplicate after the stage casing picture is spliced into described processing.
In figure piece treating apparatus of the present invention, described stage casing picture is provided with module and further comprises:
Mirror image unit is used to obtain the mirror image stage casing picture of described stage casing picture;
Second concatenation unit is used for described mirror image stage casing picture and described stage casing picture are spliced with the stage casing picture after the acquisition processing.
In figure piece treating apparatus of the present invention, described figure piece treating apparatus further comprises:
Receiver module is used to receive user's input so that described stretched width and described tensile elongation to be set; With
Memory module is used to store the length breadth ratio of setting.
Implement image processing method of the present invention and device, stretching changes the Aspect Ratio of picture, also pattern deformation can not take place, and therefore can use picture more complicated and changeable background as menu item.
Embodiment
Fig. 1 is the process flow diagram of first embodiment of image processing method of the present invention.As shown in Figure 1, in step S1, at first described picture is divided into the front end rigion picture, stage casing picture and rear end section picture according to length.In a simplified embodiment of the present invention, this picture can itself be combined by three sections pictures.Therefore in step S1, directly this picture is resolved into original three sections and get final product.In other embodiments of the invention, this picture can be a picture, and those skilled in the art also can decompose picture as required.In general, this decomposition should make that the content that comprises in the picture of stage casing is simple as much as possible or single.In the present embodiment, comprise a front end rigion picture respectively, a stage casing picture and a rear end section picture.In other embodiments of the invention, also can comprise one group of front end rigion picture, one group of stage casing picture and one group of rear end section picture.Wherein each group front end rigion picture, stage casing picture and rear end section picture can have a plurality of.In such embodiments, can handle according to following method for each picture in each group.Those skilled in the art can adopt known any picture decomposition technique to come disassemble picture according to actual needs, the restriction of the kind of the picture decomposition technique that is not adopted in this present invention.
In step S2, the width of described front end rigion picture, stage casing picture and rear end section picture is arranged to stretched width respectively.In one embodiment of the invention, described stretched width is that the user sets.Those skilled in the art know that this stretched width is meant the integral width of picture.Such as, in the DVD menu item is used, when the user drags DVD menu button stretching picture, stretched width can be set.Again such as, when the user uses the dilatory pattern of mouse or button, also stretched width can be set.In other embodiments of the invention, also can be by keyboard or other input medias input stretched width.
In step S3, the length breadth ratio based on setting is provided with the length of described front end rigion picture and the length of described rear end section picture respectively.The length breadth ratio of setting can preestablish constant, also can be User Defined or can make amendment based on user's input.For example, the width of front end rigion picture, stage casing picture and rear end section picture is arranged to 2cm respectively, and the length breadth ratio of setting is 2: 1, the length of the length of so described front end rigion picture and described rear end section picture is set to 4cm.
In step S4, based on the final lengths of the described stage casing of the length computation picture of the length of tensile elongation, described front end rigion picture and described rear end section picture.Wherein, tensile elongation is the same with stretched width, is that the user sets.Those skilled in the art know that this tensile elongation is meant the entire length of picture.Such as, in the DVD menu application, when the user drags DVD menu button tension pattern, tensile elongation can be set.Again such as, when using the dilatory pattern of mouse or button.In other embodiments of the invention, also can be by keyboard or other input medias input tensile elongation.Because tensile elongation is the final length of whole picture, and the length of the length of front end rigion picture and rear end section picture is known, therefore, the length of the final lengths=tensile elongation of stage casing picture-described front end rigion picture and the length sum of described rear end section picture.
In step S5, handle described stage casing picture based on the final lengths of described stage casing picture.In a simplified embodiment of the present invention, can directly the length of stage casing picture be arranged to the final lengths of described stage casing picture.
In step S6, with described front end rigion picture, stage casing picture after the processing and the combination of rear end section picture obtain synthesising picture.
Implement image processing method of the present invention, change the Aspect Ratio of picture, also pattern deformation can not take place, therefore can use picture more complicated and changeable background as menu item even stretch.
In another preferred embodiment of the present invention, particularly when there is irregular pattern in the stage casing picture, in order to guarantee picture effect, can adopt the mode of directly duplicating to do spliced stretching, so just can guarantee pattern in the picture of stage casing can be because size changes gross distortion.In this embodiment, step S1-S4 and step S6 are identical with the image processing method shown in Fig. 1, and its difference is that described step S5 further comprises the following steps S51 and S52.
In step S51, can obtain a plurality of stage casing pictures that duplicate based on the final lengths of described stage casing picture and the current length of described stage casing picture.Such as, the final lengths that calculates described stage casing picture by step S4 is 10cm, and the current length of described stage casing picture is 5cm, therefore can determine, need obtain 2 and duplicate the stage casing picture.Those skilled in the art are familiar with the method for various picture reproductions certainly, just have been not repeated at this.Certainly, in another embodiment of the present invention, when the final lengths of described stage casing picture is not the multiple of current length, the length that last duplicates the stage casing picture can be set as required.Such as the final lengths that calculates described stage casing picture by step S4 is 10cm, and the current length of described stage casing picture is 3cm, therefore can determine, need duplicate 3 stage casing pictures.And last length of duplicating the stage casing picture should be 4cm.Certainly, in other preferred embodiments of the present invention, also can be arranged to duplicate 4 and duplicate the stage casing picture, wherein last length of duplicating the stage casing picture is 1cm.In another preferred embodiment of the present invention, can select the number of duplicating the stage casing picture according to following formula:
L-x*l<l/2, wherein L is the final lengths of stage casing picture, and l is the current length of stage casing picture, and x is the number of duplicating the stage casing picture.
In another preferred embodiment of the present invention, can directly adopt the rear end section picture to cover the long stage casing picture of length after duplicating.Such as the final lengths that calculates described stage casing picture by step S4 is 10cm, and the current length of described stage casing picture is 3cm, therefore can determine, need duplicate 4 stage casing pictures.In step S52, can be with described a plurality of stage casing pictures that duplicate after the stage casing picture is spliced into described processing.At this moment, the initial length of the stage casing picture of acquisition is 12cm.Therefore can adopt the rear end section picture to cover the last 2cm of last stage casing picture, thereby make that the length of the stage casing picture that obtains still is 10cm.In other embodiments of the invention, those skilled in the art also can carry out other setting as required.
In a preferred embodiment more of the present invention, particularly when there is irregular pattern in the stage casing picture, in order to guarantee picture effect, can adopt the mode of image copying to do spliced stretching, so just can guarantee pattern in the picture of stage casing can be because size changes gross distortion.In this embodiment, step S1-S4 and step S6 are identical with the image processing method shown in Fig. 1, and its difference is that described step S5 further comprises the following steps S5a-5c.
In step S5a, obtain the mirror image stage casing picture of described stage casing picture.Those skilled in the art can adopt known any mirror image technology to obtain the mirror image picture of this stage casing picture.At this, the present invention is not subjected to the restriction of its concrete mirror method that adopts.In a preferred embodiment of the invention, may need to obtain a plurality of mirror images stage casing picture.
In step S5b, described mirror image stage casing picture and described stage casing picture are spliced with the stage casing picture after the acquisition processing.In a preferred embodiment of the invention, be 10cm such as the final lengths that calculates described stage casing picture by step S4, and the current length of described stage casing picture is 3cm.Therefore can directly obtain three mirror image stage casing pictures of stage casing picture.Then with this stage casing picture and this three mirror image stage casing picture splicings.At this moment, the initial length of the stage casing picture of acquisition is 12cm.Therefore can adopt the rear end section picture to cover the last 2cm of last stage casing picture, thereby make that the length of the stage casing picture that obtains still is 10cm.In other embodiments of the invention, those skilled in the art also can carry out other setting as required.Fig. 2 is the theory diagram of first embodiment of figure piece treating apparatus of the present invention.As shown in Figure 2, described figure piece treating apparatus comprises that picture divides module 100, width and module 200, first length are set module 300, length computation module 400, stage casing picture are set module 500 and concatenation module 600 are set.
Wherein, described picture division module 600 is used for according to length described picture being divided into the front end rigion picture stage casing picture and rear end section picture.In a simplified embodiment of the present invention, this picture can itself be combined by three sections pictures.Therefore picture is divided module 600 and can directly this picture be resolved into original three sections and get final product.In other embodiments of the invention, those skilled in the art also can decompose picture as required.In general, the content that comprises in the picture of stage casing is simple as much as possible or single.In the present embodiment, comprise a front end rigion picture respectively, a stage casing picture and a rear end section picture.In other embodiments of the invention, also can comprise one group of front end rigion picture, one group of stage casing picture and one group of rear end section picture.Wherein each group front end rigion picture, stage casing picture and rear end section picture can have a plurality of.In such embodiments, can handle according to following method for each picture in each group.Those skilled in the art can adopt known any picture decomposition technique to make up described picture and divide module 100 according to actual needs.
Described width is provided with module 200, is used for the width of described front end rigion picture, described stage casing picture and described rear end section picture is arranged to stretched width respectively.In a preferred embodiment of the invention, described figure piece treating apparatus further comprises receiver module, is used to receive user's input so that described stretched width to be set.Such as, in the DVD menu application, when the user drags DVD menu button tension pattern, stretched width can be set.Again such as, when using the dilatory pattern of mouse or button, also stretched width can be set.In other embodiments of the invention, also can be by keyboard or other input medias input stretched width.
Described first length is provided with module 300, is used for based on the length breadth ratio of setting the length of described front end rigion picture and the length of described rear end section picture being set respectively.The length breadth ratio of setting can preestablish constant, for example is stored in the independent memory module, for described first length module 300 is set and calls.The length breadth ratio of this setting also can be User Defined or can make amendment based on user's input.
Described length computation module 400 is used for the final lengths based on the described stage casing of the length computation picture of the length of tensile elongation, described front end rigion picture and described rear end section picture.Such as the width of front end rigion picture, stage casing picture and rear end section picture is arranged to 2cm respectively, and the length breadth ratio of setting is 2: 1, and the length of the length of so described front end rigion picture and described rear end section picture is set to 4cm.
The stage casing picture is provided with module 500, is used for handling described stage casing picture based on the final lengths of described stage casing picture.In a simplified embodiment of the present invention, the final lengths that described stage casing picture is provided with module 500 direct described stage casing pictures is set to the length of described stage casing picture.
Concatenation module 600 is used for described front end rigion picture, and stage casing picture after the processing and the combination of rear end section picture obtain synthesising picture.
In another preferred embodiment of the present invention, particularly when there is irregular pattern in the stage casing picture, in order to guarantee picture effect, can adopt the mode of directly duplicating to do spliced stretching, so just can guarantee pattern in the picture of stage casing can be because size changes gross distortion.In this embodiment, described figure piece treating apparatus is identical with the figure piece treating apparatus shown in Fig. 2, and its difference only is that in this embodiment, described stage casing picture is provided with module 500 and further comprises: the copied cells and first concatenation unit.
Described copied cells is used for obtaining a plurality of stage casing pictures that duplicate based on the current length of the final lengths of described stage casing picture and described stage casing picture.Such as, it is 10cm that length computation module meter 400 is calculated the final lengths that draws described stage casing picture, and the current length of described stage casing picture is 5cm, therefore can determine, need obtain 2 and duplicate the stage casing picture.Those skilled in the art are familiar with the method for various picture reproductions certainly, just have been not repeated at this.Certainly, in another embodiment of the present invention, when the final lengths of described stage casing picture is not the multiple of current length, the length that last duplicates the stage casing picture can be set as required.Such as the final lengths that calculates described stage casing picture by length computation module 400 is 10cm, and the current length of described stage casing picture is 3cm, therefore can determine, need duplicate 3 stage casing pictures.And last length of duplicating the stage casing picture should be 4cm.Certainly, in other preferred embodiments of the present invention, also can be arranged to duplicate 4 and duplicate the stage casing picture, wherein last length of duplicating the stage casing picture is 1cm.In another preferred embodiment of the present invention, copied cells can be selected the number of duplicating the stage casing picture according to following formula:
L-x*l<l/2, wherein L is that the final lengths of stage casing picture is 10cm, and l is the current length of stage casing picture, and x is the number of duplicating the stage casing picture.
In another preferred embodiment of the present invention, can directly adopt the rear end section picture to cover the long stage casing picture of length after duplicating.The final lengths that calculates described stage casing picture such as length computation module 400 is 10cm, and the current length of described stage casing picture is 3cm, therefore can determine that copied cells need duplicate 4 stage casing pictures.First concatenation unit can be with described a plurality of stage casing pictures that duplicate after the stage casing picture is spliced into described processing.At this moment, the initial length of the stage casing picture of acquisition is 12cm.Therefore, in this embodiment, concatenation module 600 can adopt the rear end section picture to cover the last 2cm of last stage casing picture, thereby makes that the length of the stage casing picture that obtains still is 10cm.In other embodiments of the invention, also can carry out other setting as required.
In a preferred embodiment more of the present invention, particularly when there is irregular pattern in the stage casing picture, in order to guarantee picture effect, can adopt the mode of image copying to do spliced stretching, so just can guarantee pattern in the picture of stage casing can be because size changes gross distortion.In this embodiment, described figure piece treating apparatus is identical with the figure piece treating apparatus shown in Fig. 2, and its difference only is that in this embodiment, described stage casing picture is provided with module and further comprises: the mirror image unit and second concatenation unit.
Wherein, described mirror image unit is used to obtain the mirror image stage casing picture of described stage casing picture.Those skilled in the art can adopt known any mirror image technology to construct described mirror image unit.In a preferred embodiment of the invention, may need to obtain a plurality of mirror images stage casing picture.
Second concatenation unit is used for described mirror image stage casing picture and described stage casing picture are spliced with the stage casing picture after the acquisition processing.In a preferred embodiment of the invention, be 10cm such as the final lengths that calculates described stage casing picture by length computation module 400, and the current length of described stage casing picture is 3cm.Therefore can directly obtain three mirror image stage casing pictures of stage casing picture.Then second concatenation unit is with this stage casing picture and this three mirror image stage casing picture splicings.At this moment, the initial length of the stage casing picture of acquisition is 12cm.Therefore, in this embodiment, concatenation module 600 can adopt the rear end section picture to cover the last 2cm of last stage casing picture, thereby makes that the length of the stage casing picture that obtains still is 10cm.In other embodiments of the invention, also can carry out other setting as required.
Implement image processing method of the present invention and device, stretching changes the Aspect Ratio of picture, also pattern deformation can not take place, and therefore can use picture more complicated and changeable background as menu item.
Those skilled in the art know, figure piece treating apparatus of the present invention and method not only can be used for the processing of the picture background of DVD menu item, and the picture that can also be used for other field is handled.
Though the present invention describes by specific embodiment, it will be appreciated by those skilled in the art that, without departing from the present invention, can also carry out various conversion and be equal to alternative the present invention.Therefore, the present invention is not limited to disclosed specific embodiment, and should comprise the whole embodiments that fall in the claim scope of the present invention.