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

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

Info

Publication number
CN109086705A
CN109086705A CN201810817215.0A CN201810817215A CN109086705A CN 109086705 A CN109086705 A CN 109086705A CN 201810817215 A CN201810817215 A CN 201810817215A CN 109086705 A CN109086705 A CN 109086705A
Authority
CN
China
Prior art keywords
convolution
image
processed
length
convolution kernel
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
CN201810817215.0A
Other languages
Chinese (zh)
Other versions
CN109086705B (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.)
Beijing Megvii Technology Co Ltd
Original Assignee
Beijing Megvii 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 Beijing Megvii Technology Co Ltd filed Critical Beijing Megvii Technology Co Ltd
Priority to CN201810817215.0A priority Critical patent/CN109086705B/en
Publication of CN109086705A publication Critical patent/CN109086705A/en
Application granted granted Critical
Publication of CN109086705B publication Critical patent/CN109086705B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Biophysics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

The embodiment of the present application provides a kind of image processing method, device, electronic equipment and storage medium, is related to field of image processing.Obtain image to be processed;According to the resolution ratio of default convolution number and image to be processed to image to be processed, the characteristic parameter of convolution kernel is determined;The process of convolution for carrying out default convolution number to image to be processed using the convolution kernel after determination, obtains convolution results data.So, it is determined based on the characteristic parameter to convolution kernel, it avoids to be adjusted image to be processed and the resolution ratio of image to be processed is caused to reduce, therefore the process of convolution of default convolution number is carried out using the convolution collecting image after determination and obtains convolution results data, it can be distorted to avoid portrait, therefore greatly improve the accuracy rate for improving Identification of Images.

Description

