CN108491258A - Method and apparatus for handling image - Google Patents

Method and apparatus for handling image Download PDF

Info

Publication number
CN108491258A
CN108491258A CN201810270168.2A CN201810270168A CN108491258A CN 108491258 A CN108491258 A CN 108491258A CN 201810270168 A CN201810270168 A CN 201810270168A CN 108491258 A CN108491258 A CN 108491258A
Authority
CN
China
Prior art keywords
threads
facial image
thread
image
threshold value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810270168.2A
Other languages
Chinese (zh)
Inventor
张刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Baidu Online Network Technology Beijing Co Ltd
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201810270168.2A priority Critical patent/CN108491258A/en
Publication of CN108491258A publication Critical patent/CN108491258A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • 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
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • General Engineering & Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the present application discloses the method and apparatus for handling image.One specific implementation mode of this method includes:Obtain at least one facial image;Quantity based on facial image and preset number of threads threshold value determine the number of threads of the thread handled facial image;An at least facial image is distributed into number of threads thread, wherein thread in number of threads thread is will treated enters wait state after facial image is sent to image storage service end.The embodiment is realized using multiple thread process facial images, improves execution efficiency.

Description

Method and apparatus for handling image
Technical field
The invention relates to field of computer technology, and in particular to the method and apparatus for handling image.
Background technology
Currently, face recognition technology is current main biological identification technology, since it is with untouchable, friendly, square Just the features such as, not noticeable, is easy to be received by user, enables user without any mental handicape, to obtain widely grinding Study carefully and apply, is computer vision and important one of the project of area of pattern recognition.
In face recognition technology, computer-internal needs many work, especially many data processing works.Such as Before carrying out recognition of face, Face datection is carried out, detect the position of 3 faces, respectively face A, face B and face C, then The key point (eyes, nose and mouth etc.) for specifically detecting each face, finally extracts each feature of each face.When detecting Face quantity when having multiple, handled using serial manner, that is, handle perfect person's face A and then processing face B, processing Face C is reprocessed after perfect person's face B, in this case, it is necessary to improve the efficiency of program execution.
Invention content
The embodiment of the present application proposes the method and apparatus for handling image.
In a first aspect, the embodiment of the present application provides a kind of method for handling image, including:Obtain at least one people Face image;Quantity based on facial image and preset number of threads threshold value determine the thread handled facial image Number of threads;An at least facial image is distributed into number of threads thread, wherein the thread in number of threads thread exists By treated, facial image is sent to image storage service end later into wait state.
In some embodiments, the quantity based on facial image and preset number of threads threshold value are determined to facial image The number of threads of the thread handled, including:It is more than or equal to number of threads threshold value in response to the quantity of facial image, determines line Number of passes amount is number of threads threshold value.
In some embodiments, the quantity based on facial image and preset number of threads threshold value are determined to facial image The number of threads of the thread handled further includes:It is less than number of threads threshold value in response to the quantity of facial image, determines thread Quantity is the quantity of facial image.
In some embodiments, at least number of threads thread will be distributed to by a facial image, including:In response to thread Quantity is number of threads threshold value, at least will distribute to number of threads threshold value thread by a facial image.
In some embodiments, it at least will distribute to number of threads thread by a facial image, and further include:In response to line Number of passes amount is the quantity of facial image, and the quantity thread of facial image is chosen from number of threads threshold value thread;It will at least One facial image distributes to the quantity thread of facial image.
Second aspect, the embodiment of the present application provide a kind of device for handling image, which includes:It obtains single Member, number of threads determination unit and processing unit, acquiring unit are configured to obtain at least one facial image;Number of threads Determination unit is configured to the quantity based on facial image and preset number of threads threshold value, determines to facial image The number of threads of the thread of reason;Processing unit is configured to an at least facial image distributing to number of threads thread, In, thread in number of threads thread is will treated enters after facial image is sent to image storage service end and wait for State.
In some embodiments, processing unit includes:First determining module is configured to the quantity in response to facial image More than or equal to number of threads threshold value, determine that number of threads is number of threads threshold value.
In some embodiments, processing unit further includes:Second determining module is configured to the number in response to facial image Amount is less than number of threads threshold value, determines that number of threads is the quantity of facial image.
In some embodiments, number of threads determination unit is further configured to:It is Thread Count in response to number of threads Threshold value is measured, at least will distribute to number of threads threshold value thread by a facial image.
In some embodiments, number of threads determination unit is further configured to:It is face figure in response to number of threads The quantity of picture chooses the quantity thread of facial image from number of threads threshold value thread;It will an at least facial image point The quantity thread of dispensing facial image.
The third aspect, the embodiment of the present application provide a kind of electronic equipment, which includes:One or more processing Device;Storage device, for storing one or more programs;When one or more programs are executed by one or more processors, make Obtain method of the one or more processors realization as described in any realization method in first aspect.
Fourth aspect, the embodiment of the present application provide a kind of computer-readable medium, are stored thereon with computer program, should The method as described in any realization method in first aspect is realized when computer program is executed by processor.
Method and apparatus provided by the embodiments of the present application for handling image, by obtaining at least one facial image; Quantity based on facial image and preset number of threads threshold value determine the Thread Count of the thread handled facial image Amount;An at least facial image is distributed into number of threads thread, wherein the thread in number of threads thread will handled Facial image afterwards enters wait state after being sent to image storage service end.To realize using multiple thread process people Face image improves execution efficiency.
Description of the drawings
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the application's is other Feature, objects and advantages will become more apparent upon:
Fig. 1 is that this application can be applied to exemplary system architecture figures therein;
Fig. 2 is the flow chart according to one embodiment of the method for handling image of the application;
Fig. 3 is the schematic diagram according to an application scenarios of the method for handling image of the application;
Fig. 4 is the flow chart according to another embodiment of the method for handling image of the application;
Fig. 5 is the flow chart according to another embodiment of the method for handling image of the application;
Fig. 6 is the structural schematic diagram according to one embodiment of the device for handling image of the application;
Fig. 7 is adapted for the structural schematic diagram of the computer system of the server for realizing the embodiment of the present application.
Specific implementation mode
The application is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to Convenient for description, is illustrated only in attached drawing and invent relevant part with related.
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase Mutually combination.The application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 shows the example of the method for handling image or the device for handling image that can apply the application Property framework 100.
As shown in Figure 1, system architecture 100 may include terminal device (being shown as entrance guard device in figure) 101, terminal device (smart mobile phone is shown as in figure) 102, terminal device (gate that safety check is shown as in figure) 103, network 104, network 106, Server 105 and storage server 107.Network 104 between terminal device 101,102,103 and server 105 providing The medium of communication link.Network 106 between server 105 and storage server 107 provide communication link medium.Net Network 104,106 may include various connection types, such as wired, wireless communication link or fiber optic cables etc..
Terminal device 101,102,103 is interacted by network 104 with server 105, to receive or send message etc..Terminal Camera can be installed in equipment 101,102,103, or various client applications are installed, such as image processing class is answered With the application of, photography and vedio recording class, searching class application, the application of browsing class, social platform software etc..
Terminal device 101,102,103 can be hardware, can also be software.When terminal device 101,102,103 is hard Can be the various electronic equipments that there is camera and image is supported to transmit, including but not limited to smart mobile phone, gate inhibition when part Device, the gate with camera, tablet computer, pocket computer on knee and desktop computer etc..Work as terminal device 101,102,103 when being software, may be mounted in above-mentioned cited electronic equipment.Multiple softwares or soft may be implemented into it Part module (such as providing Distributed Services), can also be implemented as single software or software module.Specific limit is not done herein It is fixed.
Server 105 can be to provide the server of various services, for example, be obtained on terminal device 101,102,103 Facial image is allocated the allocation processing server 105 of processing.Allocation processing server 105 can be to the facial image of acquisition It carries out the processing such as analyzing.By treated, facial image is sent to that treated, image that facial image stores stores clothes Business device 107.
It should be noted that above-mentioned facial image can also be stored directly in the local of server 105, server 105 can Directly to extract the local facial image stored and be handled, at this point it is possible to which 101,102,103 and of terminal device is not present Network 104.
It should be noted that the method for handling image that the embodiment of the present application is provided can be held by server 105 Row, correspondingly, the device for handling image is generally positioned in server 105.
It should be noted that server can be hardware, can also be software.When server is hardware, may be implemented At the distributed server cluster that multiple servers form, individual server can also be implemented as.It, can when server is software To be implemented as that for example single software or software can also be implemented as providing the multiple softwares or software module of Distributed Services Module.It is not specifically limited herein.
It should be understood that the number of the terminal device, network and server in Fig. 1 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
With continued reference to Fig. 2, the flow of one embodiment of the method for handling image according to the application is shown 200.The method for being used to handle image includes the following steps:
Step 201, at least one facial image is obtained.
In the present embodiment, the executive agent (such as server 105 shown in FIG. 1) of the method for handling image can be with By wired connection mode or radio connection from terminal device (such as terminal device shown in FIG. 1 101,102,103) Obtain at least one facial image.Wherein, terminal device can be the various electronics for carrying camera and supporting image procossing It is equipment, including but not limited to smart mobile phone, the entrance guard device with camera, the gate with camera, tablet computer, above-knee Type pocket computer and desktop computer etc..Here, facial image is exactly the face-image of acquired people, referred to as face figure Picture.
Step 202, the quantity based on facial image and preset number of threads threshold value, determination handle facial image Thread number of threads.
In the present embodiment, based at least one facial image acquired in step 201, above-mentioned executive agent can be based on The quantity of facial image and preset number of threads threshold value determine the number of threads of the thread handled facial image.It needs It is noted that preset number of threads threshold value can be the line that (such as Face datection purpose) is pre-created for various purposes The Thread Count magnitude of journey.As an example, thread as much as possible can be selected to carry out executor from the above-mentioned thread being pre-created The processing work of face image.Determining number of threads accordingly can be as close as the thread for the thread being pre-created as a result, Sum.
It should be noted that after above-mentioned thread can start for above-mentioned executive agent, for various purposes (such as to face The purpose that image is handled) in advance and create thread.
In general, in order to handle facial image, above-mentioned executive agent can be pre-created for the multiple of image procossing Thread is to improve the efficiency of processing.When calling these threads, caller can directly for use thread without again It creates.And after the completion of calling, caller need not also destroy these threads.In this way, these threads only create and destroy once, With this influence to performance is frequently created and destroys to reduce thread.
Step 203, at least number of threads thread will be distributed to by a facial image.
In the present embodiment, the number of threads based on determined by step 202, above-mentioned executive agent can will an at least people Face image distributes to number of threads thread.Wherein, the thread in number of threads thread is will treated facial image hair It gives image storage service end and enters wait state later.Here, wait state is to wait for the shape for obtaining facial image next time State.Thread under being waited for is without destroyed.Above-mentioned image storage service end (such as storage server shown in FIG. 1 107) it can be communicated to connect with executive agent (such as server 105 shown in FIG. 1), it can be for being stored to image Database or database server.
It is number of threads threshold value in response to number of threads in some optional realization methods of the present embodiment, can incites somebody to action At least one facial image is averagely allocated to number of threads threshold value thread.Then, the thread in number of threads threshold value thread Wait state will entered after treated facial image is sent to image storage service end.
In some optional realization methods of the present embodiment, in response to the quantity that number of threads is facial image, from line The quantity thread of facial image is chosen in journey amount threshold thread.And then at least it will distribute to people by a facial image The quantity thread of face image.Finally, the thread in the quantity thread of facial image is sent by treated facial image Enter wait state later to image storage service end.
As an example, when several users reach the office building with entrance guard device, if there are 6 users, door is operated in Prohibit the facial image that the camera on device obtains 6 users.Facial image based on 6 users and preset number of threads Threshold value 3, it may be determined that the number of threads (such as 3) for the thread that facial image is handled.Then, these number of threads lines Facial image is sent to is deposited for the image of treated facial image provides image storage service by treated for thread in journey After storing up server-side, into wait state.
It is a signal according to the application scenarios of the method for handling image of the present embodiment with continued reference to Fig. 3, Fig. 3 Figure.In the application scenarios of Fig. 3, when 3 users reach before gate 301, the camera operated on gate 301 obtains 3 A facial image 302.If preset number of threads threshold value is 3, it is based on 3 facial images and thread threshold 3, is determined to face The number of threads for the thread that image is handled is 3.3 facial images 302 of acquisition are distributed into this 3 threads, that is, thread 305, thread 306 and thread 307.Then, by treated, facial image 303 is sent to as place each thread in 3 threads Facial image 303 after reason provides the image storage service end 304 of image storage service.Later, this 3 threads enter waiting shape State.
The method that above-described embodiment of the application provides is by obtaining at least one facial image;Number based on facial image Amount and preset number of threads threshold value determine the number of threads of the thread handled facial image;By an at least face Image distributes to number of threads thread, wherein thread in number of threads thread is will treated that facial image is sent Enter wait state later to image storage service end.To realize using multiple thread process facial images, improves and hold Line efficiency.
With further reference to Fig. 4, it illustrates according to another embodiment of the method for handling image of the application Flow 400.This is used to handle the flow 400 of the method for image, includes the following steps:
Step 401, at least one facial image is obtained.
In this embodiment, the concrete operations of step 401 and the operation of step 201 in embodiment shown in Fig. 2 are essentially identical, Details are not described herein.
Step 402, it is more than or equal to number of threads threshold value in response to the quantity of facial image, determines that number of threads is Thread Count Measure threshold value.
In the present embodiment, after obtaining at least one facial image based on step 401, above-mentioned executive agent can be again by this These facial images and preset number of threads threshold value are made comparisons, when the quantity of facial image is more than or equal to number of threads threshold value When, determine that number of threads is number of threads threshold value.
As an example, if the quantity of facial image is 5, number of threads threshold value is 4, when the quantity 5 of facial image is more than When number of threads threshold value 4, it is thus determined that number of threads be number of threads threshold value 4.
Step 403, it is number of threads threshold value in response to number of threads, at least will distributes to number of threads by a facial image Threshold value thread, wherein thread in number of threads threshold value thread is will treated that facial image is sent to image storage Enter wait state after server-side.
In the present embodiment, when number of threads is number of threads threshold value, will the distribution of at least facial image (such as can To pass through mean allocation) give number of threads threshold value thread.Wherein, the thread in number of threads threshold value thread will be after it will handle Facial image be sent to after image storage service end and enter wait state.Here, wait state is to wait for obtaining next time The state of facial image.Thread under being waited for is without destroyed.Above-mentioned image storage service end can with execute master Body (such as server 105 shown in FIG. 1) communicates to connect, and can be the database or database for being stored to image Server.
As an example, when several users reach gate, if there is 8 users, the camera operated on gate obtains The facial image of 8 users, since the quantity 8 of facial image is more than preset number of threads threshold value 4, it is thus determined that Thread Count Amount is number of threads threshold value 4.Then, 8 facial images are distributed into 4 threads handled facial image.Namely It says, per thread handles 2 facial images.Then, by the thread in 4 threads, by treated, facial image is sent to as place After facial image after reason provides the image storage service end of image storage service, into wait state.
Figure 4, it is seen that compared with the corresponding embodiments of Fig. 2, the flow of the information-pushing method in the present embodiment Figure 40 0 highlights the size of the quantity and number of threads threshold value by comparing facial image, determines the step of the number of threads of thread Suddenly.The scheme of the present embodiment description can determine the thread of thread by the quantity and number of threads threshold value of facial image as a result, Quantity further by comparing the size of the quantity and number of threads threshold value of facial image, determines the Thread Count of thread Amount, to realize the reasonable distribution to the task of thread.
With further reference to Fig. 5, it illustrates according to another embodiment of the method for handling image of the application Flow 500.This is used to handle the flow 500 of the method for image, includes the following steps:
Step 501, at least one facial image is obtained.
In this embodiment, the concrete operations of step 501 and the operation of step 201 in embodiment shown in Fig. 2 are essentially identical, Details are not described herein.
Step 502, it is less than number of threads threshold value in response to the quantity of facial image, determines that number of threads is facial image Quantity.
In the present embodiment, after obtaining at least one facial image based on step 501, above-mentioned executive agent can be again by this These facial images and preset number of threads threshold value are made comparisons, when the quantity of facial image is less than number of threads threshold value, really Determine the quantity that number of threads is facial image.
As an example, if the quantity of facial image is 4, number of threads threshold value is 7, when the quantity 4 of facial image is less than When number of threads threshold value 7, it is thus determined that number of threads be facial image quantity 4.
Step 503, in response to the quantity that number of threads is facial image, face is chosen from number of threads threshold value thread The quantity thread of image;An at least facial image is distributed to the quantity thread of facial image, wherein facial image Thread in quantity thread is will treated enters wait state after facial image is sent to image storage service end.Its In, thread in the quantity thread of facial image is will treated that facial image is sent to the laggard of image storage service end Enter wait state.
In the present embodiment, when number of threads is the quantity of facial image, first, from number of threads threshold value thread Choose the quantity thread of facial image.Later, an at least facial image is distributed to the quantity thread of facial image.Its In, thread in facial image thread is will treated enters after facial image is sent to image storage service end and wait for State.Here, wait state is to wait for the state for obtaining facial image next time.Thread under being waited for is not necessarily to by pin It ruins.Above-mentioned image storage service end can be communicated to connect with executive agent (such as server 105 shown in FIG. 1), can use In the database or database server that are stored to image.
As an example, when several users reach gate, if there are 4 users, the facial image of 4 users is obtained, Since the quantity 4 of facial image is less than preset number of threads threshold value 8, it is thus determined that number of threads is the quantity 4 of facial image. Then, 4 facial images are distributed into 8 threads handled facial image.That is, there is 4 thread process etc. Wait for state, in addition 4 threads are separately dispensed into 1 facial image.It then, will treated face by the thread in 4 threads After the image storage service end for facial image provides image storage service that image is sent to that treated, into wait state.
From figure 5 it can be seen that compared with the corresponding embodiments of Fig. 2, the flow of the information-pushing method in the present embodiment Figure 50 0 highlights the size of the quantity and number of threads threshold value by comparing facial image, determines the step of the number of threads of thread Suddenly.The scheme of the present embodiment description can determine the thread of thread by the quantity and number of threads threshold value of facial image as a result, Quantity further by comparing the size of the quantity and number of threads threshold value of facial image, determines the Thread Count of thread Amount, to realize the reasonable distribution to the task of thread.
With further reference to Fig. 6, as the realization to method shown in above-mentioned each figure, this application provides for handling image One embodiment of device, the device embodiment is corresponding with embodiment of the method shown in Fig. 2, which specifically can be applied to In various electronic equipments.
As shown in fig. 6, the device 600 for handling image of the present embodiment includes:Acquiring unit 601, number of threads are true Order member 602 and processing unit 603.Wherein, acquiring unit 601 are configured to obtain at least one facial image;Number of threads Determination unit 602 is configured to the quantity based on facial image and preset number of threads threshold value, determines and is carried out to facial image The number of threads of the thread of processing;Processing unit 603 is configured to an at least facial image distributing to number of threads line Journey, wherein thread in number of threads thread is will treated that facial image is sent to the laggard of image storage service end Enter wait state
In the present embodiment, in the device 600 for handling image:Acquiring unit 601, number of threads determination unit 602 Specific processing and its caused technique effect with processing unit 603 can be respectively with reference to the steps in 2 corresponding embodiment of figure 201, the related description of step 202 and step 203, details are not described herein.
In some optional realization methods of the present embodiment, processing unit 603 includes:First determining module is (in figure not Show), it is configured to be more than or equal to number of threads threshold value in response to the quantity of facial image, determines that number of threads is number of threads Threshold value.
In some optional realization methods of the present embodiment, processing unit 603 further includes:Second determining module is (in figure It is not shown), it is configured to be less than number of threads threshold value in response to the quantity of facial image, determines that number of threads is facial image Quantity.
In some optional realization methods of the present embodiment, number of threads determination unit 602 can further configure use In:It is number of threads threshold value in response to number of threads, at least will distributes to number of threads threshold value thread by a facial image.
In some optional realization methods of the present embodiment, number of threads determination unit 602 can further configure use In:In response to the quantity that number of threads is facial image, the quantity of facial image is chosen from number of threads threshold value thread Thread;An at least facial image is distributed to the quantity thread of facial image.
The device that above-described embodiment of the application provides, is obtained by number of threads determination unit 602 by acquiring unit 601 The quantity of the facial image taken and preset number of threads threshold value then, will an at least facial images to determine number of threads Number of threads thread determined by distributing to improves to realize using multiple thread process facial images and executes effect Rate.
Below with reference to Fig. 7, it illustrates the computer systems 700 suitable for the server for realizing the embodiment of the present application Structural schematic diagram.Server shown in Fig. 7 is only an example, should not be to the function and use scope band of the embodiment of the present application Carry out any restrictions.
As shown in fig. 7, computer system 700 includes central processing unit (CPU) 701, it can be read-only according to being stored in Program in memory (ROM) 702 or be loaded into the program in random access storage device (RAM) 703 from storage section 708 and Execute various actions appropriate and processing.In RAM 703, also it is stored with system 700 and operates required various programs and data. CPU 701, ROM 702 and RAM 703 are connected with each other by bus 704.Input/output (I/O) interface 705 is also connected to always Line 704.
It is connected to I/O interfaces 705 with lower component:Importation 706 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 707 of spool (CRT), liquid crystal display (LCD) etc. and loud speaker etc.;Storage section 708 including hard disk etc.; And the communications portion 709 of the network interface card including LAN card, modem etc..Communications portion 709 via such as because The network of spy's net executes communication process.Driver 710 is also according to needing to be connected to I/O interfaces 705.Detachable media 711, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on driver 710, as needed in order to be read from thereon Computer program be mounted into storage section 708 as needed.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium On computer program, which includes the program code for method shown in execution flow chart.In such reality It applies in example, which can be downloaded and installed by communications portion 709 from network, and/or from detachable media 711 are mounted.When the computer program is executed by central processing unit (CPU) 701, limited in execution the present processes Above-mentioned function.
It should be noted that the computer-readable medium of the application can be computer-readable signal media or computer Readable storage medium storing program for executing either the two arbitrarily combines.Computer readable storage medium for example can be --- but it is unlimited In --- electricity, system, device or the device of magnetic, optical, electromagnetic, infrared ray or semiconductor, or the arbitrary above combination.It calculates The more specific example of machine readable storage medium storing program for executing can include but is not limited to:Being electrically connected, be portable with one or more conducting wires Formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device or The above-mentioned any appropriate combination of person.In this application, can be any include computer readable storage medium or storage program Tangible medium, the program can be commanded execution system, device either device use or it is in connection.And in this Shen Please in, computer-readable signal media may include in a base band or as the data-signal that a carrier wave part is propagated, In carry computer-readable program code.Diversified forms may be used in the data-signal of this propagation, including but not limited to Electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be computer-readable Any computer-readable medium other than storage medium, the computer-readable medium can send, propagate or transmit for by Instruction execution system, device either device use or program in connection.The journey for including on computer-readable medium Sequence code can transmit with any suitable medium, including but not limited to:Wirelessly, electric wire, optical cable, RF etc. or above-mentioned Any appropriate combination.
Flow chart in attached drawing and block diagram, it is illustrated that according to the system of the various embodiments of the application, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part for a part for one module, program segment, or code of table, the module, program segment, or code includes one or more uses The executable instruction of the logic function as defined in realization.It should also be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually It can be basically executed in parallel, they can also be executed in the opposite order sometimes, this is depended on the functions involved.Also it to note Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction Combination realize.
Being described in unit involved in the embodiment of the present application can be realized by way of software, can also be by hard The mode of part is realized.Described unit can also be arranged in the processor, for example, can be described as:Acquiring unit, thread Quantity determination unit and processing unit.Wherein, the title of these units is not constituted to the unit itself under certain conditions It limits, for example, acquiring unit is also described as " obtaining the unit of at least one facial image ".
As on the other hand, present invention also provides a kind of computer-readable medium, which can be Included in device described in above-described embodiment;Can also be individualism, and without be incorporated the device in.Above-mentioned calculating Machine readable medium carries one or more program, when said one or multiple programs are executed by the device so that should Device:By obtaining at least one facial image;Quantity based on facial image and preset number of threads threshold value are determined to people The number of threads for the thread that face image is handled;An at least facial image is distributed into number of threads thread, wherein line Thread in number of passes amount thread is will treated enters wait state after facial image is sent to image storage service end. To realize using multiple thread process facial images, execution efficiency is improved.
Above description is only the preferred embodiment of the application and the explanation to institute's application technology principle.People in the art Member should be appreciated that invention scope involved in the application, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic Scheme, while should also cover in the case where not departing from foregoing invention design, it is carried out by above-mentioned technical characteristic or its equivalent feature Other technical solutions of arbitrary combination and formation.Such as features described above has similar work(with (but not limited to) disclosed herein Can technical characteristic replaced mutually and the technical solution that is formed.

