A kind of interactive single image material based on YUV color space obtain system and
Method
Technical field
The present invention relates to a kind of obtain system and method based on the interactive single image material of YUV color space, belong to
Area of computer graphics.
Background technology
Material acquisition methods and the reconstruction in virtual scene are the important subject of computer graphicss.In the past
More than ten years in, research worker proposes many processing methods and develops corresponding system, and for example, the BTF of Bonn university is (double
To texture function) obtain system.But such system exists, and system building complexity, data acquisition time length, data volume be big, data pressure
The shortcomings of contracting time is long, thus material obtains system and still fails to enter practical stage.
In recent years, obtain, using single image, the attention that material appearance obtains industrial quarters and research worker, and develop
Many moneys materials obtains and editing system.For example, image, utilization are edited in industrial quarters technical staff using Photoshop
CrazyBump calculates Normal figure etc..In research field, Microsoft Research, Asia have developed a interactive mode material and obtains system
System AppGen.On the basis of correlational study, the present invention have developed a kind of interactive single image material based on YUV color space
Acquisition system.
YUV is a kind of colour coding method being adopted by eurovision system, is PAL and SECAM simulation color TV
The color space that standard adopts.In modern color television system, generally adopt three pipe colour cameras or colored CCD camera
Carry out capture, then the colour picture signal obtaining through color separation, obtain RGB after amplification correction respectively, then through matrixing
Circuit obtains luminance signal Y and two colour difference signal B-Y (i.e. U), R-Y (i.e. V), and last transmitting terminal is by brightness and aberration three
Signal is encoded respectively, is sent with same channel.The method for expressing of this color is exactly so-called YUV color space table
Show.Luminance signal Y of YUV and carrier chrominance signal U, V are detached.If only Y-signal component is without U, V component, then this
The image that sample represents is exactly black and white gray level image.Color television adopts yuv space precisely in order to solving technicolo with luminance signal Y
Depending on the compatibling problem of machine and black and white television, make black and white television also can receive colour TV signal.
Bilateral filtering [1] (Bilateral filter) is a kind of nonlinear filtering method, is the space with reference to image
Adjacency and a kind of compromise of pixel value similarity, consider spatial information (si) and grey similarity simultaneously, reach guarantor's side denoising
Purpose.There is simple, non-iterative, local.
List of references:
[1]Yang Q.,Wang S.,N.Real-time specular highlight removal using
bilateral filtering.Computer Vision–ECCV 2010.Springer,2010,87-100.
Content of the invention
For the subsidy of prior art, the technical method of the present invention is based on YUV color space it is only necessary to single image can be given birth to
Become more real texturing, including diffuse-reflectance coefficient figure, specularity factor figure, normal direction figure and high backscatter extinction logarithmic ratio figure.
Technical scheme includes a kind of interactive single image material acquisition system based on YUV color space,
It is characterized in that, this system includes:Preparation module is for providing, for system, the single width flat sample texture map picture that meets the requirements, right
Texture map picture is parsed, and obtains light source direction and viewpoint direction;Separation module, for separating to texture map image height light, obtains
High light image, also obtains diffuse-reflectance figure and the mirror reflection figure of bloom image further;Normal direction module, obtains described splitting die
The diffuse-reflectance figure of the high light image that block obtains, interacts formula based on the lightness of diffuse-reflectance figure and is calculated normal direction figure;Unrestrained anti-
Penetrate coefficient module, be calculated diffuse-reflectance coefficient for obtaining described normal direction figure;Coefficients calculation block, for by direct reflection figure
Lightness as high backscatter extinction logarithmic ratio, based on the parameter of high backscatter extinction logarithmic ratio and user setup, recalculate further and obtain final bloom
Coefficient and specularity factor.
System is obtained according to the interactive single image material of described YUV color space, described preparation module is also wrapped
Include:For obtaining satisfactory single width flat sample texture map picture, parsing obtains the rgb value of material image pixel, further
By rgb value I (x) of certain pixel x be expressed as diffuse-reflectance and direct reflection and, wherein
I (x)=Id(x)+Is(x),
Diffuse-reflectance is Id(x)=ρd(x)Sd(x)=ρd(x) Dot (N (x), L),
Mirror reflection is Is(x)=ρs(x)Ss(x)=ρs(x) pow (Dot (N (x), H), g (x)) Dot (N (x), L), its
Middle g (x) is high backscatter extinction logarithmic ratio, and H=(L+V)/| L+V |, wherein L are light source direction, and V is viewpoint direction.
System is obtained according to the interactive single image material of described YUV color space, described separation module also wraps
Include:Default submodule, the high photo threshold for arranging when pixel is screened is configured, and this high photo threshold can carry out self-defined
Setting;Filter submodule, for filtering to each pixel practicality bilateral filtering of texture map picture, is not higher than including rejecting
Preset the pixel of high photo threshold, the pixel meeting bloom threshold requirement is carried out respectively obtaining diffuse-reflectance figure and mirror image
Reflectogram.
System is obtained according to the interactive single image material of described YUV color space, described normal direction module is also
Including:Transform subblock, for being converted to YUV color space to the diffuse-reflectance figure of material pixel from RGB color, and obtains
The lightness Y of YUV color space;Interactive computing submodule, for calculating maximum MaxY and minimum M inY of lightness Y,
Change in depth scope empirical value DepthRange, the lightness Y to diffuse-reflectance image according to User Defined setting further
Carry out secondary calculating, its meter obtains final lightness, computing formula is Y=(Y-MinY)/(MaxY-MinY) * DepthRange,
Wherein change in depth scope empirical value can arrange scope is 0-255;Normal direction figure calculating sub module, for obtaining described interactive computing
The final lightness that submodule secondary calculating obtains, is calculated normal direction figure according to lightness Y to diffuse-reflectance figure further.
Interactive single image material according to described YUV color space obtains system, described diffuse-reflectance coefficient module
Block also includes:For using ρd(x)=IdX ()/Dot (N (x), L) is calculated diffuse-reflectance coefficient.
Interactive single image material according to described YUV color space obtains system, described diffuse-reflectance coefficient module
Block also includes:Interim submodule, for being converted to the conversion formula of YUV color space according to RGB color, calculates minute surface anti-
Penetrate the lightness G of figure, using G as high backscatter extinction logarithmic ratio temporarily, and calculate maximum MaxG and the minima of high backscatter extinction logarithmic ratio temporarily
MinG;Interaction submodule, for the bloom excursion empirical value GlossinessRange according to user input, using g (x)
=(g (x)-MinG)/(MaxG-MinG) * GlossinessRange is calculated finally high backscatter extinction logarithmic ratio, using ρs(x)=Is
(x)/pow(Dot(ND(x),H),g(x))/Dot(ND(x), L) it is calculated specularity factor, wherein
GlossinessRange can input range be 0-255.
Also a kind of interactive single image material acquisition methods based on YUV color space of technical scheme, its
It is characterised by, the method includes:There is provided, for system, the single width flat sample texture map picture that meets the requirements, texture map picture is solved
Analysis, obtains light source direction and viewpoint direction;Texture map image height light is separated, obtains high light image, also obtain bloom figure further
The diffuse-reflectance figure of picture and mirror reflection figure;Obtain the diffuse-reflectance figure of the high light image that described separation module obtains, based on diffuse-reflectance
The lightness of figure interacts formula and is calculated normal direction figure;Obtain described normal direction figure and be calculated diffuse-reflectance coefficient;Minute surface is anti-
The lightness penetrating figure, as high backscatter extinction logarithmic ratio, based on the parameter of high backscatter extinction logarithmic ratio and user setup, is recalculated further and is obtained finally
High backscatter extinction logarithmic ratio and specularity factor.
Further, the method also includes:
For obtaining satisfactory single width flat sample texture map picture, parsing obtains the rgb value of material image pixel, enters
One step by rgb value I (x) of certain pixel x be expressed as diffuse-reflectance and direct reflection and, wherein I (x)=Id(x)+Is(x),
Diffuse-reflectance is Id(x)=ρd(x)Sd(x)=ρdX () Dot (N (x), L), mirror reflection is Is(x)=ρs(x)Ss(x)=ρs(x)
Pow (Dot (N (x), H), g (x)) Dot (N (x), L), wherein g (x) are high backscatter extinction logarithmic ratio, and H=(L+V)/| L+V |, wherein L are light
Source direction, V is viewpoint direction.
Further, the method also includes:The high photo threshold arranging when pixel is screened is configured, and this high photo threshold is permissible
Carry out self-defined setting;Each pixel practicality bilateral filtering of texture map picture is filtered, not higher than default including rejecting
The pixel of high photo threshold, the pixel meeting bloom threshold requirement is carried out respectively obtaining diffuse-reflectance figure and mirror reflection
Figure.
Further, the method also includes:Transform subblock, for the diffuse-reflectance figure of material pixel from RGB color
Be converted to YUV color space, and obtain the lightness Y of YUV color space;Interactive computing submodule, for calculating lightness Y's
Maximum MaxY and minimum M inY, the change in depth scope empirical value according to User Defined setting further
DepthRange, carries out secondary calculating to the lightness Y of diffuse-reflectance image, and its meter obtains final lightness, and computing formula is Y=
(Y-MinY) it is 0-255 that/(MaxY-MinY) * DepthRange, wherein change in depth scope empirical value can arrange scope;Normal direction
Figure calculating sub module, for obtaining the final lightness that described interactive computing submodule secondary calculating obtains, further according to bright
Brightness Y is calculated normal direction figure to diffuse-reflectance figure.
Further, the method also includes:Using ρd(x)=IdX ()/Dot (N (x), L) is calculated diffuse-reflectance coefficient.
Further, the method also includes:Be converted to the conversion formula of YUV color space according to RGB color, calculate mirror
The lightness G of face reflectogram, using G as high backscatter extinction logarithmic ratio temporarily, and calculates maximum MaxG and the minimum of high backscatter extinction logarithmic ratio temporarily
Value MinG;According to the bloom excursion empirical value GlossinessRange of user input, using g (x)=(g (x)-MinG)/
(MaxG-MinG) * GlossinessRange is calculated finally high backscatter extinction logarithmic ratio, using ρs(x)=Is(x)/pow(Dot(ND
(x),H),g(x))/Dot(ND(x), L) it is calculated specularity factor, wherein GlossinessRange can input range be
0-255.
Brief description
Fig. 1 show the population structure block diagram of the system according to embodiment of the present invention;
Fig. 2 show the overall flow figure according to embodiment of the present invention.
Specific embodiment
In order that the object, technical solutions and advantages of the present invention are clearer, below in conjunction with the accompanying drawings with specific embodiment pair
The present invention is described in detail.The interactive single image material of the YUV color space of the present invention obtains system and is used for singly belonging to
Graph and image processing field.
Fig. 1 show the population structure block diagram of the system according to embodiment of the present invention;Preparation module, for carrying for system
For the single width that meets the requirements flat sample texture map picture, texture map picture is parsed, obtain light source direction and viewpoint direction;Separate
Module, for separating to texture map image height light, obtains high light image, also obtains diffuse-reflectance figure and the mirror image of bloom image further
Reflectogram;Normal direction module, obtains the diffuse-reflectance figure of the high light image that described separation module obtains, bright based on diffuse-reflectance figure
Degree interacts formula and is calculated normal direction figure;Diffuse-reflectance coefficient module, is calculated diffuse-reflectance system for obtaining described normal direction figure
Number;Coefficients calculation block, with using the lightness of direct reflection figure as high backscatter extinction logarithmic ratio, based on high backscatter extinction logarithmic ratio and user setup
Parameter, recalculates further and obtains finally high backscatter extinction logarithmic ratio and specularity factor.
Fig. 2 show the overall flow figure according to embodiment of the present invention.Its implementing procedure including step S201~
S205, including:
S201, prepares material picture and carries out checking filtration, the system inputs as single width flat sample texture map picture.
The I (x) of Blinn-x be represented by diffuse-reflectance and direct reflection and,
I (x)=Id(x)+Is(x).
Wherein,
Id(x)=ρd(x)Sd(x)=ρd(x)Dot(N(x),L)
Is(x)=ρs(x)Ss(x)=ρs(x) pow (Dot (N (x), H), g (x)) Dot (N (x), L),
G (x) is high backscatter extinction logarithmic ratio, and (L is light source direction to H=(L+V)/| L+V |, and V is viewpoint direction, and this report supposes often
The L of individual pixel x, V all same).
Therefore, the system can be described as, and the pictures giving flat sample material are it is assumed that light source direction L and viewpoint
Direction V is it is known that calculate normal vector N (x), diffuse-reflectance coefficient ρd(x), specularity factor ρs(x), high backscatter extinction logarithmic ratio g (x).
S202, carries out bloom and separates, obtain diffuse-reflectance and mirror reflection figure, the bloom based on single image separates to picture
Method has a lot.More simple empirical method can also be adopted in actual applications, for example, the pixel value with bloom be obtained
Threshold value is set to 235, i.e. I (x)>235 expression blooms.The system is based on bilateral filtering (Bilateral Filterin) using a kind of
Bloom separation method.
S203, the lightness using diffuse-reflectance figure calculates normal direction figure, and the color space of image is that coded system is varied,
Wherein most commonly seen is RGB color.The system will study calculating normal direction figure on YUV color space.YUV color space
Middle Y represents lightness (Luminance), that is, grey decision-making;U and V is used for representing colourity (Chrominance), i.e. description figure
The color of picture, saturation.As follows from the linear transformation formula of RGB color to YUV color space:
Y=0.299R+0.587G+0.114B,
U=-0.147R-0.298G+0.437B,
V=0.615R-0.515G-0.100B.
The feature of YUV color space is that lightness Y and carrier chrominance signal U, V are detached, if only Y-signal component,
The image representing is exactly black and white gray level image.Therefore, to adopt the lightness Y in YUV color space to replace traditional bright for the system
Secretly (brightness) intrinsic figure.In addition, for improving computational efficiency, we will directly utilize lightness Y to calculate normal direction in actual applications
Figure.
For improving the precision of normal direction figure, the system devises a kind of interactive mode and calculates normal direction drawing method using lightness.Base
This step is as follows:
(1) maximum MaxY, minimum M inY of image lightness Y are calculated;
(2) utilize change in depth scope empirical value DepthRange (0~255) of user input, according to below equation weight
New calculating image lightness Y,
Y=(Y-MinY)/(MaxY-MinY) * DepthRange.
The ultimate principle of the method is to customer satisfaction system interval range by image lightness uniform zoom, thus revised law
To the change of figure, when DepthRange value is larger, normal direction excursion is larger, and otherwise, normal direction excursion is less.
S204 calculates diffuse-reflectance coefficient, and its computing formula is:ρd(x)=Id(x)/Dot(N(x),L).
S205, calculates high backscatter extinction logarithmic ratio and specularity factor, and the system is stronger according to direct reflection, high backscatter extinction logarithmic ratio bigger this
One feature, devises a kind of interactive mode bloom generation method.
(1) conversion formula according to RGB to YUV, the lightness calculating direct reflection figure is as high backscatter extinction logarithmic ratio g (x), and counts
Calculate maximum MaxG, minimum M inG;
(2) utilize bloom excursion empirical value GlossinessRange (0~255) of user input, according to following public affairs
Formula recalculates high backscatter extinction logarithmic ratio, specularity factor,
G (x)=(g (x)-MinG)/(MaxG-MinG) * GlossinessRange,
ρs(x)=Is(x)/pow(Dot(ND(x),H),g(x))/Dot(ND(x),L).
True finally by the diffuse-reflectance coefficient obtained by step S204 and step S205, mirror reflection coefficient and high backscatter extinction logarithmic ratio
Recognize final image material.
The above, simply presently preferred embodiments of the present invention, the invention is not limited in above-mentioned embodiment, as long as
It reaches the technique effect of the present invention with identical means, all should belong to protection scope of the present invention.Protection model in the present invention
In enclosing, its technical scheme and/or embodiment can have various different modifications and variations.