CN114612962A - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
CN114612962A
CN114612962A CN202210178886.3A CN202210178886A CN114612962A CN 114612962 A CN114612962 A CN 114612962A CN 202210178886 A CN202210178886 A CN 202210178886A CN 114612962 A CN114612962 A CN 114612962A
Authority
CN
China
Prior art keywords
processing
target
visible light
image
parameter
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
CN202210178886.3A
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.)
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 CN202210178886.3A priority Critical patent/CN114612962A/en
Publication of CN114612962A publication Critical patent/CN114612962A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2415Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate

Abstract

The present disclosure provides an image processing method and apparatus, which relates to the technical field of artificial intelligence, specifically to the technical field of deep learning and computer vision, and can be applied to scenes such as image processing and image detection. The implementation scheme is as follows: determining a first parameter of a first processing operation included in an image detection strategy; calling a callback function corresponding to an image detection strategy according to the acquired target visible light image and the target infrared image corresponding to the target visible light image; processing at least one image in the target visible light image and the target infrared image by adopting a second processing operation in the first processing operation and based on the callback function and the second parameter to obtain a first detection result; the second parameter is a parameter corresponding to the second processing operation in the first parameters, the first detection result indicates whether the target object corresponds to the first category, and the target visible light image and the target infrared image both correspond to the target object.

Description