Claims (12)

1. a kind of method for handling image, including:
Obtain at least one facial image;
Quantity based on facial image and preset number of threads threshold value determine the thread of the thread handled facial image Quantity;
At least one facial image is distributed into the number of threads thread, wherein in the number of threads thread Thread will enter wait state after treated facial image is sent to image storage service end.
2. according to the method described in claim 1, wherein, the quantity based on facial image and preset number of threads threshold Value determines the number of threads of the thread handled facial image, including:
It is more than or equal to the number of threads threshold value in response to the quantity of the facial image, determines that the number of threads is the line Journey amount threshold.
3. according to the method described in claim 1, wherein, the quantity based on facial image and preset number of threads threshold Value determines the number of threads of the thread handled facial image, further includes:
It is less than the number of threads threshold value in response to the quantity of the facial image, determines that the number of threads is the face figure The quantity of picture.
4. described that at least one facial image is distributed to the Thread Count according to the method described in claim 2, wherein Amount thread, including:
It is the number of threads threshold value in response to the number of threads, at least one facial image is distributed into the thread Amount threshold thread.
5. described that at least one facial image is distributed to the Thread Count according to the method described in claim 3, wherein A thread is measured, further includes:
In response to the quantity that the number of threads is the facial image, from the number of threads threshold value thread described in selection The quantity thread of facial image;At least one facial image is distributed to the quantity thread of the facial image.
6. a kind of device for handling image, including:
Acquiring unit is configured to obtain at least one facial image;
Number of threads determination unit is configured to the quantity based on facial image and preset number of threads threshold value, determines to people The number of threads for the thread that face image is handled;
Processing unit is configured at least one facial image distributing to the number of threads thread, wherein described Thread in number of threads thread is will treated enters after facial image is sent to image storage service end and wait for shape State.
7. device according to claim 6, wherein the processing unit includes:
First determining module is configured to be more than or equal to the number of threads threshold value in response to the quantity of the facial image, really The fixed number of threads is the number of threads threshold value.
8. device according to claim 6, wherein the processing unit further includes:
Second determining module is configured to be less than the number of threads threshold value in response to the quantity of the facial image, determines institute State the quantity that number of threads is the facial image.
9. device according to claim 7, wherein the number of threads determination unit is further configured to:
It is the number of threads threshold value in response to the number of threads, at least one facial image is distributed into the thread Amount threshold thread.
10. device according to claim 8, wherein the number of threads determination unit is further configured to:
In response to the quantity that the number of threads is the facial image, from the number of threads threshold value thread described in selection The quantity thread of facial image;At least one facial image is distributed to the quantity thread of the facial image.
11. a kind of server, including:
One or more processors;
Storage device, for storing one or more programs;
When one or more of programs are executed by one or more of processors so that one or more of processors are real The now method as described in any in claim 1-5.
12. a kind of computer-readable medium, is stored thereon with computer program, wherein the program is realized when being executed by processor Method as described in any in claim 1-5.
CN201810270168.2A 2018-03-29 2018-03-29 Method and apparatus for handling image Pending CN108491258A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810270168.2A CN108491258A (en) 2018-03-29 2018-03-29 Method and apparatus for handling image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810270168.2A CN108491258A (en) 2018-03-29 2018-03-29 Method and apparatus for handling image

