CN109325992A - Image drawing method and device calculate equipment and storage medium - Google Patents

Image drawing method and device calculate equipment and storage medium Download PDF

Info

Publication number
CN109325992A
CN109325992A CN201811223702.0A CN201811223702A CN109325992A CN 109325992 A CN109325992 A CN 109325992A CN 201811223702 A CN201811223702 A CN 201811223702A CN 109325992 A CN109325992 A CN 109325992A
Authority
CN
China
Prior art keywords
pixel
depth
value
projection
preset threshold
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201811223702.0A
Other languages
Chinese (zh)
Other versions
CN109325992B (en
Inventor
李侃
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Xishanju Shiyou Technology Co Ltd
Zhuhai Kingsoft Online Game Technology Co Ltd
Original Assignee
Chengdu Xishanju Shiyou Technology Co Ltd
Zhuhai Kingsoft Online Game Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Xishanju Shiyou Technology Co Ltd, Zhuhai Kingsoft Online Game Technology Co Ltd filed Critical Chengdu Xishanju Shiyou Technology Co Ltd
Priority to CN201811223702.0A priority Critical patent/CN109325992B/en
Publication of CN109325992A publication Critical patent/CN109325992A/en
Application granted granted Critical
Publication of CN109325992B publication Critical patent/CN109325992B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/08Volume rendering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/10Geometric effects
    • G06T15/20Perspective computation
    • G06T15/205Image-based rendering

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Graphics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Geometry (AREA)
  • Image Generation (AREA)
  • Apparatus For Radiation Diagnosis (AREA)

Abstract

This specification provides a kind of image drawing method and device, calculates equipment and storage medium, the method comprise the steps that obtaining the real depth to pixel in drawing image;The real depth and preset threshold are compared;First projection is carried out to the pixel that the real depth is less than preset threshold, obtains corresponding first Z value depth, Z value depth of the first Z value depth as the pixel;Second projection is carried out to the pixel that the real depth is greater than preset threshold, obtain corresponding 2nd Z value depth, Z value depth of the 2nd Z value depth as the pixel, the pixel that the real depth is greater than preset threshold are less than the nonlinearity in first projection in the nonlinearity of second projection;The pixel is drawn according to the Z value depth of the pixel.

Description

Image drawing method and device calculate equipment and storage medium
Technical field
This specification is related to image rendering technologies field, in particular to a kind of image drawing method and device calculate equipment And storage medium.
Background technique
3D rendering in, treat the pixel in drawing image projected to obtain along Z-direction it is corresponding with its real depth Z value depth, and the Z value depth for being tested pixel and current pixel point on same position is compared to determine whether to draw The tested pixel: the Z value depth of tested pixel is greater than the Z value depth of current pixel point, then without drafting, it is on the contrary then into Row is drawn.All pixels are depicted as corresponding image after completing.
The relationship of the real depth of pixel and Z value is linear in rectangular projection, but is not in perspective projection 's.Referring to Fig. 1, abscissa indicates the real depth of pixel, and ordinate indicates the pixel obtained after having an X-rayed coordinate conversion The Z value depth of point, this relationship is nonlinear in perspective projection.In the prior art using perspective projection to image slices vegetarian refreshments It is projected along Z-direction, obtains corresponding Z value depth.
From figure 1 it appears that the nonlinear degree of the real depth of pixel is related to the size of Z value, therefore, in depth Spending biggish place, there may be Z-Fighting phenomenons.When the depth of two pixels is all larger, and the depth of the two is more When close, the Z value of the two will be very close, when the Z value of the two reaches the precision lower limit of Z buffer, in Z buffer, and two The Z value of person will become completely the same.The result that will lead to depth test is unpredictable, and system can not judge the two pixels Which is preceding on earth, which is rear, thus it is shown that the phenomenon come is former and later two pictures staggeredly flashed.
Summary of the invention
In view of this, this specification embodiment provides a kind of image drawing method and device, calculates equipment and storage is situated between Matter, to solve technological deficiency existing in the prior art.
According to this specification embodiment in a first aspect, providing a kind of image drawing method, comprising:
The real depth to pixel in drawing image is obtained, the location information of each pixel passes through three-dimensional coordinate It indicates, the depth value of each pixel indicated by the value of the Z axis in three-dimensional coordinate;By the real depth and in advance If threshold value is compared;
The pixel for being less than preset threshold to the real depth carries out the first projection along Z-direction, and it is deep to obtain the first Z value Degree, Z value depth of the first Z value depth as the pixel;
The pixel for being greater than preset threshold to the real depth carries out the second projection along Z-direction, and it is deep to obtain the 2nd Z value Degree, Z value depth of the 2nd Z value depth as the pixel, the pixel that the real depth is greater than preset threshold exist The nonlinearity of second projection is less than the nonlinearity in first projection;
The pixel is drawn according to the Z value depth of the pixel.
Optionally, the pixel that preset threshold is less than to the real depth carries out the first projection along Z-direction, comprising:
To the real depth be less than preset threshold pixel along Z-direction using perspective projection along Z-direction into Row first projects.
Optionally, the pixel that preset threshold is greater than to the real depth carries out the second projection along Z-direction, comprising:
To the real depth be greater than preset threshold pixel along Z-direction using linear projection's method along Z-direction into Row second projects.
Optionally, the pixel that preset threshold is greater than to the real depth carries out the second projection along Z-direction further include:
To the real depth be greater than preset threshold pixel along Z-direction using back mapping method along Z-direction into Row second projects.
Optionally, the back mapping method includes:
According to the 2nd Z value depth, the 2nd Z value is made into inversion operation and realizes back mapping.
Optionally, the pixel is drawn according to the Z value depth of the pixel, comprising:
Judge wait draw the pixel for whether having drawing image on the position where pixel;
If no, directly drawing the pixel to be drawn;
If so, then by the Z value depth of pixel to be drawn compared with the Z value depth of the pixel of drawing image, if to The Z value depth for drawing pixel is bigger than the Z value depth of the pixel of drawing image, then without drawing;If pixel to be drawn The Z value depth of point is smaller than the Z value depth of the pixel of drawing image, then is drawn.
According to the second aspect of this specification embodiment, a kind of image plotting device is provided, comprising:
Pixel obtains module, is configured as obtaining the real depth to pixel in drawing image, each pixel The location information of point indicates that the depth value of each pixel passes through the value of the Z axis in three-dimensional coordinate by three-dimensional coordinate To indicate;
Depth comparison module is configured as the real depth and preset threshold being compared;
First projection module, the pixel for being configured as being less than the real depth preset threshold are carried out along Z-direction First projection, obtains the first Z value depth, Z value depth of the first Z value depth as the pixel;
Second projection module, the pixel for being configured as being greater than the real depth preset threshold are carried out along Z-direction Second projection, obtains the 2nd Z value depth, Z value depth of the 2nd Z value depth as the pixel, the real depth It is less than the nonlinearity in first projection in the nonlinearity of second projection greater than the pixel of preset threshold;
Image Rendering module is configured as drawing the pixel according to the Z value depth of the pixel.
Optionally, the pixel that first projection module is less than preset threshold to the real depth is adopted along Z-direction The first projection is carried out along Z-direction with perspective projection.
Optionally, the pixel that second projection module is greater than preset threshold to the real depth is adopted along Z-direction The second projection is carried out along Z-direction with linear projection's method.
Optionally, the pixel that second projection module is greater than preset threshold to the real depth is adopted along Z-direction The second projection is carried out along Z-direction with back mapping method.
Optionally, the back mapping method includes:
According to the 2nd Z value depth, the 2nd Z value is made into inversion operation and realizes back mapping.
Optionally, described image drafting module includes:
Judging submodule is configured as judging wait draw the pixel for whether having drawing image on the position where pixel Point;
Rendering submodule: it is configured as not having the feelings of the pixel of drawing image on the position where pixel wait draw Under condition, the pixel to be drawn directly is drawn;Wait draw the pixel for having drawing image on the position where pixel In the case where, by the Z value depth of pixel to be drawn compared with the Z value depth of the pixel of drawing image, if picture to be drawn The Z value depth of vegetarian refreshments is bigger than the Z value depth of the pixel of drawing image, then without drawing;If the Z value of pixel to be drawn Depth is smaller than the Z value depth of the pixel of drawing image, then is drawn.
According to the third aspect of this specification embodiment, a kind of calculating equipment is provided, including memory, processor and deposit The computer instruction that can be run on a memory and on a processor is stored up, the processor is realized described when executing described instruction The step of image drawing method.
According to the fourth aspect of this specification embodiment, a kind of computer readable storage medium is provided, is stored with meter Calculation machine instruction, when described instruction is executed by processor the step of image drawing method described in realization.
In this specification embodiment, the image slices vegetarian refreshments for being less than preset threshold to real depth is had an X-rayed along Z-direction Projection obtains the first Z value depth, then carries out second along Z-direction to the image slices vegetarian refreshments that real depth is greater than preset threshold and throw Shadow, obtains the 2nd Z value depth, and the second projection includes two methods of linear projection or back mapping.Real depth is greater than default threshold The pixel point image of value projects compared in the first projection second, the real depth of the 2nd obtained Z value depth and pixel Nonlinearity it is lower, Z value precision is higher, so that solving in existing perspective projection technology real depth is greater than preset threshold Multiple images pixel make system that can not judge the sky between multiple pixels in the 2nd Z value depth that perspective projection obtains Between positional relationship, and the problem of show the picture for being staggered front to back flashing, improve the precision of Image Rendering.
Detailed description of the invention
Fig. 1 is to show the schematic diagram of non-linear relation in the perspective projection provided according to this specification background technique;
Fig. 2 is to show the structural block diagram of the calculating equipment 200 according to one embodiment of this specification;
Fig. 3 is to show the flow chart of the image drawing method according to one embodiment of this specification;
Fig. 4 is to show to project showing for the Image Rendering for using linear projection's method according to the second of one embodiment of this specification It is intended to;
Fig. 5 is to show to project showing for the Image Rendering for using back mapping method according to the second of one embodiment of this specification It is intended to;
Fig. 6 is the schematic diagram for drawing pixel to be drawn shown according to one embodiment of this specification;
Fig. 7 is to show the structural schematic diagram of the image plotting device according to one embodiment of this specification.
Specific embodiment
Many details are explained in the following description in order to fully understand this specification.But this specification energy Enough to be implemented with being much different from other way described herein, those skilled in the art can be without prejudice to this specification intension In the case where do similar popularization, therefore this specification is not limited by following public specific implementation.
Fig. 2 is to show the structural block diagram of the calculating equipment 200 according to one embodiment of this specification.The calculating equipment 100 Component include but is not limited to memory 210 and processor 220.Processor 220 is connected with memory 210 by bus 230, Database 250 is used to save the real depth data to pixel in drawing image.
Calculating equipment 200 further includes access device 240, access device 240 enable calculate equipment 200 via one or Multiple networks 260 communicate.The example of these networks includes public switched telephone network (PSTN), local area network (LAN), wide area network (WAN), the combination of the communication network of personal area network (PAN) or such as internet.Access device 140 may include wired or wireless One or more of any kind of network interface (for example, network interface card (NIC)), such as IEEE802.11 wireless local area Net (WLAN) wireless interface, worldwide interoperability for microwave accesses (Wi-MAX) interface, Ethernet interface, universal serial bus (USB) connect Mouth, cellular network interface, blue tooth interface, near-field communication (NFC) interface, etc..
In one embodiment of this specification, calculate in above-mentioned and Fig. 2 of equipment 200 that unshowned other component can also be with It is connected to each other, such as passes through bus.It should be appreciated that calculating device structure block diagram shown in Fig. 2 is merely for the sake of exemplary mesh , rather than the limitation to this specification range.Those skilled in the art can according to need, and increase or replace other component.
Calculating equipment 200 can be any kind of static or mobile computing device, including mobile computer or mobile meter Calculate equipment (for example, tablet computer, personal digital assistant, laptop computer, notebook computer, net book etc.), movement Phone (for example, smart phone), wearable calculating equipment (for example, smartwatch, intelligent glasses etc.) or other kinds of shifting Dynamic equipment, or the static calculating equipment of such as desktop computer or PC.Calculating equipment 200 can also be mobile or state type Server.
Wherein, processor 220 can execute the step in method shown in Fig. 3.Fig. 3 is to show according to this specification one in fact The process for applying the image drawing method of example is schematically schemed, including step 302 is to step 310.
Step 302: obtaining the real depth to pixel in drawing image, the location information of each pixel passes through Three-dimensional coordinate indicates that the depth value of each pixel indicated by the value of the Z axis in three-dimensional coordinate.
In one embodiment of this specification, the location information of each pixel is indicated by three-dimensional coordinate, Mei Gesuo The depth value for stating pixel is indicated by the value of the Z axis in three-dimensional coordinate.There is one to pixel each in drawing image Real depth indicates that the pixel distance of Z-direction apart from screen in three-dimensional system of coordinate, such as a pixel depth are 400, indicate that the pixel distance of Z-direction apart from screen in three-dimensional system of coordinate is 400.
Step 304: the real depth and preset threshold are compared.
In one embodiment of this specification, it is previously provided with a preset threshold, for true with the pixel that gets Depth is compared, such as preset threshold is set as 500, and pixel is divided into real depth less than 500 by the size of real depth Pixel and real depth be greater than 500 pixel, for different projecting methods to be respectively adopted to two kinds of pixels.
Step 306: the pixel for being less than preset threshold to the real depth carries out the first projection along Z-direction, obtains First Z value depth, Z value depth of the first Z value depth as the pixel.
In one embodiment of this specification, the pixel for being less than preset threshold to the real depth carries out the along Z-direction One projection, comprising:
To the real depth be less than preset threshold pixel along Z-direction using perspective projection along Z-direction into Row first projects.
The first Z value depth that the pixel that the real depth is less than preset threshold is obtained by perspective projection with really The nonlinearity of depth is low, is greater than Z value precision lower limit in caching, Image Rendering is used directly for, for example, to drawing image The real depth 400 of middle pixel is less than preset threshold 500, then uses perspective projection, and the first obtained Z value depth is 0.88, it is greater than Z value precision lower limit, may be used as the Z value depth of the pixel.
Step 308: the pixel for being greater than preset threshold to the real depth carries out the second projection along Z-direction, obtains 2nd Z value depth, Z value depth of the 2nd Z value depth as the pixel, the real depth are greater than preset threshold Pixel is less than the nonlinearity in first projection in the nonlinearity of second projection.
In one embodiment of this specification, the pixel for being greater than preset threshold to the real depth carries out the along Z-direction Two projections, comprising:
To the real depth be greater than preset threshold pixel along Z-direction using linear projection's method along Z-direction into Row second projects.
The 2nd Z value depth obtained with process perspective projection is on the contrary, the real depth is greater than the pixel of preset threshold The 2nd Z value depth obtained by linear projection's method is low with the nonlinearity of real depth, is greater than under Z value caching in caching Limit, can be used for Image Rendering, for example, the real depth 800 to pixel in drawing image is greater than preset threshold 500, use The 2nd Z value depth that linear projection obtains is 0.8, is greater than Z value precision lower limit, may be used as the Z value depth of the pixel.
In one embodiment of this specification, the pixel for being greater than preset threshold to the real depth carries out the along Z-direction Two projections further include:
To the real depth be greater than preset threshold pixel along Z-direction using back mapping method along Z-direction into Row second projects.
The 2nd Z value depth obtained with process perspective projection is on the contrary, the real depth is greater than the pixel of preset threshold 500 Point is low with the nonlinearity of real depth by the 2nd Z value depth that back mapping obtains, under being greater than Z value precision in caching Limit, may be used as the Z value depth of the pixel.
In one embodiment of this specification, the threshold value is determined by drawing precision, draws required precision height, and threshold value is smaller, Required precision is low, and threshold value is bigger.
In one embodiment of this specification, the back mapping method includes:
According to the 2nd Z value depth, the 2nd Z value is made into inversion operation and realizes that back mapping is carried out along Z-direction Second projection.
For example, drop shadow spread is 1000, it is 500 according to precision threshold value is drawn, real depth is greater than 500 pixel The 2nd Z value depth is obtained using back mapping, the back mapping passes through the obtained maximum pixel of depth value and maps to obtain Z value be 0, the Z value that the smallest pixel of depth value maps be 1, the Z value that the bigger pixel of depth value obtains is smaller.
Step 310: the pixel is drawn according to the Z value depth of the pixel.
In one embodiment of this specification, the pixel is drawn according to the Z value depth of the pixel, comprising:
Judge wait draw the pixel for whether having drawing image on the position where pixel;
If no, directly drawing the pixel to be drawn;
If so, then by the Z value depth of pixel to be drawn compared with the Z value depth of the pixel of drawing image, if to The Z value depth for drawing pixel is bigger than the Z value depth of the pixel of drawing image, then without drawing;If pixel to be drawn The Z value depth of point is smaller than the Z value depth of the pixel of drawing image, then is drawn.
For example, for, wait draw the position where pixel, judge on screen it is rendered have Z value depth as 0.7 picture Vegetarian refreshments, if the Z value depth of pixel to be drawn is 0.6, less than 0.7, then system, which is drawn, is somebody's turn to do pixel to be drawn;If picture to be drawn The Z value depth of vegetarian refreshments is 0.8, is greater than 0.7, then system does not draw the pixel to be drawn.
By above-mentioned image drawing method, real depth is greater than the picture of preset threshold to effective solution in the prior art Vegetarian refreshments, because reaching Z value precision lower limit in caching, is buffered in Z value depth that perspective projection obtains as the same Z value depth, So as to cause system it can not judge the spatial relation between pixel, and the picture that flashing is staggered front to back at display is asked Topic, improves the precision of Image Rendering.
Fig. 4 is to show the perspective view that linear projection's method is used according to the second of one embodiment of this specification the projection.
In one embodiment of this specification, obtain real depth to pixel in drawing image, each pixel it is true Depth is any one value between 0 to 1000, for example, the real depth of a certain pixel is 400.
In one embodiment of this specification, setting preset threshold is 500, and by the often real depth of pixel to be drawn and in advance If threshold value 500 compares, so that pixel to be drawn is divided into the pixel and real depth that real depth is less than preset threshold 500 Greater than the pixel of preset threshold 500.
In one embodiment of this specification, there is different real depths, the projecting method of use for pixel to be drawn Are as follows:
Wherein, abscissa represents the real depth of pixel to be drawn in projecting method functional arrangement, and ordinate is represented wait draw The Z value depth that pixel processed obtains after projection.
In one embodiment of this specification, the pixel for being less than preset threshold to the real depth carries out the along Z-direction One projection is less than preset threshold 500 for example, the real depth to pixel C in drawing image is 300, then uses perspective projection Method projects pixel C along Z-direction, and the first obtained Z value depth is 0.8, is greater than Z value precision lower limit, may be used as The Z value depth of the pixel;
In one embodiment of this specification, the pixel for being greater than preset threshold to the real depth carries out the along Z-direction Two projections are greater than preset threshold for example, the real depth to pixel A, B other in drawing image is respectively 600 and 650 500, then linear projection's method is used, the 2nd obtained Z value depth is respectively 0.6 and 0.65, the obtained with process perspective projection Two Z value depth are different, are all larger than Z value precision lower limit by the 2nd Z value depth that linear projection obtains, may be used as two pixels The Z value depth of point.
In one embodiment of this specification, the pixel is drawn according to the Z value depth of the pixel, is first judged wait draw Whether there is the pixel of drawing image on position where pixel, if not having, directly draws the pixel to be drawn;
If so, then by the Z value depth of pixel to be drawn compared with the Z value depth of the pixel of drawing image, if to The Z value depth for drawing pixel is bigger than the Z value depth of the pixel of drawing image, then without drawing, for example, if for screen Wait draw the position where pixel on curtain, judge it is rendered have Z value depth as 0.7 pixel, if pixel to be drawn Z value depth be 0.6, less than 0.7, then draw should pixel be drawn for system;If the Z value depth of pixel to be drawn is 0.8, Greater than 0.7, then system does not draw the pixel to be drawn.
By above-mentioned image drawing method, real depth is greater than the picture of preset threshold to effective solution in the prior art Vegetarian refreshments, because reaching Z value precision lower limit in caching, is buffered in Z value depth that perspective projection obtains as the same Z value depth, So as to cause system it can not judge the spatial relation between pixel, and the picture that flashing is staggered front to back at display is asked Topic, improves the precision of Image Rendering.
Fig. 5 is to show the perspective view that back mapping method is used according to the second of one embodiment of this specification the projection.
In one embodiment of this specification, obtain real depth to pixel in drawing image, each pixel it is true Depth is any one value between 0 to 1000, for example, the real depth of a certain pixel is 400.
In one embodiment of this specification, setting preset threshold is 500, and by by the real depth of often pixel to be drawn Compared with preset threshold 500, so that pixel to be drawn is divided into real depth less than the pixel of preset threshold 500 and true Depth is greater than the pixel of preset threshold 500.
In one embodiment of this specification, there is different real depths, the projecting method of use for pixel to be drawn Are as follows:
Wherein, abscissa represents the real depth of pixel to be drawn in projecting method functional arrangement, and ordinate is represented wait draw The Z value depth that pixel processed obtains after projection.
In one embodiment of this specification, the pixel for being less than preset threshold to the real depth carries out the along Z-direction One projection is less than preset threshold 500 for example, the real depth to pixel C in drawing image is 300, then uses perspective projection Method projects pixel C along Z-direction, and the first obtained Z value depth is 0.8, is greater than Z value precision lower limit, may be used as The Z value depth of the pixel;
In one embodiment of this specification, the pixel for being greater than preset threshold to the real depth carries out the along Z-direction Two projections, for example, the real depth to pixel A, B other in drawing image is all larger than preset threshold 500, then using reversed Reflection method, the 2nd obtained Z value depth is respectively 0.46 and 0.45, different from the 2nd Z value depth obtained by perspective projection, It is all larger than Z value precision lower limit by the 2nd Z value depth that back mapping obtains, may be used as the Z value depth of two pixels.
In one embodiment of this specification, the pixel is drawn according to the Z value depth of the pixel, is first judged wait draw Whether there is the pixel of drawing image on position where pixel, if not having, directly draws the pixel to be drawn;
If so, then by the Z value depth of pixel to be drawn compared with the Z value depth of the pixel of drawing image, if to The Z value depth for drawing pixel is bigger than the Z value depth of the pixel of drawing image, then without drawing, for example, if for screen Wait draw the position where pixel on curtain, judge it is rendered have Z value depth as 0.7 pixel, if pixel to be drawn Z value depth be 0.6, less than 0.7, then draw should pixel be drawn for system;If the Z value depth of pixel to be drawn is 0.8, Greater than 0.7, then system does not draw the pixel to be drawn.
By above-mentioned image drawing method, real depth is greater than the picture of preset threshold to effective solution in the prior art Vegetarian refreshments, because reaching Z value precision lower limit in caching, is buffered in Z value depth that perspective projection obtains as the same Z value depth, So as to cause system it can not judge the spatial relation between pixel, and the picture that flashing is staggered front to back at display is asked Topic, improves the precision of Image Rendering.
Fig. 6 is the schematic diagram for drawing pixel to be drawn shown according to one embodiment of this specification.
In one embodiment of this specification, the location information of each pixel is indicated by three-dimensional coordinate x-y-z, Mei Gesuo The depth value for stating pixel is indicated by the value of the Z axis in three-dimensional coordinate.Screen plane is x-o-y plane, in three-dimensional coordinate The B of drawing image in have the pixel B2 that pixel B1 and Z the value depth that Z value depth is 0.5 is 0.7.Image A is three-dimensional sits In mark to drawing image, gray area indicate to drawing image A and drawing image B along the region that Z-direction is overlapped.
In one embodiment of this specification, the real depth to pixel in drawing image A is obtained, pixel includes wait draw Pixel in image A in the pixel and the pixel outside gray area, such as drawing image A of gray area outside gray area The real depth of A1 is 300, and the real depth to the pixel A2 of gray area in drawing image A is 600, to drawing image A The real depth of the pixel A3 of interior gray area is 650.
In one embodiment of this specification, setting preset threshold be 500, by the real depth of pixel in drawing image with Preset threshold 500 is made comparisons, and the pixel to be drawn is divided into pixel of the real depth less than preset threshold and true depth Degree is greater than the pixel of preset threshold.
In one embodiment of this specification, first is carried out along Z-direction to the pixel that real depth is less than preset threshold and is thrown Shadow obtains for example, the pixel A1 to be drawn for being less than preset threshold 500 to real depth uses perspective projection along Z-direction The first Z value depth be 0.8, be greater than Z value precision lower limit, may be used as the Z value depth of pixel A1 to be drawn.
In one embodiment of this specification, second is carried out along Z-direction to the pixel that real depth is greater than preset threshold and is thrown Shadow, for example, pixel A2, A3 to be drawn for being greater than preset threshold 500 to real depth use linear projection's method along Z-direction, Obtaining corresponding 2nd Z value depth is respectively 0.6 and 0.65, the Z value depth as pixel A2, A3 to be drawn.
In one embodiment of this specification, pixel is drawn according to the Z value depth of the pixel, first judges pixel to be drawn Whether there is the pixel of drawing image on position where point, if not having, directly draws the pixel to be drawn;
If so, then by the Z value depth of pixel to be drawn compared with the Z value depth of the pixel of drawing image, if to The Z value depth for drawing pixel is bigger than the Z value depth of the pixel of drawing image, then without drawing.
For example, there is no the pixel of drawing image B on position where pixel A1 to be drawn, then directly draw wait draw Pixel A1 processed;
There is the pixel B2 of drawing image B on position where pixel A2 to be drawn, then compares pixel to be drawn A2 and the size for having drawn pixel B2Z value depth, the Z value depth of pixel A2 to be drawn is less than for 0.6 has drawn pixel The Z value depth 0.7 of B2 is then treated drafting pixel A2 and is drawn, and pixel B2 has been drawn in covering;
Have drawing image B pixel B1 on position where pixel A3 to be drawn, compare pixel A3 to be drawn and The size of pixel B1Z value depth is drawn, the Z value depth of pixel A3 to be drawn is greater than for 0.65 has drawn pixel B1's Z value depth 0.5 is then treated and draws pixel A3 without drawing.
In one embodiment of this specification, second is carried out along Z-direction to the pixel that real depth is greater than preset threshold and is thrown Shadow, for example, pixel A2, A3 to be drawn for being greater than preset threshold 500 to real depth use back mapping method along Z-direction, Obtain corresponding 2nd Z value depth difference 0.4 and 0.6, the Z value depth as pixel A2, A3 to be drawn.
In one embodiment of this specification, pixel is drawn according to the Z value depth of the pixel, first judges pixel to be drawn Whether there is the pixel of drawing image on position where point, if not having, directly draws the pixel to be drawn;
If so, then by the Z value depth of pixel to be drawn compared with the Z value depth of the pixel of drawing image, if to The Z value depth for drawing pixel is bigger than the Z value depth of the pixel of drawing image, then without drawing.
For example, there is no the pixel of drawing image B on position where pixel A1 to be drawn, then directly draw wait draw Pixel A1 processed;
There is the pixel B2 of drawing image B on position where pixel A2 to be drawn, then compares pixel to be drawn A2 and the size for having drawn pixel B2Z value depth, the Z value depth of pixel A2 to be drawn is less than for 0.4 has drawn pixel The Z value depth 0.7 of B2 is then treated drafting pixel A2 and is drawn, and pixel B2 has been drawn in covering;
Have drawing image B pixel B1 on position where pixel A3 to be drawn, compare pixel A3 to be drawn and The size of pixel B1Z value depth is drawn, the Z value depth of pixel A3 to be drawn is 0.6 greater than the Z for having drawn pixel B1 It is worth depth 0.5, then treats and draw pixel A3 without drawing.
By above-mentioned image drawing method, real depth is greater than the picture of preset threshold to effective solution in the prior art Vegetarian refreshments, because reaching Z value precision lower limit in caching, is buffered in Z value depth that perspective projection obtains as the same Z value depth, So as to cause system it can not judge the spatial relation between pixel, and the picture that flashing is staggered front to back at display is asked Topic, improves the precision of Image Rendering.
It is adapted with above method embodiment, this specification additionally provides image plotting device embodiment.Fig. 7 is to show According to the module map of the image plotting device of one embodiment of this specification.As described in Figure 7, which includes:
Pixel obtains module 710, is configured as obtaining the real depth to pixel in drawing image;
Depth comparison module 720 is configured as the real depth and preset threshold being compared;
First projection module 730, the pixel for being configured as being less than the real depth preset threshold carry out the first throwing Shadow obtains the first Z value depth, Z value depth of the first Z value depth as the pixel;
Second projection module 740, the pixel for being configured as being greater than the real depth preset threshold carry out the second throwing Shadow, obtains the 2nd Z value depth, Z value depth of the 2nd Z value depth as the pixel, and the real depth is greater than pre- If the pixel of threshold value is less than the nonlinearity in the first projection in the nonlinearity of second projection;
Image Rendering module 750 is configured as drawing the pixel according to the Z value depth of the pixel.
In an optional embodiment, first projection module is less than the pixel of preset threshold to the real depth The first projection is carried out along Z-direction using perspective projection along Z-direction.
In an optional embodiment, second projection module is greater than the pixel of preset threshold to the real depth The second projection is carried out along Z-direction using linear projection's method along Z-direction.
In an optional embodiment, second projection module is greater than the pixel of preset threshold to the real depth The second projection is carried out along Z-direction using back mapping method along Z-direction.
In an optional embodiment, the back mapping method includes:
According to the 2nd Z value depth, the 2nd Z value is made into inversion operation and realizes back mapping.
In an optional embodiment, described image drafting module includes:
Judge wait draw the pixel for whether having drawing image on the screen position where pixel;
Judging submodule: it is configured as judging wait draw the pixel for whether having drawing image on the position where pixel Point;
Rendering submodule: it is configured as not having the feelings of the pixel of drawing image on the position where pixel wait draw Under condition, the pixel to be drawn directly is drawn;Wait draw the pixel for having drawing image on the position where pixel In the case where, by the Z value depth of pixel to be drawn compared with the Z value depth of the pixel of drawing image, if picture to be drawn The Z value depth of vegetarian refreshments is bigger than the Z value depth of the pixel of drawing image, then without drawing;If the Z value of pixel to be drawn Depth is smaller than the Z value depth of the pixel of drawing image, then is drawn.
The function of each unit and the realization process of effect are specifically detailed in the above method and correspond to step in above-mentioned apparatus Realization process, details are not described herein.
For device embodiment, since it corresponds essentially to embodiment of the method, so related place is referring to method reality Apply the part explanation of example.The apparatus embodiments described above are merely exemplary, wherein described be used as separation unit The unit of explanation may or may not be physically separated, and component shown as a unit can be or can also be with It is not physical unit, it can it is in one place, or may be distributed over multiple network units.It can be according to actual The purpose for needing to select some or all of the modules therein to realize this specification scheme.Those of ordinary skill in the art are not In the case where making the creative labor, it can understand and implement.
One embodiment of this specification also provides a kind of calculating equipment, including memory, processor and storage are on a memory And the computer instruction that can be run on a processor, the processor realize above-mentioned image drawing method when executing described instruction The step of.
One embodiment of this specification also provides a kind of computer readable storage medium, is stored with computer instruction, described The step of instruction realizes image drawing method as previously described when being executed by processor.
A kind of exemplary scheme of above-mentioned computer readable storage medium for the present embodiment.It should be noted that this is deposited The technical solution of storage media and the technical solution of above-mentioned image drawing method belong to same design, the technical solution of storage medium The detail content being not described in detail may refer to the description of the technical solution of above-mentioned image drawing method.
The computer instruction includes computer program code, the computer program code can for source code form, Object identification code form, executable file or certain intermediate forms etc..The computer-readable medium may include: that can carry institute State any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic disk, CD, the computer storage of computer program code Device, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), Electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that the computer-readable medium include it is interior Increase and decrease appropriate can be carried out according to the requirement made laws in jurisdiction with patent practice by holding, such as in certain jurisdictions of courts Area does not include electric carrier signal and telecommunication signal according to legislation and patent practice, computer-readable medium.
It should be noted that for the various method embodiments described above, describing for simplicity, therefore, it is stated as a series of Combination of actions, but those skilled in the art should understand that, this specification is not limited by the described action sequence, because For according to this specification, certain steps can use other sequences or carry out simultaneously.Secondly, those skilled in the art also should Know, the embodiments described in the specification are all preferred embodiments, and related actions and modules might not all be this Necessary to specification.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment Point, it may refer to the associated description of other embodiments.
This specification preferred embodiment disclosed above is only intended to help to illustrate this specification.Alternative embodiment is not All details of detailed descriptionthe, do not limit the invention to the specific embodiments described.Obviously, according in this specification Hold, can make many modifications and variations.These embodiments are chosen and specifically described to this specification, is in order to preferably explain this theory The principle and practical application of bright book, so that skilled artisan be enable to better understand and utilize this specification.This Specification is limited only by the claims and their full scope and equivalents.