Image processing method and device
Technical Field
The present disclosure relates to the field of artificial intelligence technologies, in particular to the field of deep learning and computer vision technologies, and may be applied to scenes such as image processing and image detection, and in particular to an image processing method, an apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
Background
Artificial intelligence is the subject of research that makes computers simulate some human mental processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), both at the hardware level and at the software level. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing, and the like: the artificial intelligence software technology mainly comprises a computer vision technology, a voice recognition technology, a natural language processing technology, machine learning/deep learning, a big data processing technology, a knowledge map technology and the like.
Image processing techniques based on artificial intelligence have penetrated into various fields. The method comprises the steps of judging whether a user passes verification or not according to face image data input by the user based on an artificial intelligence face authentication technology.
The approaches described in this section are not necessarily approaches that have been previously conceived or pursued. Unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section. Similarly, unless otherwise indicated, the problems mentioned in this section should not be considered as having been acknowledged in any prior art.
Disclosure of Invention
The present disclosure provides an image processing method, an apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
According to an aspect of the present disclosure, there is provided an image processing method including: determining a first parameter of a first processing operation included in an image detection strategy; calling a callback function corresponding to the image detection strategy according to the obtained target visible light image and a target infrared image corresponding to the target visible light image; processing at least one image of the target visible light image and the target infrared image by adopting a second processing operation in the first processing operation based on the callback function and a second parameter to obtain a first detection result; the second parameter is a parameter corresponding to the second processing operation in the first parameters, the first detection result indicates whether the target object corresponds to a first category, and the target visible light image and the target infrared image both correspond to the target object.
According to another aspect of the present disclosure, there is provided an image processing apparatus including: a parameter determination unit configured to determine a first parameter of a first processing operation included in the image detection policy; the function calling unit is configured to call a callback function corresponding to the image detection strategy according to the acquired target visible light image and the target infrared image corresponding to the target visible light image; the image processing unit is configured to adopt a second processing operation in the first processing operation and process at least one image in the target visible light image and the target infrared image based on the callback function and a second parameter to obtain a first detection result; the second parameter is a parameter corresponding to the second processing operation in the first parameters, the first detection result indicates whether the target object corresponds to the first category, and the target visible light image and the target infrared image both correspond to the target object.
According to another aspect of the present disclosure, there is provided an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to implement a method according to the above.
According to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to implement the method according to the above.
According to another aspect of the present disclosure, a computer program product is provided comprising a computer program, wherein the computer program realizes the method according to the above when executed by a processor.
By acquiring the first parameter of the first processing operation included in the image detection strategy and executing the callback of the callback function of the image detection strategy once, the first detection result corresponding to the image detection strategy can be acquired, and the implementation process of the image detection strategy is simplified. Meanwhile, the parameters of the first processing operation included in the image detection strategy can be adjusted according to the situation, so that the image detection strategy can be adjusted according to the situation, the image detection strategy can be adapted to different scenes, the target visible light image and the target infrared image corresponding to the same target object are processed, whether the target object corresponds to the first category or not is detected, and the obtained first detection result is accurate.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments of the embodiments and, together with the description, serve to explain the exemplary implementations of the embodiments. The illustrated embodiments are for purposes of illustration only and do not limit the scope of the claims. Throughout the drawings, identical reference numbers designate similar, but not necessarily identical, elements.
FIG. 1 illustrates a schematic diagram of an exemplary system in which various methods described herein may be implemented, according to an embodiment of the present disclosure;
FIG. 2 shows a flow diagram of an image processing method according to an embodiment of the present disclosure;
fig. 3 shows a flowchart of a process of processing at least one of the target visible-light image and the target infrared image using a second processing operation of the first processing operations and based on the callback function and the second parameter in the image processing method according to the embodiment of the present disclosure;
fig. 4 shows a flowchart of a process of processing at least one of the target visible light image and the target infrared image using a third one of the first processing operations and based on the callback function and the third parameter in the image processing method according to an embodiment of the present disclosure;
fig. 5 is a flowchart illustrating a process of processing the target visible-light image based on the callback function and the fourth parameter with a fourth processing operation of the third processing operations in the image processing method according to the embodiment of the present disclosure;
fig. 6 shows a flowchart of a process of processing a target infrared image based on a callback function and a fifth parameter with a fifth processing operation of the third processing operations in the image processing method according to the embodiment of the present disclosure;
FIG. 7 shows a flow diagram of an image processing method according to an embodiment of the present disclosure;
FIG. 8 shows a flow diagram of a process for implementing an image detection policy by multiple steps in an image processing method according to an embodiment of the present disclosure;
fig. 9 shows a block diagram of the structure of an image processing apparatus according to an embodiment of the present disclosure; and
FIG. 10 illustrates a block diagram of an exemplary electronic device that can be used to implement embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, the timing relationship, or the importance relationship of the elements, and such terms are used only to distinguish one element from another. In some examples, a first element and a second element may refer to the same instance of the element, and in some cases, based on the context, they may also refer to different instances.
The terminology used in the description of the various described examples in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the elements may be one or more. Furthermore, the term "and/or" as used in this disclosure is intended to encompass any and all possible combinations of the listed items.
Embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
Fig. 1 illustrates a schematic diagram of an exemplary system 100 in which various methods and apparatus described herein may be implemented in accordance with embodiments of the present disclosure. Referring to fig. 1, the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. Client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.
In an embodiment of the present disclosure, the server 120 may run one or more services or software applications that enable the image processing method to be performed.
In some embodiments, the server 120 may also provide other services or software applications that may include non-virtual environments and virtual environments. In some embodiments, these services may be provided as web-based services or cloud services, for example, provided to users of client devices 101, 102, 103, 104, 105, and/or 106 under a software as a service (SaaS) model.
In the configuration shown in fig. 1, server 120 may include one or more components that implement the functions performed by server 120. These components may include software components, hardware components, or a combination thereof, which may be executed by one or more processors. A user operating client devices 101, 102, 103, 104, 105, and/or 106 may, in turn, utilize one or more client applications to interact with server 120 to take advantage of the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from system 100. Accordingly, fig. 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.
The user may receive the first detection result using client devices 101, 102, 103, 104, 105, and/or 106. The client device may provide an interface that enables a user of the client device to interact with the client device. The client device may also output information to the user via the interface. Although fig. 1 depicts only six client devices, those skilled in the art will appreciate that any number of client devices may be supported by the present disclosure.
Client devices 101, 102, 103, 104, 105, and/or 106 may include various types of computer devices, such as portable handheld devices, general purpose computers (such as personal computers and laptops), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, gaming systems, thin clients, various messaging devices, sensors or other sensing devices, and so forth. These computer devices may run various types and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, Linux, or Linux-like operating systems (e.g., GOOGLE Chrome OS); or include various Mobile operating systems such as MICROSOFT Windows Mobile OS, iOS, Windows Phone, Android. Portable handheld devices may include cellular telephones, smart phones, tablets, Personal Digital Assistants (PDAs), and the like. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. The gaming system may include a variety of handheld gaming devices, internet-enabled gaming devices, and the like. The client device is capable of executing a variety of different applications, such as various Internet-related applications, communication applications (e.g., email applications), Short Message Service (SMS) applications, and may use a variety of communication protocols.
Network 110 may be any type of network known to those skilled in the art that may support data communications using any of a variety of available protocols, including but not limited to TCP/IP, SNA, IPX, etc. By way of example only, one or more networks 110 may be a Local Area Network (LAN), an ethernet-based network, a token ring, a Wide Area Network (WAN), the internet, a virtual network, a Virtual Private Network (VPN), an intranet, an extranet, a Public Switched Telephone Network (PSTN), an infrared network, a wireless network (e.g., bluetooth, WIFI), and/or any combination of these and/or other networks.
The server 120 may include one or more general purpose computers, special purpose server computers (e.g., PC (personal computer) servers, UNIX servers, mid-end servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and/or combination. The server 120 may include one or more virtual machines running a virtual operating system, or other computing architecture involving virtualization (e.g., one or more flexible pools of logical storage that may be virtualized to maintain virtual storage for the server). In various embodiments, the server 120 may run one or more services or software applications that provide the functionality described below.
The computing units in server 120 may run one or more operating systems including any of the operating systems described above, as well as any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and/or middle tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, and the like.
In some implementations, the server 120 may include one or more applications to analyze and consolidate data feeds and/or event updates received from users of the client devices 101, 102, 103, 104, 105, and 106. Server 120 may also include one or more applications to display data feeds and/or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and 106.
In some embodiments, the server 120 may be a server of a distributed system, or a server incorporating a blockchain. The server 120 may also be a cloud server, or a smart cloud computing server or a smart cloud host with artificial intelligence technology. The cloud Server is a host product in a cloud computing service system, and is used for solving the defects of high management difficulty and weak service expansibility in the traditional physical host and Virtual Private Server (VPS) service.
The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and object files. The data store 130 may reside in various locations. For example, the data store used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. The data store 130 may be of different types. In certain embodiments, the data store used by the server 120 may be a database, such as a relational database. One or more of these databases may store, update, and retrieve data to and from the database in response to the command.
In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the application may be different types of databases, such as key-value stores, object stores, or regular stores supported by a file system.
The system 100 of fig. 1 may be configured and operated in various ways to enable application of the various methods and apparatus described in accordance with the present disclosure.
Referring to fig. 2, an image processing method 200 according to some embodiments of the present disclosure includes:
step S210: determining a first parameter of a first processing operation included in an image detection strategy;
step S220: calling a callback function corresponding to the image detection strategy according to the obtained target visible light image and a target infrared image corresponding to the target visible light image;
step S230: and processing at least one image of the target visible light image and the target infrared image by adopting a second processing operation in the first processing operation based on the callback function and the second parameter to obtain a first detection result.
The second parameter is a parameter corresponding to the second processing operation in the first parameters, the first detection result indicates whether the target object corresponds to a first category, and the target visible light image and the target infrared image both correspond to the target object.
In the process of processing the image, a first detection result corresponding to the image detection strategy can be obtained by obtaining a first parameter of a first processing operation included in the image detection strategy and executing callback of a callback function of the image detection strategy once, and the implementation process of the image detection strategy is simplified. Meanwhile, because the parameters of each of the plurality of processes included in the image detection strategy can be adjusted according to the situation, so that the image detection strategy can be adapted to different scenes, the target visible light image and the target infrared image corresponding to the same target object are processed, whether the target object corresponds to the first target classification is detected, and the obtained first detection result is accurate.
In the related art, an image detection policy for detecting an image is realized by performing a plurality of processing operations on the image, wherein the plurality of processing operations perform different processes on the image, respectively. For example, in the process of implementing an image detection policy related to face authentication, face authentication is implemented by performing a face detection operation, a face alignment operation, a living body detection operation, and a feature matching step on an image. The human face detection operation is used for detecting whether the image contains a human face, the human face alignment operation is used for correcting the pose of the human face in the image, the living body detection operation is used for judging whether the human face in the image comes from a living body, and the feature matching operation is used for judging whether the human face in the image has matched human face data in a preset database. In the process of realizing the face authentication, the respective processing is realized through the function of each processing operation, so that the face authentication is realized, and the whole process needs to be carried out for multiple times of function calls. Meanwhile, the face authentication process often needs to be implemented in different scenes. Therefore, new image detection strategies need to be re-developed for different scenes. For example, an image detection strategy applied to a face authentication process of security inspection in a railway station cannot be applied to a face authentication process under community access control. For another example, in an image detection policy applied to face authentication used in community gate inhibition, the accuracy of face authentication implemented in daytime and the accuracy of face authentication implemented in night are not consistent, which results in poor adaptability of the image detection policy in various scenes. For example, an image detection strategy for processing a visible light image is only applicable to a face authentication process performed in the daytime, and has a low accuracy when applied to a face authentication process performed at night.
According to the embodiment of the disclosure, the image detection strategy is realized by determining the first parameter of the first processing operation of the image detection strategy and calling the callback function once, so that the process of realizing the image detection strategy is simple. Meanwhile, in the process of realizing the image detection strategy, the image detection strategy can be suitable for different application scenes by determining corresponding first parameters aiming at different application scenes. Meanwhile, when the image detection strategy is realized, at least one of the infrared image and the visible light image is processed through the first processing operation, so that the environment where the obtained image detection strategy can be applied is wider, and the accuracy of the obtained detection result is improved. For example, when the image detection policy is applied to the face authentication process, by adjusting a plurality of processing parameters, the image detection policy may be simultaneously applied to the face authentication process of security check at a train station, the face authentication process of day and night of community access control, and the like.
In the technical scheme of the disclosure, the collection, storage, use, processing, transmission, provision, disclosure and other processing of the personal information of the related user are all in accordance with the regulations of related laws and regulations and do not violate the good customs of the public order.
In some embodiments, the image processing method of the present disclosure is implemented by a face authentication apparatus, where the face authentication apparatus includes a visible light camera, an infrared camera, and a processing device. The visible light imaging device is used for shooting a subject to obtain a visible light image (namely, an RCB image), and the infrared imaging device is used for shooting the subject to obtain an infrared image. The processing device is used for processing the visible light image shot by the visible light camera device and the infrared image shot by the infrared camera device, so that an image detection strategy is realized.
It should be noted that the embodiment takes a face authentication process as an example, and the image processing method according to the present disclosure is only exemplary, and those skilled in the art will understand that the image processing method according to the present disclosure may also be applied to any process of obtaining a detection result based on a visible light image and an infrared image.
In some embodiments, the first processing operation is provided by a function of a library of functions, wherein the parameter of the function may be a first parameter of the first processing operation.
According to an embodiment of the present disclosure, the first processing operation includes a plurality of sub-operations, and the function implements the plurality of sub-operations through the included plurality of sub-functions. For example, the function includes a detection function for performing target detection on the target visible light image to determine whether the target visible light image contains the target object, a matching function for performing matching processing on the target visible light image to determine whether data matching the target visible light image is included in the preset database, and the like, which are not limited herein.
It is to be understood that each sub-operation of the plurality of sub-operations in the first processing operation may further include a respective next-level sub-operation, and meanwhile, the next-level sub-operation of each sub-operation may also be provided by a next-level sub-function included (or discounted) by the respective sub-function; and the like, and are not limited herein.
In an embodiment according to the present disclosure, the second processing operation is a sub-operation in the first processing operation, and the parameter corresponding to the sub-operation provides a parameter of the second processing operation.
In some embodiments, the face authentication device provides an interface for determining the first parameter of the first processing operation through the provided API interface. For example, the parameter of each sub-function in the function library is determined by setting the parameter of the API interface of the face device, thereby determining the first parameter of the first processing operation. In some embodiments, the API interface is a high level API interface. In some embodiments, in response to the target visible light image and the target infrared image being input to the high level api interface, a plurality of functions encapsulated within the high level api interface are automatically executed to implement the image detection policy.
In some embodiments, the image detection policy corresponds to a face authentication process, and the image detection policy is implemented by logically combining a plurality of sub-functions in the function library to implement the first processing operation.
In some embodiments, the visible light camera may be any camera that can obtain RGB images, such as a camera, a video camera, and the like.
In some embodiments, the infrared camera device may be any infrared device that can obtain an infrared image of the target, such as an infrared camera.
In some embodiments, after the visible light image and the infrared image corresponding to the same object are captured by the visible light imaging device and the infrared imaging device in the face equipment, the captured visible light image and infrared image are respectively determined as a target visible light image and a target infrared image, and the same object is determined as a target object.
In some embodiments, the target object comprises a human face, and the first class indicates that the human face is authenticated.
It should be understood that the embodiment is described by taking the target object as a human face as an example, which is only an example, and those skilled in the art should understand that the target object may also be other parts of a human body, an animal, etc., and is not limited herein.
In some embodiments, in response to the determination of the target visible light image and the target infrared image, a callback function of the image detection policy is invoked, and based on the callback function being invoked, the image detection policy is implemented, i.e., the face authentication process is implemented.
In some embodiments, as shown in fig. 3, processing at least one of the target visible light image and the target infrared image using a second one of the first processing operations and based on the callback function and a second parameter includes:
step S310: processing a target visible light image with a second processing operation of the first processing operations;
step S320: determining whether the processing result is matched with a preset processing result corresponding to the second processing operation;
step S330: in response to determining that the processing result of the second processing operation does not match the preset processing result corresponding to the second processing operation, determining that the first detection result indicates that the target object does not correspond to the first class; and
step S330': and in response to determining that the processing result of the second processing operation is matched with the preset processing result corresponding to the second processing operation, processing at least one of the target visible light image and the target infrared image by using a third processing operation in the first processing operation based on the callback function and a third parameter to obtain the first detection result, wherein the third parameter is a parameter corresponding to the third processing operation in the first parameter.
In the process of realizing the image detection strategy, for the second processing operation in the first operation, when the processing result is determined to be not matched with the corresponding preset processing result, the first detection result is directly determined without executing other processing in the plurality of processing, so that unnecessary processing in the subsequent process is avoided, and the resource consumption of the system is reduced; and when the processing result is determined to be matched with the corresponding preset processing result, executing a third processing operation in the first processing operation to obtain a first detection result, thereby realizing the image detection strategy. In the whole process, the asynchronous result is returned based on the call of the callback function, and the occupied time of system resources is reduced. It is to be appreciated that, in accordance with an embodiment of the present disclosure, the third processing operation is a different sub-operation of the first processing operation than the second processing operation.
In some embodiments, the second processing operation comprises:
a target object detection operation is performed on the target visible light image, and a preset processing result corresponding to the target object detection operation indicates that the target visible light image contains the target object; or
And comparing the target visible light image, wherein a preset processing result corresponding to the comparison operation indicates that the target visible light image does not exist in a preset record table.
For example, in the process of face authentication, face detection operation is firstly implemented on a visible light image of a face obtained based on the face, the face is not included in the visible light image of the face displayed as a result of the face detection operation, that is, the result of the face detection operation is not matched with a preset processing result indicating that the visible light image of the face contains the face, so that the comparison operation after the face detection operation is not implemented, the implementation of unnecessary second processing operation is avoided, and the resource consumption of the system is reduced.
For another example, when the result of the face detection operation matches the corresponding operation result, the face visible light image is further compared with the processed face visible light image in the preset recording table through the comparison operation, and when the result of the comparison operation shows that the face visible light image already exists in the preset recording table (that is, the result of the comparison operation does not match the corresponding preset processing result), it is determined that the processing result of the first processing does not match the corresponding processing result, and then the processing other than the second processing operation is not performed, so that the execution of unnecessary processing is reduced, and the resource consumption of the system is reduced.
It should be noted that the above-mentioned second processing operation includes a target object detection operation and a comparison operation implemented successively, which are only exemplary, and those skilled in the art should understand that any other processing operation may also be provided, for example, a processing operation for performing color space conversion on a target visible light image and a target infrared image, or a processing operation for adding a target visible light image into a buffer queue to be processed, and the like.
In some embodiments, the preset processing result corresponding to the third processing operation indicates that the target object corresponds to a second category, and the second category is different from the first category.
For example, in the face authentication process, the second class is a face living body class, and in response to determining that the target object corresponds to the face living body class, that is, the target infrared image and the target visible light image are obtained by shooting a living body face (that is, the target object), and then obtaining whether the target object corresponds to the first detection result of the first class, the accuracy of the obtained first detection result is further improved.
In some embodiments, as shown in fig. 4, the processing at least one of the target visible light image and the target infrared image using a third processing operation of the first processing operations and based on the callback function and a third parameter includes:
step S410: processing the target visible light image with a fourth one of the third processing operations and based on the callback function and a fourth parameter to obtain a first classification result corresponding to the target visible light image and indicating whether the target object corresponds to the second class, the fourth parameter being a parameter of the third parameter corresponding to the fourth processing operation;
step S420: processing the target infrared image with a fifth processing operation of the third processing operations and based on the callback function and a fifth parameter to obtain a second classification result corresponding to the target infrared image and indicating whether the target object corresponds to the second class, the fifth parameter being a parameter of the third parameters corresponding to the fifth processing operation;
step S430: in response to determining that either of the first classification result and the second classification result indicates that the target object does not correspond to the first class, determining that the processing result of the third processing operation does not match a preset processing result corresponding to the third processing operation.
In the process of processing the target visible light image and the target infrared image by using the third processing operation, a processing result of the third processing operation is obtained based on a first classification result and a second classification result obtained after the target visible light image and the target infrared image are respectively processed, and when it is determined that the first classification result after the first classification of the target visible light image and the second classification result after the second classification of the target infrared image both indicate that the target object corresponds to the second class, it is determined that the processing result of the third processing operation indicates that the target object corresponds to the second class, so that the obtained processing result of the third processing operation is accurate.
For example, in the face authentication process, the living face detection (i.e., the third processing operation of determining whether the target object is a living face) is performed on the target object, wherein detection is performed based on the target visible light image and the target infrared image, respectively, to obtain a first classification result corresponding to the target visible image and indicating whether the target object is from a living face and a second classification result corresponding to the target infrared image and indicating whether the target object is from a living face. When the first classification result and the second classification result indicate that the target object is from the human face living body, the fact that the detection result of the human face living body detection indicates that the target object is from the human face living body is determined, and the result of the human face living body detection is more accurate.
It should be noted that, the embodiment is only exemplary to obtain the processing result of the third processing operation based on the obtained first classification result and the second classification result after respectively performing the processing on the target visible light image and the target infrared image, and it should be understood by those skilled in the art that it is also possible to first perform the processing on the target infrared image to obtain the second classification result, and then perform the processing on the target visible light image to obtain the first classification result in response to determining that the second classification result on the infrared image indicates that the target object corresponds to the second category; or conversely, the target visible light image is processed to obtain a first classification result, and then the target infrared image is processed to obtain a second classification result.
In some embodiments, as shown in fig. 5, processing the target visible light image with a fourth processing operation of the third processing operations and based on the callback function and a fourth parameter includes:
step S510: processing the target visible light image with a fourth processing operation of the third processing operations;
step S520: determining whether the processing result is matched with a preset processing result corresponding to the fourth processing operation
Step S530: obtaining the first classification result in response to the processing result of the fourth processing operation not matching the preset processing result corresponding to the fourth processing operation, wherein the first classification result indicates that the target object does not correspond to the second class; and
step S530': and in response to that the processing result of the fourth processing operation is matched with a preset processing result corresponding to the fourth processing operation, processing the target visible light image by adopting a sixth processing operation in the third processing operation based on the callback function and a sixth parameter to obtain the first classification result, wherein the sixth parameter is a parameter corresponding to the sixth processing operation in the third parameter.
In the process of processing the target visible light image to obtain the first classification result, the target visible light image is processed by using the fourth processing operation, and when the processing result of the fourth processing operation is not matched with the preset processing result corresponding to the fourth processing operation, the first classification result indicating that the target object does not correspond to the second classification is obtained, so that other processing operations after the fourth processing operation in the third processing operation are prevented from being performed, unnecessary processing operations are prevented from being performed subsequently, and the resource consumption of the system is reduced.
Meanwhile, when the result of any one of the first processing operations in the third processing operation does not correspond to the corresponding preset processing result, it is determined that the first classification result indicates that the target object does not correspond to the second target classification, the accuracy of the obtained first classification result is improved, and the accuracy of the classification result obtained based on the first classification result is improved.
In some embodiments, the third processing operation comprises:
a first alignment operation performed on the target visible light image, wherein a preset processing result corresponding to the first alignment operation indicates that the similarity between the pose and a preset pose of the target object in the target visible light image is not less than a first preset threshold;
performing quality detection operation on the target visible light image, wherein a preset processing result corresponding to the quality detection operation indicates that the quality of the target visible light image conforms to preset quality; or
A first detection operation performed on the target visible light image, wherein a preset processing result corresponding to the first detection operation indicates that a probability that the target visible light image corresponds to the second category is not less than a preset first probability threshold.
For example, in the face authentication process, a first classification result is obtained by sequentially performing a first alignment operation, a quality detection operation, and a first detection operation on the target visible light image to process the target visible light image. The method comprises the steps of firstly processing a target visible light image by utilizing a first alignment operation so as to judge face alignment and alignment, wherein the face alignment process is a process of correcting a face pose in the target visible light image, and the judgment after alignment is realized by comparing the similarity between the corrected pose and a preset pose with a first preset threshold. When the similarity between the corrected pose and the preset pose is smaller than a first preset threshold, it is determined that the face living body detection cannot be judged based on the pose of the face in the target visible light image, so that subsequent quality detection operation and first detection operation are determined not to be realized, unnecessary operation is avoided, and consumption of system resources is reduced.
After the first alignment operation is carried out on the target visible light image, in response to the matching of the result of the first alignment operation and the corresponding preset processing result, the judgment that the living body detection of the human face can be carried out based on the pose of the human face in the target visible light image is determined, and the target visible light image is further processed by utilizing the quality detection operation, wherein the quality of the target visible light image is compared with the preset quality. When the quality of the target visible light image is determined not to meet the preset quality, the judgment that the human face living body detection cannot be carried out based on the quality of the target visible light image is judged, so that the follow-up first detection operation is determined not to be realized, unnecessary operation is avoided, and the consumption of system resources is reduced. In some examples, the preset quality may be, for example, a preset luminance range, a preset sharpness range, or the like.
Further, after the quality detection operation is performed on the target visible light image, in response to a result of the quality detection operation matching a corresponding preset processing result, that is, a determination is made that the living human face detection is possible based on the quality of the target visible light image, the target visible light image is further processed by using the first detection operation to obtain a probability that the target object corresponds to the second category, and the probability that the target object obtained based on the target visible light image corresponds to the second category is compared with a preset first probability threshold. When the probability that the light image can be obtained based on the target and corresponds to the second category is not smaller than the first probability threshold value, the first classification result is determined to indicate that the target object corresponds to the second category, otherwise, the target object does not correspond to the second category, and therefore the target image is processed to obtain the first classification result.
It should be noted that the above-mentioned multiple first processing operations include the first alignment operation, the quality detection operation, and the first detection operation that are implemented sequentially, which are merely exemplary, and those skilled in the art should understand that any first processing operation that can improve the accuracy of the first classification result may also be provided.
In some embodiments, as shown in fig. 6, processing the target infrared image using a fifth processing operation of the third processing operations and based on the callback function and a fifth parameter includes:
step S610: processing a target infrared image by adopting a fifth processing operation in the third processing operation;
step S620: determining whether the processing result is matched with a preset processing result corresponding to the fifth processing operation;
step S630: obtaining a second classification result in response to a processing result of the fifth processing operation not matching a preset processing result corresponding to the fifth processing operation, wherein the second classification result indicates that the target object does not correspond to the second category; and
step S630': and in response to that the processing result of the fifth processing operation is matched with the preset processing result corresponding to the fifth processing operation, processing the target infrared image by adopting a seventh processing operation in the third processing operation based on the callback function and a seventh parameter to obtain the second classification result, wherein the seventh parameter is a parameter corresponding to the seventh processing operation in the third parameter.
And in the process of processing the target infrared image to obtain a second classification result, processing the target infrared image by using a fifth processing operation. And when the processing result of the fifth processing operation is not matched with the preset processing result corresponding to the fifth processing operation, directly obtaining a result of a third processing operation indicating that the target object does not correspond to the second category, and simultaneously not realizing the processing operation after the fifth processing operation in the third processing operation, thereby further avoiding subsequent unnecessary operations and reducing the resource consumption of the system.
Meanwhile, when the result of any one of the third processing operations does not correspond to the corresponding preset operation threshold, it is determined that the second classification result indicates that the target object does not correspond to the second target class, the accuracy of the obtained second classification result is improved, and the accuracy of the processing result of the third processing operation obtained based on the second classification result is improved.
In some embodiments, the plurality of second processing operations comprises:
a target object detection operation is executed on the target infrared image, and a preset processing result corresponding to the target object detection operation indicates that the target infrared image comprises the target object;
a second alignment operation is executed on the target infrared image, and a preset processing result corresponding to the second alignment operation indicates that the similarity between the pose and the preset pose of the target object is not smaller than a second preset threshold; or
And a second detection operation executed on the target infrared image, wherein a preset processing result corresponding to the second detection operation indicates that the probability of the target object corresponding to the second category is not less than a preset second probability threshold.
For example, in the face authentication process, the target infrared image is processed to obtain a second classification result by sequentially performing a target object detection operation, a second alignment operation, and a second detection operation on the target infrared image. Firstly, a target infrared image is processed by using a target object detection operation to determine whether the target infrared image contains a target object, namely a human face. When the target object is determined not to be included in the target infrared image, namely the second classification result indicates that the target object does not correspond to the second target classification (namely the target object is not from a living human face but from an attack (such as a screen attack) or a composite image), unnecessary operation is avoided, and consumption of system resources is reduced.
After the target object detection operation is performed on the target infrared image, in response to the result of the target object detection operation matching with the corresponding preset processing result, it is determined that the target infrared image contains the target object (i.e., the face), the target visible light image is further processed by using a second alignment operation to correct the pose of the face in the target infrared image, and the corrected pose is compared with the preset pose. And when the similarity between the corrected pose and the preset pose is smaller than a second preset threshold, judging that the face living body detection cannot be carried out based on the pose of the target object in the target infrared image, so that the follow-up second detection operation is not realized, unnecessary operation is avoided, and the consumption of system resources is reduced.
Further, after the second alignment operation is performed on the target infrared image, in response to that the result of the second alignment operation matches the corresponding preset processing result, that is, it is determined that the face living body detection can be performed based on the pose of the target object in the target infrared image, the target infrared image is further processed by using the second detection operation to obtain the probability that the target object corresponds to the second target classification, and the probability that the target object corresponds to the second target classification obtained based on the infrared image is compared with a preset second probability threshold. And when the probability corresponding to the second category obtained based on the target infrared image is not less than a second probability threshold value, determining that the second classification result indicates that the target object corresponds to the second category, otherwise, not corresponding, and processing the infrared image to obtain the second classification result.
It should be noted that the third processing operation includes a target object detection operation, a second alignment operation, and a second detection operation that are implemented sequentially, which is merely an example, and those skilled in the art should understand that any third processing operation that can improve the accuracy of the second classification result may also be provided.
In some embodiments, the first processing operation further includes a matching processing operation, and after the third processing operation is implemented, the matching processing operation is further performed in response to a processing result of the third processing operation matching with the corresponding preset processing result.
In some embodiments, the process of matching processing operations includes: extracting the characteristics of the target visible light image; comparing the extracted features with each of a plurality of features in a preset database; in response to that the similarity between the first feature in the preset database and the extracted feature is not smaller than a preset threshold, determining that the result of the matching processing operation is matched with the corresponding preset processing result; and in response to determining that the result of the matching processing operation matches the corresponding preset processing result, determining that the first detection result indicates that the target object corresponds to a first category.
In some embodiments, the process of matching processing operations includes: extracting the characteristics of the target visible light image; comparing the characteristics of the target visible light image with the characteristics of the first image corresponding to the target object; in response to that the similarity between the features of the first image and the features of the target visible light image is not smaller than a preset threshold, determining that the result of the matching processing operation matches the corresponding preset processing result; and in response to determining that the result of the matching processing operation matches the corresponding preset processing result, determining that the first detection result indicates that the target object corresponds to a first class. In one example, the target object is a human face, and the first image is a certificate photo corresponding to the human face, such as an identification card photo.
In some embodiments, as shown in fig. 7, the image processing method according to the present disclosure further includes:
step S710: in response to determining that the detection result indicates that the target object does not correspond to the first category, obtaining an updated visible light image and an updated infrared image corresponding to the updated visible light image, the updated visible light image and the updated infrared image corresponding to a first object; and
step S720: determining the updated visible light image as the target visible light image, determining the updated infrared image as the target infrared image, and determining the first object as the target object.
And after the detection result indicates that the target object does not correspond to the first target classification, the target visible light image and the target infrared image are obtained again, and then whether the target object corresponding to the obtained target visible light image and the target infrared image corresponds to the first classification or not is judged.
Referring to fig. 8, a process of obtaining a detection result corresponding to an image detection policy by using the first processing based on a callback function being called in the image processing method according to an embodiment of the present disclosure is exemplarily described.
As shown in fig. 8, in the process of implementing the image detection strategy by using the first processing operation, the processing of the target visible light image by using the second processing operation is implemented through steps 811-814.
In step 811, the target visible-light image is processed by the detection and tracking operation, and it is determined whether the processing result of the detection and tracking operation matches the corresponding preset processing result. In response to the result of step 811 showing that the processing result of the detection tracking operation matches the corresponding preset processing result, performing step 812; otherwise, it is determined that the first detection result indicates that the target object does not correspond to the first class.
In step 812, the comparison operation is performed on the target visible light image to determine whether the target visible light image exists in the preset list. In response to the result of the step 812 indicating that the result of the comparison operation matches the corresponding preset processing result, performing step 813; otherwise, it is determined that the first detection result indicates that the target object does not correspond to the first class.
In step 813, the target visible light image is added to a buffer queue to be processed.
In step 814, in response to the previous target visible light image being processed, the target visible light image obtained from the buffer queue in step 813 is processed by using the comparison process operation, and it is determined whether the target visible light image exists in the preset list. Responding to the result of the step 814, displaying that the result of the comparison operation is matched with the corresponding preset processing result, determining that the result of the first processing is matched with the corresponding preset processing result, and further entering a process of processing the target visible light image and the target infrared image by using a third processing operation; otherwise, it is determined that the first detection result indicates that the target object does not correspond to the first class.
The above-mentioned two comparison operations are implemented through the steps 812 and 814, so that the repeated processing of the same or similar target visible light images is further avoided, and the consumption of computing resources is reduced.
In processing the target visible light image and the target infrared image with the third processing operation, the processing of the target visible light image to obtain the first classification result is implemented through steps 821a-821c, and the processing of the target infrared image to obtain the second classification result is implemented through steps 822a-822c, and finally step 823 obtains the processing result of the third processing operation based on the first classification result and the second classification result.
In step 821a, the target visible light image is processed by the alignment operation, and it is determined whether the processing result of the alignment operation matches the corresponding preset processing result. In response to the result of the step 821a showing that the processing result of the alignment operation matches the corresponding preset processing result, performing step 821 b; otherwise, it is determined that the first classification result indicates that the target object does not correspond to the second class.
In step 821b, the target visible light image is processed by the quality detection operation, and whether the processing result of the quality detection operation matches the corresponding preset processing result is determined. In response to the result of the display quality detection operation of step 821b matching the corresponding preset processing result, performing step 821 c; otherwise, it is determined that the first classification result indicates that the target object does not correspond to the second class.
In step 821c, the target visible light image is processed by the first detection operation, and it is determined whether a processing result of the first detection operation matches a corresponding preset processing result. In response to the result of step 821c indicating that the processing result of the first detection operation matches the corresponding preset processing result, determining that the first classification result indicates that the target object corresponds to the second target classification; otherwise, it is determined that the first classification result indicates that the target object does not correspond to the second target classification.
In step 822a, the target infrared image is processed by using the target object detection operation, and whether the processing result of the target object detection operation matches with the corresponding preset processing result is determined. Responding to the result of the step 822a that the processing result of the target object detection is matched with the corresponding preset processing result, and executing a step 822 b; otherwise, it is determined that the second classification result indicates that the target object does not correspond to the second class.
In step 822b, the target infrared image is processed by the second alignment operation, and it is determined whether a processing result of the second alignment operation matches a corresponding preset processing result. Responding to the result of the step 822b that the processing result of the second alignment operation is matched with the corresponding preset processing result, and executing a step 822 c; otherwise, it is determined that the second classification result indicates that the target object does not correspond to the second class.
In step 822c, the target infrared image is processed by the first living body detection operation, and whether the processing result of the first detection operation matches with the corresponding preset processing result is determined. In response to the result of step 821c indicating that the processing result of the first detection operation matches the corresponding preset processing result, determining that the second classification result indicates that the target object corresponds to the second class; otherwise, it is determined that the second classification result indicates that the target object does not correspond to the second class.
In step 823, a processing result of a third processing operation is obtained based on the above-mentioned first classification result obtained by implementing the processing on the target visible light image through steps 821a-821c and the judgment on the second classification result obtained by implementing the processing on the target infrared image through steps 822a-822c, wherein when any one of the first classification result and the second classification result indicates that the target object does not correspond to the second target classification, it is determined that the processing result of the third processing operation does not match the corresponding preset processing result, and it is further determined that the first detection result indicates that the target object does not correspond to the first target classification; otherwise, determining that the processing result of the third processing operation is matched with the corresponding preset processing result, and further entering a process of processing the target image by using the matching processing operation.
In the process of processing the target image by using the matching processing operation, the target visible light image is subjected to feature extraction in step 831, and the features extracted in step 831 are matched with features in the preset database in step 832 to determine whether the features matched with the features extracted in step 831 exist in the preset database, so as to obtain a first detection result for determining whether the processing result of the third processing 830 matches with the corresponding preset processing result, and further determine whether the target object corresponds to the first class. Wherein, in response to the result of the step 832 indicating that there is a feature in the preset database matching the feature extracted in the step 831, it is determined that the processing result of the third processing 830 matches the corresponding preset processing result, and it is further determined that the detection result indicates that the target object corresponds to the first category; otherwise, it is determined that the processing result of the third processing 830 does not match the corresponding preset processing result, and it is further determined that the detection result indicates that the target object does not correspond to the first category.
According to another aspect of the present disclosure, there is also provided an image processing apparatus, as shown in fig. 9, the apparatus 900 including: a parameter determining unit 910 configured to determine a first parameter of a first processing operation included in the image detection policy; a function calling unit 920, configured to call a callback function corresponding to the image detection policy according to the acquired target visible light image and a target infrared image corresponding to the target visible light image; an image processing unit 930, configured to employ a second processing operation of the first processing operations, and process at least one of the target visible light image and the target infrared image based on the callback function and a second parameter, to obtain a first detection result; the second parameter is a parameter corresponding to the second processing operation in the first parameters, the first detection result indicates whether the target object corresponds to the first category, and the target visible light image and the target infrared image both correspond to the target object.
In some embodiments, the image processing unit 930 comprises: a first determining unit, configured to determine that the first detection result indicates that the target object does not correspond to a first category in response to determining that a processing result of the second processing operation does not match a preset processing result corresponding to the second processing operation; a second determining unit, configured to, in response to determining that a processing result of the second processing operation matches a preset processing result corresponding to the second processing operation, adopt a third processing operation of the first processing operations, and process at least one of the target visible light image and the target infrared image based on the callback function and a third parameter, to obtain the first detection result, where the third parameter is a parameter of the first parameter corresponding to the third processing operation.
In some embodiments, the second processing operation comprises: detecting and tracking the target visible light image, wherein a preset processing result corresponding to the detecting and tracking operation indicates that the target visible light image contains the target object; or a comparison operation performed on the target visible light image, wherein a preset processing result corresponding to the comparison operation indicates that the target visible light image does not exist in a preset recording table.
In some embodiments, the preset processing result corresponding to the third processing operation indicates that the target object corresponds to a second category, and the second category is different from the first category.
In some embodiments, the second determination unit comprises: a first processing subunit configured to employ a fourth one of the third processing operations and, based on the callback function and a fourth parameter, process the target visible light image to obtain a first classification result corresponding to the target visible light image and indicating whether the target object corresponds to the second class, the fourth parameter being a parameter of the third parameter corresponding to the fourth processing operation; a second processing subunit configured to employ a fifth one of the third processing operations and, based on the callback function and a fifth parameter, process the target infrared image to obtain a second classification result corresponding to the target infrared image and indicating whether the target object corresponds to the second class, the fifth parameter being a parameter of the third parameter corresponding to the fifth processing operation; and a second determining subunit, configured to determine that the processing result of the third processing operation does not match the preset processing result corresponding to the third processing operation in response to determining that either of the first classification result and the second classification result indicates that the target object does not correspond to the first class.
In some embodiments, the first processing subunit comprises: a first determining subunit, configured to, in response to a mismatch between a processing result of the fourth processing operation and a preset processing result corresponding to the fourth processing operation, obtain the first classification result, where the first classification result indicates that the target object does not correspond to the second category; and a second determining subunit, configured to, in response to a matching of a processing result of the fourth processing operation and a preset processing result corresponding to the fourth processing operation, adopt a sixth processing operation of the third processing operations, and process the target visible light image based on the callback function and a sixth parameter to obtain the first classification result, where the sixth parameter is a parameter of the third parameters corresponding to the sixth processing operation.
In some embodiments, the third processing operation comprises: a first alignment operation performed on the target visible light image, wherein a preset processing result corresponding to the first alignment operation indicates that a similarity between a pose and a preset pose of the target object in the target visible light image is not less than a first preset threshold; performing quality detection operation on the target visible light image, wherein a preset processing result corresponding to the quality detection operation indicates that the quality of the target visible light image meets a preset quality; or a first living body detection operation performed on the target visible light image, wherein a preset processing result corresponding to the first living body detection operation indicates that the probability that the target visible light image corresponds to the second target class is not less than a preset first probability threshold.
In some embodiments, the second processing subunit comprises: a third determining subunit, configured to obtain the second classification result in response to a mismatch between a processing result of the fifth processing operation and a preset processing result corresponding to the fifth processing operation, where the second classification result indicates that the target object does not correspond to the second class; and a fourth determining subunit, configured to, in response to a matching of a processing result of the fifth processing operation and a preset processing result corresponding to the fifth processing operation, adopt a seventh processing operation of the third processing operations, and process the target infrared image based on the callback function and a seventh parameter to obtain the second classification result, where the seventh parameter is a parameter of the third parameters corresponding to the seventh processing operation.
In some embodiments, the third processing operation comprises: target object detection operation is executed on the target infrared image, wherein a preset processing result corresponding to the target object detection operation indicates that the target infrared image comprises the target object; a second alignment operation is executed on the target infrared image, wherein a preset processing result corresponding to the second alignment operation indicates that the similarity between the pose of the target object and a preset pose is not smaller than a second preset threshold; or a second living body detection operation is executed on the target infrared image, wherein a preset processing result corresponding to the second living body detection operation indicates that the probability that the target object is classified corresponding to the second target is not less than a preset second probability threshold.
In some embodiments, the apparatus 900 further comprises: an image acquisition unit configured to acquire, in response to determining that the detection result indicates that the target object does not correspond to the first category, an updated visible light image and an updated infrared image corresponding to the updated visible light image, the updated visible light image and the updated infrared image corresponding to a first object; and an image determination unit configured to determine the updated visible light image as the target visible light image, determine the updated infrared image as the target infrared image, and determine the first object as the target object.
In some embodiments, the target object comprises a human face, and the first class indicates that the human face is authenticated.
According to another aspect of the present disclosure, there is also provided an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores a computer program which, when executed by the at least one processor, implements a method according to the above.
According to another aspect of the present disclosure, there is also provided a non-transitory computer readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the method according to the above.
According to another aspect of the present disclosure, there is also provided a computer program product comprising a computer program, wherein the computer program realizes the method according to the above when executed by a processor.
Referring to fig. 10, a block diagram of a structure of an electronic device 1000, which may be a server or a client of the present disclosure, which is an example of a hardware device that may be applied to aspects of the present disclosure, will now be described. Electronic device is intended to represent various forms of digital electronic computer devices, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 10, the electronic device 1000 includes a computing unit 1001 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)1002 or a computer program loaded from a storage unit 1008 into a Random Access Memory (RAM) 1003. In the RAM 1003, various programs and data necessary for the operation of the electronic apparatus 1000 can also be stored. The calculation unit 1001, the ROM 1002, and the RAM 1003 are connected to each other by a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
A number of components in the electronic device 1000 are connected to the I/O interface 1005, including: input section 1006, output section 1007, storage section 1008, and communication section 1009. The input unit 1006 may be any type of device capable of inputting information to the electronic device 1000, and the input unit 1006 may receive input numeric or character information and generate key signal inputs related to user settings and/or function controls of the electronic device, and may include, but is not limited to, a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and/or a remote controller. The output unit 1007 may be any type of device capable of presenting information and may include, but is not limited to, a display, speakers, an object/audio output terminal, a vibrator, and/or a printer. The storage unit 1008 may include, but is not limited to, a magnetic disk, an optical disk. The communication unit 1009 allows the electronic device 1000 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and/or chipsets, such as bluetooth (TM) devices, 802.11 devices, WiFi devices, WiMax devices, cellular communication devices, and/or the like.
Computing unit 1001 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The computing unit 1001 performs the various methods and processes described above, such as the method 200. For example, in some embodiments, the method 200 may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 1008. In some embodiments, part or all of the computer program may be loaded and/or installed onto electronic device 1000 via ROM 1002 and/or communications unit 1009. When the computer program is loaded into RAM 1003 and executed by the computing unit 1001, one or more steps of the method 200 described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to perform the method 200 in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user may provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server with a combined blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be performed in parallel, sequentially or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
Although embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it is to be understood that the above-described methods, systems and apparatus are merely exemplary embodiments or examples and that the scope of the present invention is not limited by these embodiments or examples, but only by the claims as issued and their equivalents. Various elements in the embodiments or examples may be omitted or may be replaced with equivalents thereof. Further, the steps may be performed in an order different from that described in the present disclosure. Further, various elements in the embodiments or examples may be combined in various ways. It is important that as technology evolves, many of the elements described herein may be replaced with equivalent elements that appear after the present disclosure.