Image processing method, device, electronic equipment and storage medium
Technical field
This application involves field of image processing, in particular to a kind of image processing method, device, electronic equipment and Storage medium.
Background technique
In current video processing technique, carrying out identification to the portrait in video is a vital skill Art often plays central role to the identification of portrait especially in the various fields such as security protection, video frequency searching.
But in daily application, since the size of each camera shooting image is different, and again due to portrait Distance causes portrait in image also not of uniform size.Therefore during carrying out Identification of Images to image, need the size of image It is adjusted to and is matched with the operational parameter in image processing algorithm, but the size for adjusting image is likely to result in image resolution ratio substantially Reduction cause the accuracy rate of Identification of Images to be affected so that portrait is distorted in image.
Summary of the invention
The application is to provide a kind of image processing method, device, electronic equipment and storage medium, effectively to avoid image Middle portrait is distorted, and improves the accuracy rate of Identification of Images.
To achieve the goals above, embodiments herein is accomplished in that
In a first aspect, the embodiment of the present application provides a kind of image processing method, which comprises
Obtain image to be processed;
According to the resolution ratio of default convolution number and the image to be processed to the image to be processed, convolution kernel is determined Characteristic parameter;
The process of convolution of the default convolution number is carried out to the image to be processed using the convolution kernel after determination, Obtain convolution results data.
With reference to first aspect, the embodiment of the present application provides the first possible embodiment of first aspect, the spy Sign parameter includes convolution kernel size and convolution step-length, the basis to the default convolution number of the image to be processed and it is described to The resolution ratio for handling image, determines the characteristic parameter of convolution kernel, comprising:
According to the current convolution step-length of the convolution kernel, judge whether there is big with the convolution kernel of the resolution match It is small, enable the convolution kernel to carry out the process of convolution of preset times to the image to be processed;
If it is not, adjusting the convolution step-length of the convolution kernel, and the convolution is determined according to the convolution step-length adjusted The convolution kernel size of core;
In the convolution kernel size determined and the resolution match, determine the convolution kernel size be with it is described The size of resolution match, and determine that the convolution step-length adjusted is the step-length with the resolution match.
With reference to first aspect, the embodiment of the present application provides second of possible embodiment of first aspect, the tune The convolution step-length of the whole convolution kernel, and determine according to the convolution step-length adjusted the convolution kernel size of the convolution kernel, Include:
The current convolution step-length is sequentially reduced or is successively increased preset value, the convolution step-length after being adjusted, according to The convolution step-length adjusted each time determines the convolution kernel size of the convolution kernel.
With reference to first aspect, the embodiment of the present application provides the third possible embodiment of first aspect, described to incite somebody to action The current convolution step-length is sequentially reduced or successively increases preset value, the convolution step-length after being adjusted, according to adjusting each time The convolution step-length afterwards determines the convolution kernel size of the convolution kernel, comprising:
According to preset convolution step-length value range, judgement is located at the current convolution within the scope of the default convolution step-length Whether step-length is maximum value or minimum value within the scope of the default convolution step-length;
If it is not, the current convolution step-length is sequentially reduced preset value, the convolution step-length after being adjusted, and according to each The secondary convolution step-length adjusted determines the convolution kernel size of the convolution kernel;
Judge whether the convolution step-length adjusted each time is decreased to the minimum within the scope of the default convolution step-length Value;
If so, the current convolution step-length is successively increased into preset value, the convolution step-length after being adjusted, and according to each The secondary convolution step-length adjusted determines the convolution kernel size of the convolution kernel.
With reference to first aspect, the embodiment of the present application provides the 4th kind of possible embodiment of first aspect, and described It is described after judging whether there is the convolution kernel size with the resolution match according to the current convolution step-length of the convolution kernel Method further include:
If so, by the convolution kernel size adjust to the resolution match.
With reference to first aspect, any one possible embodiment in the first of first aspect to the 4th kind, this Shen Please embodiment provide described in the 5th kind of possible embodiment of first aspect acquisition image to be processed, which comprises
Obtain original image;
Judge whether there is the portrait being not exclusively blocked on the original image;
If so, cutting the size of the original image according to preset picture size range, the image to be processed is obtained, It wherein, include the portrait on the image to be processed, and the image to be processed meets the volume to the default convolution number Product processing.
With reference to first aspect, the embodiment of the present application provides the 6th kind of possible embodiment of first aspect, described to press The size of the original image is cut according to preset picture size range, after obtaining the image to be processed, the method is also Include:
By preset physical trait, the image to be processed is divided into multiple physical feeling images, wherein the multiple Each physical feeling image corresponds to each physical feeling in physical feeling image;
The convolution kernel using after determining carries out the convolution of the default convolution number to the image to be processed Processing obtains convolution results data, comprising:
Using the convolution kernel after determination to the carry out convolution of each physical feeling image in the image to be processed Processing, obtains the convolution results data of each physical feeling image;
By the corresponding storage of the convolution results data of each physical feeling image.
With reference to first aspect, the embodiment of the present application provides the 7th kind of possible embodiment of first aspect, the benefit The process of convolution of the default convolution number is carried out to the image to be processed with the convolution kernel adjusted, obtains convolution knot Fruit data, comprising:
It is described to obtain image to be processed, comprising:
Obtain the portrait of acquisition;
According to the recognition result to physical feeling in the portrait, the portrait is divided into multiple physical feeling images, Wherein, each physical feeling image is used as each image to be processed.
Second aspect, the embodiment of the present application provide a kind of image processing apparatus, and described device includes:
Module is obtained, for obtaining image to be processed;
Determining module, for the resolution according to default convolution number and the image to be processed to the image to be processed Rate determines the characteristic parameter of convolution kernel;
Convolution module, for carrying out the default convolution time to the image to be processed using the convolution kernel after determining Several process of convolution obtains convolution results data.
The third aspect, the embodiment of the present application provide a kind of electronic equipment, and the electronic equipment includes: processor, storage Device, bus and communication module;
The processor, the communication module and memory are connected by the bus;
The memory, for storing program;
The processor, for by calling the program execution of storage in the memory as processing method.
Fourth aspect, the embodiment of the present application provide a kind of meter of non-volatile program code that can be performed with processor The readable storage medium of calculation machine, said program code make the processor execute image processing method.
The beneficial effect of the embodiment of the present application is:
The embodiment of the present application provides a kind of image processing method, device, electronic equipment and storage medium, by obtaining After image to be processed, the feature ginseng of convolution kernel is determined according to the resolution ratio of default convolution number and the image to the image Number.So, it is determined, avoids to be adjusted image to be processed and caused wait locate based on the characteristic parameter to convolution kernel The resolution ratio for managing image reduces, therefore process of convolution and the acquisition of default convolution number are carried out using the convolution collecting image after determination Convolution results data can be distorted to avoid portrait, therefore greatly improve the accuracy rate of Identification of Images.
To enable the above objects, features, and advantages of the application to be clearer and more comprehensible, preferred embodiment is cited below particularly, and cooperate Appended attached drawing, is described in detail below.
Detailed description of the invention
Technical solution in ord to more clearly illustrate embodiments of the present application, below will be to needed in the embodiment attached Figure is briefly described, it should be understood that the following drawings illustrates only some embodiments of the application, therefore is not construed as pair The restriction of range for those of ordinary skill in the art without creative efforts, can also be according to this A little attached drawings obtain other relevant attached drawings.
Fig. 1 shows the structural block diagram of a kind of electronic equipment of the application first embodiment offer;
Fig. 2 shows a kind of flow charts for image processing method that the application second embodiment provides;
Fig. 3 shows image division body to be processed in a kind of image processing method of the application second embodiment offer The schematic diagram of position;
Fig. 4 shows first showing for convolution algorithm application in a kind of image processing method of the application second embodiment offer Example diagram;
Fig. 5 shows second showing for convolution algorithm application in a kind of image processing method of the application second embodiment offer Example diagram;
Fig. 6 shows a kind of structural block diagram of image processing apparatus of the application 3rd embodiment offer.
Specific embodiment
Below in conjunction with attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete Ground description, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.Usually exist The component of the embodiment of the present application described and illustrated in attached drawing can be arranged and be designed with a variety of different configurations herein.Cause This, is not intended to limit claimed the application's to the detailed description of the embodiments herein provided in the accompanying drawings below Range, but it is merely representative of the selected embodiment of the application.Based on embodiments herein, those skilled in the art not into Row goes out every other embodiment obtained under the premise of creative work, shall fall in the protection scope of this application.
It should also be noted that similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi It is defined in a attached drawing, does not then need that it is further defined and explained in subsequent attached drawing.Term " first ", " the Two " etc. are only used for distinguishing description, are not understood to indicate or imply relative importance.
First embodiment
Referring to Fig. 1, the embodiment of the present application provides electronic equipment 10, the electronic equipment 10 may include: memory 11, Communication module 12, bus 13 and processor 14.Wherein, processor 14, communication module 12 and memory 11 are connected by bus 13. Processor 14 is for executing the executable module stored in memory 11, such as computer program.Electronic equipment 10 shown in FIG. 1 Component and structure be it is illustrative, and not restrictive, as needed, electronic equipment 10 also can have other assemblies and Structure
Wherein, memory 11 may include high-speed random access memory (Random Access Memory RAM), It may further include non-labile memory (non-volatile memory), for example, at least a magnetic disk storage.This implementation In example, memory 11 stores program required for executing image processing method.
Bus 13 can be isa bus, pci bus or eisa bus etc..It is total that bus can be divided into address bus, data Line, control bus etc..Only to be indicated with a four-headed arrow in Fig. 1, it is not intended that an only bus or one convenient for indicating The bus of seed type.
Processor 14 may be a kind of processing capacity IC chip with signal.During realization, above-mentioned side Each step of method can be completed by the integrated logic circuit of the hardware in processor 14 or the instruction of software form.Above-mentioned Processor 14 can be general processor, including central processing unit (Central Processing Unit, abbreviation CPU), network Processor (Network Processor, abbreviation NP) etc.;It can also be digital signal processor (DSP), specific integrated circuit (ASIC), ready-made programmable gate array (FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components.General processor can be microprocessor or the processor is also possible to any conventional processor etc.. The step of method in conjunction with disclosed in the embodiment of the present invention, can be embodied directly in hardware decoding processor and execute completion, Huo Zheyong Hardware and software module combination in decoding processor execute completion.Software module can be located at random access memory, flash memory, read-only The storage medium of this fields such as memory, programmable read only memory or electrically erasable programmable memory, register maturation In.
Method performed by the device of stream process or definition that any embodiment of the embodiment of the present invention discloses can be applied to In processor 14, or realized by processor 14.Processor 14 is stored in after receiving and executing instruction by the calling of bus 13 After program in memory 11, processor 14, which controls communication module 12 by bus 13, can then execute the stream of image processing method Journey.
Second embodiment
Present embodiments provide a kind of image processing method, it should be noted that step shown in the flowchart of the accompanying drawings It can execute in a computer system such as a set of computer executable instructions, although also, showing patrol in flow charts Sequence is collected, but in some cases, it can be with the steps shown or described are performed in an order that is different from the one herein.Below to this Embodiment describes in detail.
Referring to Fig. 2, in image processing method provided in this embodiment, the image processing method include: step S100, Step S200 and step S300.
Step S100: image to be processed is obtained.
Step S200: according to the resolution ratio of default convolution number and the image to be processed to the image to be processed, Determine the characteristic parameter of convolution kernel.
Step S300: the default convolution number is carried out to the image to be processed using the convolution kernel after determination Process of convolution obtains convolution results data.
The scheme of the application will be specifically described below.
Step S100: image to be processed is obtained.
After electronic equipment obtains image to be processed, electronic equipment can be handled the image to be processed.Wherein, The mode that electronic equipment obtains the image to be processed can be to obtain the image to be processed, for example, based on taking the photograph from other equipment As the image to be processed currently acquired is sent to the electronic equipment by head and the image to be processed is obtained, in another example, from service The image to be processed etc. is downloaded on device.
As a kind of mode optionally, the image to be processed that electronic equipment obtains can be to have already passed through other equipment Treated image, for example, the image to be processed that server has acquired the camera is handled, i.e., electronic equipment obtains The image to be processed can be to meet electronic equipment and carry out subsequent process of convolution to the equipment to be processed and require image, that , electronic equipment can continue to execute subsequent step S200 after obtaining the image to be processed.
As another mode optionally, electronic equipment can obtain untreated original image, for example, electronics Equipment directly obtains the untreated original image of camera acquisition.For the execution convenient for electronic equipment follow-up process, electronics Equipment needs pre-process the original image.In this present embodiment, convolutional neural networks are preset in electronic equipment can be with Preparatory process of convolution is carried out to the original image, and obtains pretreated convolution results data.Electronic equipment has been based in advance The sample first learnt analyzes the pretreated convolution results data, so that it may judge whether have not on the original image The portrait being blocked completely.
It is understood that carrying out pretreatment to the original image by convolutional neural networks is that one kind can in the present embodiment Selection of land embodiment is not intended as limiting in the present embodiment.The present embodiment can also be using semantic slicing network or key point Network etc. pre-processes the original image.
Wherein, do not have the portrait being not exclusively blocked on being judged as the original image, then illustrate the original image not Meet treatment conditions, for example, the original image is that take be various objects or original image be that take portrait other Object is blocked completely or can not be identified since human body causes the portrait in the original image too small too far from camera. Optionally, electronic equipment can abandon the original image, terminate continuing to execute for follow-up process, and continue with other originals Beginning image.
There is the portrait being not exclusively blocked on being judged as the original image, then illustrate that the original image meets processing item Part, for example, the original image takes the bust for taking human body for the full-length picture or original image of human body.So, electronics Equipment then can use subsequent process and continue to handle the original image.
Optionally, to guarantee in subsequent treatment process, due to the size of the original image not necessarily meet can electricity Sub- equipment can carry out the process of convolution of default convolution number to the original image, and in order to guarantee that electronic equipment can be to image Carry out the process of convolution of default convolution number, thus electronic equipment can the size to the original image carry out certain processing.
Specifically, electronic equipment, according to preset picture size range, the size acquisition for cutting the original image is to be processed Image, the resolution ratio of acquisition image to be processed just can match the process of convolution of subsequent default convolution number.Wherein, preset Picture size range can be the corresponding multiple resolving range values of multiple length-width ratios, and each resolving range value can With subsequent convolution.For example, preset picture size may range from: 1200:900 to 400 under conditions of length-width ratio is 4:3: 300, in another example, under conditions of length-width ratio is 16:9, preset picture size be may range from: 1600:900 to 320:180.
It should be noted that cutting the figure to be processed of acquisition to guarantee the subsequent portrait that can be identified on image to be processed It is should also be as on picture with portrait, i.e. electronic equipment is when cutting original image, the selected length-width ratio of electronic equipment and length and width It should the size close to original image original itself as far as possible than corresponding resolution ratio.For example, the size of original image itself are as follows: Length-width ratio is 18:9, resolution ratio 720:360, then can choose the condition that length-width ratio is 16:9 to cut the original image, and It is not that length-width ratio is selected to cut the original image for 4:3.And the resolution ratio after original image cutting should also be as selection most Close to 720:360 resolution ratio, i.e., meet length-width ratio be 16:9 under conditions of, select the original image cut after resolution ratio for 640:360, so that the size of the image to be processed obtained is then closest to the size of the original image itself.Therefore, electronic equipment Using above-mentioned tailoring rule, can be realized in the case where guaranteeing that the cutting to original image meets default convolution number, it is right The edge of original image is cut and cuts a little less as far as possible, is cut into avoid the portrait in original image.
Also as another mode optionally, after electronic equipment obtains the image to be processed, for convenient for the figure to be processed As matching efficiency when being used for Identification of Images is higher, the physical feeling that electronic equipment can be different by portrait on image to be processed It marks off and, after the subsequent progress convolution to image to be processed, each physical feeling convolution is obtained the corresponding storage of data. If therefore carry out Identification of Images, each physical feeling convolution of distributed storage can be obtained data and individually call out to compare It is right, to improve the efficiency of Identification of Images.
Specifically, obtained by electronic equipment can pre-process the original image using convolutional neural networks based on before As a result, determine which physical feeling portrait on the image to be processed has, based on these physical feelings to be processed The image to be processed is divided multiple physical feeling images by the region on image.Wherein, each body in multiple physical feeling images Body region image is corresponding with each physical feeling of human body.
Such as shown in Fig. 3, it is bust that pre-process resulting result, which be the portrait on image to be processed, and the body of the portrait Body region has head, left hand and trunk, therefore image to be processed can be divided into: physical feeling image A, physical feeling image B and physical feeling image C, wherein physical feeling image A include head image and, body corresponding with the head of physical feeling Position image B include left hand image and and physical feeling image C corresponding with the left hand of physical feeling comprising trunk image And it is corresponding with the trunk of physical feeling.
It is understood that, it is not that electronic equipment will that image to be processed is divided into multiple physical feeling images by electronic equipment Image cutting to be processed, but each physical feeling image on image to be processed is identified.Using to each body Bit image is identified, in subsequent convolution process, electronic equipment to convolution to each physical feeling image track, The data that each physical feeling image convolution obtains can be carried out to corresponding storage.
Also as another mode optionally, electronic equipment can also be that electronics is set obtaining the mode of original image The standby portrait that can also directly obtain camera acquisition.Electronic equipment can also be by convolutional neural networks to the portrait of the acquisition Carry out pretreated convolution algorithm.In calculating process, electronic equipment is based on preset sample to the body in the portrait of the acquisition Body region is identified.
If not including portrait in the portrait for passing through the identification decision acquisition, then electronic equipment can be by the people of the acquisition As abandoning, the execution of follow-up process is terminated, and continue with the portrait of other acquisitions.
If by including portrait in the portrait of the identification decision acquisition, then electronic equipment can continue to be based on it is preset Sample identifies the portrait of the acquisition and obtains recognition result.To which electronic equipment is to the identification knot of physical feeling in portrait Portrait can be then divided into multiple physical feeling images by fruit, wherein each physical feeling image in multiple physical feeling images Correspond to each physical feeling.Later, electronic equipment each physical feeling image can be used as it is corresponding each to Image is handled, continues with each original image so as to subsequent.
It should be noted that each physical feeling due to portrait is in different size, therefore the multiple body bitmaps being divided into The size of each physical feeling image can not be identical as in.Optionally, each physical feeling image is used as corresponding every After a image to be processed, the subsequent characteristic parameter to convolution kernel used by each image procossing to be processed may not also be identical.
Step S200: according to the resolution ratio of default convolution number and the image to be processed to the image to be processed, Determine the characteristic parameter of convolution kernel.
Electronic equipment is obtaining image to be processed, and after image to be processed is divided into multiple physical feeling images, electricity Sub- equipment then needs the characteristic parameter by convolution kernel in preset convolutional neural networks to determine, so that the convolution kernel determined Characteristic parameter meet electronic equipment and can carry out the convolution for meeting default convolution number to the image to be processed using convolution kernel Processing.
As an optional implementation manner, to carry out convolution algorithm convenient for electronic equipment, electronic equipment is provided with default Convolution number, i.e., in the case where the size of every image to be processed is different, it is also desirable to be preset to every image to be processed The identical process of convolution of convolution number.
Optionally, the characteristic parameter of convolution kernel may include: convolution kernel size and convolution step-length, then electronic equipment can be with According to the default convolution number to the image to be processed, the current convolution step-length of convolution kernel is judged whether there is and figure to be processed The convolution kernel size of the resolution match of picture.I.e. electronic equipment judges in the current unadjusted situation of convolution step-length, if deposits In the convolution kernel size of the resolution match with image to be processed, so that electronic equipment utilizes the resolution ratio with image to be processed The convolution kernel size and current convolution step-length matched can carry out the process of convolution of default convolution number to image to be processed.If judgement For there are the resolution match of convolution kernel size and image to be processed, electronic equipment convolution kernel size can then be adjusted to this The resolution match of image to be processed.It is thereby achieved that in the case where guaranteeing that current convolution step-length is constant, by adjusting convolution Core size carries out the process of convolution of default convolution number to the image to be processed.
Such as shown in Fig. 4, the resolution ratio of image to be processed is 8:6, and presetting convolution number is 35 times, and before convolution kernel adjustment Characteristic parameter are as follows: convolution kernel size be 5:4, current convolution step-length be 1.So, electronic equipment can determine convolution kernel is big Small to adjust to 4:3, i.e., convolution kernel size is the convolution kernel of 4:3 and the resolution match of the image to be processed, and utilizes the convolution The convolution kernel and current convolution step-length that core size is 4:3 are 1, can satisfy 35 times handled the image convolution to be processed.Cause This, electronic equipment can adjust convolution kernel size to 4:3.
Electronic equipment is 4:3 using the convolution kernel size and the convolution kernel of convolution step-length 1 rolls up the image to be processed When product processing, a convolution of the convolution kernel can acquire the first parameter of 12 pixels in dotted line frame A in Fig. 4, and be based on 12 the first parameters carry out operation.And when proceeding to convolution algorithm next time, to the convolution region of image to be processed just by void Wire frame A is moved to dotted line frame B with convolution step-length for 1, and convolution kernel can acquire the second ginseng of 12 pixels in dotted line frame B Number, and operation is carried out based on 12 the second parameters.And so on, electronic equipment just can carry out the image to be processed 35 times Convolution.
If judging, there is no the resolution match as convolution kernel size and image to be processed, electronic equipment, which can determine, to be protected Demonstrate,prove convolution step-length it is constant in the case where, the image to be processed can not be carried out meeting default convolution by adjusting convolution kernel size The process of convolution of number, therefore electronic equipment can be adjusted convolution step-length.
In the present embodiment, the convolution step-length of the adjustable convolution kernel of electronic equipment, and it is true according to convolution step-length adjusted Determine the convolution kernel size of convolution kernel, for example, current convolution step-length can be sequentially reduced or be successively increased preset value by electronic equipment, And available convolution step-length adjusted, then electronic equipment can determine institute according to convolution step-length adjusted each time State the convolution kernel size of convolution kernel, wherein preset value can use 0.5 or 1, but be not intended as limiting.
Specifically, electronic equipment carries out the process for being sequentially reduced preset value or successively increasing preset value to current convolution step-length It can be with are as follows:
Electronic equipment is by preset convolution step-length value range, and electronic equipment is it may determine that be located at the default convolution step-length Whether the current convolution step-length in range is that this presets the maximum value or minimum value within the scope of convolution step-length.
If current convolution step-length is not the maximum value or minimum value within the scope of the default convolution step-length, for convenient for subsequent progress Resulting result is thinner when process of convolution and effect is more preferable, and current convolution step-length can be sequentially reduced preset value by electronic equipment, Convolution step-length after being adjusted, and determine according to convolution step-length adjusted each time the convolution kernel size of convolution kernel.
If determining the convolution kernel size of convolution kernel and point of image to be processed according to certain primary convolution step-length adjusted Resolution matching, electronic equipment knows that convolution kernel size can be determined, so as to no longer adjust convolution step-length.
If determining the convolution kernel size of convolution kernel and point of image to be processed according to convolution step-length adjusted each time Resolution mismatches, and electronic equipment knows that convolution kernel size has not determined out, to need to continue to adjust convolution step-length.Therefore in determination When needing to continue to adjust convolution step-length, electronic equipment may determine that whether convolution step-length adjusted it is default be decreased to this each time Minimum value within the scope of convolution step-length.If not minimum value, then electronic equipment continues to reduce volume adjusted by preset value Product step-length, by continuing to reduce convolution kernel of the convolution step-length adjusted to determine the resolution match with image to be processed Size.If minimum value, then just explanation during current convolution step-length is decreased to minimum value, have not determined out with to Handle the convolution kernel size of the resolution match of image.To electronic equipment current convolution step-length can be successively increased again it is default Value, the convolution step-length after being adjusted, and the convolution kernel size of convolution kernel is also determined according to convolution step-length adjusted each time. To successively increase the process of preset value to maximum value in current convolution step-length, determined according to certain primary convolution step-length adjusted The resolution match of the convolution kernel size of convolution kernel and image to be processed out, electronic equipment know that convolution kernel size can determine Out, so as to no longer adjusting convolution step-length.
In the present embodiment, electronic equipment after determining the convolution kernel size with the resolution match of image to be processed, that Electronic equipment can determine that convolution kernel size is the size with the resolution match of image to be processed, and determine volume adjusted Product step-length is the step-length with resolution match.Electronic equipment can utilize the matched convolution kernel size and convolution adjusted Core step-length carries out subsequent convolution algorithm.
It should also be noted that, if electronic equipment determines that current convolution step-length is the maximum within the scope of the default convolution step-length Value, then electronic equipment can be by being sequentially reduced preset value for current convolution step-length, the convolution step-length after being adjusted, and The convolution kernel size of convolution kernel is determined according to convolution step-length adjusted each time.To current convolution step-length by maximum value according to The secondary process for being decreased to minimum value, according to certain primary convolution step-length adjusted determine the convolution kernel size of convolution kernel with wait locate The resolution match of image is managed, electronic equipment knows that convolution kernel size can be determined, so as to no longer adjust convolution step-length. And also determine that the convolution kernel size is the size with the resolution match of image to be processed, and also determine convolution step-length adjusted For the step-length of the resolution match with the image to be processed.
It is accordingly, if electronic equipment determines that current convolution step-length is the minimum value within the scope of the default convolution step-length, that Electronic equipment can be by successively increasing preset value for current convolution step-length, the convolution step-length after being adjusted, and also basis Convolution step-length adjusted determines the convolution kernel size of convolution kernel each time.To successively be increased in current convolution step-length by minimum value The process for adding to maximum value, according to certain primary convolution step-length adjusted determine convolution kernel convolution kernel size and figure to be processed The resolution match of picture, electronic equipment know that convolution kernel size can be determined, so as to no longer adjust convolution step-length.And Determine that the convolution kernel size is size with the resolution match of image to be processed, and also determine convolution step-length adjusted be with The step-length of the resolution match of the image to be processed.
It should be understood that convolution step-length adjusted should not be more than matched convolution kernel size.
Such as shown in Fig. 5, also 8:6, default convolution number are 24 times to the resolution ratio of image to be processed, and before convolution kernel adjustment Characteristic parameter are as follows: convolution kernel size be 5:4, convolution step-length be 1.So, electronic equipment can determine that in convolution step-length be 1 On the basis of unregulated, the image to be processed can not be carried out 24 times by adjusting convolution kernel size to resolution match Process of convolution.Therefore, electronic equipment can increase by 1 according to preset rules adjusting convolution step-length to 2.
Electronic equipment based on convolution step-length be 2 can determine to adjust convolution kernel size to the image to be processed When the 4:3 of resolution match, and it is 4:3 using convolution kernel size and convolution step-length is 2, can satisfy to the image volume to be processed 24 times of product processing.Therefore, while electronic equipment can adjust convolution step-length to 2, also convolution kernel size is adjusted to 4: 3.When carrying out process of convolution to the image to be processed using the convolution kernel that convolution kernel size is 4:3 and convolution step-length is 2, the volume Convolution of product core can acquire the third parameters of 12 pixels in dotted line frame C in Fig. 5, and based on 12 third parameters into Row operation.And when proceeding to convolution algorithm next time, to the convolution region of image to be processed just by dotted line frame c with convolution stepping Dotted line frame D is moved to for 2, and convolution kernel can acquire the 4th parameter of 12 pixels in dotted line frame D, and based on 12 the Four parameters carry out operation.And so on, electronic equipment just can carry out 24 convolution to the image to be processed.
As another optional implementation manner, a table, the table can be preset in the present embodiment, in electronic equipment Incidence relation between interior every kind of resolution ratio equipped with image and corresponding convolution kernel size and convolution step-length.Therefore electronic equipment exists After obtaining image to be processed, electronic equipment can determine the resolution ratio with the image to be processed from table by traversal table Matched target resolution, and be assured that out further according to the incidence relation of the target resolution and match image to be processed The convolution kernel size and convolution step-length of resolution ratio.
Step S300: the default convolution number is carried out to the image to be processed using the convolution kernel adjusted Process of convolution obtains convolution results data.
Since the image to be processed has been already divided into multiple physical feeling images, then during convolution, electronics Equipment can to convolution to each physical feeling image track.Correspondingly, electronic equipment utilizes the convolution adjusted Core just can carry out the process of convolution of default convolution number to the image to be processed, it can utilize for electronic equipment adjusted Carry out process of convolution of the convolution kernel to each physical feeling image in image to be processed.Therefore, based on to physical feeling image Tracking, electronic equipment is obtained with the convolution results data of each physical feeling image, obtains multiple convolution results data. Optionally, electronic equipment can divide the convolution results data of each physical feeling image to door according to preset storage rule Store corresponding storage region.
3rd embodiment
Referring to Fig. 6, the embodiment of the present application provides a kind of image processing apparatus 100, the image processing apparatus 100 application In electronic equipment, which includes:
Module 110 is obtained, for obtaining image to be processed.
Determining module 120, for according to the default convolution number of the image to be processed and the image to be processed Resolution ratio determines the characteristic parameter of convolution kernel.
Convolution module 130, for carrying out the default volume to the image to be processed using the convolution kernel after determining The process of convolution of product number, obtains convolution results data.
It should be noted that due to it is apparent to those skilled in the art that, for the convenience and letter of description Clean, system, the specific work process of device and unit of foregoing description can be with reference to corresponding in preceding method embodiment Journey, details are not described herein.
It should be understood by those skilled in the art that, the embodiment of the present application can provide as the production of method, system or computer program Product.Therefore, in terms of the embodiment of the present application can be used complete hardware embodiment, complete software embodiment or combine software and hardware Embodiment form.Moreover, it wherein includes computer available programs generation that the embodiment of the present application, which can be used in one or more, The meter implemented in the computer-usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) of code The form of calculation machine program product.
In conclusion the embodiment of the present application provides a kind of image processing method, device, electronic equipment and storage medium. Method includes: to obtain image to be processed;According to the resolution ratio of default convolution number and image to be processed to image to be processed, really Determine the characteristic parameter of convolution kernel;The process of convolution of default convolution number is carried out to image to be processed using the convolution kernel after determination, Obtain convolution results data.
The characteristic parameter of convolution kernel is determined according to the resolution ratio of default convolution number and the image to the image.That , it is determined based on the characteristic parameter to convolution kernel, avoids to be adjusted image to be processed and lead to figure to be processed The resolution ratio of picture reduces, therefore carries out the process of convolution of default convolution number using the convolution collecting image after determination and obtain convolution Result data can be distorted to avoid portrait, therefore greatly improve the accuracy rate for improving Identification of Images.
The above is only preferred embodiment of the present application, are not intended to limit this application, for those skilled in the art For member, various changes and changes are possible in this application.Within the spirit and principles of this application, it is made it is any modification, Equivalent replacement, improvement etc., should be included within the scope of protection of this application.It should also be noted that similar label and letter are under Similar terms are indicated in the attached drawing in face, therefore, once being defined in a certain Xiang Yi attached drawing, are not then needed in subsequent attached drawing It is further defined and explained.
More than, the only specific embodiment of the application, but the protection scope of the application is not limited thereto, and it is any to be familiar with Those skilled in the art within the technical scope of the present application, can easily think of the change or the replacement, and should all cover Within the protection scope of the application.Therefore, the protection scope of the application should be subject to the protection scope in claims.

