Embodiment
The embodiment of the invention provides image presentation method and device, reception sources image parameter and the target background parameter that is used to present described source images, and calculate the uniform zoom parameter of described source images and the correspondence position in described target background according to described source images parameter and target background parameter, according to the described source images of described uniform zoom parameter convergent-divergent, according to the correspondence position of described source images in described target background, export after the described source images behind the convergent-divergent is combined into piece image.
In order to make those skilled in the art person understand the technical scheme that the embodiment of the invention provides better, the technical scheme that the embodiment of the invention provides is described in further detail below in conjunction with the drawings and specific embodiments.
The first embodiment flow process of image presentation method of the present invention is as shown in Figure 1:
Step 101: reception sources image parameter and the target background parameter that is used to present source images.
Wherein, the source images parameter comprises wide, the height of source images, the integrated mode of source images in described target background of source images at least; Target background parameter comprises at least: wide, the height of target background of target background, the position of target background.
Wherein, integrated mode comprises the single image pattern that only comprises a source images; Comprise image of upside of two source images, the 2 panes pattern of an image of downside, or the 2 panes pattern of the image in left side, the image in right side;
Comprise image in left side of three source images, the 3 panes pattern of two images in right side, or the 3 panes pattern of two images in left side, the image in right side, or the 3 panes pattern of image of upside, two images of downside, or the 3 panes pattern of two images of upside, an image of downside; Comprise four source images the image in left side, three images in right side one add the 3 panes pattern, or three images in left side, the image in right side one add the 3 panes pattern, or three images of upside, an image of downside one add the 3 panes pattern, or image of upside, three images of downside one add the 3 panes pattern; Comprise two images of upside of four source images, four span mode of two images of downside, or four span mode of two images in left side, two images in right side.
Step 102: calculate the uniform zoom parameter of source images and the correspondence position in target background according to source images parameter and target background parameter.
Concrete, analyze the ratio of width to height of described source images and the ratio of width to height of target background, integrated mode in described target background is determined the relation between source images parameter and the target background parameter according to analysis result and source images, according to the uniform zoom parameter of the acquisition of the relation between the parameter of determining source images, and according to integrated mode acquisition source images the correspondence position in target background of source images in described target background.
Step 103: according to uniform zoom parameter convergent-divergent source images.
Step 104: export after being combined into piece image according to the source images of the correspondence position of source images in target background after with convergent-divergent.
Application the foregoing description carries out image and is current, owing to can guarantee that image can distortion according to the optimal location position of parameter acquiring source images in target background of source images and target background.
The second embodiment flow process of image presentation method of the present invention as shown in Figure 2, this embodiment shows according to the source images parameter of input and target background parameter and calculates the uniform zoom parameter of source images and the detailed process of position:
Step 201: set in advance the ratio of width to height scope of source images, the ratio of width to height scope and the integrated mode of source images in target background of target background.
The ratio of width to height scope that source images is set usually is 1 to 2.5, and the ratio of width to height scope of target background is 4/3 to 2, and integrated mode comprises that single image pattern, 2 panes pattern, 3 panes pattern, add 3 panes pattern and four span mode.
Step 202: wide, the height of target background of integrated mode in target background of the height of wide, the source images of input source image, source images, target background and the position of target background.
Step 203: whether the ratio of width to height of judging the ratio of width to height of source images and target background is in preset range, if then execution in step 204; Otherwise, execution in step 210.
Step 204: whether the integrated mode of judging source images belongs to default integrated mode, if then execution in step 205; Otherwise, execution in step 210.
Step 205: analyze the ratio of width to height of source images and the ratio of width to height of target background.
Step 206: the integrated mode in target background is determined the relation between source images parameter and the target background parameter according to analysis result and source images.
Step 207: calculate the uniform zoom parameter of source images according to the relation between the parameter, and calculate the correspondence position of each source images in target background according to the integrated mode of source images in target background.
Step 208: each source images is zoomed to correspondence position in the target background according to the uniform zoom parameter.
Step 209: export after the source images behind the convergent-divergent is combined into piece image, finish current flow process.
Step 210: return error message, finish current flow process.
Application the foregoing description carries out image and is current, since can be according to the parameter of source images and target background uniform zoom parameter and the optimized placement position of corresponding acquisition source images in target background, therefore guaranteed that the source images of different proportion can maximize and utilize without distortion the target background space to make up demonstration.
In conjunction with the embodiment of the invention described above image presentation method, the image of describing respectively below under several different source images integrated modes presents process.
Integrated mode among the image presentation method embodiment of the present invention is when only comprising the single image pattern of a source images, adaptive synoptic diagram as shown in Figure 3 between source images and the target background: the wide and height of source images 1 is respectively W1 and H1, wide and the height of target background is respectively BackW and BackH, SubW and SubH are wide and high in target background of source images 1 after the uniform zoom, wherein the ratio of W1 and H1 and BackW and BackH are the parameter of input, the ratio of width to height (W1/H1) of source images 1 shown in this figure is greater than the ratio of width to height (BackW/BackH) of target background, therefore wide wide (SubW=BackW) as the source images after the uniform zoom 1 of target background, calculate the high SubH of the source images 1 after the uniform zoom according to the relation between the above-mentioned parameter, according to the SubW that calculates and SubH with source images 1 uniform zoom in target background, as shown in Figure 3.
If the ratio of width to height (W1/H1) of source images 1 is less than the ratio of width to height (BackW/BackH) of target background, then corresponding to the height (SubH=BackH) of the source images 1 of the height of target background after as uniform zoom, still calculate the wide SubW of the source images 1 after the uniform zoom according to the relation between the above-mentioned parameter, according to the SubW that calculates and SubH with source images 1 uniform zoom in target background.
Integrated mode among the image presentation method embodiment of the present invention is when comprising the 2 panes image model of two source images, adaptive synoptic diagram as shown in Figure 4 between source images and the target background: the wide and height of source images 1 is respectively W1 and H1, wide and the height of source images 2 is respectively W2 and H2, wide and the height of target background is respectively BackW and BackH, SubW1 and SubH1 are wide and high in target background of source images 1 after the uniform zoom, SubW2 and SubH2 are wide and high in target background of source images 2 after the uniform zoom, wherein BackW, BackH, the ratio of W1 and H1, W2 is the parameter of input with the ratio of H2.The integrated mode of the source images shown in this figure is the 2 panes pattern of the image in left side, the image in right side, therefore determine that the pass between source images parameter and the target background parameter is that the height that source images 1 and source images 2 equal proportions zoom in the target background equates (SubH1=SubH2), width and the width (SubW1+SubW2=BackW) that equals target background, according to the SubW1 that calculates, SubH1, SubW2 and SubH2 with source images 1 and source images 2 uniform zoom in target background, as shown in Figure 4.
Need to prove, when the integrated mode of source images is the 2 panes pattern of image of upside, an image of downside, then the relation between source images parameter and the target background parameter is adjusted into the width that source images 1 and source images 2 equal proportions zoom in the target background and equates, height and the height that equals target background, according to the wide and high of source images 1 that calculates and source images 2 its uniform zoom is got final product in target background, the synoptic diagram behind its convergent-divergent no longer illustrates.
Integrated mode among the image presentation method embodiment of the present invention is when comprising the 3 panes image model of three source images, adaptive synoptic diagram as shown in Figure 5 between source images and the target background: the wide and height of source images 1 is respectively W1 and H1, wide and the height of source images 2 is respectively W2 and H2, wide and the height of source images 3 is respectively W3 and H3, wide and the height of target background is respectively BackW and BackH, SubW1 and SubH1 are wide and high in target background of source images 1 after the uniform zoom, SubW2 and SubH2 are wide and high in target background of source images 2 after the uniform zoom, and SubW3 and SubH3 are wide and high in target background of source images 3 after the uniform zoom; Wherein BackW, BackH, W1 are the parameter of input with ratio, the W3 of H2 with the ratio of H3 with ratio, the W2 of H1.The integrated mode of the source images shown in this figure is the image in left side, the 3 panes pattern of two images in right side, therefore determine that the pass between source images parameter and the target background parameter is that the width that source images 2 and source images 3 equal proportions zoom in the target background equates (SubW2=SubW3), high and equal the height (SubH2+SubH3=BackH) of target background, wide (SubW1+SubW3=BackW) wide and that equal target background of the wide and source images 3 of source images 1, according to the SubW1 that calculates, SubH1, SubW2, SubH2, SubW3 and SubH3 are with source images 1, source images 2 and source images 3 uniform zoom are in target background, as shown in Figure 5.
When the integrated mode of source images was the 3 panes pattern of two images in left side, the image in right side, its image presents process and synoptic diagram shown in Figure 5 is similar, does not repeat them here.
Integrated mode among the image presentation method embodiment of the present invention is when comprising the 3 panes image model of three source images, and adaptive another synoptic diagram is as shown in Figure 6 between source images and the target background:
Wide and the height of source images 1 is respectively W1 and H1, wide and the height of source images 2 is respectively W2 and H2, wide and the height of source images 3 is respectively W3 and H3, wide and the height of target background is respectively BackW and BackH, SubW1 and SubH1 are wide and high in target background of source images 1 after the uniform zoom, SubW2 and SubH2 are wide and high in target background of source images 2 after the uniform zoom, and SubW3 and SubH3 are wide and high in target background of source images 3 after the uniform zoom; Wherein BackW, BackH, W1 are the parameter of input with ratio, the W3 of H2 with the ratio of H3 with ratio, the W2 of H1.The integrated mode of the source images shown in this figure is two images of upside, the 3 panes pattern of an image of downside, therefore determine that the pass between source images parameter and the target background parameter is that the height that source images 1 and source images 2 equal proportions zoom in the target background equates (SubH1=SubH2), wide and equal wide (SubW1+SubW2=BackW) of target background, the height (SubH1+SubH3=BackH) high and that equal target background of the height of source images 1 and source images 3, according to the SubW1 that calculates, SubH1, SubW2, SubH2, SubW3 and SubH3 are with source images 1, source images 2 and source images 3 uniform zoom are in target background, as shown in Figure 6.
When the integrated mode of source images was the 3 panes pattern of image of upside, two images of downside, its image presents process and synoptic diagram shown in Figure 6 is similar, does not repeat them here.
Integrated mode among the image presentation method embodiment of the present invention is when comprising one of four source images and adding the 3 panes image model, and an adaptive synoptic diagram is as shown in Figure 7 between source images and the target background:
Wide and the height of source images 1 is respectively W1 and H1, wide and the height of source images 2 is respectively W2 and H2, wide and the height of source images 3 is respectively W3 and H3, wide and the height of source images 4 is respectively W4 and H4, wide and the height of target background is respectively BackW and BackH, SubW1 and SubH1 are wide and high in target background of source images 1 after the uniform zoom, SubW2 and SubH2 are wide and high in target background of source images 2 after the uniform zoom, SubW3 and SubH3 are wide and high in target background of source images 3 after the uniform zoom, and SubW4 and SubH4 are wide and high in target background of source images 4 after the uniform zoom; Wherein the ratio of ratio, W3 and H3, the W4 of the ratio of BackW, BackH, W1 and H1, W2 and H2 and H4 is the parameter of input.The integrated mode of the source images shown in this figure is the image in left side, one of three images in right side add the 3 panes pattern, therefore determine that the pass between source images parameter and the target background parameter is a source images 2, the width that source images 3 and source images 4 equal proportions zoom in the target background equates (SubW2=SubW3=SubW4), high and equal the height (SubH2+SubH3+SubH4=BackH) of target background, wide (SubW1+SubW2=BackW) wide and that equal target background of the wide and source images 2 of source images 1, according to the SubW1 that calculates, SubH1, SubW2, SubH2, SubW3, SubH3, SubW4 and SubH4 are with source images 1, source images 2, source images 3 and source images 4 uniform zoom are in target background, as shown in Figure 7.
When the integrated mode of source images is one of three images in left side, the image in right side when adding the 3 panes pattern, its image presents process and synoptic diagram shown in Figure 7 is similar, does not repeat them here.
Integrated mode among the image presentation method embodiment of the present invention is when comprising one of four source images and adding the 3 panes image model, and adaptive another synoptic diagram is as shown in Figure 8 between source images and the target background:
Wide and the height of source images 1 is respectively W1 and H1, wide and the height of source images 2 is respectively W2 and H2, wide and the height of source images 3 is respectively W3 and H3, wide and the height of source images 4 is respectively W4 and H4, wide and the height of target background is respectively BackW and BackH, SubW1 and SubH1 are wide and high in target background of source images 1 after the uniform zoom, SubW2 and SubH2 are wide and high in target background of source images 2 after the uniform zoom, SubW3 and SubH3 are wide and high in target background of source images 3 after the uniform zoom, and SubW4 and SubH4 are wide and high in target background of source images 4 after the uniform zoom; Wherein the ratio of ratio, W3 and H3, the W4 of the ratio of BackW, BackH, W1 and H1, W2 and H2 and H4 is the parameter of input.The integrated mode of the source images shown in this figure is image of upside, one of three images of downside add the 3 panes pattern, therefore determine that the pass between source images parameter and the target background parameter is a source images 2, the height that source images 3 and source images 4 equal proportions zoom in the target background equates (SubH2=SubH3=SubH4), wide and equal wide (SubW2+SubW3+SubW4=BackW) of target background, the height (SubH1+SubH2=BackH) high and that equal target background of the height of source images 1 and source images 2, according to the SubW1 that calculates, SubH1, SubW2, SubH2, SubW3, SubH3, SubW4 and SubH4 are with source images 1, source images 2, source images 3 and source images 4 uniform zoom are in target background, as shown in Figure 8.
When the integrated mode of source images is one of three images of upside, an image of downside when adding the 3 panes pattern, its image presents process and synoptic diagram shown in Figure 8 is similar, does not repeat them here.
Integrated mode among the image presentation method embodiment of the present invention is when comprising four split screen image models of four source images, synoptic diagram adaptive between source images and the target background is shown in Fig. 9 A and 9B: in Fig. 9 A and Fig. 9 B, wide and the height of source images 1 is respectively W1 and H1, wide and the height of source images 2 is respectively W2 and H2, wide and the height of source images 3 is respectively W3 and H3, wide and the height of source images 4 is respectively W4 and H4, wide and the height of target background is respectively BackW and BackH, SubW1 and SubH1 are wide and high in target background of source images 1 after the uniform zoom, SubW2 and SubH2 are wide and high in target background of source images 2 after the uniform zoom, and SubW3 and SubH3 are wide and high in target background of source images 3 after the uniform zoom; SubW4 and SubH4 are wide and high in target background of source images 4 after the uniform zoom, and wherein the ratio of the ratio of the ratio of the ratio of BackW, BackH, W1 and H1, W2 and H2, W3 and H3, W4 and H4 is the parameter of input.
Wherein, wide equate (SubW1=SubW4) that pass between source images parameter shown in Fig. 9 A and the target background parameter is source images 1 and source images 4 uniform zoom in the target background, source images 2 and source images 3 uniform zoom wide equate (SubW2=SubW3) in the target background, wide after source images 1 and source images 2 uniform zoom and equal source images 3 and source images 4 uniform zoom after wide and (SubW1+SubW2=SubW3+SubW4), high after the uniform zoom high and that equal source images 2 and source images 3 after the uniform zoom of source images 1 and source images 4 and (SubH1+SubH4=SubH2+SubH3).Because the ratio of width to height of the picture that the image 1 after the uniform zoom, image 2, image 3, image 4 are synthetic is less than the ratio of width to height of target background, source images parameter that obtains thus and the pass between the target background parameter are the height (SubH1+SubH4=BackH and SubH2+SubH3=BackH) that the high of source images 1 after the uniform zoom and source images 4 and (be the high of source images 2 after the uniform zoom and source images 3 and) equal target background.According to the SubW1 that calculates, SubH1, SubW2, SubH2, SubW3, SubH3, SubW4, SubH4 with source images 1, source images 2, source images 3, source images 4 uniform zoom in target background, shown in Fig. 9 A.
Wherein, pass between source images parameter shown in Fig. 9 B and the target background parameter is that source images 1 and source images 2 uniform zoom equate (SubH1=SubH2) to the height in the target background, source images 3 and source images 4 uniform zoom equate (SubH3=SubW4) to the height in the target background, high in the target background of wide in the target background of source images 1 and source images 2 uniform zoom and equal source images 3 and source images 4 uniform zoom wide in the target background and (SubW1+SubW2=SubW3+SubW4), source images 1 and source images 4 uniform zoom and equal source images 2 and source images 3 uniform zoom high in the target background and (SubH1+SubH4=SubH2+SubH3).Because the ratio of width to height of the picture that the image 1 after the uniform zoom, image 2, image 3, image 4 are synthetic is greater than the ratio of width to height of target background, source images parameter that obtains thus and the pass between the target background parameter are wide (SubW1+SubW2=BackW and the SubW3+SubW4=BackW) that the wide of source images 1 after the uniform zoom and source images 2 and (be the wide of source images 3 after the uniform zoom and source images 4 and) equal target background.According to the SubW1 that calculates, SubH1, SubW2, SubH2, SubW3, SubH3, SubW4, SubH4 with source images 1, source images 2, source images 3, source images 4 uniform zoom in target background, shown in Fig. 9 B.
The area of four source images after the uniform zoom that at last can be more respectively calculates according to Fig. 9 A and Fig. 9 B and, select the bigger combination image of area to export.
With four split screen image models be example image presentation method embodiment of the present invention the application structure synoptic diagram as shown in figure 10:
Source images optimal combination configurator reception sources image 1, source images 2, the ratio of width to height of source images 3 and source images 4, integrated mode four split screens of source images, and target background is wide, height and position (being the X coordinate and the Y coordinate in the target background upper left corner), can be the computing chip that has write in advance at the computing method of each integrated mode in the source images optimal combination configurator, call corresponding computing method according to integrated mode, calculate the uniform zoom parameter of each source images and the correspondence position in target background, source images optimal combination configurator is input to the uniform zoom parameter that calculates in the zooming engine of each source images correspondence, according to zooming parameter source images is zoomed to correspondence position in the target background by zooming engine, be combined into piece image by the source images of image sets compound module after then and export in the background terminal and show, realize presenting of combination image thus uniform zoom.
The image that the application said structure is finished in the embodiment of the invention is current, because can uniform zoom parameter and the optimized placement position of corresponding acquisition source images in target background according to the parameter of source images and target background, therefore need not picture is cut or is out of shape, guaranteed that the source images of different proportion can maximize and utilize without distortion the target background space to make up demonstration.
Corresponding with the embodiment of image presentation method of the present invention, the present invention also provides the embodiment of picture production device.
The first embodiment block diagram of picture production device of the present invention as shown in figure 11, this device comprises: receiving element 810, the computing unit 820 that links to each other with receiving element 810, unit for scaling 830 that links to each other with computing unit 820 and the output unit 840 that links to each other with unit for scaling 830.
Wherein, receiving element 810 is used for reception sources image parameter and the target background parameter that is used to present described source images; Computing unit 820 is used for calculating the uniform zoom parameter of described source images and at the correspondence position of described target background according to described source images parameter and target background parameter; Unit for scaling 830 is used for according to the described source images of described uniform zoom parameter convergent-divergent; Output unit 840 is used for according to the correspondence position of described source images in described target background, exports after the described source images behind the convergent-divergent is combined into piece image.
Application the foregoing description carries out image and is current, owing to can guarantee that image can distortion according to the optimal location position of parameter acquiring source images in target background of source images and target background.
The second embodiment block diagram of picture production device of the present invention as shown in figure 12, this device comprises: unit 910, receiving element 920, judging unit 930, computing unit 940, unit for scaling 950 and output unit 960 are set.
Wherein, unit 910 is set and is used for setting in advance the ratio of width to height scope of the ratio of width to height scope of described source images, described target background and described source images integrated mode in described target background; With wide, the height of target background that integrated mode in described target background of height that receiving element 920 that unit 910 links to each other is used for wide, the source images of reception sources image, source images, target background are set and the position of target background; Whether the ratio of width to height that the judging unit 930 that links to each other with receiving element 920 is used to judge the ratio of width to height of described source images and described target background is in described scope, and whether the integrated mode of described source images in described target background belongs to described integrated mode type; The computing unit 940 that links to each other with judging unit 930 is used for the ratio of width to height when the ratio of width to height of the described source images of described judgment unit judges and described target background in described scope, and the integrated mode of described image in target background calculated the uniform zoom parameter of described source images and the correspondence position in described target background according to described source images parameter and target background parameter when belonging to described integrated mode type; The unit for scaling 950 that links to each other with computing unit 940 is used for according to the described source images of described uniform zoom parameter convergent-divergent; The output unit 960 that links to each other with unit for scaling 950 is used for according to the correspondence position of described source images in described target background, exports after the described source images behind the convergent-divergent is combined into piece image.
Wherein, computing unit 940 further comprises the analytic unit 941 that links to each other with receiving element 930, is used to analyze the ratio of width to height of described source images and the ratio of width to height of described target background; The order unit 942 really that links to each other with analytic unit 941 is used for determining relation between described source images parameter and the described target background parameter according to described analysis result and described source images in the integrated mode of described target background; The acquisition unit 943 that links to each other with determining unit 942, be used for obtaining the uniform zoom parameter of described source images, and obtain the correspondence position of described source images in described target background according to the integrated mode of described source images in described target background according to the relation between the described definite parameter.
Description by the embodiment of the invention as can be known, the application embodiment of the invention is carried out image and is current, because can uniform zoom parameter and the optimized placement position of corresponding acquisition source images in target background according to the parameter of source images and target background, therefore need not picture is cut or is out of shape, make that image can distortion, guaranteed that the source images of different proportion can maximize and utilize without distortion the target background space to make up demonstration.
One of ordinary skill in the art will appreciate that all or part of step that realizes in the foregoing description method is to instruct relevant hardware to finish by program, described program can be stored in the computer read/write memory medium, this program is when carrying out, comprise the steps: reception sources image parameter and the target background parameter that is used to present described source images, and calculate the uniform zoom parameter of described source images and the correspondence position in described target background according to described source images parameter and target background parameter; According to the described source images of described uniform zoom parameter convergent-divergent; According to the correspondence position of described source images in described target background, export after the described source images behind the convergent-divergent is combined into piece image.Described storage medium, as: ROM/RAM, magnetic disc, CD etc.
Though described the present invention by embodiment, those of ordinary skills know, the present invention has many distortion and variation and do not break away from spirit of the present invention, wish that appended claim comprises these distortion and variation and do not break away from spirit of the present invention.