Claims (25)

1. An image processing method comprising:
determining a first parameter of a first processing operation included in an image detection strategy;
calling a callback function corresponding to the image detection strategy according to the obtained target visible light image and a target infrared image corresponding to the target visible light image; and
processing at least one image of the target visible light image and the target infrared image by adopting a second processing operation in the first processing operation based on the callback function and a second parameter to obtain a first detection result;
the second parameter is a parameter corresponding to the second processing operation in the first parameters, the first detection result indicates whether the target object corresponds to the first category, and the target visible light image and the target infrared image both correspond to the target object.
2. The method of claim 1, wherein said processing at least one of the target visible light image and the target infrared image with a second one of the first processing operations and based on the callback function and a second parameter comprises:
in response to determining that the processing result of the second processing operation does not match the preset processing result corresponding to the second processing operation, determining that the first detection result indicates that the target object does not correspond to the first class; and
and in response to determining that the processing result of the second processing operation is matched with the preset processing result corresponding to the second processing operation, processing at least one of the target visible light image and the target infrared image by using a third processing operation in the first processing operation based on the callback function and a third parameter to obtain the first detection result, wherein the third parameter is a parameter corresponding to the third processing operation in the first parameter.
3. The method of claim 1 or 2, wherein the second processing operation comprises:
detecting and tracking the target visible light image, wherein a preset processing result corresponding to the detecting and tracking operation indicates that the target visible light image contains the target object; or
And comparing the target visible light image, wherein a preset processing result corresponding to the comparison operation indicates that the target visible light image does not exist in a preset record table.
4. The method according to claim 2 or 3, wherein the preset processing result corresponding to the third processing operation indicates that the target object corresponds to a second category, the second category being different from the first category.
5. The method of claim 4, wherein said processing at least one of the target visible light image and the target infrared image with a third one of the first processing operations and based on the callback function and a third parameter comprises:
processing the target visible light image with a fourth one of the third processing operations and based on the callback function and a fourth parameter to obtain a first classification result corresponding to the target visible light image and indicating whether the target object corresponds to the second class, the fourth parameter being a parameter of the third parameter corresponding to the fourth processing operation;
processing the target infrared image with a fifth processing operation of the third processing operations and based on the callback function and a fifth parameter to obtain a second classification result corresponding to the target infrared image and indicating whether the target object corresponds to the second class, the fifth parameter being a parameter of the third parameters corresponding to the fifth processing operation; and
in response to determining that either of the first classification result and the second classification result indicates that the target object does not correspond to the first class, determining that a processing result of the third processing operation does not match a preset processing result corresponding to the third processing.
6. The method of claim 5, wherein said processing the target visible light image with a fourth one of the third processing operations and based on the callback function and a fourth parameter comprises:
obtaining the first classification result in response to the processing result of the fourth processing operation not matching the preset processing result corresponding to the fourth processing operation, wherein the first classification result indicates that the target object does not correspond to the second class; and
and in response to that the processing result of the fourth processing operation is matched with a preset processing result corresponding to the fourth processing operation, processing the target visible light image by adopting a sixth processing operation in the third processing operation based on the callback function and a sixth parameter to obtain the first classification result, wherein the sixth parameter is a parameter corresponding to the sixth processing operation in the third parameter.
7. The method of claim 6, wherein the third processing operation comprises:
a first alignment operation performed on the target visible light image, wherein a preset processing result corresponding to the first alignment operation indicates that a similarity between a pose and a preset pose of the target object in the target visible light image is not less than a first preset threshold;
performing quality detection operation on the target visible light image, wherein a preset processing result corresponding to the quality detection operation indicates that the quality of the target visible light image meets a preset quality; or
A first living body detection operation performed on the target visible light image, wherein a preset processing result corresponding to the first living body detection operation indicates that a probability that the target visible light image corresponds to the second category is not less than a preset first probability threshold.
8. The method of any of claims 5-7, wherein said processing the target infrared image with a fifth one of the third processing operations and based on the callback function and a fifth parameter comprises:
obtaining a second classification result in response to a processing result of the fifth processing operation not matching a preset processing result corresponding to the fifth processing operation, wherein the second classification result indicates that the target object does not correspond to the second category; and
and in response to that the processing result of the fifth processing operation is matched with the preset processing result corresponding to the fifth processing operation, processing the target infrared image by adopting a seventh processing operation in the third processing operation based on the callback function and a seventh parameter to obtain the second classification result, wherein the seventh parameter is a parameter corresponding to the seventh processing operation in the third parameter.
9. The method of claim 8, wherein the third processing operation comprises:
target object detection operation is executed on the target infrared image, wherein a preset processing result corresponding to the target object detection operation indicates that the target infrared image comprises the target object;
a second alignment operation is executed on the target infrared image, wherein a preset processing result corresponding to the second alignment operation indicates that the similarity between the pose of the target object and a preset pose is not smaller than a second preset threshold; or
And performing a second living body detection operation on the target infrared image, wherein a preset processing result corresponding to the second living body detection operation indicates that the probability of the target object corresponding to the second category is not less than a preset second probability threshold.
10. The method according to any one of claims 1-9, further comprising:
in response to determining that the detection result indicates that the target object does not correspond to the first category, obtaining an updated visible light image and an updated infrared image corresponding to the updated visible light image, the updated visible light image and the updated infrared image corresponding to a first object; and
determining the updated visible light image as the target visible light image, determining the updated infrared image as the target infrared image, and determining the first object as the target object.
11. The method of any of claims 1-10, wherein the target object comprises a human face, the first class indicating that the human face is authenticated.
12. An image processing apparatus comprising:
a parameter determination unit configured to determine a first parameter of a first processing operation included in the image detection policy;
the function calling unit is configured to call a callback function corresponding to the image detection strategy according to the acquired target visible light image and the target infrared image corresponding to the target visible light image;
the image processing unit is configured to adopt a second processing operation in the first processing operation and process at least one image in the target visible light image and the target infrared image based on the callback function and a second parameter to obtain a first detection result;
the second parameter is a parameter corresponding to the second processing operation in the first parameters, the first detection result indicates whether the target object corresponds to the first category, and the target visible light image and the target infrared image both correspond to the target object.
13. The apparatus of claim 12, wherein the image processing unit comprises:
a first determining unit, configured to determine that the first detection result indicates that the target object does not correspond to a first category in response to determining that a processing result of the second processing operation does not match a preset processing result corresponding to the second processing operation; and
a second determining unit, configured to, in response to determining that a processing result of the second processing operation matches a preset processing result corresponding to the second processing operation, adopt a third processing operation of the first processing operations, and process at least one of the target visible light image and the target infrared image based on the callback function and a third parameter, to obtain the first detection result, where the third parameter is a parameter of the first parameter corresponding to the third processing operation.
14. The apparatus of claim 12 or 13, wherein the second processing operation comprises:
detecting and tracking the target visible light image, wherein a preset processing result corresponding to the detecting and tracking operation indicates that the target visible light image contains the target object; or
And comparing the target visible light image, wherein a preset processing result corresponding to the comparison operation indicates that the target visible light image does not exist in a preset record table.
15. The apparatus according to claim 13 or 14, wherein the preset processing result corresponding to the third processing operation indicates that the target object corresponds to a second category, the second category being different from the first category.
16. The apparatus of claim 15, wherein the second determining unit comprises:
a first processing subunit configured to employ a fourth one of the third processing operations and, based on the callback function and a fourth parameter, process the target visible light image to obtain a first classification result corresponding to the target visible light image and indicating whether the target object corresponds to the second class, the fourth parameter being a parameter of the third parameter corresponding to the fourth processing operation;
a second processing subunit configured to employ a fifth one of the third processing operations and, based on the callback function and a fifth parameter, process the target infrared image to obtain a second classification result corresponding to the target infrared image and indicating whether the target object corresponds to the second class, the fifth parameter being a parameter of the third parameter corresponding to the fifth processing operation; and
a second determining subunit, configured to determine that the processing result of the third processing operation does not match the preset processing result corresponding to the third processing operation in response to determining that either of the first classification result and the second classification result indicates that the target object does not correspond to the first class.
17. The apparatus of claim 16, wherein the first processing subunit comprises:
a first determining subunit, configured to, in response to a mismatch between a processing result of the fourth processing operation and a preset processing result corresponding to the fourth processing operation, obtain the first classification result, where the first classification result indicates that the target object does not correspond to the second category; and
a second determining subunit, configured to, in response to a matching of a processing result of the fourth processing operation and a preset processing result corresponding to the fourth processing operation, adopt a sixth processing operation of the third processing operations, and process the target visible light image based on the callback function and a sixth parameter to obtain the first classification result, where the sixth parameter is a parameter of the third parameters corresponding to the sixth processing operation.
18. The apparatus of claim 17, wherein the third processing operation comprises:
a first alignment operation performed on the target visible light image, wherein a preset processing result corresponding to the first alignment operation indicates that a similarity between a pose and a preset pose of the target object in the target visible light image is not less than a first preset threshold;
performing quality detection operation on the target visible light image, wherein a preset processing result corresponding to the quality detection operation indicates that the quality of the target visible light image conforms to preset quality; or
A first living body detection operation performed on the target visible light image, wherein a preset processing result corresponding to the first living body detection operation indicates that the probability that the target visible light image corresponds to the second target class is not less than a preset first probability threshold.
19. The apparatus of any one of claims 16-18, wherein the second processing subunit comprises:
a third determining subunit, configured to, in response to a processing result of the fifth processing operation not matching a preset processing result corresponding to the fifth processing operation, obtain the second classification result, where the second classification result indicates that the target object does not correspond to the second category; and
a fourth determining subunit, configured to, in response to a matching of a processing result of the fifth processing operation and a preset processing result corresponding to the fifth processing operation, adopt a seventh processing operation of the third processing operations, and process the target infrared image based on the callback function and a seventh parameter to obtain the second classification result, where the seventh parameter is a parameter of the third parameters corresponding to the seventh processing operation.
20. The apparatus of claim 19, wherein the third processing operation comprises:
target object detection operation is executed on the target infrared image, wherein a preset processing result corresponding to the target object detection operation indicates that the target infrared image comprises the target object;
a second alignment operation is executed on the target infrared image, wherein a preset processing result corresponding to the second alignment operation indicates that the similarity between the pose and the preset pose of the target object is not smaller than a second preset threshold; or alternatively
And performing a second in-vivo detection operation on the target infrared image, wherein a preset processing result corresponding to the second in-vivo detection operation indicates that the probability that the target object is classified corresponding to the second target is not less than a preset second probability threshold.
21. The apparatus of any of claims 12-20, further comprising:
an image acquisition unit configured to acquire, in response to determining that the detection result indicates that the target object does not correspond to the first category, an updated visible light image and an updated infrared image corresponding to the updated visible light image, the updated visible light image and the updated infrared image corresponding to a first object; and
an image determination unit configured to determine the updated visible light image as the target visible light image, determine the updated infrared image as the target infrared image, and determine the first object as the target object.
22. The apparatus of any of claims 12-21, wherein the target object comprises a human face, the first class indicating that the human face is authenticated.
23. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein
The memory stores instructions executable by the at least one processor to cause the at least one processor to perform the method of any one of claims 1-11.
24. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-11.
25. A computer program product comprising a computer program, wherein the computer program realizes the method of any one of claims 1-11 when executed by a processor.
CN202210178886.3A 2022-02-25 2022-02-25 Image processing method and device Pending CN114612962A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210178886.3A CN114612962A (en) 2022-02-25 2022-02-25 Image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210178886.3A CN114612962A (en) 2022-02-25 2022-02-25 Image processing method and device