Claims (11)

1. a kind of image processing method, which is characterized in that the described method includes:
Obtain image to be processed;
According to the resolution ratio of default convolution number and the image to be processed to the image to be processed, the spy of convolution kernel is determined Levy parameter;
The process of convolution of the default convolution number is carried out to the image to be processed using the convolution kernel after determination, is obtained Convolution results data.
2. image processing method according to claim 1, which is characterized in that the characteristic parameter include convolution kernel size and Convolution step-length, the basis determine the default convolution number of the image to be processed and the resolution ratio of the image to be processed The characteristic parameter of convolution kernel, comprising:
According to the current convolution step-length of the convolution kernel, the convolution kernel size with the resolution match is judged whether there is, is made The process of convolution of preset times can be carried out to the image to be processed by obtaining the convolution kernel;
If it is not, adjusting the convolution step-length of the convolution kernel, and the convolution kernel is determined according to the convolution step-length adjusted Convolution kernel size;
In the convolution kernel size and the resolution match determined, determine that the convolution kernel size is and the resolution The matched size of rate, and determine that the convolution step-length adjusted is the step-length with the resolution match.
3. image processing method according to claim 2, which is characterized in that the convolution step of the adjustment convolution kernel It grows, and determines the convolution kernel size of the convolution kernel according to the convolution step-length adjusted, comprising:
The current convolution step-length is sequentially reduced or is successively increased preset value, the convolution step-length after being adjusted, according to each The secondary convolution step-length adjusted determines the convolution kernel size of the convolution kernel.
4. image processing method according to claim 3, which is characterized in that described successively to subtract the current convolution step-length Small or successively increase preset value, the convolution step-length after being adjusted determines institute according to the convolution step-length adjusted each time State the convolution kernel size of convolution kernel, comprising:
According to preset convolution step-length value range, judgement is located at the current convolution step-length within the scope of the default convolution step-length It whether is maximum value or minimum value within the scope of the default convolution step-length;
If it is not, the current convolution step-length is sequentially reduced preset value, the convolution step-length after being adjusted, and according to adjusting each time The convolution step-length after whole determines the convolution kernel size of the convolution kernel;
Judge whether the convolution step-length adjusted each time is decreased to the minimum value within the scope of the default convolution step-length;
If so, the current convolution step-length is successively increased preset value, the convolution step-length after being adjusted, and according to adjusting each time The convolution step-length after whole determines the convolution kernel size of the convolution kernel.
5. image processing method according to claim 2, which is characterized in that the current convolution according to the convolution kernel Step-length, after judging whether there is the convolution kernel size with the resolution match, the method also includes:
If so, by the convolution kernel size adjust to the resolution match.
6. image processing method described in -5 any claims according to claim 1, which is characterized in that described to obtain figure to be processed Picture, which comprises
Obtain original image;
Judge whether there is the portrait being not exclusively blocked on the original image;
If so, cutting the size of the original image according to preset picture size range, the image to be processed is obtained, In, it include the portrait on the image to be processed, and the image to be processed meets the convolution to the default convolution number Processing.
7. image processing method according to claim 6, which is characterized in that described to be cut out according to preset picture size range The size of the original image is cut, after obtaining the image to be processed, the method also includes:
By preset physical trait, the image to be processed is divided into multiple physical feeling images, wherein the multiple body Each physical feeling image corresponds to each physical feeling in the image of position;
The convolution kernel using after determining carries out the process of convolution of the default convolution number to the image to be processed, Obtain convolution results data, comprising:
Using the convolution kernel after determination to the carry out process of convolution of each physical feeling image in the image to be processed, Obtain the convolution results data of each physical feeling image.
8. image processing method according to claim 6, which is characterized in that described to obtain image to be processed, comprising:
Obtain the portrait of acquisition;
According to the recognition result to physical feeling in the portrait, the portrait is divided into multiple physical feeling images, wherein Each physical feeling image is used as each image to be processed.
9. a kind of image processing apparatus, which is characterized in that described device includes:
Module is obtained, for obtaining image to be processed;
Determining module, for according to the default convolution number of the image to be processed and the resolution ratio of the image to be processed, Determine the characteristic parameter of convolution kernel;
Convolution module, for carrying out the default convolution number to the image to be processed using the convolution kernel after determination Process of convolution obtains convolution results data.
10. a kind of electronic equipment, which is characterized in that the electronic equipment includes: processor, memory, bus and communication module;
The processor, the communication module and memory are connected by the bus;
The memory, for storing program;
The processor, for by calling the program of storage in the memory to execute such as any claim of claim 1-8 The image processing method.
11. a kind of computer-readable storage media for the non-volatile program code that can be performed with processor, which is characterized in that Said program code makes the processor execute the image processing method as described in any claim of claim 1-8.
CN201810817215.0A 2018-07-23 2018-07-23 Image processing method, image processing device, electronic equipment and storage medium Active CN109086705B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810817215.0A CN109086705B (en) 2018-07-23 2018-07-23 Image processing method, image processing device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810817215.0A CN109086705B (en) 2018-07-23 2018-07-23 Image processing method, image processing device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109086705A true CN109086705A (en) 2018-12-25
CN109086705B CN109086705B (en) 2021-11-16