Publications (1)

Publication Number Publication Date
CN108491258A true CN108491258A (en) 2018-09-04

Family

ID=63316716

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810270168.2A Pending CN108491258A (en) 2018-03-29 2018-03-29 Method and apparatus for handling image

Country Status (1)

Country Link
CN (1) CN108491258A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110891032A (en) * 2019-11-27 2020-03-17 佛山市蠢材科技有限公司 Face data parallel issuing method and device and electronic equipment
CN113627387A (en) * 2021-08-30 2021-11-09 平安国际融资租赁有限公司 Parallel identity authentication method, device, equipment and medium based on face recognition

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105308618A (en) * 2013-06-27 2016-02-03 英特尔公司 Face recognition with parallel detection and tracking, and/or grouped feature motion shift tracking
CN105474175A (en) * 2013-06-14 2016-04-06 微软技术许可有限责任公司 Assigning and scheduling threads for multiple prioritized queues
CN106156732A (en) * 2016-07-01 2016-11-23 合网络技术(北京)有限公司 Object identifying method and object recognition equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105474175A (en) * 2013-06-14 2016-04-06 微软技术许可有限责任公司 Assigning and scheduling threads for multiple prioritized queues
CN105308618A (en) * 2013-06-27 2016-02-03 英特尔公司 Face recognition with parallel detection and tracking, and/or grouped feature motion shift tracking
CN106156732A (en) * 2016-07-01 2016-11-23 合网络技术(北京)有限公司 Object identifying method and object recognition equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
CSDNWEI: "使用boost线程池(多线程使用opencv处理图片)", 《CSDN博客: HTTPS://BLOG.CSDN.NET/CSDNWEI/ARTICLE/DETAILS/71730370》 *
边馥苓 等: "《时空大数据的技术与方法》", 31 May 2016, 测绘出版社 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110891032A (en) * 2019-11-27 2020-03-17 佛山市蠢材科技有限公司 Face data parallel issuing method and device and electronic equipment
CN113627387A (en) * 2021-08-30 2021-11-09 平安国际融资租赁有限公司 Parallel identity authentication method, device, equipment and medium based on face recognition