Claims (14)

1. a kind of image drawing method, comprising:
The real depth to pixel in drawing image is obtained, the location information of each pixel is by three-dimensional coordinate come table Show, the depth value of each pixel is indicated by the value of the Z axis in three-dimensional coordinate;
The real depth and preset threshold are compared;
The pixel for being less than preset threshold to the real depth carries out the first projection along Z-direction, obtains the first Z value depth, Z value depth of the first Z value depth as the pixel;
The pixel for being greater than preset threshold to the real depth carries out the second projection along Z-direction, obtains the 2nd Z value depth, Z value depth of the 2nd Z value depth as the pixel, the real depth are greater than the pixel of preset threshold described The nonlinearity of second projection is less than the nonlinearity in first projection;
The pixel is drawn according to the Z value depth of the pixel.
2. the method according to claim 1, wherein being less than the pixel edge of preset threshold to the real depth Z-direction carries out the first projection, comprising:
The pixel for being less than preset threshold to the real depth carries out the along Z-direction using perspective projection along Z-direction One projection.
3. the method according to claim 1, wherein being greater than the pixel edge of preset threshold to the real depth Z-direction carries out the second projection, comprising:
The pixel for being greater than preset threshold to the real depth carries out the along Z-direction using linear projection's method along Z-direction Two projections.
4. the method according to claim 1, wherein being greater than the pixel edge of preset threshold to the real depth Z-direction carries out the second projection further include:
The pixel for being greater than preset threshold to the real depth uses back mapping method along Z-direction.
5. according to the method described in claim 4, it is characterized in that, the back mapping method includes:
According to the 2nd Z value depth, the 2nd Z value is made into inversion operation and realizes back mapping.
6. the method according to claim 1, wherein drawing the pixel according to the Z value depth of the pixel Point, comprising:
Judge wait draw the pixel for whether having drawing image on the position where pixel;
If no, directly drawing the pixel to be drawn;
If so, then by the Z value depth of pixel to be drawn compared with the Z value depth of the pixel of drawing image, if wait draw The Z value depth of pixel is bigger than the Z value depth of the pixel of drawing image, then without drawing;If the Z of pixel to be drawn It is smaller than the Z value depth of the pixel of drawing image to be worth depth, then is drawn.
7. a kind of image plotting device, comprising:
Pixel obtains module, is configured as obtaining the real depth to pixel in drawing image, each pixel Location information indicates that the depth value of each pixel is by the value of the Z axis in three-dimensional coordinate come table by three-dimensional coordinate Show;
Depth comparison module is configured as the real depth and preset threshold being compared;
First projection module, the pixel for being configured as being less than the real depth preset threshold carry out first along Z-direction Projection, obtains the first Z value depth, Z value depth of the first Z value depth as the pixel;
Second projection module, the pixel for being configured as being greater than the real depth preset threshold carry out second along Z-direction Projection, obtains the 2nd Z value depth, Z value depth of the 2nd Z value depth as the pixel, the real depth is greater than The pixel of preset threshold is less than the nonlinearity in first projection in the nonlinearity of second projection;
Image Rendering module is configured as drawing the pixel according to the Z value depth of the pixel.
8. device according to claim 7, which is characterized in that first projection module is less than the real depth pre- If the pixel of threshold value carries out the first projection along Z-direction using perspective projection along Z-direction.
9. device according to claim 7, which is characterized in that second projection module is greater than the real depth pre- If the pixel of threshold value carries out the second projection along Z-direction using linear projection's method along Z-direction.
10. device according to claim 7, which is characterized in that second projection module is greater than the real depth The pixel of preset threshold carries out the second projection along Z-direction using back mapping method along Z-direction.
11. according to the method described in claim 10, it is characterized in that, the back mapping method includes:
According to the 2nd Z value depth, the 2nd Z value is made into inversion operation and realizes back mapping.
12. device according to claim 7, which is characterized in that described image drafting module includes:
Judging submodule: it is configured as judging wait draw the pixel for whether having drawing image on the position where pixel;
Rendering submodule: it is configured as not having the case where pixel of drawing image on the position where pixel wait draw Under, directly draw the pixel to be drawn;Wait draw the pixel for having drawing image on the position where pixel In the case of, by the Z value depth of pixel to be drawn compared with the Z value depth of the pixel of drawing image, if pixel to be drawn The Z value depth of point is bigger than the Z value depth of the pixel of drawing image, then without drawing;If the Z value of pixel to be drawn is deep Degree is smaller than the Z value depth of the pixel of drawing image, then is drawn.
13. a kind of calculating equipment including memory, processor and stores the calculating that can be run on a memory and on a processor Machine instruction, which is characterized in that the processor realizes claim 1 to 6 any one the method when executing described instruction Step.
14. a kind of computer readable storage medium, is stored with computer instruction, which realizes right when being executed by processor It is required that the step of 1 to 6 described in any item methods.
CN201811223702.0A 2018-10-19 2018-10-19 Image drawing method and device, computing device and storage medium Active CN109325992B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811223702.0A CN109325992B (en) 2018-10-19 2018-10-19 Image drawing method and device, computing device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811223702.0A CN109325992B (en) 2018-10-19 2018-10-19 Image drawing method and device, computing device and storage medium