Family

ID=64838227

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810817215.0A Active CN109086705B (en) 2018-07-23 2018-07-23 Image processing method, image processing device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109086705B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109615066A (en) * 2019-01-30 2019-04-12 新疆爱华盈通信息技术有限公司 A kind of method of cutting out of the convolutional neural networks for NEON optimization
CN111311599A (en) * 2020-01-17 2020-06-19 北京达佳互联信息技术有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN111382685A (en) * 2020-03-04 2020-07-07 电子科技大学 Scene recognition method and system based on deep learning

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160358068A1 (en) * 2015-06-04 2016-12-08 Samsung Electronics Co., Ltd. Reducing computations in a neural network
CN106682127A (en) * 2016-12-13 2017-05-17 上海联影医疗科技有限公司 Image searching system and method
CN107784654A (en) * 2016-08-26 2018-03-09 杭州海康威视数字技术股份有限公司 Image partition method, device and full convolutional network system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160358068A1 (en) * 2015-06-04 2016-12-08 Samsung Electronics Co., Ltd. Reducing computations in a neural network
CN107784654A (en) * 2016-08-26 2018-03-09 杭州海康威视数字技术股份有限公司 Image partition method, device and full convolutional network system
CN106682127A (en) * 2016-12-13 2017-05-17 上海联影医疗科技有限公司 Image searching system and method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109615066A (en) * 2019-01-30 2019-04-12 新疆爱华盈通信息技术有限公司 A kind of method of cutting out of the convolutional neural networks for NEON optimization
CN111311599A (en) * 2020-01-17 2020-06-19 北京达佳互联信息技术有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN111311599B (en) * 2020-01-17 2024-03-26 北京达佳互联信息技术有限公司 Image processing method, device, electronic equipment and storage medium
CN111382685A (en) * 2020-03-04 2020-07-07 电子科技大学 Scene recognition method and system based on deep learning

