CN109523473A - Image processing method, device, storage medium and electronic device - Google Patents

Image processing method, device, storage medium and electronic device Download PDF

Info

Publication number
CN109523473A
CN109523473A CN201811204054.4A CN201811204054A CN109523473A CN 109523473 A CN109523473 A CN 109523473A CN 201811204054 A CN201811204054 A CN 201811204054A CN 109523473 A CN109523473 A CN 109523473A
Authority
CN
China
Prior art keywords
image
pixel
mean value
processing
original image
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.)
Pending
Application number
CN201811204054.4A
Other languages
Chinese (zh)
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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN201811204054.4A priority Critical patent/CN109523473A/en
Publication of CN109523473A publication Critical patent/CN109523473A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • G06T5/92Dynamic range modification of images or parts thereof based on global image properties
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20024Filtering details

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a kind of image processing method, device, storage medium and electronic devices.This method comprises: obtaining to original image to be processed;Floodlight processing is carried out based on pixel of the mean value fuzzy filter to original image, obtains target image.Through the invention, achieved the effect that improve the speed for handling image.

Description

Image processing method, device, storage medium and electronic device
Technical field
The present invention relates to data processing field, in particular to a kind of image processing method, device, storage medium and Electronic device.
Background technique
Currently, floodlight (Bloom) processing can be carried out to image when handling image.General to image progress When light processing, a Gaussian Blur usually is carried out to image, for example, directlying adopt Gaussian function to image is filtered place Reason.
In the case where screen resolution is 1080P, when carrying out full frame operation to image by gaussian filtering, operand It is bigger, for example, a common I7 machine carries out full frame operation to image by gaussian filtering, need 10 minutes or so ability Operation is complete, slow so as to cause the speed handled image, and is handled image that the effect is unsatisfactory.
For the low problem of the speed handled in the prior art to image, effective solution side is not yet proposed at present Case.
Summary of the invention
The main purpose of the present invention is to provide a kind of image processing method, device, storage medium and electronic devices, so that The low technical problem of few speed for solving to handle image.
To achieve the goals above, according to an aspect of the invention, there is provided a kind of image processing method.This method packet It includes: obtaining original image to be processed;Floodlight processing is carried out based on pixel of the mean value fuzzy filter to original image, obtains target Image.
Optionally, floodlight processing is carried out based on pixel of the mean value fuzzy filter to original image, obtaining target image includes: Based on mean value fuzzy filter three times or nine mean value fuzzy filters, floodlight processing is carried out to the pixel of original image, obtains target Image.
Optionally, floodlight processing is carried out based on pixel of the mean value fuzzy filter to original image, obtaining target image includes: Floodlight is carried out to the first longitudinal direction pixel of the first horizontal pixel of original image and original image respectively based on mean value fuzzy filter Processing, obtains target image.
Optionally, carrying out floodlight processing to the first longitudinal direction pixel of original image based on mean value fuzzy filter includes: by the One longitudinal pixel is switched to the second horizontal pixel of target image;Floodlight is carried out to the second horizontal pixel based on mean value fuzzy filter Processing.
It optionally, include: by the picture of original image by the second horizontal pixel that first longitudinal direction pixel is switched to target image The storage location rolling target angle of element in memory, so that first longitudinal direction pixel is switched to the second lateral picture of target image Element.
Optionally, floodlight processing is being carried out to the pixel of original image based on mean value fuzzy filter, obtain target image it Before, this method further include: original image is divided into the specific item logo image of destination number according to score number of passes, wherein target Thread Count is the quantity for multiple threads that processor is supported;It is carried out at floodlight based on pixel of the mean value fuzzy filter to original image Reason, obtaining target image includes: by thread corresponding with each specific item logo image, based on mean value fuzzy filter to each specific item Logo image carries out floodlight processing, obtains target image.
To achieve the goals above, according to another aspect of the present invention, a kind of image processing apparatus is additionally provided.The device It include: acquiring unit, for obtaining original image to be processed;Processing unit, for being based on mean value fuzzy filter to original graph The pixel of picture carries out floodlight processing, obtains target image.
Optionally, processing unit includes: processing modulus, for based on mean value fuzzy filter three times or the fuzzy filter of nine mean values Wave carries out floodlight processing to the pixel of original image, obtains target image.
To achieve the goals above, according to another aspect of the present invention, a kind of storage medium is additionally provided.The storage medium In be stored with computer program, wherein computer program is arranged to execute the image procossing of the embodiment of the present invention when operation Method.
To achieve the goals above, according to another aspect of the present invention, a kind of electronic device is additionally provided.The electronic device Including memory and processor, which is characterized in that be stored with computer program in memory, processor is arranged to operation and calculates Machine program is to execute the image processing method in the embodiment of the present invention.
Through the invention, original image to be processed is obtained;It is carried out based on pixel of the mean value fuzzy filter to original image Floodlight processing, obtains target image.Due to carrying out floodlight processing based on pixel of the mean value fuzzy filter to original image, avoid Cause the operand of processing excessive due to directlying adopt Gauss formula and being filtered to image, has reached after being carried out to original image The purpose of processing solves the low technical problem of the speed handled to image, so reached raising to image at The technical effect of the speed of reason.
Detailed description of the invention
The attached drawing constituted part of this application is used to provide further understanding of the present invention, schematic reality of the invention It applies example and its explanation is used to explain the present invention, do not constitute improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is a kind of hardware block diagram of the mobile terminal of image processing method of the embodiment of the present invention;
Fig. 2 is a kind of flow chart of image processing method according to an embodiment of the present invention;
Fig. 3 is a kind of schematic diagram of filter curve according to an embodiment of the present invention;
Fig. 4 is a kind of schematic diagram of the cache structure of CPU according to an embodiment of the present invention;
Fig. 5 is a kind of schematic diagram of curve handled by gaussian filtering image according to an embodiment of the present invention;
Fig. 6 is the schematic diagram for the scene that a kind of pair of image according to an embodiment of the present invention is handled;And
Fig. 7 is a kind of schematic diagram of image processing apparatus according to an embodiment of the present invention.
Specific embodiment
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase Mutually combination.The present invention will be described in detail below with reference to the accompanying drawings and embodiments.
In order to make those skilled in the art more fully understand application scheme, below in conjunction in the embodiment of the present application Attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is only The embodiment of the application a part, instead of all the embodiments.Based on the embodiment in the application, ordinary skill people Member's every other embodiment obtained without making creative work, all should belong to the model of the application protection It encloses.
It should be noted that the description and claims of this application and term " first " in above-mentioned attached drawing, " Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this way Data be interchangeable under appropriate circumstances, so as to embodiments herein described herein.In addition, term " includes " and " tool Have " and their any deformation, it is intended that cover it is non-exclusive include, for example, containing a series of steps or units Process, method, system, product or equipment those of are not necessarily limited to be clearly listed step or unit, but may include without clear Other step or units listing to Chu or intrinsic for these process, methods, product or equipment.
Embodiment 1
Embodiment of the method provided by the embodiment of the present application can be in mobile terminal, terminal or similar operation It is executed in device.For running on mobile terminals, Fig. 1 is a kind of mobile end of image processing method of the embodiment of the present invention The hardware block diagram at end.As shown in Figure 1, mobile terminal 10 may include one or more (only showing one in Fig. 1) processing Device 102 (processing unit that processor 102 can include but is not limited to Micro-processor MCV or programmable logic device FPGA etc.) and Memory 104 for storing data, optionally, above-mentioned mobile terminal can also include the transmission device for communication function 106 and input-output equipment 108.It will appreciated by the skilled person that structure shown in FIG. 1 is only to illustrate, simultaneously The structure of above-mentioned mobile terminal is not caused to limit.For example, mobile terminal 10 may also include it is more than shown in Fig. 1 or less Component, or with the configuration different from shown in Fig. 1.
Memory 104 can be used for storing computer program, for example, the software program and module of application software, such as this hair The corresponding computer program of one of bright embodiment data processing method, processor 102 are stored in memory 104 by operation Interior computer program realizes above-mentioned method thereby executing various function application and data processing.Memory 104 can Including high speed random access memory, may also include nonvolatile memory, as one or more magnetic storage device, flash memory or Other non-volatile solid state memories of person.In some instances, memory 104 can further comprise remote relative to processor 202 The memory of journey setting, these remote memories can pass through network connection to mobile terminal 20.The example of above-mentioned network includes But be not limited to internet, intranet, local area network, mobile radio communication and combinations thereof.
Transmitting device 106 is used to that data to be received or sent via a network.Above-mentioned network specific example may include The wireless network that the communication providers of mobile terminal 10 provide.In an example, transmitting device 106 includes a Network adaptation Device (Network Interface Controller, referred to as NIC), can be connected by base station with other network equipments to It can be communicated with internet.In an example, transmitting device 106 can for radio frequency (Radio Frequency, referred to as RF) module is used to wirelessly be communicated with internet.
A kind of a kind of image processing method for running on above-mentioned mobile terminal is provided in the present embodiment, and Fig. 2 is basis A kind of flow chart of image processing method of the embodiment of the present invention.As shown in Fig. 2, this method comprises the following steps:
Step S202 obtains original image to be processed.
In the technical solution that above-mentioned steps S202 of the present invention is provided, target scene can be the field in rendering pipeline Scape, for example, being scene of game, original image can be the picture rendered to target scene, that is, for former field Jing Tu.Optionally, renderer renders three-dimensional target scene, obtains original image, which is by renderer To the effect picture that three-dimensional target scene is rendered, it can be made of picture frame data, more meet three-dimensional scenic. Wherein, renderer is the core of d engine, is the plug-in unit of advanced global illumination rendering, for realizing by three-dimensional article body painting It makes on screen.
It is rendered to target scene, after obtaining original image, obtains the original image.
Step S204 carries out floodlight processing based on pixel of the mean value fuzzy filter to original image, obtains target image.
In the technical solution that above-mentioned steps S204 of the present invention is provided, after obtaining original image to be processed, it is based on Mean value fuzzy filter carries out floodlight processing to the pixel of original image, obtains target image.
In this embodiment, it renders to target scene, after obtaining original image, can rapidly add movable Post-processing (Post Effect) effect of state modification.The post-processing of the embodiment is the final stage in rendering pipeline, place The object of reason is the above-mentioned original image generated by target scene.Optionally, after which dynamically adds on renderer Function is managed, carries out floodlight processing including the pixel to original image, floodlight processing can be rapidly adjusted according to original image Parameter reduces the switching of the process handled image, to can quickly obtain in the case where the operation of not blocked user Processing result is to show preview effect corresponding with processing result to user.
The mean value fuzzy filter (Box Blur) of the embodiment can calculate the adjacent pixels in image around object pixel The average value of (pixel radius is R), as output pixel as a result, can rapidly be obscured to image based on sliding window Processing has suppressed the high-frequency signal being treated in journey to image and has retained low frequency signal, realized to each of on image Pixel realizes that low frequency filtering shows less detailed information so that overall effect is exactly a fuzzy image.In addition, mean value Fuzzy filter can also make accumulator, that is, can use front accumulated result completes subsequent operation, this is compared to convolution Fuzzy Processing, operand is small, and processing speed is fast, carries out Fuzzy Processing to image so as to be efficiently completed.
Optionally, the embodiment is in the effect filtered using mean value fuzzy filter come fitted Gaussian, d=floor (σ * 3* Sqrt (2* π)/4+0.5), wherein d >=0 is used to determine the radius of mean value fuzzy filter, and σ is the standard deviation of Gaussian function, Floor is for indicating downward rounding operation, and sqrt is for indicating extraction of square root operation.
Optionally, the embodiment is when carrying out floodlight processing to the pixel of original image based on mean value fuzzy filter, can be with The luminance threshold for needing to carry out original image the pixel of floodlight processing is arranged to need in first pass processing to original Pixel in image is screened, and all pixels less than luminance threshold are all screened out, all to be more than or equal to above-mentioned luminance threshold Pixel stay, available one only comprising needing the textures of floodlight part, and rest part is black, general to needing The part of light carries out above-mentioned mean value fuzzy filter processing, obtains the image with light spill-over effects, will finally have light to overflow effect The image and original image of fruit are overlapped, and obtain final target image.Optionally, the embodiment by original image into The processing of row floodlight the illumination range of original image can be turned up to reach supersaturation, that is, the place for making original image bright is more It is bright.
Optionally, the embodiment is after carrying out rendering completion to target scene with renderer, to the data in buffer area Immediately do floodlight processing post-processing operation, can be by adjusting floodlight intensity (Bloom Intensity) Lai Jinhang floodlight at Reason.
It should be noted that since gaussian filtering needs to do the exponential operation of eIt leads Cause the operand handled image big, and the effect that the embodiment can be filtered by mean value fuzzy filter come fitted Gaussian Fruit, mean value fuzzy filter, which only needs for pixel to be added, to be averaging, and can also be counted using accumulated obtained result It calculates, thus, it is simple and can be to avoid directlying adopt height that floodlight processing be carried out to the pixel of original image based on mean value fuzzy filter The big problem of operand caused by this formula is filtered image is improved and is filtered to image so that performance consumption is small Speed and floodlight processing effect.For example, the resolution ratio of 1080P only needs can complete within 2 seconds on common I7 loom The calculating of whole image.
Above-mentioned steps S202 to step S204 can be based on central processing for the floodlight Processing Algorithm based on image filtering Device (Central Processing Unit/Processor, referred to as CPU) realizes quickly full frame Bloom.By obtaining wait locate The original image of reason;Floodlight processing is carried out based on pixel of the mean value fuzzy filter to original image, obtains target image.Due to base Floodlight processing is carried out to the pixel of original image in mean value fuzzy filter, avoid due to directly adopt Gauss formula to image into Row filtering causes the operand of processing excessive, has achieved the purpose that post-process original image, solves and carries out to image The low technical problem of the speed of processing, and then reached the technical effect for improving the speed handled image.
As an alternative embodiment, step S204, is carried out based on pixel of the mean value fuzzy filter to original image Floodlight processing, obtaining target image includes: based on mean value fuzzy filter or nine mean value fuzzy filters three times, to original image Pixel carries out floodlight processing, obtains target image.
In this embodiment, floodlight processing is carried out based on pixel of the mean value fuzzy filter to original image, to original image Fuzzy degree is carried out depending on the pixel radius in X direction, the pixel radius on y direction and the number of iterations. Wherein, in the identical situation of pixel radius, the number of iterations is more, and the image of output is fuzzyyer, in the identical feelings of the number of iterations Under condition, pixel radius is bigger, and the image of output is fuzzyyer, also more significant to the drawing effect of image.
The embodiment can carry out floodlight processing based on pixel of the mean value fuzzy filter three times to original image, obtain target Image, wherein mean value fuzzy filter namely iteration mean value fuzzy filter three times three times.Optionally, d=floor (σ * 3*sqrt (2* π)/4+0.5), wherein d >=0 is used to determine that the radius of mean value fuzzy filter, σ to be the standard deviations of Gaussian function, and floor is used In indicating downward rounding operation, sqrt is for indicating extraction of square root operation.If d is odd number, the half of mean value fuzzy filter three times Diameter is all d;If d is even number, the radius of preceding mean value fuzzy filter twice is d, the radius of the mean value fuzzy filter of third time It is d+1.When iteration third time mean value fuzzy filter, the curve of mean value fuzzy filter can be with the song of Gaussian Blur filtering Line essentially coincides, to realize using the effect that mean value fuzzy filter filters three times come fitted Gaussian.
As another example, which is based on nine mean value fuzzy filters, carries out floodlight to the pixel of original image Processing, to improve the expression effect for carrying out floodlight processing to image, wherein nine mean values of nine mean value fuzzy filters namely iteration Fuzzy filter, nine (3*3=9) mean value fuzzy filters are equivalent to the effect of Gaussian Blur filtering three times.
Optionally, the number of the mean value fuzzy filter of the embodiment can also be A=log2(Gaussian Blur radius) is secondary, can To be determined according to the size for the image that need to carry out floodlight processing.
As an alternative embodiment, step S204, is carried out based on pixel of the mean value fuzzy filter to original image Floodlight processing, obtaining target image includes: based on mean value fuzzy filter respectively to the first horizontal pixel of original image and original The first longitudinal direction pixel of image carries out floodlight processing, obtains target image, wherein including multiple pixels in the first horizontal pixel Middle Coutinuous store is deposited, differs the one-row pixels of memory storage, original image packet in first longitudinal direction pixel per two adjacent pixels Include one-row pixels.
In this embodiment, the arrangement position of the pixel of original image in memory can be in target-based coordinate system, from First, upper left corner position starts, and is arranged with transverse direction, the second row of a line arrangement and then arrangement, from top to bottom, until row The last one position of cloth to the lower right corner.The pixel of the original image include the first horizontal pixel and first longitudinal direction pixel, first Horizontal pixel may include multiple pixels that transverse direction is under target-based coordinate system, and first longitudinal direction pixel may include position Multiple pixels of longitudinal direction are under target-based coordinate system.Wherein, multiple pixels in the first horizontal pixel are in memory Coutinuous store, per the one-row pixels of adjacent two pixels difference memory storage in first longitudinal direction pixel.
In this embodiment, when the first horizontal pixel to original image accesses, since memory is continuous, make The hit rate for obtaining the caching (Cache) of CPU increases, and when longitudinally accessing pixel, memory can deviate the pixel pair of a full line The internal storage data answered.
The embodiment can carry out floodlight processing based on first horizontal pixel of the mean value fuzzy filter three times to original image, Pixel including the transverse direction to original image carries out mean value fuzzy filter three times;Based on mean filter three times to original image First longitudinal direction pixel carry out floodlight processing, pixel including the longitudinal direction to original image carries out mean filter three times, into And obtain Target Photo.It should be noted that the embodiment is based on mean value fuzzy filter three times to the first transverse direction of original image Pixel carries out floodlight processing, and it is not successive to carry out floodlight processing based on first longitudinal direction pixel of the mean filter three times to original image Sequence requirement, due to being carried out at floodlight based on first horizontal pixel and first longitudinal direction pixel of the mean value fuzzy filter to original image Reason, avoid causes the operand of processing excessive due to directlying adopt Gauss formula and being filtered to image, has reached raising pair The effect for the speed that image is handled.
As an alternative embodiment, step S204, based on mean value fuzzy filter to the first longitudinal direction of original image It includes: the second horizontal pixel that first longitudinal direction pixel is switched to target image that pixel, which carries out floodlight processing, wherein second laterally Multiple pixels in pixel Coutinuous store in memory;Floodlight processing is carried out to the second horizontal pixel based on mean value fuzzy filter.
In this embodiment, when CPU executes code segment logic, a small pieces memory can be obtained and be added to Inside CPU Cache.In the continuous situation of memory, data access be it is most fast, so as to increase in CPU Cache data The hit rate deposited.Thus, when the first horizontal pixel to original image accesses, since memory is continuous, so that CPU The hit rate of Cache increases, but when longitudinally accessing pixel, memory can deviate the corresponding memory number of pixel of a full line According to for example, for one 1024 × 1024 picture, when accessing first longitudinal direction pixel, 1024*4*4byte=can be deviated The data of 16384Byte, since the Cache Line size of CPU Cache is 64Byte, 16384Byte is had been above 64Byte, at this time cpu cache can not put down the data of 16384Byte, under the hit rate that can directly result in CPU in this way Drop, wherein Cache Line is the minimal cache unit of CPU Cache.
Thus, which is carrying out floodlight processing based on first longitudinal direction pixel of the mean value fuzzy filter to original image When, first longitudinal direction pixel is switched to the second horizontal pixel of target image, for example, in memory by the pixel of original image Storage location is rotated by 90 °, and access pixel longitudinal in this way will switch to laterally access pixel, so that multiple in the second horizontal pixel Pixel Coutinuous store in memory do the speed of mean value fuzzy filter then the hit rate of CPU opposite can improve two grades Faster, and then floodlight processing can be carried out to the second horizontal pixel based on mean value fuzzy filter, it can be based on the fuzzy filter of mean value three times Wave carries out floodlight processing to the second horizontal pixel, causes so as to avoid due to directlying adopt Gauss formula and being filtered to image The operand of processing is excessive, has achieved the effect that improve the speed for handling image.
As an alternative embodiment, first longitudinal direction pixel to be switched to the second horizontal pixel packet of target image It includes: by the storage location rolling target angle of the pixel of original image in memory, so that first longitudinal direction pixel is switched to target Second horizontal pixel of image.
It in this embodiment, can will be former when first longitudinal direction pixel to be switched to the second horizontal pixel of target image The storage location rolling target angle of the pixel of beginning image in memory, the target angle can be so that first longitudinal direction pixel is cut It is changed to the angle of the second horizontal pixel of target image, for example, be 90 degree, 450 degree, so that when accessing the second horizontal pixel, Access speed is most fast, and improves the hit rate of CPU Cache datarams, and then improves the effect handled image Rate.
As an alternative embodiment, in step S204, based on mean value fuzzy filter to the pixel of original image into The processing of row floodlight, before obtaining target image, this method further include: original image is divided into number of targets according to score number of passes The specific item logo image of amount, wherein score number of passes is the quantity for multiple threads that processor is supported;Step S204 is based on mean value Fuzzy filter carries out floodlight processing to the pixel of original image, obtain target image include: by with each specific item logo image pair The thread answered carries out floodlight processing to each specific item logo image based on mean value fuzzy filter, obtains target image.
In this embodiment it is possible to multi-thread mechanism is introduced in the overall calculation handled image, it will be entire former Beginning image carries out piecemeal processing, and original image is divided into the specific item logo image of destination number, score according to score number of passes Number of passes is the quantity for multiple threads that processor is supported, the quantity for multiple threads that different processor is supported can be different, at this Managing device can be CPU.Optionally, when determining the destination number of specific item logo image, can round up to score number of passes into It is that row evolution obtains as a result, carried out square to the result that rounds up again, finally by square after result be determined as target Quantity.
For example, for the CPU of 4 threads, score number of passes is 4, and can round up the knot obtained to 4 progress evolutions Fruit 2, then the result 2 that rounds up is carried out square, finally by square after result 4 be determined as destination number, that is, can Original image is divided into 4 pieces;For the CPU of 8 threads, score number of passes is 8, can round up and obtain to 8 progress evolutions Result 2.828, then the result 3 that rounds up is carried out square, finally by square after result 9 be determined as number of targets Amount, that is, original image can be divided into 9 pieces;For the CPU of 16 threads, score number of passes is 16, can be rounded up to 16 Carry out the obtained result 4 of evolution, then the result 4 to round up carried out square, finally by square after result 16 determine For destination number, that is, original image can be divided into 16 pieces.
After original image is divided into the specific item logo image of destination number according to score number of passes, by with every height The corresponding thread of target image carries out floodlight processing to each specific item logo image based on mean value fuzzy filter, obtains target image. Optionally, under score number of passes and destination number unanimous circumstances, by the corresponding sub-goal figure of each thread process Picture, in the case where score number of passes and destination number are inconsistent, for example, the case where score number of passes is less than destination number Under, by having handled the thread of a sub- target image at first, handle also untreated specific item logo image.
In this embodiment, each specific item logo image executes floodlight processing by an individual thread, due to will not be to original Beginning image is modified, so multithreading completely dispenses with locking, ensure that processing speed maximizes, under 1080P resolution ratio Original image does floodlight processing, can complete in 2 seconds, and then can be rapidly achieved interactive effect.
In this embodiment, it is not inconsistent if carrying out the J curve effectJ that floodlight is handled to original image based on gaussian filtering It closes and requires, then can go to be fitted better glossing up curve using recursive filtering (Recursive Filter), being log, (2 are Bottom) (Gaussian Blur radius) secondary corresponding Gaussian Blur results added, for example, one 1024 × 512 image, select 512 for Then radius is 512 in A=log by Gaussian Blur radius2Corresponding Gaussian Blur result is folded in (Gaussian Blur radius) Add, radius can be by obtaining divided by 2 always, until being less than or equal to 2, so as to reach the floodlight for more meeting human eye Treatment effect.
In the related art, a Gaussian Blur usually is carried out to image, gaussian filtering needs to do the exponential fortune of e It calculates, operand is bigger, and is handled image that the effect is unsatisfactory.And the embodiment can be on renderer dynamically Some post-processing functions are added into, floodlight Processing Algorithm is improved for based on image filtering, it can be based on equal three times Value fuzzy filter removes fitted Gaussian function, can serve as output as long as being in this way added the surrounding pixel of object pixel averagely Pixel can also carry out subsequent arithmetic using accumulated result, to reduce operand;In addition, the embodiment also needle To the Cache caching mechanism of CPU, mean value fuzzy filter is divided into laterally filtering and longitudinal filtering, to increase the hit of Cache Rate accelerates algorithm speed;Further, embodiment, can also be using the fuzzy filter of nine mean values in order to promote floodlight treatment effect Wave goes to reinforce the expression effect of whole floodlight processing, and introduces multi-thread mechanism, filters to improve to image The speed of wave and the effect that floodlight processing is carried out to image.
Embodiment 2
Technical solution of the present invention is illustrated below with reference to preferred embodiment, specifically using original image as picture It is illustrated.
The embodiment be computer graphics a kind of image processing algorithm, the floodlight Processing Algorithm based on image filtering into Row improves, and can be used in after having rendered an effect picture, rapidly add the post-processing effect that can dynamically modify, can basis Present image quickly adjusts floodlight, to reduce the switching in process, thus the performance effect of the speed of boostfiltering and floodlight processing Fruit.
In this embodiment, if directlying adopt Gauss formulaFiltering will lead to operation Measure excessive, the embodiment is using the effect that mean value fuzzy filter filters three times come fitted Gaussian.
Optionally, d=floor (σ * 3*sqrt (2* π)/4+0.5), wherein d is used to determine the half of mean value fuzzy filter Diameter, σ are used to indicate the standard deviation of Gaussian function, and floor is for indicating downward rounding operation, and sqrt is for indicating extraction of square root fortune It calculates.
Optionally, if above-mentioned d is odd number, the radius of mean value fuzzy filter is all d three times;If d is even number, before The radius of mean value fuzzy filter is d twice, and the radius of third time is d+1.
Fig. 3 is a kind of schematic diagram of filter curve according to an embodiment of the present invention.As shown in figure 3, solid line is for indicating equal The curve of value filtering, dotted line is for indicating gaussian filtering curve, and abscissa is for indicating filtering diameter, and ordinate is for indicating power Value.In each iteration mean value fuzzy filter, the curve of mean value fuzzy filter is increasingly closer to the curve of gaussian filtering, in iteration When third time mean value fuzzy filter, the curve of mean value fuzzy filter substantially and the curve co-insides of Gaussian Blur filtering, reality Show using the effect that mean value fuzzy filter filters three times come fitted Gaussian.
In this embodiment, to each pixel in the picture for needing to carry out floodlight processing using lateral mean value fuzzy filter With longitudinal mean value fuzzy filter.In order to more meet the Cache mechanism of CPU, the embodiment when carrying out longitudinal mean value fuzzy filter, Can be 90 degree by picture rotation, the longitudinal data in picture is become into lateral data and starts to calculate again, so as to image The speed handled is faster.
The cache structure of the embodiment is introduced below.
Fig. 4 is a kind of schematic diagram of the cache structure of CPU according to an embodiment of the present invention.As shown in figure 4, desktop grade CPU It can be multi-level cache architecture, in order to accelerate the access speed of data, access speed L1 caching > L2 caching > L3 caching, L1 caching Including L1i caching and L1d caching.
In this embodiment, when CPU executes code segment logic, a small pieces memory can be obtained and be added to The Cache of CPU caches the inside.For example, the L1 cache size of i7 6700K is 64KB by taking Intel Core i7 6700K as an example, L2 caching is 256KB, and L3 is 8MB, in order to increase the hit rate of CPU Cache datarams, when accessing data, is connected in memory In the case where continuous, access speed is most fast.The pixel of one picture can be in target-based coordinate system in the arrangement of memory, from First, upper left corner position starts, and is arranged with transverse direction, the second row of a line arrangement and then arrangement, from top to bottom, until row The last one position of cloth to the lower right corner.Thus, the embodiment when carrying out horizontal pixel access to picture, memory be it is continuous, The hit rate of CPU Cache can be made to increase.But when longitudinally accessing pixel, memory can deviate the picture of a full line Plain internal storage data, for example, for one 1024 × 1024 image, when accessing longitudinal data, 1024*4*4byte can be deviated The data of=16384Byte, since the Cache Line size of CPU Cache is 64Byte, 16384Byte is had been above 64Byte, at this moment L1 and L2 caching shown in Fig. 4 can not put down the data of 16384Byte, directly will lead to CPU hit Rate decline, wherein Cache Line is the minimal cache unit of CPU Cache.
Thus, which, can be 90 degree by picture rotation when carrying out longitudinal filtered blurry operation, in this way into When the access of row longitudinal direction, it will directly switch to lateral access, the data of access are successively that continuously, can make CPU in memory The hit rate of Cache increases, and the hit rate of CPU opposite can improve two grades, so that the speed for doing filtered blurry also can Faster.
Fig. 5 is a kind of schematic diagram of curve handled by gaussian filtering image according to an embodiment of the present invention. As shown in figure 5, abscissa is used to indicate the distance of surrounding pixel, ordinate for indicating weight, the standard deviation sigma of Gaussian function= 0.4.When dissatisfied to the J curve effectJ handled based on gaussian filtering picture progress floodlight, it can use Recursive Filter goes to be fitted better glossing up curve, can be A=log2(Gaussian Blur radius) secondary corresponding Gauss Fuzzy result is added, for example, one 1024 × 512 image, select 512 for Gaussian Blur radius, then by radius for 512 A=log2Corresponding Gaussian Blur result is overlapped in (Gaussian Blur radius), radius can by being obtained divided by 2 always, Until being less than or equal to 2, so as to reach the floodlight treatment effect for more meeting human eye.
Entire picture can be carried out piecemeal by the embodiment, introduce multi-thread mechanism.Optionally, image procossing point is being carried out When block, piecemeal can be carried out according to the Thread Count of user CPU, can be rounded up by user's CPU line number of passes evolution again square Determine block count, for example, the CPU of 4 threads is segmented into 4 pieces, the CPU of 8 threads is segmented into 9 pieces, and the CPU of 16 threads can divide At 16 pieces.Each piece is individually performed by a thread, because will not modify to original image, thus multithreading completely dispenses with and adds Lock, speed maximize.Doing floodlight processing in the image under 1080P resolution ratio can complete in 2 seconds, quick so as to reach Interactive effect.
Fig. 6 is the schematic diagram for the scene that a kind of pair of image according to an embodiment of the present invention is handled.As shown in fig. 6, When getting the buffer area of rendering with renderer MAX or MAYA rendering, the data of buffer area are post-processed immediately, this In be the operation for being Bloom.Bloom operation is done by adjusting Bloom Intensity numerical value.Wherein, the radius of filtering can be with It is the half for rendering resolution ratio length and width maximum value, to realize full frame operation.
It should be noted that interface shown in Fig. 6, which is only used for signal, carries out floodlight processing to image based on mean value fuzzy filter The scene of image afterwards does not represent actual treatment effect.It, can be by original graph by carrying out floodlight processing to original image The illumination range of picture is turned up to reach supersaturation, that is, the place for making original image bright is brighter.
It should be noted that the above-mentioned scene handled image is only a kind of example of the embodiment of the present invention, not It is limited to the display effect of above-mentioned scene, any floodlight Processing Algorithm based on mean value fuzzy filter realizes quick full frame Bloom's Display effect within the scope of the mean value embodiment of the present invention, no longer illustrates one by one herein.
The renderer of the embodiment is when having rendered a scene and obtaining picture frame data, after can dynamically adding Effect is managed, floodlight parameter is quickly adjusted according to current image, to reduce the switching in process, the case where not blocked user operates Under, result can be quickly obtained with to user's preview, for example, the resolution ratio of 1080P may be implemented on common I7 loom 2 The calculating of whole image is completed in second.
In the related art, a Gaussian Blur usually is carried out to image, gaussian filtering needs to do the exponential fortune of e It calculates, operand is bigger, and is handled image that the effect is unsatisfactory.And the embodiment is dynamically added on renderer Enter some post-processing functions, floodlight Processing Algorithm is improved for based on image filtering, it can be based on mean value mould three times Fitted Gaussian function is removed in paste filtering, as long as the surrounding pixel of object pixel to be added averagely to the picture that can serve as output in this way Element can also carry out subsequent arithmetic using accumulated result, to reduce operand, in addition, the embodiment also directed to Mean value fuzzy filter is divided into laterally filtering and longitudinal filtering, to increase the hit of Cache by the Cache caching mechanism of CPU Rate accelerates algorithm speed;Further, embodiment, can also be using the fuzzy filter of nine mean values in order to promote floodlight treatment effect Wave goes to reinforce the expression effect of whole floodlight processing, and introduces multi-thread mechanism, filters to improve to image The effect of speed and the floodlight processing of wave.
It should be noted that step shown in the flowchart of the accompanying drawings can be in such as a group of computer-executable instructions It is executed in computer system, although also, logical order is shown in flow charts, and it in some cases, can be with not The sequence being same as herein executes shown or described step.
Embodiment 3
The embodiment of the invention also provides a kind of image processing apparatus.It should be noted that the image procossing of the embodiment Device can be used for executing the image processing apparatus of the embodiment of the present invention.
Fig. 7 is a kind of schematic diagram of image processing apparatus according to an embodiment of the present invention.As shown in fig. 7, the image procossing Device 700 includes: acquiring unit 10 and processing unit 20.
Acquiring unit 10, for obtaining original image to be processed.
Processing unit 20 obtains target for carrying out floodlight processing based on pixel of the mean value fuzzy filter to original image Image.
Optionally, processing unit 20 includes: first processing module, for the picture based on mean value fuzzy filter to original image Element carries out floodlight processing, and obtaining target image includes: based on mean value fuzzy filter or nine mean value fuzzy filters three times, to original The pixel of image carries out floodlight processing, obtains target image.
Optionally, processing unit 20 includes: Second processing module, for being based on mean value fuzzy filter respectively to original image The first horizontal pixel and original image first longitudinal direction pixel carry out floodlight processing, obtain target image, wherein first laterally Multiple pixels in pixel Coutinuous store in memory, per adjacent two pixels difference memory storage in first longitudinal direction pixel One-row pixels, original image include one-row pixels.
Optionally, processing unit 20 includes: switching module, for first longitudinal direction pixel to be switched to the second of target image Horizontal pixel, wherein multiple pixels in the second horizontal pixel Coutinuous store in memory;Third processing module, for being based on Mean value fuzzy filter carries out floodlight processing to the second horizontal pixel.
Optionally, switching module includes: rotation submodule, for the storage location by the pixel of original image in memory Rolling target angle, so that first longitudinal direction pixel is switched to the second horizontal pixel of target image.
Optionally, the device further include: division unit, for based on mean value fuzzy filter to the pixel of original image into The processing of row floodlight, before obtaining target image, marks the specific item that original image is divided into destination number on a map according to score number of passes Picture, wherein score number of passes is the quantity for multiple threads that processor is supported;Processing unit 20 includes: fourth processing module, is used In by thread corresponding with each specific item logo image, each specific item logo image is carried out at floodlight based on mean value fuzzy filter Reason, obtains target image.
The embodiment obtains original image to be processed by acquiring unit 10, and 20 is fuzzy based on mean value through the processing unit It filters and floodlight processing is carried out to the pixel of original image, obtain target image.Due to being based on mean value fuzzy filter to original image Pixel carry out floodlight processing, avoid the operand mistake for being filtered to image due to directlying adopt Gauss formula and leading to processing Greatly, achieved the purpose that post-process original image, solved the low technical problem of the speed handled to image, into And the technical effect for improving the speed handled image is reached.
Embodiment 4
The embodiments of the present invention also provide a kind of storage medium, computer program is stored in the storage medium, wherein The computer program is arranged to execute the step in any of the above-described embodiment of the method when operation.
Optionally, in the present embodiment, above-mentioned storage medium can include but is not limited to: USB flash disk, read-only memory (Read- Only Memory, referred to as ROM), it is random access memory (Random Access Memory, referred to as RAM), mobile hard The various media that can store computer program such as disk, magnetic or disk.
Embodiment 5
The embodiments of the present invention also provide a kind of electronic device, including memory and processor, stored in the memory There is computer program, which is arranged to run computer program to execute the step in any of the above-described embodiment of the method Suddenly.
Optionally, above-mentioned electronic device can also include transmission device and input-output equipment, wherein the transmission device It is connected with above-mentioned processor, which connects with above-mentioned processor.
Obviously, those skilled in the art should be understood that each module of the above invention or each step can be with general Computing device realize that they can be concentrated on a single computing device, or be distributed in multiple computing devices and formed Network on, optionally, they can be realized with the program code that computing device can perform, it is thus possible to which they are stored It is performed by computing device in the storage device, and in some cases, it can be to be different from shown in sequence execution herein Out or description the step of, perhaps they are fabricated to each integrated circuit modules or by them multiple modules or Step is fabricated to single integrated circuit module to realize.In this way, the present invention is not limited to any specific hardware and softwares to combine.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field For art personnel, the invention may be variously modified and varied.It is all within principle of the invention, it is made it is any modification, etc. With replacement, improvement etc., should all be included in the protection scope of the present invention.