Publications (2)

Publication Number Publication Date
CN109325992A true CN109325992A (en) 2019-02-12
CN109325992B CN109325992B (en) 2023-07-04

Family

ID=65262977

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811223702.0A Active CN109325992B (en) 2018-10-19 2018-10-19 Image drawing method and device, computing device and storage medium

Country Status (1)

Country Link
CN (1) CN109325992B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001160153A (en) * 1999-12-03 2001-06-12 Namco Ltd Image generation system and information storage medium
CN1830007A (en) * 2003-07-30 2006-09-06 皇家飞利浦电子股份有限公司 System for adaptive resampling in texture mapping
CN101231754A (en) * 2008-02-03 2008-07-30 四川虹微技术有限公司 Multi-visual angle video image depth detecting method and depth estimating method
CN102163324A (en) * 2010-03-26 2011-08-24 微软公司 Deep image de-aliasing technique
US20120299910A1 (en) * 2011-05-25 2012-11-29 Via Technologies, Inc. Z-culling method, three-dimensional graphics processing method and apparatus threrof
CN102959945A (en) * 2010-06-29 2013-03-06 皇家飞利浦电子股份有限公司 Method and system for producing a virtual output image from data obtained by an array of image capturing devices
CN104899924A (en) * 2015-06-16 2015-09-09 桂林电子科技大学 Linear projection depth estimating method based on frog-leaping algorithm
CN105051790A (en) * 2013-03-25 2015-11-11 株式会社吉奥技术研究所 Three-dimensional map display system
US20170019653A1 (en) * 2014-04-08 2017-01-19 Sun Yat-Sen University Non-feature extraction-based dense sfm three-dimensional reconstruction method
CN106709865A (en) * 2015-11-13 2017-05-24 杭州海康威视数字技术股份有限公司 Depth image synthetic method and device
CN107274476A (en) * 2017-08-16 2017-10-20 城市生活(北京)资讯有限公司 The generation method and device of a kind of echo

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001160153A (en) * 1999-12-03 2001-06-12 Namco Ltd Image generation system and information storage medium
CN1830007A (en) * 2003-07-30 2006-09-06 皇家飞利浦电子股份有限公司 System for adaptive resampling in texture mapping
CN101231754A (en) * 2008-02-03 2008-07-30 四川虹微技术有限公司 Multi-visual angle video image depth detecting method and depth estimating method
CN102163324A (en) * 2010-03-26 2011-08-24 微软公司 Deep image de-aliasing technique
CN102959945A (en) * 2010-06-29 2013-03-06 皇家飞利浦电子股份有限公司 Method and system for producing a virtual output image from data obtained by an array of image capturing devices
US20120299910A1 (en) * 2011-05-25 2012-11-29 Via Technologies, Inc. Z-culling method, three-dimensional graphics processing method and apparatus threrof
CN105051790A (en) * 2013-03-25 2015-11-11 株式会社吉奥技术研究所 Three-dimensional map display system
US20170019653A1 (en) * 2014-04-08 2017-01-19 Sun Yat-Sen University Non-feature extraction-based dense sfm three-dimensional reconstruction method
CN104899924A (en) * 2015-06-16 2015-09-09 桂林电子科技大学 Linear projection depth estimating method based on frog-leaping algorithm
CN106709865A (en) * 2015-11-13 2017-05-24 杭州海康威视数字技术股份有限公司 Depth image synthetic method and device
CN107274476A (en) * 2017-08-16 2017-10-20 城市生活(北京)资讯有限公司 The generation method and device of a kind of echo

