Summary of the invention
For the deficiencies in the prior art, technical scheme discloses the mutual material of a kind of portable equipment and obtains system
System method, view data is glistened by the equipment such as mobile phone, slr camera shooting band and flashless photo obtains.
Technical scheme includes that the mutual material of a kind of portable equipment obtains system, it is characterised in that this system
Including: acquisition module, it is used for using portable equipment to gather flashless texture map picture, is additionally operable to utilize portable equipment to gather band flash of light
Texture map picture;High light separation module, changes into for the flashless original RGB color image gathered by described acquisition module
YUV color space image, and separation parameter based on user's input and the original continuous-tone image of YUV color space image calculate
To new continuous-tone image, further by YUV image isolated mirror reflection figure and diffuse-reflectance figure;Normal direction module, according to Gao Guang
The pixel that separation module obtains new continuous-tone image is poor, creates the first tangent vector and the second tangent vector in tangent space, further, according to
All vector sum second tangent vectors calculate normal direction figure initial value;Diffuse-reflectance module, for obtaining the unrestrained of described high light isolated
Reflectogram, calculates diffuse-reflectance coefficient figure initial value;High optical index module, is used for obtaining described high light separation module and obtains new light and shade
Figure, further, high backscatter extinction logarithmic ratio based on user's input calculates the initial value of high optical index figure;Mirror reflection module, is used for obtaining
The mirror reflection figure of described high light isolated, calculates the initial value of mirror reflection coefficient figure further;Parameter optimization module, uses
In obtaining the initialization ginseng obtained according to described normal direction module, diffuse-reflectance module, high optical index module and mirror reflection module
Number, also obtains the band flash of light texture map picture of described acquisition module, uses non-linear optimization technique to calculate texturing parameter life
Become texturing.
Mutual material according to described portable equipment obtains system, and described high light separation module also includes: conversion
Module, for the original RGB color of the flashless texture map picture gathered being converted to the texture map picture of YUV color space,
Original continuous-tone image Y1 and primitive color figure U and saturation V;Segregant module, for the separation arranged according to User Defined
Parameter p, wherein new continuous-tone image Y2 is Y2=Y1*p, further, combines based on new continuous-tone image Y2, primitive color figure U and saturation V
For new RGB image, and using new RGB image as diffuse-reflectance figure, mirror reflection image and diffuse-reflectance figure and be that original RGB schemes
Picture.
Mutual material according to described portable equipment obtains system, and described normal direction module also includes: be used for obtaining
The pixel of described new continuous-tone image Y2 is poor, further, for any pixel (i, value D j) (i, j), tangential in S and T direction
Amount be respectively S (i, j)=(1,0, D (and i+1, j)-D (i-1, j)), T (i, j)=(0,1, D (i, j+1)-D (i, j-1)), then
Amassing as normal direction figure initial value of first tangent vector S and the second tangent vector T.
Mutual material according to described portable equipment obtains system, and described diffuse-reflectance module also includes: for unrestrained
Reflection initial value calculates, and wherein, diffuse-reflectance coefficient figure=diffuse-reflectance figure/NdotL, NdotL is pixel normal vector and illumination
The inner product of vector.
Mutual material according to described portable equipment obtains system, and described high optical index module also includes: for root
According to the high optical parameter of User Defined input, calculating the initial value of high optical index figure, its calculation is, high optical index
Figure=new continuous-tone image Y2* high optical parameter.
Mutual material according to described portable equipment obtains system, and described mirror reflection module also includes: based on by
Calculating the initial value of specularity factor figure, its calculation is, specularity factor figure=direct reflection figure/pow (NdotH, g
(x))/NdotL, wherein H represents illumination, sight line Middle Component, and NdotH is the inner product of pixel normal vector and H, and g (x) represents arbitrarily
The high optical index of pixel x.
Mutual material according to described portable equipment obtains system, and described parameter optimization module also includes: cluster
Module, for all pixels of the flashless image of parameter initialization are carried out N cluster, N represents cluster number;Acquisition parameter
Submodule, for obtaining the FOV parameter of portable equipment, initializes the illumination Lj of each pixel of band flashlight images, sight line Vj ginseng
Number;Processes pixel submodule, for each pixel class Ci process to described band flashlight images.
Mutual material according to described portable equipment obtains system, in a preferred embodiment, described picture
Element processes submodule to each pixel class Ci processs, including: pixel chooses submodule, is used for obtaining in current pixel classification
The value of any one pixel P;Read initial parameter sub-module, for obtaining the flashless texture map picture corresponding with pixel P
The initiation parameter of pixel;Read acquisition parameter submodule, for reading each pixel Pj of current pixel classification Ci
Rgb value, illumination Lj, sight line Vj;Nonlinear optimization submodule, chooses at the beginning of submodule, reading for transferring described pixel respectively
The data that beginning parameter sub-module, reading acquisition parameter submodule obtain, use nonlinear optimization to calculate the parameter of pixel P, and
Store the pinup picture parameter base corresponding as current pixel classification Ci;Pinup picture parameter sub-module, for calculating current pixel class one by one
The residual pixel point of other Ci and the ratio of pixel P, as the weight coefficient of residual pixel point, further, according to current pixel
The pinup picture parameter base of classification Ci, calculates the pinup picture parameter of residual pixel point.
Technical scheme also includes a kind of mutual material acquisition methods, it is characterised in that the method includes: use
Portable equipment gathers flashless texture map picture, is additionally operable to utilize portable equipment to gather band flash of light texture map picture;By described collection mould
The flashless original RGB color image of block collection changes into YUV color space image, and separation ginseng based on user's input
The original continuous-tone image of number and YUV color space image is calculated new continuous-tone image, further by YUV image isolated mirror
As reflectogram and diffuse-reflectance figure;Poor according to the pixel that high light separation module obtains new continuous-tone image, create first in tangent space tangential
Amount and the second tangent vector, further, calculate normal direction figure initial value according to the first tangent vector and the second tangent vector;Obtain described Gao Guang
The diffuse-reflectance figure of isolated, calculates diffuse-reflectance coefficient figure initial value;Obtain described high light separation module and obtain new continuous-tone image, enter
One step, high backscatter extinction logarithmic ratio based on user's input calculates the initial value of high optical index figure;Obtain the mirror image of described high light isolated
Reflectogram, calculates the initial value of mirror reflection coefficient figure further;Obtain according to described normal direction module, diffuse-reflectance module, height
The initiation parameter that optical index module and mirror reflection module obtain, also obtains the band flash of light texture map picture of described acquisition module,
Non-linear optimization technique is used to calculate texturing parameter and generate texturing.
Further, the method also includes: the original RGB color of the flashless texture map picture gathered is converted to YUV
The texture map picture of color space, original continuous-tone image Y1 and primitive color figure U and saturation V;Arrange according to User Defined
Separation parameter p, wherein new continuous-tone image Y2 is Y2=Y1*p, further, based on new continuous-tone image Y2, primitive color figure U and saturation V
Be combined as new RGB image, and using new RGB image as diffuse-reflectance figure, mirror reflection image and diffuse-reflectance figure and be original RGB
Image.
Further, the method also includes: the pixel obtaining described new continuous-tone image Y2 is poor, further, for any pixel
(i, value D j) (i, j), the tangent vector in S and T direction be respectively S (i, j)=(1,0, D (and i+1, j)-D (i-1, j)), T (i,
J)=(0,1, D (i, j+1)-D (i, j-1)), then the amassing as normal direction figure initial value of the first tangent vector S and the second tangent vector T.
Further, the method also includes: calculate diffuse-reflectance initial value, wherein, and diffuse-reflectance coefficient figure=diffuse-reflectance
Figure/NdotL, NdotL are the inner product of pixel normal vector and illumination vector.
Further, the method also includes: according to the high optical parameter of User Defined input, the initial value to high optical index figure
Calculating, its calculation is, the continuous-tone image Y2* high optical parameter of high optical index figure=new.
Further, the method also includes: calculating the initial value of specularity factor figure, its calculation is, direct reflection
Coefficient figure=direct reflection figure/pow (NdotH, g (x))/NdotL, wherein H represents illumination, sight line Middle Component, and NdotH is picture
Element normal vector and the inner product of H, g (x) represents the high optical index of any pixel x.
Further, the method also includes: all pixels of the flashless image of parameter initialization are carried out N cluster, N table
Show cluster number;Obtain the FOV parameter of portable equipment, initialize the illumination Lj of each pixel of band flashlight images, sight line Vj ginseng
Number;Each pixel class Ci process to described band flashlight images.
Further, the method also to not having individual Ci to calculate, including: obtain any one pixel in current pixel classification
The value of some P;Obtain the flashless texture map corresponding with pixel P as the initiation parameter of pixel;Read current pixel classification
The rgb value of each pixel Pj of Ci, illumination Lj, sight line Vj;Transfer described pixel respectively to choose submodule, read initial ginseng
The data that number submodule, reading acquisition parameter submodule obtain, use nonlinear optimization to calculate the parameter of pixel P, and store
As the pinup picture parameter base that current pixel classification Ci is corresponding;Calculate residual pixel point and the pixel of current pixel classification Ci one by one
The ratio of P, as the weight coefficient of residual pixel point, further, according to the pinup picture parameter base of current pixel classification Ci, calculates surplus
The pinup picture parameter of after image vegetarian refreshments.Weight coefficient, further, according to the pinup picture parameter base of current pixel classification Ci, calculate residue
The pinup picture parameter of pixel.
The invention have the benefit that the material appearance of the present invention obtains system and utilizes that mobile phone, slr camera etc. are portable to be set
Standby band flash of light, flashless two images of gathering, the most real texturing of interactive generation, thus the system that solves to play at present
The problems such as the field material fabrication cycle length such as work, video display animation, cost are high, precision is low.
Detailed description of the invention
In order to make the object, technical solutions and advantages of the present invention clearer, below in conjunction with the accompanying drawings with specific embodiment pair
The present invention is described in detail.The mutual material of the portable equipment of the present invention obtains system and method and is applicable at graph image
Reason.
Fig. 1 show the system module figure according to embodiment of the present invention and flow chart.The most just acquisition module is for real
Existing image source data collection, high light separation module therein, normal direction module, diffuse-reflectance module, mirror reflection module are used for root
According to flashless image initial texturing parameter, parameter module therein is for flash of light material image procossing.This collection mould
Block, for gathering the flash of light texture map picture of the first portable equipment, is additionally operable to gather the non-flash texture map picture of the second portable equipment;
High light separation module, the original RGB color of non-flash described acquisition module gathered for separation parameter based on user's input
Spatial image changes into YUV color space image, and is new RGB image to converting YUV image twice transformation and separates
Obtaining mirror reflection figure and diffuse-reflectance figure, wherein YUV color space includes original continuous-tone image, primitive color figure and saturation;Method
To module, for obtaining the new continuous-tone image of YUV color space image, create the in tangent space according to the pixel difference of new continuous-tone image
All vector sum second tangent vectors, further, calculate normal direction figure initial value according to the first tangent vector and the second tangent vector;Diffuse-reflectance
Module, for obtaining the diffuse-reflectance figure of described high light isolated, calculates diffuse-reflectance coefficient figure initial value;High optical index module,
Obtaining new continuous-tone image for obtaining described high light separation module, further, high backscatter extinction logarithmic ratio based on user's input calculates high light and refers to
The initial value of number figure;Mirror reflection module, for obtaining the mirror reflection figure of described high light isolated, calculates mirror image further
The initial value of stickogram, obtains according to described high light separation module, normal direction module, diffuse-reflectance module and high optical index module
To final non-flash texture map picture;Parameter module, for according to described high light separation module, normal direction module, diffuse-reflectance module
Initiation parameter with high optical index module obtains final non-flash texture map picture, also obtains the flash of light material of described acquisition module
Image, uses non-linear optimization technique to calculate texturing parameter, further, obtains texture map and as appearance attribute and generate material
Pinup picture.
Fig. 2 show the detail flowchart according to embodiment of the present invention.It is embodied as step include S201~
S201, data acquisition, glistened and flashless two texture map pictures by the equipment such as mobile phone, slr camera shooting band.
S202, high light separates, and technical scheme utilizes light and shade value Y of YUV color space to be divided by original RGB image
From becoming diffuse-reflectance figure, direct reflection figure two parts.
It is embodied as follows shown in (1)~(5), including:
(1) original continuous-tone image Y and primitive color figure U, V are calculated according to original RGB image;
(2) user interactively enters separation parameter (generally 0.6~0.8);
(3) new continuous-tone image Y2=original continuous-tone image Y* separation parameter;
(4) new RGB image is generated, as diffuse-reflectance figure according to new continuous-tone image Y2 and primitive color figure U, V;
(5) direct reflection figure=original RGB image-diffuse-reflectance figure.
S203, normal direction figure initializes, and basic thought is the margin of image element according to new continuous-tone image Y2, constructs S in tangent space
Vector sum T vector, is obtained N by S × TD.Specific as follows:
According to picture element (i, value D j) (i, j), the tangent vector in S and T direction is,
S (i, j)=(1,0, D (i+1, j)-D (i-1, j)),
T (i, j)=(0,1, D (i, j+1)-D (i, j-1)).
Therefore, according to ND(((i j) can calculate normal direction figure for i, j) × T for i, j)=S.
S204, diffuse-reflectance coefficient figure initializes, diffuse-reflectance coefficient=diffuse-reflectance figure/NdotL.Wherein, NdotL is pixel method
The inner product that vector is vectorial with illumination.Assume that illumination is perpendicular to material surface in this stage, i.e. L (0,0,1).
S205, high optical index figure initializes, and user's interactive mode inputs high optical parameter (generally 0.1~0.5), high optical index
Figure=new continuous-tone image Y2* high optical parameter.
S206, specularity factor figure initializes, specularity factor figure=direct reflection figure/pow (NdotH, g (x))/
NdotL.NdotL: for the inner product of pixel normal vector with illumination vector;NdotH: for pixel normal vector and H (in the middle of illumination, sight line
Component) inner product;G (x): arbitrarily pixel x height optical index;Pow (NdotH, g (x)): g (x) power of NdotH.
S207, according to band flashlight images, utilizes non-linear optimization technique to calculate texturing parameter, including following (1)~
(3):
(1) all pixels to flashless image cluster (N is cluster number).
(2) according to the FOV parameter of camera, the illumination Lj of each pixel of band flashlight images, sight line Vj parameter are initialized.
(3) each class pixel Ci is processed successively according to following steps.
For step (3), it also includes (A)~(E) 6 submodules:
(A) a pixel P is randomly choosed from current class Ci;
(B) corresponding for read pixel point P texturing parameter is (in step S202~S206 according to flashless image initial
Obtain);
(C) rgb value of each pixel Pj of current class Ci, illumination Lj, sight line Vj are read;
(D) by the value of (B) and (C) respectively as the texturing initial parameter value of pixel P and known input data, profit
With non-linear optimization technique, recalculate the pinup picture parameter of pixel P, and as current class pinup picture parameter base.
(E) ratio of other pixels of current class Ci and pixel P is calculated successively, as the weight system of other pixels
Number, according to the pinup picture parameter base of current class, calculates the pinup picture parameter of other pixels.
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.