Claims (10)

1. a kind of image processing method characterized by comprising
Obtain original image to be processed;
Floodlight processing is carried out based on pixel of the mean value fuzzy filter to the original image, obtains target image.
2. the method according to claim 1, wherein based on mean value fuzzy filter to the pixel of the original image Floodlight processing is carried out, obtaining the target image includes:
Based on mean value fuzzy filter three times or nine mean value fuzzy filters, floodlight processing is carried out to the pixel of the original image, Obtain the target image.
3. the method according to claim 1, wherein based on mean value fuzzy filter to the pixel of the original image Floodlight processing is carried out, obtaining the target image includes:
Based on mean value fuzzy filter respectively to the first longitudinal direction of the first horizontal pixel of the original image and the original image Pixel carries out floodlight processing, obtains the target image.
4. according to the method described in claim 3, it is characterized in that, based on mean value fuzzy filter to described in the original image First longitudinal direction pixel carries out floodlight processing
The first longitudinal direction pixel is switched to the second horizontal pixel of the target image;
Floodlight processing is carried out to second horizontal pixel based on mean value fuzzy filter.
5. according to the method described in claim 4, it is characterized in that, the first longitudinal direction pixel is switched to the target image Second horizontal pixel include:
By the storage location rolling target angle of the pixel of the original image in memory, so that the first longitudinal direction pixel is cut It is changed to the second horizontal pixel of the target image.
6. method as claimed in any of claims 1 to 5, which is characterized in that
Floodlight processing is being carried out based on pixel of the mean value fuzzy filter to the original image, before obtaining the target image, The method also includes: the original image is divided into the specific item logo image of destination number according to score number of passes, wherein institute State the quantity that score number of passes is multiple threads that processor is supported;
Floodlight processing is carried out based on pixel of the mean value fuzzy filter to the original image, it includes: logical for obtaining the target image Thread corresponding with each specific item logo image is crossed, floodlight is carried out to each specific item logo image based on mean value fuzzy filter Processing, obtains the target image.
7. a kind of image processing apparatus characterized by comprising
Acquiring unit, for obtaining original image to be processed;
Processing unit obtains target figure for carrying out floodlight processing based on pixel of the mean value fuzzy filter to the original image Picture.
8. device according to claim 7, which is characterized in that the processing unit includes:
Modulus is handled, for being based on mean value fuzzy filter or nine mean value fuzzy filters three times, to the pixel of the original image Floodlight processing is carried out, the target image is obtained.
9. a kind of storage medium, which is characterized in that be stored with computer program in the storage medium, wherein the computer Program is arranged to execute method described in any one of claim 1 to 6 when operation.
10. a kind of electronic device, including memory and processor, which is characterized in that be stored with computer journey in the memory Sequence, the processor are arranged to run the computer program to execute side described in any one of claim 1 to 6 Method.
CN201811204054.4A 2018-10-16 2018-10-16 Image processing method, device, storage medium and electronic device Pending CN109523473A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811204054.4A CN109523473A (en) 2018-10-16 2018-10-16 Image processing method, device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811204054.4A CN109523473A (en) 2018-10-16 2018-10-16 Image processing method, device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN109523473A true CN109523473A (en) 2019-03-26