Also Published As

Publication number Publication date
CN109325992B (en) 2023-07-04

Similar Documents

Publication Publication Date Title
CN109191514B (en) Method and apparatus for generating a depth detection model
CN102682446B (en) Adaptive combined two-sided filter is used to generate equipment and the method for dense depth map
CN110379020B (en) Laser point cloud coloring method and device based on generation countermeasure network
CN109472264B (en) Method and apparatus for generating an object detection model
CN109308681A (en) Image processing method and device
CN109344752B (en) Method and apparatus for processing mouth image
CN107622504B (en) Method and device for processing pictures
KR102145220B1 (en) Method and apparatus for convert two-dimensional image to three-dimensional image utilizing deep learning
CN105874506A (en) Image blur with preservation of detail
WO2020082830A1 (en) Method and apparatus for processing images
CN115423923A (en) Model rendering method and device
CN110599532A (en) Depth estimation model optimization and depth estimation processing method and device for image
CN115115611A (en) Vehicle damage identification method and device, electronic equipment and storage medium
CN109829963A (en) A kind of image drawing method and device calculate equipment and storage medium
CN108848365B (en) A kind of reorientation stereo image quality evaluation method
CN109445569A (en) Information processing method, device, equipment and readable storage medium storing program for executing based on AR
CN108921792A (en) Method and apparatus for handling picture
CN109325992A (en) Image drawing method and device calculate equipment and storage medium
CN112132871A (en) Visual feature point tracking method and device based on feature optical flow information, storage medium and terminal
CN110363733A (en) A kind of mixed image generation method and device
CN110782390A (en) Image correction processing method and device and electronic equipment
EP4283566A2 (en) Single image 3d photography with soft-layering and depth-aware inpainting
CN110288691A (en) Render method, apparatus, electronic equipment and the computer readable storage medium of image
CN104751454A (en) Method and device for determining figure outline in image
CN114170068A (en) Image special effect generation method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 519000 Room 102, 202, 302 and 402, No. 325, Qiandao Ring Road, Tangjiawan Town, high tech Zone, Zhuhai City, Guangdong Province, Room 102 and 202, No. 327 and Room 302, No. 329

Applicant after: Zhuhai Jinshan Digital Network Technology Co.,Ltd.

Applicant after: CHENGDU XISHANJU SHIYOU TECHNOLOGY Co.,Ltd.

Address before: 519000 Room 102, 202, 302 and 402, No. 325, Qiandao Ring Road, Tangjiawan Town, high tech Zone, Zhuhai City, Guangdong Province, Room 102 and 202, No. 327 and Room 302, No. 329

Applicant before: ZHUHAI KINGSOFT ONLINE GAME TECHNOLOGY Co.,Ltd.

Applicant before: CHENGDU XISHANJU SHIYOU TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant