Background technology
A most important New function in Microsoft DirectX 9.0 is the merging that people's video of always expecting and figure present pipeline, recently, DirectX 9.0 introduces VMR 9 (The Video Mixing Renderer-9, VMR-9), all available on all platforms that VMR-9 supports at DirectX, Direct3D surface energy is used to present frame of video, wherein, Direct3D, referred to as D3D, it is a set of 3D drawing DLL (dynamic link library) that Microsoft develops in Microsoft Windows operating system, it is the some of DirectX.
VMR-9 has advantage below: first, the all process conversions using D3D to provide, such as, easily video flowing is run by pixel shader engine, thus obtain self-defining video effect, in fact, VMR-9 is Real-time digital signal processing device (the DigitalSignal Processing that our a very familiar function is very powerful, DSP), video can also be presented on texture, as a situation the simplest, you it is contemplated that and play video on a surface of a revolving cube, if you are game developer, video elementary will no longer be confined to dull editing segment, now, video and 3D figure can combine by you, to make the video clipping that image pattern is equally dynamic and mutual.
Secondly, VMR-9 makes video to carry out integrated with UI (User Interface, user interface) more easily, and now, UI can be dynamic, and you will no longer be confined to use color control method to be covered in video by static UI element.
Finally, except with D3D integrated except, VMR additionally provides some other important New function: the function simultaneously presenting multiple video flowing; Support up-to-date cancellation staggered scanning hardware, when staggered scanning source (such as, TV or DV video) when being presented in a progressive display, interlaced field must cancel staggered scanning could form a progressive image, complicated cancellation horizontal-interlace technique can be provided in real time by Graphics Processing Unit (GPU), and this VMR makes application program can select from some techniques available; Support can control the new hardware of hue, saturation, intensity and contrast, this hardware is called Product management model or ProcAmp, ProcAmp is no longer that the overall situation that user must carry out adjusting over the display is arranged, in 3D environment, usually global contrast and brightness function is not needed, by with the mixing of VMR-9, alpha mixes and color controlling function combines, various possible film is made to the support of ProcAmp and to be fade-in fade-out effect.
Huge curtain film is made up of multiple video source, synchronous by server controls video source, and with projector on huge curtain, by adjusting huge curtain and projector, multiple high resolution image can be formed the image of a complete ultrahigh resolution, each screen can carry out rough adjustment by projector, can link up to make multiple little screen, but edge's complete matching to be made to be more difficult by regulating projector, therefore need to carry out trickle adjustment to the local of video, when distortion adjustment is carried out to video, if bit by bit manually adjusted, change uneven, whole image can be made to tear, distortion, cause image quality decrease.
As everyone knows, the curve and shape classification change in mathematics is got up smooth, is rich in visual impact, the change of whole figure can be distributed on each point uniformly.Therefore, if the change of image, according to the certain methods that mechanics principle and geometry principle combine, reasonably be converted into the change at reference mark of curve, curved surface, in Curve On The Surface interpolation, fairing and smooth splicing, overcome the contradiction of local amendment and overall fairing, just can deal with problems preferably.
Summary of the invention
The technical problem to be solved in the present invention is, when using huge curtain for prior art, cannot make the defect of edge's complete matching of multiple the small screen, provide a kind of image processing method and the system that realize the seamless alignment of projection screen.
The technical solution adopted for the present invention to solve the technical problems is: construct a kind of image processing method realizing the seamless alignment of projection screen, said method comprising the steps of:
S1 image splitter is loaded into the grid image that user preserves in advance;
S2. the reference mark on adjacent mesh curve and the reference mark on curved surface in described grid image is adjusted respectively according to Bezier law, to realize the edge seamless alignment of the adjacent mesh of projection screen on D3D surface;
S3. the grid image after adjustment is saved in grid file;
S4. image demonstration device be presented in real time D3D surface adjustment after grid image.
In method of the present invention, it is characterized in that, also comprise before described step S1:
S0. on VMR, create D3D object respectively according to image splitter and image demonstration device and distribute at least one D3D surface.
In method of the present invention, described step S2 comprises further:
S21. judge whether the edge difference in described grid image between adjacent mesh is greater than preset value, if, then adjust the reference mark in described grid image on adjacent mesh curved surface on D3D surface according to Bezier law, with the edge seamless alignment between the adjacent mesh realizing projection screen, if not, then adjust reference mark in described grid image on adjacent mesh curve on D3D surface according to Bezier law, with the edge seamless alignment between the adjacent mesh realizing projection screen.
In method of the present invention, described step S2 also comprises:
S22. the reference mark that in described grid image, adjacent mesh is intersected is adjusted, to realize the seamless alignment of the adjacent mesh crossover location of projection screen on D3D surface according to Bezier law.
In method of the present invention, described step S2 also comprises:
S23. the pixel of adjacent mesh in described grid image is adjusted on D3D surface, consistent with the shading value of the adjacent mesh realizing projection screen.
The present invention have also been constructed a kind of system realizing the seamless alignment of projection screen, and described system comprises:
Image splitter, for being loaded into the grid image that user preserves in advance;
Curve On The Surface adjusting module, for adjusting the reference mark on adjacent mesh curve and the reference mark on curved surface in described grid image respectively according to Bezier law, to realize the edge seamless alignment of the adjacent mesh of projection screen on D3D surface;
Preserve module, for being saved in grid file by the grid image after adjustment;
Image demonstration device, for being presented at the grid image after the adjustment of D3D surface in real time.
In the systems described in the present invention, it is characterized in that, described system also comprises:
Image creation distribution module, for creating D3D object respectively according to image splitter and image demonstration device and distributing at least one D3D surface on VMR.
In the systems described in the present invention, described adjusting module comprises further:
Judging unit, for judging whether the edge difference in described grid image between adjacent mesh is greater than preset value, if, then adjust the reference mark on adjacent mesh curved surface in described grid image, with the edge seamless alignment between the adjacent mesh realizing projection screen, if not, then adjust the reference mark on adjacent mesh curve in described grid image, with the edge seamless alignment between the adjacent mesh realizing projection screen.
In the systems described in the present invention, described system also comprises:
Point of crossing adjusting module, for adjusting the reference mark that in described grid image, adjacent mesh is intersected, to realize the seamless alignment of the adjacent mesh crossover location of projection screen on D3D surface according to Bezier law.
In the systems described in the present invention, described system also comprises:
Pixel adjusting module, for the pixel of adjacent mesh in the described grid image of D3D surface adjustment, consistent with the shading value of the adjacent mesh realizing projection screen.
Implement the image processing method and the system that realize the seamless alignment of projection screen of the present invention, according to Bezier law by adjusting the reference mark in grid image on adjacent mesh curve and the reference mark on curved surface respectively, achieve the seamless alignment of projection screen, make image smoothing neat, and utilize the various special efficacys of D3D to process image.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
Please refer to Fig. 1, is the process flow diagram realizing the image processing method embodiment one of the seamless alignment of projection screen according to the present invention.As shown in Figure 1, the method starts from step S100, VMR creates D3D object respectively according to image splitter and image demonstration device, and distribute at least one D3D surface, with process also show grid image, in various embodiments of the present invention, entire image is made up of grid, so be grid image, the large I of the grid in grid image is defined by user oneself, the position that adjacent mesh is intersected is exactly a little, the line segment constituent curve of grid lastrow or row, the set of curve is exactly curved surface, as shown in Figure 1A, such as, P1, P2, .... be point of crossing, (P1, P2, P3), (P1, P4, P7, P10) be curve, P1, P3, P10, P12 is curved surface, do not enumerate at this.
Subsequently, next step S200, image splitter is loaded into the grid image that user preserves in advance.
Subsequently, next step S300, the reference mark on adjacent mesh curve and the reference mark on curved surface in grid image is adjusted respectively according to Bezier law on D3D surface, to realize the edge seamless alignment of the adjacent mesh of projection screen, in various embodiments of the present invention, the reference mark on adjacent mesh curve and the reference mark on curved surface are by mouse control.
Simply introduce Bezier law below, for some P0 given on grid curve, P1 ..., Pn, its n rank Bezier is:
Wherein, n be greater than 0 natural number, preferably, as n=1, be linear Bezier.
Above-mentioned formula also available recurrence form express, adopt
represent the Bezier determined by a P0, P1 ..., Pn.Then its n rank Bezier can be expressed as:
Briefly, the Bezier on n rank, the interpolation namely between the Bezier of two n-1 rank.
Correspondingly, bezier surface is built by bezier curve equation, and the general cubic curve equation that uses builds bezier surface, article one, curve needs four reference mark, so whole curved surface then needs 16 reference mark, and those skilled in the art should understand, and repeats no more here.
Subsequently, next step S400, is saved to the grid image after adjustment in grid file.
The method ends at step S500, and image demonstration device is presented at the grid image after the adjustment of D3D surface in real time.
Please refer to Fig. 2, is the process flow diagram realizing the image processing method embodiment two of the seamless alignment of projection screen according to the present invention.As shown in Figure 2, the method starts from step S100, VMR creates D3D object respectively according to image splitter and image demonstration device and distributes at least one D3D surface, to process and show grid image.
Subsequently, next step S200, image splitter is loaded into the grid image that user preserves in advance.
Subsequently, next step S310, judge whether the edge difference in network chart picture between adjacent mesh is greater than preset value, if, then adjust the reference mark in network image on adjacent mesh curved surface on D3D surface according to Bezier law, with the edge seamless alignment between the adjacent mesh realizing projection screen, if not, then adjust the reference mark on network image adjacent mesh curve according to Bezier law on Direct3D surface, with the edge seamless alignment between the adjacent mesh realizing projection screen, go to step S400, briefly, if the edge difference between adjacent mesh is too large, a face then can be selected seamless alignment is carried out at edge, if the edge difference between adjacent mesh is little, a line then can be selected seamless alignment is carried out at edge, in an embodiment of the present invention, preset value is system or arranges according to the demand of user.
Or next step S320, at the reference mark that Direct3D surface intersects according to adjacent mesh in Bezier law adjustment network image, to realize the seamless alignment of the adjacent mesh crossover location of projection screen, goes to step S400.
Or, next step S330, at the pixel of D3D surface adjustment adjacent mesh, consistent with the shading value realizing the adjacent mesh of projection screen, go to step S400.
In various embodiments of the present invention, on D3D surface, process is carried out to grid image and following shortcut can be used to switch, such as:
E switches edit pattern
ALT+1 reconnaissance pattern
ALT+2 route selection pattern
ALT+3 selects surface model
Edited result is saved in grid file by S
L is loaded into existing grid image
+ picture brightens
-picture is dimmed
ESC removes current selection
Subsequently, next step S400, is saved to the grid image after adjustment in grid file.
The method ends at step S500, and image demonstration device is presented at the grid image after the adjustment of D3D surface in real time.
Above-mentioned steps completes in respective independently module, do not affect the treatment step of existing software, only need designated treatment container, just can process grid image and export, wherein, grid file output is the grid file of standard, therefore supports MAYA, and the 3D modeling software of the specialty such as 3DMAX is edited video effect.
Please refer to Fig. 3, is the structural representation realizing the image processing system of the seamless alignment of projection screen according to the present invention.As shown in Figure 3, this system comprises image creation distribution module 1, image splitter 2, Curve On The Surface adjusting module 3, point of crossing adjusting module 4, pixel adjusting module 5, preserves module 6 and image demonstration device 7, wherein, Curve On The Surface adjusting module 3 comprises judging unit 31, illustrates various piece below:
Image creation distribution module 1, for creating D3D object respectively according to image splitter 2 and image demonstration device 7 and distributing at least one D3D surface, to process and show grid image on VMR.
Image splitter 2, for being loaded into the grid image that user preserves in advance.In an embodiment of the present invention, can realize image splitter 2 by following program, this program is the interface with external application communication, and external application is loaded into grid image by the image splitter 2 provided.
IVMRSurfaceA11ocator9:public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE InitializeDevice(
/* [in] */DWORD_PTR dwUserID,
/* [in] */VMR9A11ocationInfo *1pA11ocInfo,
/* [out][in]*/DWORD *1pNumBuffers)=0;
virtual HRESULT STDMETHODCALLTYPE TerminateDevice(
/*[in]*/DWORD_PTR dwID)=0;
virtual HRESULT STDMETHODCALLTYPE GetSurface(
/* [in] */DWORD_PTR dwUserID,
/* [in] */DWORD SurfaceIndex,
/* [in] */DWORD SurfaceFlags,
/* [out]*/IDirect3DSurface9**1p1pSurface)=0;
virtual HRESULT STDMETHODCALLTYPE AdviseNotify(
/*[in]*/IVMRSurfaceA11ocatorNotify9*1pIVMRSurfA11ocNotify)=0;
};
Curve On The Surface adjusting module 3, for adjusting the reference mark on adjacent mesh curve and the reference mark on curved surface in network image respectively according to Bezier law, to realize the edge seamless alignment of the adjacent mesh of projection screen on D3D surface.
Point of crossing adjusting module 4, for the reference mark intersected according to adjacent mesh in Bezier law adjustment network image on D3D surface, to realize the seamless alignment of the adjacent mesh crossover location of projection screen.
Pixel adjusting module 5, for the pixel in Direct3D surface adjustment adjacent mesh, consistent with the shading value of the adjacent mesh realizing projection screen.
Preserve module 6, the grid image after adjustment is saved in grid file.
Image demonstration device 7, for being presented at the grid image after the adjustment of D3D surface in real time.In an embodiment of the present invention, can realize image demonstration device 7 by following program, this program is the interface with external application communication, and external application is presented at the grid image after the adjustment of D3D surface in real time by the image demonstration device 7 provided.
IVMRImagePresenter9:public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE StartPresenting(
/* [in] */ DWORD_PTR dwUserID)=0;
virtual HRESULT STDMETHODCALLTYPE StopPresenting(
/* [in] */ DWORD_PTR dwUserID)=0;
virtual HRESULT STDMETHODCALLTYPE PresentImage(
/* [in] */ DWORD_PTR dwUserID,
/* [in] */ VMR9PresentationTnfo *1pPresInfo)=0;
};
Judging unit 31, for judging whether the edge difference in grid image between adjacent mesh is greater than preset value, if, then adjust the reference mark in network image on adjacent mesh curved surface on D3D surface respectively according to Bezier law, with the edge seamless alignment between the described adjacent mesh realizing projection screen, if not, then on D3D surface according to the reference mark in Bezier law adjustment network image on adjacent mesh curve, with the edge seamless alignment between the described adjacent mesh realizing projection screen.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within right of the present invention.