CN107454332A - Image processing method, device and electronic equipment - Google Patents

Image processing method, device and electronic equipment Download PDF

Info

Publication number
CN107454332A
CN107454332A CN201710752944.8A CN201710752944A CN107454332A CN 107454332 A CN107454332 A CN 107454332A CN 201710752944 A CN201710752944 A CN 201710752944A CN 107454332 A CN107454332 A CN 107454332A
Authority
CN
China
Prior art keywords
background
prospect
photo
middle scape
image processing
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
CN201710752944.8A
Other languages
Chinese (zh)
Other versions
CN107454332B (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.)
Xiamen Meitu Technology Co Ltd
Original Assignee
Xiamen Meitu 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 Xiamen Meitu Technology Co Ltd filed Critical Xiamen Meitu Technology Co Ltd
Priority to CN201710752944.8A priority Critical patent/CN107454332B/en
Publication of CN107454332A publication Critical patent/CN107454332A/en
Application granted granted Critical
Publication of CN107454332B publication Critical patent/CN107454332B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/64Computer-aided capture of images, e.g. transfer from script file into camera, check of taken image quality, advice or proposal for image composition or decision on when to take image
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Processing (AREA)
  • Studio Devices (AREA)

Abstract

The embodiment of the present invention provides a kind of image processing method, device and electronic equipment, is related to technical field of image processing.Described image processing method includes:Obtain the focusing position of photo;Calculate the front and rear depth of field corresponding to the focusing position and the definition range of imaging;Based on the definition range, prospect, middle scape and the background of the photo are obtained;According to the distance between each pixel in the prospect and background and the middle scape, Fuzzy Processing is carried out respectively to the prospect and background, wherein, in the prospect and background, the fog-level away from the nearer pixel of the middle scape is less than the fog-level of the pixel away from the middle scape farther out.Using the image processing method, device and electronic equipment, it is convenient to implement, it is possible to increase the virtualization effect of picture.

Description