Publications (1)

Publication Number Publication Date
CN114612962A true CN114612962A (en) 2022-06-10

Family

ID=81860004

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210178886.3A Pending CN114612962A (en) 2022-02-25 2022-02-25 Image processing method and device

Country Status (1)

Country Link
CN (1) CN114612962A (en)

Similar Documents

Publication Publication Date Title
CN112749685B (en) Video classification method, apparatus and medium
CN113256583A (en) Image quality detection method and apparatus, computer device, and medium
CN112712498A (en) Vehicle damage assessment method and device executed by mobile terminal, mobile terminal and medium
CN114445667A (en) Image detection method and method for training image detection model
CN114495103B (en) Text recognition method and device, electronic equipment and medium
CN113723305A (en) Image and video detection method, device, electronic equipment and medium
CN113868453B (en) Object recommendation method and device
CN114842476A (en) Watermark detection method and device and model training method and device
CN113596011B (en) Flow identification method and device, computing device and medium
CN115601555A (en) Image processing method and apparatus, device and medium
CN114998963A (en) Image detection method and method for training image detection model
CN114494797A (en) Method and apparatus for training image detection model
CN114612962A (en) Image processing method and device
CN113486853A (en) Video detection method and device, electronic equipment and medium
CN114071024A (en) Image shooting method, neural network training method, device, equipment and medium
CN114140851B (en) Image detection method and method for training image detection model
CN114120420B (en) Image detection method and device
CN115512131B (en) Image detection method and training method of image detection model
CN115170536B (en) Image detection method, training method and device of model
CN115620271B (en) Image processing and model training method and device
CN114140852B (en) Image detection method and device
CN114677691B (en) Text recognition method, device, electronic equipment and storage medium
CN115578451B (en) Image processing method, training method and device of image processing model
CN114882571A (en) Method for acquiring image information and method for training image detection model
CN114495234A (en) Image processing method and 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