Also Published As

Publication number Publication date
CN109086705B (en) 2021-11-16

Similar Documents

Publication Publication Date Title
CN106875422B (en) Face tracking method and device
KR102385463B1 (en) Facial feature extraction model training method, facial feature extraction method, apparatus, device and storage medium
WO2020098250A1 (en) Character recognition method, server, and computer readable storage medium
CN109086705A (en) Image processing method, device, electronic equipment and storage medium
CN109993040B (en) Text recognition method and device
US20050249429A1 (en) Method, apparatus, and program for image processing
CN104978578B (en) Mobile phone photograph text image method for evaluating quality
CN109034078A (en) Training method, age recognition methods and the relevant device of age identification model
CN109743473A (en) Video image 3 D noise-reduction method, computer installation and computer readable storage medium
US7668389B2 (en) Image processing method, image processing apparatus, and image processing program
CN110784644B (en) Image processing method and device
CN111695462A (en) Face recognition method, face recognition device, storage medium and server
CN106027854B (en) A kind of Federated filter noise-reduction method applied in camera suitable for FPGA realization
CN115278089B (en) Face fuzzy image focusing correction method, device, equipment and storage medium
CN111311562B (en) Ambiguity detection method and device for virtual focus image
CN111179276A (en) Image processing method and device
CN110111261A (en) Adaptive equalization processing method, electronic equipment and the computer readable storage medium of image
CN113011409A (en) Image identification method and device, electronic equipment and storage medium
CN113011433B (en) Filtering parameter adjusting method and device
CN110610117A (en) Face recognition method, face recognition device and storage medium
CN113838076A (en) Method and device for labeling object contour in target image and storage medium
CN110400312A (en) Determine the method, apparatus and server of image vague category identifier
CN113438386B (en) Dynamic and static judgment method and device applied to video processing
CN113486858B (en) Face recognition model training method and device, electronic equipment and storage medium
CN113239738B (en) Image blurring detection method and blurring detection device

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