Image processing method, device and electronic equipment
Technical field
The present invention relates to technical field of image processing, is set in particular to a kind of image processing method, device and electronics It is standby.
Background technology
In order that shooting image focal point on the theme of shooting, it is necessary to enter to the subregion in shooting picture Row virtualization, in the prior art, virtualization problem are double a great problems taken the photograph in system, calculate complexity, and virtualization effect has much room for improvement.
The content of the invention
In view of this, the purpose of the embodiment of the present invention is to provide a kind of image processing method, device and electronic equipment, with Improve the problem of image virtualization calculating in the prior art is complicated, and effect has much room for improvement.
Present pre-ferred embodiments provide a kind of image processing method, and methods described includes:
Obtain the focusing position of photo;
Calculate the front and rear depth of field corresponding to the focusing position and the definition range of imaging;
Based on the definition range, prospect, middle scape and the background of the photo are obtained;
According to the distance between each pixel in the prospect and background and the middle scape, the prospect and background are entered respectively Row Fuzzy Processing, wherein, in the prospect and background, the fog-level away from the nearer pixel of the middle scape is less than away from the middle scape The fog-level of pixel farther out.
Alternatively, the step of calculating the front and rear depth of field corresponding to the focusing position and the definition range of imaging includes:
The depth information of the focusing position is obtained by depth map;
Focusing principle based on slr camera, the front and rear depth of field of the focusing position is calculated according to the depth information And the definition range of imaging.
Alternatively, based on the definition range, the step of obtaining prospect, middle scape and the background of the photo, including:
Based on the definition range, object distance range corresponding to the definition range is calculated;
Corresponding object distance in the photo is less than the image section of the object distance range as prospect;
Corresponding object distance in the photo is located at the image section of the object distance range scape as in;
Corresponding object distance in the photo is more than the image section of the object distance range as background.
Alternatively, the step of carrying out Fuzzy Processing respectively to the prospect and background includes:In tri- passages of YUV to described Prospect and background carry out Fuzzy Processing respectively;
Before carrying out Fuzzy Processing to the background, methods described also includes:
Search the intense light source position in image corresponding with the background in the photo;
Enhanced X-ray source is carried out to intense light source position described in the background on Y passages.
Alternatively, the step of searching the intense light source position in the photo in image corresponding with the background, bag Include:
Hot spot all in the photo is searched, wherein, the Y channel values of the hot spot are more than preset value;
Agglomerate is carried out to all hot spots, goes after noise processing to obtain intense light source position.
Alternatively, methods described also includes:
Carry out the intensity of enhanced X-ray source to intense light source position described in the background on Y passages by changing, obtain To different afocal image intensities;Or/and
By changing the filtering nuclear shape that agglomerate is carried out to all hot spots, goes noise to handle, difference is obtained Afocal imaged shape.
Alternatively, the step of carrying out Fuzzy Processing respectively to the prospect and background, in addition to:
Obtain the size of the photo;
Obtain corresponding with the photo of the size maximum blur radius according to preset rules, the maximum blur radius and The middle scape distance farthest apart from the prospect or background is corresponding;
Obtain the regulation information of the maximum blur radius;
The maximum blur radius is adjusted according to the regulation information, so as to strengthen or weaken the fuzzy journey of the photo Degree.
Alternatively, before Fuzzy Processing is carried out to the prospect and background, methods described also includes:
The photo is zoomed in and out by preset ratio;
After Fuzzy Processing is carried out to the prospect and background, methods described also includes:By with the preset ratio pair The ratio answered is reduced the photo.
Another preferred embodiment of the present invention provides a kind of image processing apparatus, including:
Information acquisition module, for obtaining the focusing position of photo;
Analysis module, for calculating the front and rear depth of field corresponding to the focusing position and the definition range of imaging;
Data obtaining module, for based on the definition range, obtaining prospect, middle scape and the background of the photo;
Fuzzy Processing module, for according to the distance between each pixel in the prospect and background and the middle scape, to institute State prospect and background and carry out Fuzzy Processing respectively, wherein, it is fuzzy away from the nearer pixel of the middle scape in the prospect and background Degree is less than the fog-level of the pixel away from the middle scape farther out.
Another embodiment of the present invention provides a kind of electronic equipment, including memory, processor and is stored in storage Following steps are realized on device and the computer program that can run on a processor, during the computing device described program:
Obtain the focusing position of photo;
Calculate the front and rear depth of field corresponding to the focusing position and the definition range of imaging;
Based on the definition range, prospect, middle scape and the background of the photo are obtained;
According to the distance between each pixel in the prospect and background and the middle scape, the prospect and background are entered respectively Row Fuzzy Processing, wherein, in the prospect and background, the fog-level away from the nearer pixel of the middle scape is less than away from the middle scape The fog-level of pixel farther out.
Another embodiment of the present invention provides a kind of readable storage medium storing program for executing, and the readable storage medium storing program for executing includes computer Program, equipment performs figure provided in an embodiment of the present invention the computer program controls the readable storage medium storing program for executing when running where As processing method.
Image processing method, device and electronic equipment provided in an embodiment of the present invention, according to each pixel in prospect and background The distance between middle scape, Fuzzy Processing is carried out respectively to prospect and background, so that the nearer picture of scape in prospect and background middle-range The fog-level of element is less than the fog-level of the pixel away from middle scape farther out, realizes smoothed between prospect, middle scape and background Cross, reach the different degrees of virtualization effect rich in stereovision, it is convenient to implement, and virtualization effect is preferable.
To enable the above objects, features and advantages of the present invention to become apparent, preferred embodiment cited below particularly, and coordinate Appended accompanying drawing, is described in detail below.
Brief description of the drawings
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below by embodiment it is required use it is attached Figure is briefly described, it will be appreciated that the following drawings illustrate only certain embodiments of the present invention, therefore be not construed as pair The restriction of scope, for those of ordinary skill in the art, on the premise of not paying creative work, can also be according to this A little accompanying drawings obtain other related accompanying drawings.
Fig. 1 is the block diagram for a kind of electronic equipment 10 that present pre-ferred embodiments provide.
Fig. 2 is a kind of flow chart for image processing method that present pre-ferred embodiments provide.
Fig. 3 is the schematic diagram of the sub-step that step S22 shown in Fig. 2 includes in an embodiment.
Fig. 4 is the flow chart for another image processing method that present pre-ferred embodiments provide.
Fig. 5 is the flow chart for another image processing method that present pre-ferred embodiments provide.
Fig. 6 is a kind of module frame chart for image processing apparatus 20 that present pre-ferred embodiments provide.
Icon:10- electronic equipments;11- memories;12- processors;13- mixed-media network modules mixed-medias;20- image processing apparatus;21- Information acquisition module;22- analysis modules;23- data obtaining modules;24- Fuzzy Processing modules.
Embodiment
Now in increasing product using to it is double take the photograph system, as its name suggests, be exactly made up of two cameras Camera system.Double main advantages for taking the photograph system have:The depth of field and parallax of image are calculated by stereoscopic vision, and utilizes depth of view information Many applications such as background blurring, object segmentation, 3D scannings, auxiliary focusing, action recognition are carried out to image.Two cameras are obtained To photo enter the fusion of row information, it is expected to obtain, resolution ratio is higher, color is more preferable, dynamic range is bigger, noise is less Image.
Because the emphasis of function is different, so also proposing different requirements to double hardware for taking the photograph system.One of which Two cameras of hardware requirement between have big spacing as far as possible, to obtain higher depth of field precision.Another kind needs two and taken the photograph As the picture of head is superimposed synthesis, so the closer to the distance of two cameras is more desirable to, to reduce mistake caused by image co-registration.
In addition, double systems of taking the photograph are not only that can synthesize two pictures, as mentioned above, double systems of taking the photograph can also be by two Picture calculates the depth information of image, i.e. object distance.Depth information can not only assistant images complete free hand drawing 3D, intelligence scratches figure etc. Function, moreover it is possible to realize background blurring.
It has been investigated that virtualization problem is double a great problems taken the photograph in system, a good virtualization effect should not be only It is simple LPF, if double systems of taking the photograph can simulate the virtualization effect of slr camera, can significantly improve double take the photograph is The virtualization effect of picture captured by system, lift Consumer's Experience.
Based on this, system is taken the photograph suitable for double the embodiments of the invention provide a kind of, prospect, middle scape and background can be realized Between seamlessly transit, image processing method, device and the electronics for reaching the different degrees of virtualization effect rich in stereovision are set It is standby, so as to easily improve double virtualization effects for taking the photograph picture captured by system.
Below in conjunction with accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Ground describes, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.Generally exist The component of the embodiment of the present invention described and illustrated in accompanying drawing can be configured to arrange and design with a variety of herein.Cause This, the detailed description of the embodiments of the invention to providing in the accompanying drawings is not intended to limit claimed invention below Scope, but it is merely representative of the selected embodiment of the present invention.Based on embodiments of the invention, those skilled in the art are not doing The every other embodiment obtained on the premise of going out creative work, belongs to the scope of protection of the invention.
It should be noted that:Similar label and letter represents similar terms in following accompanying drawing, therefore, once a certain Xiang Yi It is defined, then it further need not be defined and explained in subsequent accompanying drawing in individual accompanying drawing.
As shown in figure 1, it is the block diagram for the electronic equipment 10 that present pre-ferred embodiments provide.The embodiment of the present invention In electronic equipment 10 can be equipment that image processor etc. can carry out image procossing.As shown in figure 1, electronic equipment 10 wraps Include:Memory 11, processor 12, mixed-media network modules mixed-media 13 and image processing apparatus 20.
The memory 11, processor 12 and mixed-media network modules mixed-media 13 are directly or indirectly electrically connected between each other, with reality The transmission or interaction of existing data.For example, these elements can be realized by one or more communication bus or signal wire between each other It is electrically connected with.Be stored with image processing apparatus 20 in memory 11, described image processing unit 20 include it is at least one can be with soft The form of part or firmware (firmware) is stored in the software function module in the memory 11, and the processor 12 passes through fortune Row is stored in software program and module in memory 11, such as the image processing apparatus 20 in the embodiment of the present invention, so as to hold Row various function application and data processing, that is, realize the image processing method in the embodiment of the present invention.
Wherein, the memory 11 may be, but not limited to, random access memory (Random Access Memory, RAM), read-only storage (Read Only Memory, ROM), programmable read only memory (Programmable Read-Only Memory, PROM), erasable read-only memory (Erasable Programmable Read-Only Memory, EPROM), Electricallyerasable ROM (EEROM) (Electric Erasable Programmable Read-Only Memory, EEPROM) etc.. Wherein, memory 11 is used for storage program, and the processor 12 performs described program after execute instruction is received.
The processor 12 is probably a kind of IC chip, has the disposal ability of data.Above-mentioned processor 12 Can be general processor, including central processing unit (Central Processing Unit, CPU), network processing unit (Network Processor, NP) etc..It can realize or perform each method disclosed in the embodiment of the present invention, step and patrol Collect block diagram.General processor can be microprocessor or the processor can also be any conventional processor etc..
Mixed-media network modules mixed-media 13 is used for the communication connection established by network between electronic equipment 10 and external communications terminals, realizes The transmitting-receiving operation of network signal and data.Above-mentioned network signal may include wireless signal or wire signal.
It is appreciated that structure shown in Fig. 1 is only to illustrate, electronic equipment 10 may also include it is more more than shown in Fig. 1 or Less component, or there is the configuration different from shown in Fig. 1.Each component shown in Fig. 1 can use hardware, software or its Combination is realized.
The embodiment of the present invention also provides a kind of readable storage medium storing program for executing, and the readable storage medium storing program for executing includes computer program.Institute Electronic equipment 10 where the readable storage medium storing program for executing is controlled to perform following image processing method when stating computer program operation.
Referring to Fig. 2, it is a kind of flow chart for image processing method that present pre-ferred embodiments provide.Methods described has Method and step defined in the flow of pass is applied to electronic equipment 10, can be realized by the processor 12.Below will be to Fig. 2 institutes The idiographic flow shown is described in detail.
Step S21, obtain the focusing position of photo.
In the present embodiment, can it is double take the photograph system photographs when to shooting object focus, obtain focusing position, can also After double shootings taken the photograph system and completed to shooting object, a focusing position is voluntarily selected by user.
Step S22, calculate the front and rear depth of field corresponding to the focusing position and the definition range of imaging.
Fig. 3 is please referred to, the embodiments of the invention provide the exemplary implementation process of step S22 one of which, including Step S221 and the sub-steps of step S222 two.
Step S221, the depth information of the focusing position is obtained by depth map.
Step S222, the focusing principle based on slr camera, the focusing position is calculated according to the depth information The front and rear depth of field and imaging definition range.
Alternatively, the focusing principle based on slr camera in the present embodiment, calculate focusing position the front and rear depth of field and into The implementation process of the definition range of picture is as follows.
According to the imaging formula of convex lens, preceding depth of field D during image objects1With rear depth of field D2Respectively
Wherein, N is f-number f-Number;C is the disperse circular diameter on image, typically definite value, and Pixel Dimensions Pixel_size is related;U is object distance;F is lens focus, and corresponding to have f=NA, wherein A be lens opening.
The depth bounds of the focusing of object is [U-D1,U+D2], above formula is substituted into, is obtained:
Due to
Depth × Disparity=BL × f
Wherein, BL is the focal lengths that double baseline BaseLine, f taken the photograph are main camera, and focal distance is reacted on parallax, had Below equation.
Wherein, dURepresent object distance as U when corresponding parallax, dXRepresent BL*C*N/f, only N is variable, and dxWith N in just Than.
Thus, N is bigger, and aperture is smaller, and the front and rear depth of field is bigger, and parallax span is bigger in focusing range, and virtualization is relatively not clear It is aobvious.Otherwise N is smaller, and aperture is bigger, and the front and rear depth of field is smaller, and parallax span scope is smaller in focusing range, now blurs relatively more Substantially.
And then in fixed dUAfterwards, d is directly adjustedXSize simulation aperture change procedure.
Step S23, based on the definition range, obtain prospect, middle scape and the background of the photo.
In the present embodiment, using this definition range, as the reference of follow-up virtualization processing, alternatively, base in the present embodiment In the definition range, object distance range corresponding to the definition range is calculated, according to corresponding to the definition range being calculated Object distance range completes prospect, middle scape and the background division of photo.Division rule is as follows.
Corresponding object distance in the photo is less than the image section of the object distance range as prospect.
Corresponding object distance in the photo is located at the image section of the object distance range scape as in.
Corresponding object distance in the photo is more than the image section of the object distance range as background.
By above-mentioned division, using region smaller than object distance range corresponding to definition range in photo as prospect, will shine In piece positioned at region in object distance range corresponding to definition range be used as in scape, by photo than object distance model corresponding to definition range Bigger region is enclosed as background.
Step S24, according to the distance between each pixel in the prospect and background and the middle scape, to the prospect with after Scape carries out Fuzzy Processing respectively, wherein, in the prospect and background, the fog-level away from the nearer pixel of the middle scape be less than away from The fog-level of the pixel of the middle scape farther out.
During Fuzzy Processing, middle scape does not make Fuzzy Processing, keeps clear, and Fuzzy Processing is carried out to prospect and background. In Fuzzy Processing, the Fuzzy Processing of identical type can be carried out to prospect and background, prospect and background can also be carried out not Congener Fuzzy Processing.
Alternatively, Fuzzy Processing is carried out respectively to the prospect and background in tri- passages of YUV in the present embodiment, compared to RGB color, the YUV color spaces of uncoupling can farthest ensure picture quality.In addition, many digital equipments It is to use yuv data stream, thus carries out Fuzzy Processing respectively to the prospect and background using tri- passages of YUV to reduce number Come time-consuming, simplified processing procedure, reduction data processing complexity according to transfer zone.
By in the Fuzzy Processing prospect and background, the fog-level away from the nearer pixel of the middle scape be less than away from The implementation of the fog-level of the pixel of the middle scape farther out is more, with the exemplary realization of one of which in the embodiment of the present invention Flow is illustrated.
It is in the physical model d ∝ 1/D of inverse relation according to parallax d and object distance D, for a fixed focal distance D0, There is unique d0Correspond to therewith.Now prospect corresponds to d>d0+ △ d, middle scape correspond to d ∈ [d0-△d,d0+ △ d], background corresponds to d<d0- △d。
Wherein, △ d are the front and rear depth of field, the process of similar slr camera regulation aperture size:The bigger △ d of aperture are smaller, preceding The depth of field is more shallow afterwards.Otherwise the smaller △ d of aperture are bigger, and the front and rear depth of field is bigger.
Further, prospect blur radius R1 ∝ (d-d0- △ d), background blur radius R2 ∝ (d0- △ d-d), define two Individual normal number C1 and C2, corresponding R1=C1 (d-d0- △ is d) and R2=C2 (d0-△d-d).The fog-level of usual prospect can be than rear Scape is weaker, so C2 >=C1 is typically had, such as C2=2C1.In that case, can be independent by adjusting C1 and C2 value Ground adjusts the fog-level of prospect and background.
Using aforesaid way, the object distance D of each point can be obtained by double systems of taking the photograph, calculates parallax d, after defining C1 and C2, just The blur radius of each point can be obtained, that is, puts the disperse radius of energy.
Alternatively, in the present embodiment, the fuzzy core of prospect and background can have multiple choices, for example, height can be taken simultaneously This fuzzy core.In another example circular filter core can be taken simultaneously.In another example can be with foreground selection Gaussian Blur core, background selection circle Shape fuzzy core.
Based on the studies above, Fig. 4 is please referred to, the step of Fuzzy Processing is carried out respectively to the prospect and background, bag Include step S241~sub-steps of step S244 tetra-.
Step S241, obtain the size of the photo.
Step S242, maximum blur radius corresponding with the photo of the size, the maximum are obtained according to preset rules Blur radius is corresponding with the distance that the middle scape is farthest apart from the prospect or background.
Step S243, obtain the regulation information of the maximum blur radius.
Step S244, the maximum blur radius is adjusted according to the regulation information, so as to strengthen or weaken the photo Fog-level.
By a maximum blur radius defined in calculating process, such as 12,000,000 images can be selected to correspond to maximum norm It is 60 to paste radius.It is that the farthest prospect of scape or background, other positions obscure accordingly in distance corresponding to maximum blur radius Radius then calculates in proportion, and the image of other sizes then scales up or reduced this maximum blur radius.So may be used To obtain the blur effect of same degree to various sizes of image.Alternatively, it is also possible to be opened to user by adjusting this most The option of big blur radius, to strengthen or weaken the fog-level of entirety.
Fig. 5 is please referred to, in order to increase afocal imaging effect, alternatively, before carrying out Fuzzy Processing to the background, Methods described also includes step S25 and step S26.
Step S25, search the intense light source position in image corresponding with the background in the photo.
Alternatively, intense light source position is searched in the present embodiment in the following manner:Search all in the photo Hot spot, wherein, the Y channel values of the hot spot are more than preset value, carry out agglomerate to all hot spots, go noise Intense light source position is obtained after processing.
By taking 8bit YUV as an example, hot spot can be defined to meet Y>=th point, wherein, th is preset value, Ke Yiqu Th=250 or so, point of the Y channel values more than or equal to th is defined as hot spot.
Through research, hot spot has two kinds of classification, and one kind is intense light source, i.e., real light source, another kind is the anti-of large area Tabula rasa, such as glass, steel plate etc..Due to 8bit limitation, what the present embodiment should recover energy is intense light source, rather than reflective Plate.In order to which intense light source and reflecting board area are separated, meet Y for previous step is calculated>=th each hot spot, definition One search radius R, the disperse radius of the point can be generally taken as R, in other all pixels in radius R, such as The accounting of fruit hot spot gives certainty ratio, such as 25% no more than one, then it is assumed that this is an isolated hot spot, is defined as Intense light source;It is on the contrary then it is thought that a reflector, is the hot spot to join together.
Step S26, enhanced X-ray source is carried out to intense light source position described in the background on Y passages.
It is above-mentioned hot spot is divided into two parts of intense light source and reflector after.It is following then be to intense light source carry out energy Enhancing, then obscured, to there is the effect of bokeh (afocal imaging).So treated, bokeh effect only appears in At intense light source, do not appear at reflector.
According to user's request, bokeh can both appear in prospect and background simultaneously, can also be only present in background.For The situation that prospect and background occur simultaneously, is handled prospect and background by the way of same as described above.For only Background has bokeh situation, it is only necessary to it is determined that behind intense light source position, the intense light source in removal prospect.
During bokeh presentation, in order to obtain different bokeh intensity and bokeh shapes, thus it is possible to vary corresponding Enhanced X-ray source intensity or filtering nuclear shape corresponding to changing, intentionally shape, star, Christmas are tree-like etc. for common filtering nuclear shape, This variety of bokeh free effect in slr camera shooting can by camera lens before be further added by the aperture of a correspondingly-shaped Camera lens is presented.Change the option of bokeh intensity and shape, can also equally open and voluntarily be adjusted to user.
Thus, the present embodiment methods described can also include:By changing on Y passages to strong light described in the background Source position carries out the intensity of enhanced X-ray source, obtains different afocal image intensities.Or/and by changing to described all Hot spot carry out agglomerate, go noise handle filtering nuclear shape, obtain different afocal imaged shapes.
In order to ensure image processing speed, alternatively, before Fuzzy Processing is carried out to the prospect and background, the side Method also includes:The photo is zoomed in and out by preset ratio.It is described after Fuzzy Processing is carried out to the prospect and background Method also includes:The photo is reduced in ratio corresponding with the preset ratio.
By carrying out appropriate scaling to image, for example, to 12,000,000 image, merely from the angle of algorithm, Ke Yi Wide height, which is all compressed to after 1/8th, does fuzzy enhanced processing again, this kind of processing mode also can guarantee that finally export prospect, Background blur effect is not damaged.Suitably compressed according to the size of image, can also support to see effect when user shoots Preview graph.
On the basis of the above, as shown in fig. 6, the embodiments of the invention provide a kind of image processing apparatus 20, including information Obtain module 21, analysis module 22, data obtaining module 23 and Fuzzy Processing module 24.
Wherein, information acquisition module 21 is used for the focusing position for obtaining photo.
Because information acquisition module 21 is similar with the realization principle of step S21 in Fig. 2, thus do not illustrate more herein.
Analysis module 22 is used to calculate the front and rear depth of field corresponding to the focusing position and the definition range of imaging.
Because analysis module 22 is similar with the realization principle of step S22 in Fig. 2, thus do not illustrate more herein.
Data obtaining module 23 is used to be based on the definition range, obtains prospect, middle scape and the background of the photo.
Because data obtaining module 23 is similar with the realization principle of step S23 in Fig. 2, thus do not illustrate more herein.
Fuzzy Processing module 24 is used for according to the distance between each pixel in the prospect and background and the middle scape, to institute State prospect and background and carry out Fuzzy Processing respectively, wherein, it is fuzzy away from the nearer pixel of the middle scape in the prospect and background Degree is less than the fog-level of the pixel away from the middle scape farther out.
Because Fuzzy Processing module 24 is similar with the realization principle of step S24 in Fig. 2, thus do not illustrate more herein.
Image processing method, device and electronic equipment 10 in the embodiment of the present invention, based on double depth maps for taking the photograph system, with The shooting principle of slr camera is handled shooting image to obtain the single anti-effect truly blurred of simulation as algorithm logic, Realize that simply arithmetic speed is fast, can ensure to blur the high quality of picture, be particularly suitable for the virtualization effect of image for having depth map Realize.In addition, multiple functions opening voluntarily selects to user, user can be allowed to obtain different virtualization effects, increase application.
Image processing method, device and electronic equipment 10 in the embodiment of the present invention, using depth map as reference, for double The image for taking the photograph system carries out blurring or realizing automatically the function of first taking pictures and focus afterwards.User can not only selection region, moreover it is possible to Enough select fog-level, bokeh whether occur and bokeh shape and brightness.Whole scheme can be according to the chi of image Very little autonomous selection compression multiple, ensure to complete image procossing at a high speed while virtualization effect, and allow user in shooting process all It can be seen that preview design sketch.The principle that whole processing logic is shot in strict accordance with slr camera, the virtualization effect finally presented It is also very close to single anti-real shooting photo.
In several embodiments that the embodiment of the present invention is provided, it should be understood that disclosed apparatus and method, also may be used To realize by another way.Apparatus and method embodiment described above is only schematical, for example, in accompanying drawing Flow chart and block diagram show the device of multiple embodiments according to the present invention, the possibility of method and computer program product is realized Architectural framework, function and operation.At this point, each square frame in flow chart or block diagram can represent module, a program A part for section or code, a part for the module, program segment or code include one or more and are used to realize defined patrol Collect the executable instruction of function.It should also be noted that at some as the function of in the implementation replaced, being marked in square frame Can be with different from the order marked in accompanying drawing generation.For example, two continuous square frames can essentially be held substantially in parallel OK, they can also be performed in the opposite order sometimes, and this is depending on involved function.It is also noted that block diagram and/or The combination of each square frame and block diagram in flow chart and/or the square frame in flow chart, function or dynamic as defined in performing can be used The special hardware based system made is realized, or can be realized with the combination of specialized hardware and computer instruction.
In addition, each functional module in each embodiment of the present invention can integrate to form an independent portion Point or modules individualism, can also two or more modules be integrated to form an independent part.
If the function is realized in the form of software function module and is used as independent production marketing or in use, can be with It is stored in a computer read/write memory medium.Based on such understanding, technical scheme is substantially in other words The part to be contributed to prior art or the part of the technical scheme can be embodied in the form of software product, the meter Calculation machine software product is stored in a storage medium, including some instructions are causing a computer equipment (can be People's computer, electronic equipment 10, or network equipment etc.) perform all or part of step of each embodiment methods described of the present invention Suddenly.And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage (ROM, Read-Only Memory), deposit at random Access to memory (RAM, Random Access Memory), magnetic disc or CD etc. are various can be with the medium of store program codes. It should be noted that herein, term " comprising ", "comprising" or its any other variant are intended to the bag of nonexcludability Contain, so that process, method, article or equipment including a series of elements not only include those key elements, but also including The other element being not expressly set out, or also include for this process, method, article or the intrinsic key element of equipment. In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that including the key element Process, method, other identical element also be present in article or equipment.
The alternative embodiment of the present invention is the foregoing is only, is not intended to limit the invention, for the skill of this area For art personnel, the present invention can have various modifications and variations.Within the spirit and principles of the invention, that is made any repaiies Change, equivalent substitution, improvement etc., should be included in the scope of the protection.

Claims (10)

1. a kind of image processing method, it is characterised in that methods described includes:
Obtain the focusing position of photo;
Calculate the front and rear depth of field corresponding to the focusing position and the definition range of imaging;
Based on the definition range, prospect, middle scape and the background of the photo are obtained;
According to the distance between each pixel in the prospect and background and the middle scape, mould is carried out respectively to the prospect and background Paste processing, wherein, in the prospect and background, the fog-level away from the nearer pixel of the middle scape is less than away from the middle scape farther out Pixel fog-level.
2. image processing method according to claim 1, it is characterised in that calculate front and rear scape corresponding to the focusing position The step of deep and imaging definition range, includes:
The depth information of the focusing position is obtained by depth map;
Focusing principle based on slr camera, according to the depth information be calculated the focusing position the front and rear depth of field and The definition range of imaging.
3. image processing method according to claim 1, it is characterised in that based on the definition range, obtain the photograph The step of prospect of piece, middle scape and background, including:
Based on the definition range, object distance range corresponding to the definition range is calculated;
Corresponding object distance in the photo is less than the image section of the object distance range as prospect;
Corresponding object distance in the photo is located at the image section of the object distance range scape as in;
Corresponding object distance in the photo is more than the image section of the object distance range as background.
4. image processing method according to claim 1, it is characterised in that obscured respectively to the prospect and background The step of processing, includes:Fuzzy Processing is carried out respectively to the prospect and background in tri- passages of YUV;
Before carrying out Fuzzy Processing to the background, methods described also includes:
Search the intense light source position in image corresponding with the background in the photo;
Enhanced X-ray source is carried out to intense light source position described in the background on Y passages.
5. image processing method according to claim 4, it is characterised in that search corresponding with the background in the photo Image in intense light source position the step of, including:
Hot spot all in the photo is searched, wherein, the Y channel values of the hot spot are more than preset value;
Agglomerate is carried out to all hot spots, goes after noise processing to obtain intense light source position.
6. image processing method according to claim 5, it is characterised in that methods described also includes:
Carry out the intensity of enhanced X-ray source to intense light source position described in the background on Y passages by changing, obtain not Same afocal image intensity;Or/and
By changing the filtering nuclear shape that agglomerate is carried out to all hot spots, goes noise to handle, different Jiao is obtained Outer imaged shape.
7. according to the image processing method described in any one of claim 1~6, it is characterised in that to the prospect and background point Not carry out Fuzzy Processing the step of, in addition to:
Obtain the size of the photo;
Obtain corresponding with the photo of the size maximum blur radius according to preset rules, the maximum blur radius with it is described The middle scape distance farthest apart from the prospect or background is corresponding;
Obtain the regulation information of the maximum blur radius;
The maximum blur radius is adjusted according to the regulation information, so as to strengthen or weaken the fog-level of the photo.
8. according to the image processing method described in any one of claim 1~6, it is characterised in that to the prospect and background Before carrying out Fuzzy Processing, methods described also includes:
The photo is zoomed in and out by preset ratio;
After Fuzzy Processing is carried out to the prospect and background, methods described also includes:As corresponding with the preset ratio Ratio is reduced the photo.
A kind of 9. image processing apparatus, it is characterised in that including:
Information acquisition module, for obtaining the focusing position of photo;
Analysis module, for calculating the front and rear depth of field corresponding to the focusing position and the definition range of imaging;
Data obtaining module, for based on the definition range, obtaining prospect, middle scape and the background of the photo;
Fuzzy Processing module, for according to the distance between each pixel in the prospect and background and the middle scape, before described Scape and background carry out Fuzzy Processing respectively, wherein, in the prospect and background, the fog-level away from the nearer pixel of the middle scape Less than the fog-level of the pixel away from the middle scape farther out.
10. a kind of electronic equipment, including memory, processor and storage are on a memory and the calculating that can run on a processor Machine program, it is characterised in that realize following steps during the computing device described program:
Obtain the focusing position of photo;
Calculate the front and rear depth of field corresponding to the focusing position and the definition range of imaging;
Based on the definition range, prospect, middle scape and the background of the photo are obtained;
According to the distance between each pixel in the prospect and background and the middle scape, mould is carried out respectively to the prospect and background Paste processing, wherein, in the prospect and background, the fog-level away from the nearer pixel of the middle scape is less than away from the middle scape farther out Pixel fog-level.
CN201710752944.8A 2017-08-28 2017-08-28 Image processing method and device and electronic equipment Active CN107454332B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710752944.8A CN107454332B (en) 2017-08-28 2017-08-28 Image processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710752944.8A CN107454332B (en) 2017-08-28 2017-08-28 Image processing method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN107454332A true CN107454332A (en) 2017-12-08
CN107454332B CN107454332B (en) 2020-03-10

Family

ID=60494389

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710752944.8A Active CN107454332B (en) 2017-08-28 2017-08-28 Image processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN107454332B (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108234826A (en) * 2018-01-15 2018-06-29 厦门美图之家科技有限公司 Image processing method and device
CN108234865A (en) * 2017-12-20 2018-06-29 深圳市商汤科技有限公司 Image processing method, device, computer readable storage medium and electronic equipment
CN108335323A (en) * 2018-03-20 2018-07-27 厦门美图之家科技有限公司 A kind of weakening method and mobile terminal of image background
CN108564541A (en) * 2018-03-28 2018-09-21 麒麟合盛网络技术股份有限公司 A kind of image processing method and device
CN108629745A (en) * 2018-04-12 2018-10-09 Oppo广东移动通信有限公司 Image processing method, device based on structure light and mobile terminal
CN109035167A (en) * 2018-07-17 2018-12-18 北京新唐思创教育科技有限公司 Method, apparatus, equipment and the medium that multiple faces in image are handled
CN109559272A (en) * 2018-10-30 2019-04-02 深圳市商汤科技有限公司 A kind of image processing method and device, electronic equipment, storage medium
CN109819188A (en) * 2019-01-30 2019-05-28 维沃移动通信有限公司 The processing method and terminal device of video
CN109919867A (en) * 2019-02-21 2019-06-21 成都品果科技有限公司 A kind of filter method and device
CN110009555A (en) * 2018-01-05 2019-07-12 广东欧珀移动通信有限公司 Image weakening method, device, storage medium and electronic equipment
CN111246093A (en) * 2020-01-16 2020-06-05 Oppo广东移动通信有限公司 Image processing method, image processing device, storage medium and electronic equipment
CN113055584A (en) * 2019-12-26 2021-06-29 深圳市海思半导体有限公司 Focusing method based on fuzzy degree, lens controller and camera module
CN113129207A (en) * 2019-12-30 2021-07-16 武汉Tcl集团工业研究院有限公司 Method and device for blurring background of picture, computer equipment and storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11893668B2 (en) 2021-03-31 2024-02-06 Leica Camera Ag Imaging system and method for generating a final digital image via applying a profile to image information

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101764925A (en) * 2008-12-25 2010-06-30 华晶科技股份有限公司 Simulation method for shallow field depth of digital image
US20110274420A1 (en) * 2010-05-10 2011-11-10 Canon Kabushiki Kaisha Imaging apparatus and method for controlling same
CN103945210A (en) * 2014-05-09 2014-07-23 长江水利委员会长江科学院 Multi-camera photographing method for realizing shallow depth of field effect
CN106530252A (en) * 2016-11-08 2017-03-22 北京小米移动软件有限公司 Image processing method and device
CN106530241A (en) * 2016-10-31 2017-03-22 努比亚技术有限公司 Image blurring processing method and apparatus

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101764925A (en) * 2008-12-25 2010-06-30 华晶科技股份有限公司 Simulation method for shallow field depth of digital image
US20110274420A1 (en) * 2010-05-10 2011-11-10 Canon Kabushiki Kaisha Imaging apparatus and method for controlling same
CN103945210A (en) * 2014-05-09 2014-07-23 长江水利委员会长江科学院 Multi-camera photographing method for realizing shallow depth of field effect
CN106530241A (en) * 2016-10-31 2017-03-22 努比亚技术有限公司 Image blurring processing method and apparatus
CN106530252A (en) * 2016-11-08 2017-03-22 北京小米移动软件有限公司 Image processing method and device

Cited By (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11132770B2 (en) 2017-12-20 2021-09-28 Shenzhen Sensetime Technology Co., Ltd Image processing methods and apparatuses, computer readable storage media and electronic devices
CN108234865A (en) * 2017-12-20 2018-06-29 深圳市商汤科技有限公司 Image processing method, device, computer readable storage medium and electronic equipment
CN110546943B (en) * 2017-12-20 2021-08-31 深圳市商汤科技有限公司 Image processing method, image processing device, computer-readable storage medium and electronic equipment
CN110546943A (en) * 2017-12-20 2019-12-06 深圳市商汤科技有限公司 Image processing method, image processing device, computer-readable storage medium and electronic equipment
CN110009555B (en) * 2018-01-05 2020-08-14 Oppo广东移动通信有限公司 Image blurring method and device, storage medium and electronic equipment
CN110009555A (en) * 2018-01-05 2019-07-12 广东欧珀移动通信有限公司 Image weakening method, device, storage medium and electronic equipment
CN108234826A (en) * 2018-01-15 2018-06-29 厦门美图之家科技有限公司 Image processing method and device
CN108234826B (en) * 2018-01-15 2021-03-02 厦门美图之家科技有限公司 Image processing method and device
CN108335323A (en) * 2018-03-20 2018-07-27 厦门美图之家科技有限公司 A kind of weakening method and mobile terminal of image background
CN108335323B (en) * 2018-03-20 2020-12-29 厦门美图之家科技有限公司 Blurring method of image background and mobile terminal
CN108564541B (en) * 2018-03-28 2022-04-15 麒麟合盛网络技术股份有限公司 Image processing method and device
CN108564541A (en) * 2018-03-28 2018-09-21 麒麟合盛网络技术股份有限公司 A kind of image processing method and device
CN108629745A (en) * 2018-04-12 2018-10-09 Oppo广东移动通信有限公司 Image processing method, device based on structure light and mobile terminal
CN108629745B (en) * 2018-04-12 2021-01-19 Oppo广东移动通信有限公司 Image processing method and device based on structured light and mobile terminal
CN109035167A (en) * 2018-07-17 2018-12-18 北京新唐思创教育科技有限公司 Method, apparatus, equipment and the medium that multiple faces in image are handled
CN109035167B (en) * 2018-07-17 2021-05-18 北京新唐思创教育科技有限公司 Method, device, equipment and medium for processing multiple faces in image
CN109559272A (en) * 2018-10-30 2019-04-02 深圳市商汤科技有限公司 A kind of image processing method and device, electronic equipment, storage medium
CN109819188B (en) * 2019-01-30 2022-02-08 维沃移动通信有限公司 Video processing method and terminal equipment
CN109819188A (en) * 2019-01-30 2019-05-28 维沃移动通信有限公司 The processing method and terminal device of video
CN109919867A (en) * 2019-02-21 2019-06-21 成都品果科技有限公司 A kind of filter method and device
CN113055584A (en) * 2019-12-26 2021-06-29 深圳市海思半导体有限公司 Focusing method based on fuzzy degree, lens controller and camera module
CN113129207A (en) * 2019-12-30 2021-07-16 武汉Tcl集团工业研究院有限公司 Method and device for blurring background of picture, computer equipment and storage medium
CN111246093B (en) * 2020-01-16 2021-07-20 Oppo广东移动通信有限公司 Image processing method, image processing device, storage medium and electronic equipment
CN111246093A (en) * 2020-01-16 2020-06-05 Oppo广东移动通信有限公司 Image processing method, image processing device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN107454332B (en) 2020-03-10

Similar Documents

Publication Publication Date Title
CN107454332A (en) Image processing method, device and electronic equipment
Wu et al. Light field image processing: An overview
US11276177B1 (en) Segmentation for image effects
Kim et al. Multispectral transfer network: Unsupervised depth estimation for all-day vision
CN107925751A (en) For multiple views noise reduction and the system and method for high dynamic range
CN106462956A (en) Local adaptive histogram equalization
CN109903321A (en) Image processing method, image processing apparatus and storage medium
CN105678736B (en) Change the image processing system and its operating method of estimation of Depth with aperture
WO2011014421A2 (en) Methods, systems, and computer-readable storage media for generating stereoscopic content via depth map creation
US11810256B2 (en) Image modification techniques
CN109906599A (en) A kind of photographic method and terminal of terminal
CN113449623B (en) Light living body detection method based on deep learning
CN109525786A (en) Method for processing video frequency, device, terminal device and storage medium
CN105929544A (en) Virtual reality glasses
CN106204554A (en) Depth of view information acquisition methods based on multiple focussing image, system and camera terminal
CN106791456A (en) A kind of photographic method and electronic equipment
Ramirez et al. Open challenges in deep stereo: the booster dataset
WO2015175907A1 (en) Three dimensional moving pictures with a single imager and microfluidic lens
Yang et al. Raindrop removal with light field image using image inpainting
CN105450943B (en) Generate method and image acquiring device that image dissipates scape effect
Buquet et al. Evaluating the impact of wide-angle lens distortion on learning-based depth estimation
CN104754316A (en) 3D imaging method and device and imaging system
Ghosal et al. A geometry-sensitive approach for photographic style classification
Guo et al. Low-light color imaging via cross-camera synthesis
Zhao et al. Image aesthetics enhancement using composition-based saliency detection

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
GR01 Patent grant
GR01 Patent grant