Family

ID=65770888

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811204054.4A Pending CN109523473A (en) 2018-10-16 2018-10-16 Image processing method, device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN109523473A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111402384A (en) * 2020-03-25 2020-07-10 北京字节跳动网络技术有限公司 Image generation method and device, electronic equipment and computer readable storage medium
WO2022252080A1 (en) * 2021-05-31 2022-12-08 Huawei Technologies Co.,Ltd. Apparatus and method for generating a bloom effect

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101489051A (en) * 2008-01-17 2009-07-22 佳能株式会社 Image processing apparatus and image processing method and image capturing apparatus
CN102033832A (en) * 2010-12-02 2011-04-27 杭州国芯科技股份有限公司 Access control method of synchronous dynamic memory
CN103037187A (en) * 2011-09-29 2013-04-10 吴小平 Splicing device and synchronous multiple player information sources for rotating projector
CN106355545A (en) * 2015-07-16 2017-01-25 浙江大华技术股份有限公司 Treatment method and device for performing geometric transformation on digital image
CN106570827A (en) * 2016-08-31 2017-04-19 天津大学 Method and device utilizing storage space address transformation to carry out image rotation
CN108320283A (en) * 2018-02-01 2018-07-24 研靖信息科技(上海)有限公司 A kind of method and apparatus of the optimal color matching threshold range of determining image
CN108573480A (en) * 2018-04-20 2018-09-25 太平洋未来科技(深圳)有限公司 Ambient light compensation method, apparatus based on image procossing and electronic equipment
CN108596828A (en) * 2018-04-18 2018-09-28 网易(杭州)网络有限公司 Image floodlight processing method and device, electronic equipment, storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101489051A (en) * 2008-01-17 2009-07-22 佳能株式会社 Image processing apparatus and image processing method and image capturing apparatus
CN102033832A (en) * 2010-12-02 2011-04-27 杭州国芯科技股份有限公司 Access control method of synchronous dynamic memory
CN103037187A (en) * 2011-09-29 2013-04-10 吴小平 Splicing device and synchronous multiple player information sources for rotating projector
CN106355545A (en) * 2015-07-16 2017-01-25 浙江大华技术股份有限公司 Treatment method and device for performing geometric transformation on digital image
CN106570827A (en) * 2016-08-31 2017-04-19 天津大学 Method and device utilizing storage space address transformation to carry out image rotation
CN108320283A (en) * 2018-02-01 2018-07-24 研靖信息科技(上海)有限公司 A kind of method and apparatus of the optimal color matching threshold range of determining image
CN108596828A (en) * 2018-04-18 2018-09-28 网易(杭州)网络有限公司 Image floodlight processing method and device, electronic equipment, storage medium
CN108573480A (en) * 2018-04-20 2018-09-25 太平洋未来科技(深圳)有限公司 Ambient light compensation method, apparatus based on image procossing and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111402384A (en) * 2020-03-25 2020-07-10 北京字节跳动网络技术有限公司 Image generation method and device, electronic equipment and computer readable storage medium
WO2022252080A1 (en) * 2021-05-31 2022-12-08 Huawei Technologies Co.,Ltd. Apparatus and method for generating a bloom effect