Similar Documents

Publication Publication Date Title
CN106911697B (en) Access rights setting method, device, server and storage medium
CN108595628A (en) Method and apparatus for pushed information
CN107341050A (en) Service processing method and device based on dynamic thread pool
CN109389640A (en) Image processing method and device
CN109347720A (en) It determines group member, send the method and apparatus that the request of group is added
CN109255337A (en) Face critical point detection method and apparatus
CN108897854A (en) A kind of monitoring method and device of overtime task
CN109582873A (en) Method and apparatus for pushed information
CN108776692A (en) Method and apparatus for handling information
CN108600250A (en) Authentication method
CN108989369A (en) The method and its system of progress current limliting are requested user
CN108595448A (en) Information-pushing method and device
CN108388512A (en) Data processing method and server
CN110046178A (en) The method and apparatus of distributed data inquiry
CN108664510A (en) Information acquisition method and device
CN108491258A (en) Method and apparatus for handling image
CN108399401A (en) Method and apparatus for detecting facial image
CN109240802A (en) request processing method and device
CN108573054A (en) Method and apparatus for pushed information
CN109472540A (en) Method and device for business processing
CN109885564A (en) Method and apparatus for sending information
CN109597912A (en) Method for handling picture
CN108320097A (en) Method and apparatus for Amount of work
CN110414205A (en) For generating method, apparatus, electronic equipment and the medium of user's portrait
CN116109445A (en) Data processing method, device, electronic equipment and computer readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180904