Similar Documents

Publication Publication Date Title
CN109102483A (en) Image enhancement model training method, device, electronic equipment and readable storage medium storing program for executing
CN110874812A (en) Scene image drawing method and device in game and electronic terminal
CN106921829A (en) A kind of photographic method and device and photographing device
CN110163813A (en) A kind of image rain removing method, device, readable storage medium storing program for executing and terminal device
US10943389B2 (en) Removing or identifying overlapping fragments after z-culling
CN109523473A (en) Image processing method, device, storage medium and electronic device
CN109740721A (en) Wheat head method of counting and device
US9613405B2 (en) Scalable massive parallelization of overlapping patch aggregation
CN108335260A (en) A kind of scene of game image processing method, device, storage medium and electronic device
CN111683192B (en) Image processing method and related product
CN110378305A (en) Tealeaves disease recognition method, equipment, storage medium and device
CN108604302A (en) Adaptive bilateral (BL) for computer vision is filtered
CN110866872A (en) Pavement crack image preprocessing intelligent selection method and device and electronic equipment
CN109934781A (en) Image processing method, device, terminal device and computer readable storage medium
CN109886892A (en) Image processing method, image processing apparatus and storage medium
CN109564684A (en) Image, semantic dividing method, programmable logic circuit, system and electronic equipment
CN109698946A (en) Projection device Atomatic focusing method, projection device and computer readable storage medium
CN105069747B (en) Image interpolation method and device
CN108377372B (en) A kind of white balancing treatment method, device, terminal device and storage medium
CN112422842B (en) Self-adaptive exposure method, medium and terminal
CN107569851B (en) Game on-hook method, device and system
CN108734712A (en) The method, apparatus and computer storage media of background segment
CN112837350A (en) Target moving object identification method and device, electronic equipment and storage medium
CN110400312A (en) Determine the method, apparatus and server of image vague category identifier
CN109658360A (en) Method, apparatus, electronic equipment and the computer storage medium of image procossing

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190326