An image processing method and device, and an electronic device

CN117255258BActive Publication Date: 2026-09-22LENOVO (BEIJING) LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311253911.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-26
Publication Date
2026-09-22
Estimated Expiration
2043-09-26

AI Technical Summary

Technical Problem

[0003]然而,在基于如图1所示的DMFT底层架构的图像处理场景中,调用摄像头的各应用程序都是接收同一种特效的图像进行显示,图像特效控制方式单一,且会降低某些应用程序调用摄像头所执行功能的可靠性,无法达到该功能的执行目的

Benefits of technology

[0004]为了解决上述技术问题,本申请提供了以下技术方案:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117255258B_ABST
    Figure CN117255258B_ABST
Patent Text Reader

Abstract

The application provides an image processing method and device and electronic equipment. In the device-level image processing scene, at least two processing modes are configured for a second component for processing a first component output, and the output of the second component is applied to an application program that calls the first component, and the application program cannot change the output in the process of applying the output of the second component. In this way, after target information representing the calling condition of the first component is obtained, the target processing mode of the second component is determined based on the target information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates primarily to the field of image processing, and more specifically to an image processing method, apparatus, and electronic device. Background Technology

[0002] Currently, the video capture stack in Windows supports user-mode extensions in the form of DMFT (Device Media Foundation Transform), such as... Figure 1 As shown, DMFT can be used as an extension component for camera devices. Through the different MFT (Media Foundation Transform) image processing plugins it contains, it can perform post-processing operations on the raw image frames captured by the camera, such as background replacement, background blurring, beautification, face focusing, effect comparison, etc., to meet the image effect display needs under different image processing tasks.

[0003] However, based on such Figure 1 In the image processing scenario of the DMFT underlying architecture shown, all applications that call the camera receive and display images with the same special effects. The image effect control method is singular, which reduces the reliability of the functions performed by some applications calling the camera and makes it impossible to achieve the purpose of the function. Summary of the Invention

[0004] To address the aforementioned technical problems, this application provides the following technical solutions:

[0005] An image processing method, the method comprising:

[0006] Obtain target information; the target information represents the invocation status of the first component;

[0007] Based on the target information, the target processing mode of the second component is determined;

[0008] The second component includes at least two processing modes. The output of the second component is applied to the application that calls the first component, and the application cannot modify the output while applying the output of the second component.

[0009] Optionally, obtaining the target information includes:

[0010] Obtain the runtime call parameters of the first component; the runtime call parameters can represent the number of applications that have called the first component, the corresponding call mode, and the target call mode of the current request to call the first component;

[0011] Alternatively, obtain the current calling functionality of the application that requested the call to the first component.

[0012] Optionally, the first component can be invoked by one application in a first invocation mode at the same time, and can be invoked by multiple applications in a second invocation mode at the same time, wherein:

[0013] If the target processing mode is the first processing mode, the second component executes the first parameter from the application that requested to invoke the first component in the first invocation mode;

[0014] If the target processing mode is the second processing mode, the second component stops executing the first parameter from the application that requested to call the first component in the first calling mode;

[0015] If the target processing mode is the third processing mode, the second component stops executing any parameters and forwards the output of the first component.

[0016] Optionally, determining the target processing mode of the second component based on the target information includes:

[0017] Based on the target information, it is determined that the first component has not been called by any application and is currently being requested to be called in the first calling mode, and the second component is controlled to be in the first processing mode;

[0018] Based on the target information, it is determined that the first component has been invoked by at least one application in the second invocation mode, or the first component has been invoked by multiple applications in different invocation modes, and the second component is controlled to be in the second processing mode;

[0019] Based on the target information, it is determined that the first component has been invoked by an application in a first invocation mode and is currently requested to be invoked in a second invocation mode, and the second component is controlled to switch from the first processing mode to the second processing mode;

[0020] Based on the target information, it is determined that the application calls the first component to implement the authentication function, and the second component is controlled to be in the third processing mode.

[0021] Optionally, if the target processing mode is the first processing mode, the method further includes:

[0022] In response to a call request to the first component in the first call mode, a first parameter from the application requesting the call to the first component is determined;

[0023] The second component is controlled to process the acquired image output by the first component according to the first parameter and the preset second parameter to obtain a first output image with a first special effect;

[0024] The first output image is sent to the application that requested the first component.

[0025] Optionally, when the target processing mode is the second processing mode, the method further includes:

[0026] In response to a call request to the first component in the first call mode or the second call mode, a preset second parameter is determined;

[0027] The second component is controlled to process the acquired image output by the first component according to the second parameter to obtain a second output image with a second special effect;

[0028] The second output image is sent to the outputs of multiple applications that invoke the first component.

[0029] Optionally, determining, based on the target information, whether the application calls the first component to implement the authentication function includes:

[0030] Determine that the application type of the application requesting to invoke the first component belongs to the authentication application type;

[0031] Alternatively, determine that the image processing application window output by the application that requested to call the first component belongs to the authentication window;

[0032] Alternatively, it can be determined that a subcomponent of a specific subcomponent type in the first component being called is in a working state; the subcomponent of the specific component type being called and running can trigger the application being called to implement the authentication function.

[0033] Optionally, determining that a subcomponent of a specific subcomponent type among the first component requested to be invoked is in a working state includes:

[0034] The power state value of the first sub-component belonging to a specific sub-component type in the first component that is requested to be invoked is determined to be a first state value, and the attribute value of the second sub-component belonging to the specific sub-component type in the registry entry of the second component is determined to be a first value.

[0035] The power status value includes a first status value and a second status value. The first status value indicates that the first sub-component is in a working state, and the second status value indicates that the first sub-component is in a powered-off state.

[0036] The attribute values ​​for the second sub-component in the registry key of the second component include the first value and the second value. The first value indicates that the second sub-component is in a working state, and the second value indicates that the second sub-component is in a closed state.

[0037] On the other hand, this application also proposes an image processing apparatus, the apparatus comprising:

[0038] A target information acquisition module is used to acquire target information; the target information represents the invocation status of the first component;

[0039] The target processing mode determination module is used to determine the target processing mode of the second component based on the target information.

[0040] The second component includes at least two processing modes. The output of the second component is applied to the application that calls the first component, and the application cannot modify the output while applying the output of the second component.

[0041] Furthermore, this application also proposes an electronic device comprising: a first component, a second component connected to the first component, and a control circuit respectively connected to the first component and the second component, wherein:

[0042] The control circuit is used to implement the image processing method described above. Attached Figure Description

[0043] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0044] Figure 1 This is a schematic diagram of a DMFT underlying architecture for image processing;

[0045] Figure 2a This is a schematic diagram of an optional embodiment of an electronic device suitable for the image processing method proposed in this application;

[0046] Figure 2b This is a schematic diagram of another optional embodiment of an electronic device suitable for the image processing method proposed in this application;

[0047] Figure 3 This is a schematic flowchart of an optional embodiment of the image processing method proposed in this application;

[0048] Figure 4This is a schematic flowchart of an optional embodiment two of the image processing method proposed in this application;

[0049] Figure 5 A schematic diagram of the system architecture for application scenarios applicable to the image processing method proposed in this application;

[0050] Figure 6 A comparison image for split-screen rendering applicable to the image processing method proposed in this application;

[0051] Figure 7 This is a schematic flowchart of an optional embodiment three of the image processing method proposed in this application;

[0052] Figure 8 This is a schematic flowchart of an optional embodiment four of the image processing method proposed in this application;

[0053] Figure 9 This is a schematic flowchart of an optional embodiment five of the image processing method proposed in this application;

[0054] Figure 10 This is a schematic flowchart of an optional embodiment six of the image processing method proposed in this application;

[0055] Figure 11a A schematic diagram illustrating the optional configuration of the IR camera power state in the application scenario of the Winhello face function, applicable to the image processing method proposed in this application;

[0056] Figure 11b This is a schematic diagram illustrating another optional configuration of the IR camera power state for use in the Winhello face function scenario, applicable to the image processing method proposed in this application.

[0057] Figure 12 A schematic diagram of the processing flow for the Winhello face function scenario applicable to the image processing method proposed in this application;

[0058] Figure 13 This is a schematic diagram of an optional embodiment of the image processing apparatus proposed in this application. Detailed Implementation

[0059] In response to the technical problems existing in the image processing scenarios described in the background technology, for example... Figure 1In the image processing scenario depicted by the DMFT (Device Media Foundation Transform) underlying architecture—specifically, the scenario of processing camera output at the device level—this application proposes configuring multiple processing modes for the DMFT. This allows for dynamic control of the DMFT to switch to the corresponding processing mode when the camera is invoked, processing the captured image output from the camera and meeting the image output requirements of various applications calling the camera. Therefore, this adaptive switching control of multiple processing modes for the DMFT not only enriches the image effects control methods but also, when calling the camera to achieve a specific function, can control the DMFT to be in the corresponding target processing mode, ensuring that its output image reliably achieves that specific function.

[0060] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0061] Throughout this application, unless the context clearly indicates otherwise, the words "a," "an," "an," and / or "the" are not specifically singular and may include plural forms. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of explicitly identified steps and elements, which do not constitute an exclusive list; a method or apparatus may also include other steps or elements. An element defined by the phrase "comprising an..." does not exclude the presence of other identical elements in the process, method, product, or apparatus that includes the element.

[0062] In the description of the embodiments of this application, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. "And / or" in this article is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone.

[0063] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. Unless otherwise stated, in the description of embodiments in this application, "multiple" means two or more.

[0064] Reference Figure 2aThis is a schematic diagram of an optional embodiment of an electronic device applicable to the image processing method proposed in this application. The electronic device may include, but is not limited to, smartphones, tablets, wearable devices, netbooks, augmented reality (AR) devices, virtual reality (VR) devices, robots, desktop computers, etc. Figure 1 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of this application. Therefore, as... Figure 2a As shown, the electronic device may include at least a first component 110, a second component 120 connected to the first component 110, and a control circuit 130 connected to the first component 110 and the second component 120 respectively, wherein:

[0065] The first component 110 can be invoked by an application running on the electronic device to fulfill corresponding functions, such as video conferencing or facial authentication. The first component 110 can be an image capture device with image acquisition capabilities, such as a camera; or it can be a component with data transmission capabilities, capable of directly receiving or reading images required by the first application, such as a wired or wireless network communication module. This application does not limit the type of the first component 110 or its output content. It should be noted that during the process of the application invoking the first component 110, the output of the first component 110 is not directly sent to the application that successfully invoked it; it needs to be processed or forwarded by the second component 120.

[0066] The second component 120 includes at least two processing modes. In different processing modes, the second component 120 processes the same output of the first component 110 in different ways, so that the output of the second component 120 has different display states, such as images with different display effects (e.g., special effects), or images with configured special effects, etc., to meet the output requirements of different applications that call the first component 110 to perform different functions.

[0067] Combination Figure 1 In the image processing scenario under the DMFT underlying architecture shown, the second component 120 can be multiple MFT components, i.e. image processing components, in DMFT. In at least one processing mode, it can be used to process the acquired image output by the first component 110, such as background replacement / blurring, beautification, face focusing, and effect comparison, and transmit the output image with corresponding special effects to each application that calls the first component 110. The image processing methods of each MFT component are not described in detail in this application.

[0068] As can be seen, the output of the second component 120 is applied to the application that calls the first component 110, and the application cannot modify the output of the second component 120 during the application process. In other words, the output of the second component 120 in this application is the input of each application that calls the first component 110. This application does not restrict the first component 110 and the second component 120, nor the type of application that calls the first component 110, and can be determined as appropriate.

[0069] In this embodiment of the application, when any application requests to call the first component 110, the control circuit 130 can execute the image processing method proposed in this application to obtain target information that can characterize the calling situation of the first component 110. Based on the target information, the control circuit 130 controls the second component 120 to be in a target processing mode, that is, the second component 120 includes at least two processing modes that are suitable for the calling situation, so that the second component 120 processes the output of the first component 110 according to the target processing mode and sends the processed output to each application that calls the first component 120, so as to display the output of the second component 120 in the application interface of the application.

[0070] Optional, as analyzed above, such as Figure 2b As shown, the electronic device may also include output components such as a display 140, which may have a touch display panel, i.e., a touch screen, for outputting the application interface of the application that calls the first component 110, and displaying the output of the second component 120 in the application interface. For other outputs that are different from this type of image output, the electronic device may also include other output components with corresponding output functions. This application does not describe in detail the types of output components and the methods for implementing the output of the second component 120.

[0071] In some embodiments, such as Figure 2b As shown, the control circuit 130 may include a memory 131 for storing program code that implements the image processing method proposed in this application, and a processor 132 for loading and executing the program code to implement the image processing method proposed in this application.

[0072] The memory 131 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, such as a hard disk drive (HDD) or solid-state drive (SSD), or other volatile solid-state storage devices, such as random-access memory (RAM). It may also be a circuit or any other device capable of performing storage functions. This application does not limit the type and operation of the memory 131 included in the electronic device, and can be determined as appropriate.

[0073] Processor 132 can be a Central Processing Unit (CPU), an application-specific integrated circuit (ASIC), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or other general-purpose processors such as microprocessors, etc., and can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of this application. It should be understood that in this implementation process, the steps of each method embodiment below can be directly executed by the hardware processor 132, or they can be implemented by a combination of hardware and software modules in processor 132, depending on the circumstances.

[0074] The components of an electronic device, as listed above, can be connected to each other via a bus or other communication methods to achieve data transmission and implement the image processing method proposed in this application. This bus may include an address bus, a data bus, a control bus, etc., which can be determined according to actual needs and will not be detailed in this application.

[0075] In some other embodiments, the control circuit 130 described above can also be a processing device with data and processing capabilities. It can store program code implementing the image processing method proposed in this application. When an application running on the electronic device calls the first component 110, the program code can be executed to implement the image processing method proposed in this application, achieving adaptive switching control of multiple processing modes of the second component 120, meeting the output requirements of the corresponding application, and reliably implementing the function executed by the application calling the first component 110. The implementation process can be referred to the description in the corresponding part of the method embodiment below, which will not be detailed here. It should be noted that the composition structure of the control circuit 130 in the electronic device includes, but is not limited to, the content described in this application, and can be flexibly configured according to actual needs.

[0076] It should be understood that, Figure 2a and Figure 2b The structure of the electronic device shown does not constitute a limitation on the electronic device in the embodiments of this application. In practical applications, the electronic device may include more than Figure 2a and Figure 2b The hardware structure of the device may be determined according to the type of electronic device and its functional requirements, and is not listed in this application. The device may contain more or fewer components, or combinations of certain components, such as a touch sensing unit for sensing touch events on a touch display panel, at least one input component such as a keyboard, mouse, microphone, etc.; at least one output component such as a speaker, vibration mechanism, lamp, etc.; an antenna; a sensor module; a power supply module, etc. The hardware structure may be determined according to the type of electronic device and its functional requirements, and is not listed in detail here.

[0077] Reference Figure 3 This is a flowchart illustrating an optional embodiment of the image processing method proposed in this application. This method can be applied to electronic devices as described above, and can be executed by a control circuit within the electronic device. Figure 1 , Figure 2a and Figure 2b The hardware structure of the electronic device shown is as follows: Figure 3 As shown, the image processing method proposed in this embodiment may include:

[0078] Step S31: Obtain target information; this target information represents the invocation status of the first component;

[0079] Step S32: Based on the target information, determine the target processing mode of the second component; the second component includes at least two processing modes, the output of the second component is applied to the application that calls the first component, and the application cannot modify the output of the second component during the application process.

[0080] Based on the above description of the technical solution of this application, the processing mode in the embodiments of this application can be an image rendering mode, and the processing result is a special effects display. In this mode, compared with the rendering processing of the received image by the internal program of the application to output the corresponding special effects, the image processing method proposed in this application is applicable to the scenario of device-level rendering of the output of the first component. Based on this, when any application running on the electronic device requests to call the first component, the second component needs to be in different processing modes to process the output of the first component under different calling conditions, so as to ensure that the output of the second component meets the output requirements of each application that successfully calls the first component.

[0081] Therefore, this application can obtain target information representing the invocation status of the first component before responding to the application's request to invoke the first component. The target information content can be determined according to the actual possible scenarios of invoking the first component. This application does not limit the content of the target information or the method of obtaining it.

[0082] Of course, for an application that has successfully called the first component, the call to the first component can be terminated, causing the calling status of the first component to change. At this time, the control circuit can obtain the corresponding target information and determine whether to adjust the target processing mode of the second component. That is to say, step S31 can also be obtained after any application terminates the call to the first component, or step S31 can be executed in real time or periodically to accurately understand the calling status of the first component and adjust the target processing mode of the second component in a timely manner. This application does not limit the execution triggering conditions or execution scenarios of step S31.

[0083] In practical applications, the second component is usually in a certain processing mode by default. This processing mode is applicable to a certain calling situation of the first component. Based on the currently obtained target information, if it is determined that the calling situation of the first component has changed, the second component can be controlled to switch to the corresponding target processing mode, that is, another processing mode different from the default processing mode. If it is determined that the calling situation of the first component has not changed, the second component can be controlled to maintain the current target processing mode. This application does not limit the switching control method of the second component in different processing modes, and it can be determined in combination with the processing content of different processing modes.

[0084] In this process, based on the target information, if the first component is successfully called by multiple applications, the second component processes the output of the first component in the corresponding target processing mode and sends it to each application, so that all these applications output the same special effect image from the second component, that is, the special effect display of these multiple applications that call the first component is the same.

[0085] Optionally, if based on the currently obtained target information, it is determined that the application calls the first component to perform specific call functions such as face authentication, in order to ensure the reliability of the face authentication function, it is necessary to authenticate the original face image of the object being authenticated (i.e., an image without any special effects). In this case of being called, in the corresponding target processing mode of the second component, no rendering parameters will be executed on the captured image of the object being executed output by the first component.

[0086] Therefore, for the second component containing at least two processing modes, in one processing mode the second component can perform processing operations on the output of the first component (i.e., operations that change the output display effect of the first component, such as rendering processing operations) to obtain an output with corresponding special effects; in another processing mode the second component can not perform any processing operations on the output of the first component and directly forward the output of the first component. In this case, the second component can be used as a data transmission component, but it is not limited to the two processing modes described in this application. It can be flexibly configured according to actual needs. This application will not provide detailed examples here.

[0087] In summary, in this embodiment, considering that the input of each application calling the first component is the output of the second component, and that the output of the second component cannot be changed during the output process, this application configures the second component to include at least two second processing modes. Different processing modes correspond to different calling situations of the first component. In this way, this application can obtain target information that can adjust the calling situation of the first component. Based on this target information, the appropriate target processing mode of the second component can be flexibly and accurately determined. This satisfies the output requirements of each application calling the first component under the current calling situation of the first component, while improving the user experience of the application calling the functions implemented by the first component.

[0088] Reference Figure 4 This is a flowchart illustrating an optional embodiment two of the image processing method proposed in this application. This embodiment can describe an optional refined implementation of the image processing method proposed above, such as... Figure 4 As shown, the method may include:

[0089] Step S41: Obtain the runtime call parameters of the first component; the runtime call parameters can represent the number of applications that have called the first component, the corresponding call mode, and the target call mode of the current request to call the first component;

[0090] In practical applications, the first component can be invoked by an application using either a first invocation mode or a second invocation mode. The first invocation mode can be an exclusive mode, and the second invocation mode can be a shared mode. In practice, once the first component is invoked by one application in the exclusive mode, it is prohibited from being invoked by other applications in the exclusive mode. It can still be invoked by at least one other application in the shared mode, but the processing mode of the second component needs to be adjusted accordingly. Therefore, this application allows different numbers of applications to invoke the first component using different invocation modes. The first component can be invoked by one application using the first invocation mode at the same time, and can be invoked by multiple applications using the second invocation mode at the same time, but it does not restrict the application types of the applications invoking the first component using different invocation modes.

[0091] In different cases where the first component is called in different calling modes, the second component may need to switch to different processing modes to meet the corresponding output requirements. Therefore, this application can obtain the running calling parameters of the first component in real time or periodically, or it can execute step S41 after receiving a call request from any application to the first component to determine the target calling mode of the current call request to the first component, that is, the calling mode contained in the currently received call request, such as the first calling mode or the second calling mode.

[0092] Furthermore, before responding to the current call request to the first component, it is necessary to determine whether there are any applications that have successfully called the first component, how many applications have successfully called the first component, and what calling mode each application used to call the first component. This determines the current calling status of the first component, so that the second component can be controlled to switch to the appropriate target processing mode. This application does not limit the content of the runtime call parameters of the first component or the method of obtaining them; it can be determined as appropriate.

[0093] Optionally, a first component filter driver can be configured under the first component driver to automatically count the number of applications that have called the first component. For example, an identifier for recording the number of applications can be pre-configured. After the first component filter driver detects an application that has successfully called the first component, the number of applications counted by the identifier can be incremented by 1. Similarly, when an application that has successfully called the first component ends its call, the number of applications counted by the identifier can be decremented by 1. The value of the identifier represents the number of applications that have currently called the first component, but it is not limited to this method of counting the number of applications.

[0094] Step S42: Based on the running call parameters, determine that the first component has not been called by any application and is currently being requested to be called in the first call mode, and control the second component to be in the first processing mode;

[0095] Following the above analysis, by analyzing the currently obtained runtime call parameters of the first component, it is determined that if any application requests to call the first component in the first call mode, such as requesting exclusive use of the first component, before responding to the exclusive call request, if it is determined that no other application is currently calling the first component, that is, the number of applications in the obtained runtime call parameters is equal to zero, the application can directly respond to the call request sent by the current application to call the first component in exclusive mode, which can be recorded as an exclusive call request. This updates the number of applications calling the first component to 1, allowing the current application to exclusively use the first component. This can directly determine the parameters executed by the second component when processing the output of the first component, and this processing mode of the second component can be recorded as the first processing mode.

[0096] For example, taking a camera as the first component and a DMFT as the second component as an example, refer to... Figure 5 The diagram shown is an optional architecture for the first component invocation scenario of the image processing method proposed in this application. This application can configure a camera filter driver between the camera driver and the media foundation framework. The camera filter driver can write the statistically obtained number of applications currently calling the camera into a database for storage. The storage method is not described in detail.

[0097] The media infrastructure framework enables communication with upper-layer camera applications. It typically includes a DMFT platform (PlatformDMFT), an IHV (Independent Hardware Vendor) DMFT, and a dedicated view DMFT developed by a specific vendor. The view DMFT can obtain the number of applications currently calling the camera from the database, thereby determining how many applications have successfully called the first component. If the number of applications is 0, the application can directly respond to the call request regardless of the calling mode used by the current application. However, because the degree of application access to the first component varies under different calling modes, the source of parameters that the second component can execute also varies, allowing the second component to operate in different processing modes.

[0098] Therefore, when only the current application calls the first component in exclusive mode to preview the processing effects of the first component's output, other applications are not allowed to exclusively use the first component, and the second component can be controlled to be in the first processing mode. If the current application calls the first component in shared mode, other applications can continue to call the first component in shared mode, and the second component can be controlled to be in the second processing mode. The first and second processing modes of the second component allow the sources of the parameters used by the second component to process the output of the first component to be different.

[0099] Step S43: In response to the call request for the first component in the first call mode, determine the first parameter from the application requesting to call the first component;

[0100] Based on the above analysis, it can be seen that when the second component is in the first processing mode, it will execute the first parameters from the application that requested to call the first component in the first calling mode, such as the rendering parameters to achieve the preset effects. In other words, the application that is currently requesting to call the first component will exclusively occupy the first component and can flexibly configure the first parameters according to the actual application needs.

[0101] For example, in a scenario where an application calls the first component to output a video stream, this application adopts a DMFT device-level rendering camera output scheme and compares the display effects before and after rendering, such as... Figure 6 As shown, the application needs to display the raw image frames captured by the first component (such as...). Figure 6 The video area on the left side of the middle video display area where the original background was not replaced with a special effects background (i.e., the area without special effects display) and the image frame processed by the second component (such as... Figure 6 The right side of the video display area displays an area with special effects, replacing the original background. It should be noted that this area (with and without special effects) is a comparison image between corresponding areas within the same image frame, showing whether or not special effects rendering is performed. Before or after successfully invoking the first component, the configured first parameter can include the display split ratio of this comparison image, configured by means of, but not limited to, writing to the registry. Thus, when responding to an exclusive call request to the first component, the first parameter can be read from the registry to process the output of the first component.

[0102] It should be noted that the first parameter mentioned above can also be other content, which can be determined according to the function required by the application that is calling the first component. This application does not limit the content of the first parameter.

[0103] Step S44: Control the second component to process the acquired image output by the first component according to the first parameter and the preset second parameter to obtain a first output image with the first effect;

[0104] Step S45: Send the first output image to the application output that requested the first component.

[0105] Following the above analysis, the preset second parameter can be the default parameter for the second component to perform image processing, so as to perform image post-processing on the output of the first component to obtain an output image with preset effects. The second parameter can include, but is not limited to, the parameters used when performing image processing tasks such as background replacement / blurring, beautification, and face focusing.

[0106] The current application needs to call the first application to achieve the following: Figure 6 In the case of the comparison display effect shown, that is, the image display effect before and after rendering, the split screen ratio and the parameters required for the image rendering part to achieve a specific effect can be obtained, that is, the first parameter and the second parameter mentioned above are obtained. Then, after the second component receives the output of the first component, the captured image output by the first component can be processed according to the first parameter and the second parameter to obtain the first output image with the first effect (such as the comparison display effect before and after the split screen rendering effect). The processing process is not described in detail in this application.

[0107] Then, the second component can send the obtained first output image to the application currently calling the first component, i.e., the application that exclusively uses the first component. The output content of the second component will then be displayed in the application's interface or its output display window, such as... Figure 5 The View DMFT can send the processed output to the View GUI (Graphical User Interface) for display, such as... Figure 6 The split-screen comparison diagrams shown are examples of this. In this case, the current application exclusively occupies the first component, and the content of the first parameter can be flexibly adjusted according to actual needs. The second component will execute the first parameter to achieve the corresponding output effects.

[0108] Optionally, in the above scenario, if the first parameter includes the screen split ratio and the special effects processing parameters for the output of the first component (such as the content of the second parameter), the second component is determined to be in the first processing mode according to the above method. After obtaining the first parameter, the second component can be directly controlled to process the captured image output by the first component according to the first parameter to obtain the first output image with the first special effect, which meets the processing requirements of the current application calling the function executed by the first component.

[0109] It should be noted that in the scenario described in this application where the current application exclusively occupies the first component, responding to other applications' calls to the first component in the first calling mode will be prohibited, but this does not affect other applications' calls to the first component in the second calling mode. However, in this case, it is necessary to promptly control the second component to switch from the first processing mode to the second processing mode and process the output of the first component. The implementation process can be referred to the description of the corresponding scenario embodiment below, which will not be detailed here.

[0110] Reference Figure 7 This is a flowchart illustrating an optional embodiment three of the image processing method proposed in this application. This embodiment can describe another optional refined implementation of the image processing method proposed above, such as... Figure 7 As shown, the method may include:

[0111] Step S71: Receive a call request for the first component;

[0112] Step S72: Obtain the runtime call parameters of the first component; the runtime call parameters can represent the number of applications that have called the first component, the corresponding call mode, and the target call mode of the current request to call the first component;

[0113] Step S73: Based on the running call parameters, determine that the first component has been called by at least one application in the second call mode, and control the second component to be in the second processing mode;

[0114] For details regarding the content of the runtime call parameters and how to obtain them, please refer to the description of the corresponding part of the above embodiment. This embodiment will not elaborate on them here.

[0115] In this embodiment, after receiving a call request from any application requesting to invoke the first component in a target call mode (first call mode or second call mode), before responding to the call request, the call request of the first component can be determined based on the current running call parameters of the first component. Combining the above analysis of the call situation of the first component, if it is determined that the first component has been called by one or more applications (i.e., the number of such applications is greater than or equal to 1, and these applications all call the first component in a second call mode, such as a shared mode), the second component can be controlled to be in a second processing mode. At this time, the second component will stop executing the first parameters from the applications that requested to call the first component in the first call mode, thus avoiding the situation described above where each application calling the first component displays a split-screen comparison image, reducing the user experience of other applications calling the output image of the first component.

[0116] When the target invocation mode is the first invocation mode, and the number of applications is greater than or equal to one, in order to prevent the current application from calling the first component, the output display effect (such as image effects) of the determined second component from interfering with the output display effect of the second component required by other applications, combined with... Figure 6 In the application scenario shown, to prevent other applications that have already used the camera from displaying the split-screen effect in their video conferencing feeds when the current application exclusively uses the camera to preview the images before and after the split-screen effect, this application will directly control the second component to be in the second processing mode and stop the split-screen rendering.

[0117] When the target call mode is the second call mode, that is, the current application requests to call the first component in the second call mode (i.e., the shared mode), the first component can be shared with other applications that have successfully called the first component. Multiple applications that call the first component will share the display effects obtained by the second component processing the output of the first component. At this time, the second component can still be controlled to remain in the second processing mode.

[0118] Therefore, regardless of whether the target call mode is the first call mode or the second call mode, before responding to the current call request to the first component, if it is determined that the first component has been called by at least one application in the second call mode, the second component will be controlled to be in the second processing mode to process the output of the first component.

[0119] In some further embodiments of this application, based on the current runtime call parameters of the first component, it is determined that the first component has been called by multiple applications in different call modes. That is, at least one application has successfully called the first component in the first call mode, and at least one first application has successfully called the first component in the second call mode. In conjunction with the above analysis, to avoid interference with the image display effects of applications sharing the first component due to the display effects configured by the application that exclusively uses the first component, the second component is also controlled to be in the second processing mode. The handling of these multiple applications' call requests to the first component in different call modes can be referred to the descriptions of the corresponding scenarios in the above embodiments, and will not be detailed here.

[0120] Furthermore, in this embodiment, if the target invocation mode is the first invocation mode, since the first component is exclusively invoked by an application at the same time, the current invocation request to the first component in the first invocation mode will be prohibited from being responded to; if the target invocation mode is the second invocation mode, the corresponding invocation request can be responded to in accordance with the method described below, and the implementation process will not be described in detail in this application.

[0121] Step S74: In response to the above call request, determine the preset second parameter;

[0122] In some other embodiments proposed in this application, if the target calling mode is the first calling mode, and it is determined that at least one application has successfully called the first component, that is, the number of applications counted is greater than or equal to 1, it can directly try to respond to the corresponding calling request, that is, try to open the first component in exclusive mode. If the attempt is successful, it is determined that the other applications that have called the first component are calling the first component in shared mode, and the second component is still controlled to be in the second processing mode, and split-screen rendering is disabled, that is, the second component stops executing the first parameter from the current application.

[0123] Step S75: Control the second component to process the acquired image output by the first component according to the second parameter to obtain a second output image with the second effect;

[0124] Step S76: Send the second output image to the output of multiple applications that invoke the first component.

[0125] Following the above analysis, regardless of whether the received call request to the first component is an exclusive call request for the first call mode or a shared call request for the second call mode, if the first component has already been called by at least one application in the second call mode, the second component will be controlled to enter the second processing mode. Thus, in response to the call request, the second component will be controlled to process the acquired image output by the first component according to preset second parameters, obtaining a second output image with second special effects, such as... Figure 6 In the scenario shown, all output images are rendered special effects images, and the original images before rendering (i.e., the captured images directly output by the first component) are not displayed. This ensures that the output display effects of each application currently calling the first component are the same, and will not affect the functions currently being executed by each application, such as the display effect of a video conference.

[0126] It should be understood that, when the first component described above is invoked, during the process of the current application invoking the first component, if the number of applications is determined to be equal to 1 based on the number of applications in the running invocation parameters of the first component obtained in real time or periodically, it can be determined that other applications in the shared mode that invoke the first component will end their invocation of the first component, and only the current application will exclusively occupy the first component. The second component can be controlled to switch from the second processing mode to the first processing mode, and the output of the first component can be processed according to the method described in the corresponding scenario embodiment above. For example, in the example above, the previously disabled split-screen rendering is re-enabled without the current application user needing to reconfigure the split-screen ratio.

[0127] Reference Figure 8 This is a flowchart illustrating an optional embodiment four of the image processing method proposed in this application. This embodiment can describe another optional refined implementation of the image processing method proposed above, such as... Figure 8 As shown, the method may include:

[0128] Step S81: Receive a call request for the first component;

[0129] Step S82: Obtain the runtime call parameters of the first component; the runtime call parameters can represent the number of applications that have called the first component, the corresponding call mode, and the target call mode of the current request to call the first component;

[0130] The implementation process of steps S81 and S82 can be referred to the description of the corresponding parts of the above embodiments, and will not be described in detail here.

[0131] Step S83: Based on the running call parameters, it is determined that the first component has been called by an application in the first call mode and the target call mode is the second call mode, and the second component is controlled to switch from the first processing mode to the second processing mode;

[0132] Based on the above description of the number of applications that have called the first component, if the number of such applications is 1, and if the current application's call request to the first component is an exclusive call request, it can directly attempt to respond to the call request, that is, attempt to call the first component to run. If the first component is successfully called, it means that the application that previously successfully called the first component was calling the first component in the second call mode (shared mode); otherwise, it means that the application that previously successfully called the first component was calling the first component in the first call mode (exclusive mode). It is forbidden to respond to the call request received this time. The user can be reminded to change the call mode or wait for other applications to end their exclusive call to the first component, etc. The subsequent processing method can be determined according to the actual situation.

[0133] Of course, as described in this embodiment, when each application requests to call the first component, the call mode of the first component is recorded, so that the running call parameters of the first component can include the target call mode of the current request to call the first component. This application can also directly determine, based on the currently obtained running call parameters, that the application with an application count of 1 and which has successfully called the first component is calling in the first call mode. If the current application requests to call the first component in the first call mode, the call fails. If the current application requests to call the first component in the second call mode, the call to the first component can be successfully made. Since the second component was previously in the first processing mode, it processes the output of the first component. Referring to the description of the corresponding part of Embodiment 2 above, in order to ensure the output display effect of the current application, it is necessary to control the second component to switch to the second processing mode. This application does not limit the implementation method of switching control of different processing modes of the second component.

[0134] Step S84: In response to the call request, control the second component to process the acquired image output by the first component according to the preset second parameters to obtain a second output image with the second special effect;

[0135] Step S85: Send the second output image to the output of multiple applications that invoke the first component.

[0136] Regarding how the second component processes the output of the first component and sends the obtained output image to the applications that call the first component for output when the second component is in the second processing mode, please refer to the description of the corresponding part of Embodiment 3 above. This embodiment will not be described in detail here.

[0137] Based on the image processing methods described in the above embodiments, combined with Figure 5 and Figure 6 In the application scenario shown, when the current application needs to exclusively use the camera for split-screen rendering preview, before the LVF GUI starts previewing, the number of camera preview applications counted by the camera filter driver (i.e., the number of applications mentioned above, previewapp) can be read. If previewapp == 0 at this time, it means that no other application has opened the camera. When the LVF GUI starts previewing, previewapp == 1, and each MFT in the DMFT is in the first processing mode. Split-screen rendering will be performed according to the split ratio and rendering parameters configured for the current application, so that the current application displays as shown. Figure 6 The comparison chart shown.

[0138] During the LVF GUI preview process described above, if another application attempts to open the camera in exclusive mode but fails, previewapp will still equal 1, and the currently executing LVF GUI preview will remain unaffected. This avoids responding to exclusive call requests from other applications, preventing screen flickering in the current application. Since the LVF GUI preview process does not affect other applications opening the camera in shared mode, when previewapp > 1, as described in Example 4 above, each MFT in the DMFT will switch to the second processing mode, stopping split-screen rendering and outputting the effect image after rendering the entire captured image. This prevents other applications from displaying split-screen effects and thus reducing the user experience.

[0139] Optionally, before the LVF GUI starts previewing, if previewapp > 0, it indicates that an application has already opened the camera, and each MFT is in the second processing mode, disabling split-screen rendering. If the LVF GUI successfully attempts to open the camera preview in exclusive mode, it indicates that other applications are opening the camera in shared mode, and the processing procedure can be referred to the description in the corresponding part of Embodiment 3 above. When previewapp == 1 is detected, it indicates that other applications have ended their access to the camera, and only the current LVF GUI is using the camera. The control of each MFT will switch to the first processing mode, and split-screen rendering will be re-enabled.

[0140] It should be noted that the types and application scenarios of the first and second components of the image processing methods described in the above embodiments include, but are not limited to, those of the first and second components. Figure 5 and Figure 6 The contents shown can be determined according to actual processing needs, and this application will not provide detailed examples of each one.

[0141] Reference Figure 9 This is a flowchart illustrating an optional embodiment five of the image processing method proposed in this application. This embodiment can describe a different scenario from the image processing method scenario described above, namely, the image processing method applicable to the application scenario where the second component is in the third processing mode, such as... Figure 9 As shown, the method may include:

[0142] Step S91: Obtain the current calling function of the application that requested to call the first component;

[0143] In this embodiment of the application, when the application calls the first component to implement a specific function, in order to ensure the reliability of the specific function, it is not desired that the second component performs arbitrary rendering operations on the output of the first component. At this time, the second component needs to send the output of the first component directly to the application that calls the first component, so that the application can obtain the captured image output by the first component, i.e. the original image, through the second component. This image can realistically and accurately represent the attribute information of the corresponding object, and execute the specific function accordingly, ensuring that the obtained result is accurate and reliable.

[0144] Based on this, after receiving the corresponding call request from the application requesting to call the first component, the current calling function of the application that sent the call request can be obtained, that is, the function that the application will call the first component to implement. This application does not restrict the implementation method of obtaining the current calling function.

[0145] In some embodiments, the functions that different types of applications can achieve often differ. Therefore, this application can determine the current calling function that the application wants to implement by calling the first component based on the application type. This approach is more suitable for professional function applications.

[0146] However, as applications support more and more functions, it is impossible to directly determine the function that the application calls the first component to implement based on the application type. However, when any function is implemented, a corresponding application window is often output. In this way, the application can trigger a call request to the first component by outputting the image processing application window. After receiving the call request, the control circuit can determine the window type of the image processing application window output by the application, thereby accurately determining the function that the application calls the first component to implement.

[0147] Optionally, for scenarios where an application needs to open a specific sub-component in the first component to implement a corresponding function, after receiving the application's request to call the first component, the type of the sub-component requesting the call to the first component can be directly determined to determine the current function being called by the application calling the first component. The implementation process is not detailed in this application. It should be noted that the implementation methods for step S91 include, but are not limited to, the implementation methods listed above.

[0148] Step S92: Determine that the currently invoked function is an authentication function, and control the second component to enter the third processing mode;

[0149] Step S93: In response to the call request to the first component, control the second component to forward the acquired image output by the first component to the application that called the first component.

[0150] Based on the above analysis, the authentication function of this application refers to an identity authentication function that determines whether the object to be authenticated is the target object by performing feature analysis on the object to be authenticated. This can be implemented based on image recognition technology. If the image requiring feature analysis is subjected to special effects rendering processing, it will change or cover the true features of the object to be authenticated in the image, which may lead to incorrect authentication results or failure to authenticate. Therefore, to ensure the reliability and accuracy of the authentication results, this application needs to control the second component to switch to a third processing mode in this first component call scenario, so that the second component stops executing arbitrary parameters and directly forwards the output of the first component. It should be noted that in this case, the special effects control is a processing mode switch at the second component level. During this process, the application cannot change the output of the second component; it is not application-level special effects control. If multiple applications exist, the special effects displayed by all applications will undergo the same change.

[0151] In this way, after obtaining target information that can characterize the invocation of the first component, which in this case refers to the current invocation function of the application currently requesting the invocation of the first component, if the function is an authentication function, it is determined that the current application is invoking the first component to implement the authentication function. Before responding to the application's invocation request to the first component, the second component can be controlled to switch to the third processing model, prohibiting any image rendering operation on the output of the first component. In this way, when responding to the invocation request, after the second component receives the captured image output by the first component, it will not perform any post-processing operation on the captured image, such as background replacement / blurring, beautification, face focusing, and effect comparison, etc., ensuring that the output image of the second component is the original image directly captured by the first component (i.e., the aforementioned captured image). This allows the current application to perform object authentication on the received image and obtain a reliable and accurate authentication result. This application does not describe the implementation process of image-based object authentication in detail.

[0152] Based on the description of the current function invoked by the application calling the first component in the above embodiments, it can be determined that the application type of the application requesting the call to the first component belongs to the authentication application type, or that the image processing application window output by the application requesting the call to the first component belongs to the authentication window, or that a subcomponent of a specific subcomponent type in the first component requesting the call is in a working state. The execution of this specific subcomponent type can trigger the application requesting the call to implement the authentication function. This application does not limit the specific subcomponent type; it can be determined based on the actual configuration. Upon obtaining any one of these determinations, it can be determined that the application is calling the first component to implement the authentication function, and the second component is controlled to switch to the third processing mode.

[0153] It should be noted that this application does not restrict the implementation method for determining the above-mentioned application type, application window type, and sub-component type of each sub-component in the first component, etc., and can be determined based on the pre-configured type identifier, etc.

[0154] Based on the above analysis, the DMFT driver cannot determine which application the process currently calling the first component belongs to, or what function it needs to perform, which leads to its inability to adaptively adjust the processing mode of the second component. For example, when a user uses WinHello (Windows Hello) facial recognition for face registration or login authentication, each MFT (i.e., the second component) may not be aware of this operation and may still add effects processing (such as intelligent beautification processing to adjust the distance between the eyes, forehead width, chin width, etc.) to the image captured by the camera before sending it to WinHello for facial feature extraction, resulting in failure to log in or unlock authentication via face. To solve this problem, this application proposes, according to the method described above, to determine the function of the first component currently using WinHello face recognition, dynamically remove the image processing effects of each MFT, i.e., control the second component to switch to the third processing mode, and restore the image processing effects of each MFT when the use of WinHello face recognition ends, such as controlling the second component to switch back to the second processing mode. It should be noted that the application calls the first component to implement the authentication function, including but not limited to the winhello face function proposed in this application, is only illustrated using this scenario as an example. The image processing methods for other authentication functions are similar, and this application will not provide detailed examples for each one.

[0155] Among them, the judgment method for authentication functions such as the Winhello face recognition function mentioned above can be achieved by determining whether the IR camera (i.e., infrared camera) and the RGB camera are working simultaneously. If both cameras are working simultaneously, it can be determined that the Winhello face recognition function is currently being used, and each MFT can be controlled to switch to the third processing mode so that each MFT sends the image captured by the RGB camera to Winhello for face authentication.

[0156] Based on the above analysis, referring to Figure 10 The flowchart shown is a sixth optional embodiment of the image processing method. This application uses the example of calling the first component to perform facial recognition authentication function for illustration. Figure 10 As shown, the image processing method may include, but is not limited to, the following steps:

[0157] Step S101: Determine the first and second sub-components in the first component that belong to a specific sub-component type;

[0158] Step S102: Obtain the power state value of the first sub-component and the attribute value of the second sub-component in the registry key of the second component;

[0159] Step S103: Determine that the power state value is the first state value and the attribute value of the second sub-component is the first value, and control the second component to switch to the third processing mode.

[0160] In the Winhello face authentication scenario, by determining that the first and second sub-components belonging to a specific sub-component type within the first component are being called and running, it can be determined that the Winhello face authentication function is currently being used. At this time, the first component refers to the camera, the first sub-component can refer to an infrared camera (i.e., an IR camera), and the second sub-component can refer to a color camera (i.e., an RGB camera). This application can determine whether the function of the application currently calling the first component is a face recognition function by detecting whether these two cameras are working simultaneously, that is, by determining whether the sub-component belonging to a specific sub-component type within the requesting first component is in a working state.

[0161] Whether an infrared camera is working can be determined by its power status, such as... Figure 11a The diagram shows a facial recognition configuration. When the IR camera is not in use (i.e., the first sub-component is off), the power data is D3 (i.e., the power state value is the second state value). Figure 11b The diagram shows another facial recognition configuration. If the power data of the IR camera is in use (i.e., the first sub-component is in operation), it is D0 (i.e., the power state value is the first state value). It can be seen that the power state value of the first sub-component can include a first state value and a second state value. The first state value indicates that the first sub-component is in operation, and the second state value indicates that the first sub-component is in a closed state. This application can determine whether the first sub-component is in operation by using its power state value.

[0162] Based on the above analysis, combined with Figure 11a and Figure 11b In the scenario shown, this application can use a background application to dynamically monitor the power data of the IR camera on the electronic device system. If the power state of the IR camera changes from D3 to D0, it can be determined that the IR camera is in a working state; conversely, if the power state of the IR camera changes from D0 to D3 or remains at the D3 state value, it can be determined that the IR camera is in a powered-off state. Therefore, this method for detecting whether an IR camera is working does not require differentiation based on the camera manufacturer, nor does it require the manufacturer to customize a corresponding IR camera driver, thus improving the efficiency and versatility of IR camera working status detection.

[0163] The method for detecting whether the RGB camera, as a second sub-component, is working can be achieved by the DMFT driver detecting whether an application capable of accessing the camera is currently requesting access to the RGB camera to obtain the image to be processed. For example, during Winhello face registration or verification, the Winhello software will open the RGB camera. In this case, the DMFT driver will detect the flow of the image in each MFT processing chain and set its registry key CameraInUse to 1. Therefore, this application can determine whether the RGB camera is currently acquiring an image, i.e., whether the RGB camera is currently in a working state, by checking whether the CameraInUse attribute value for the second sub-component in the registry key of the second component is 1.

[0164] As can be seen, the attribute values ​​for the second sub-component in the registry key of the second component (such as CameraInUse in the WinHello face authentication scenario above) can include a first value (such as 1) and a second value (such as 0). The first value can indicate that the second sub-component is in a working state, and the second value can indicate that the second sub-component is in a closed state. However, it is not limited to this method of detecting whether the second sub-component is working.

[0165] This application does not limit the implementation method of switching control for the third processing mode of the second component. For example, it still uses... Figure 1 Under the DMFT underlying architecture shown, the first component includes two specific sub-component types: IR camera and RGB camera. The second component is illustrated using multiple MFT image processing plugins as an example. In this architecture, when each MFT registers with the DMFT driver, it will provide its own GUID (Globally Unique Identifier, a 128-bit binary identifier generated by an algorithm) for COM interface communication. The GUID is written into the registry key corresponding to each MFT, and COM interface communication support is added to each MFT, allowing specific attributes to be set through the COM interface to characterize the processing mode performed by the MFT.

[0166] Therefore, this embodiment can achieve this by setting the Effect Temporary Disabled Property for each MFT to disable image processing effects (i.e., image effects). If Effect Temporary Disabled Property = true, it means that each MFT disables image processing effects, that is, the second component switches to the third processing mode; conversely, if Effect Temporary Disabled Property = false, it means that each MFT restores image processing effects, such as controlling the second component to switch to the first processing mode or the second processing mode, etc.

[0167] Based on the above analysis, referring to Figure 12 The flowchart shown indicates that both the IR and RGB cameras of the electronic device are in working condition. If the background service program A detects that the power status of the IR camera is D0 and the CameraInUse value of the RGB camera is 1 in a specific registry key of the DMFT, it can be determined that the current application is calling the camera to implement facial recognition function, such as the WinHello face authentication function. The service program A can establish COM interface communication by obtaining the COM interface GUID of each MFT and control the Effect Temporary Disabled Property of each MFT to be true, so as to dynamically remove the image processing effect of each MFT, that is, control the second component to switch to the third processing mode, but it is not limited to this method of switching control of the third processing mode of the second component.

[0168] Step S104: In response to the above call request, control the second component to stop executing any parameters on the acquired image output by the first component, and forward the acquired image to the application that sent the call request;

[0169] Step S105: Determine the power state value as the second state value, or the attribute value of the second sub-component as the second value, and control the second component to switch from the third processing mode to the second processing mode.

[0170] Following the above analysis, it is determined that both the first and second sub-components requested by the application are in a working state. It is also determined that the application is currently implementing authentication functions, such as facial recognition based on the image output by the first component. To ensure that this function is implemented reliably and accurately, the second component will be switched to a third processing mode to remove the image processing effects that the second component can achieve. That is, the second component is prohibited from performing any operations in this scenario, such as image rendering parameters. At this time, the second component can act as an image transmission component to directly forward the image output by the first component to the application that called the first and second sub-components for authentication processing. The implementation process is not detailed in this application.

[0171] Still above Figure 12Taking the scenario shown as an example, when the second component is in the third processing mode, during Winhello face registration or verification, it will obtain the raw frame image (RGB Raw Frame) captured by the RGB camera and the raw image frame (IR Raw Frame) captured by the IR camera. If the background service program A detects that the IR camera and / or RGB camera are off, it can determine that the Winhello face function is no longer used. Service program A can establish COM interface communication by obtaining the COM interface GUID of each MFT, and control the Effect Temporary DisabledProperty of each MFT to be false, i.e., dynamically restore the image processing effect of each MFT, such as... Figure 12 The DMFT shown represents an image processing chain where each MFT processes the original RGB frame image. This chain can include, but is not limited to, background replacement / blurring, beautification, and face focusing. Each MFT can perform one processing effect. This application does not restrict the content or execution order of these effects and allows for flexible configuration and adjustment based on actual needs. The effect values ​​of each MFT can be implemented using Smart Appearance camera software developed by vendor A for a dedicated DMFT driver; the implementation process is not detailed in this application.

[0172] In summary, this application determines that both the first and second sub-components belonging to a specific sub-component type are in a working state. This indicates that the current application is calling these two sub-components to implement the authentication function. For example, if both the IR camera and the RGB camera are in a working state, it indicates that the WinHello face recognition function is being used. The application will promptly control each MFT to enter the third processing mode, removing the image processing effects of each MFT, so that the original frame images captured by the two cameras are directly forwarded to the application, thereby realizing the WinHello face registration or verification function and ensuring that the function is implemented reliably and accurately.

[0173] Reference Figure 13 This is a schematic diagram of an optional embodiment of the image processing apparatus proposed in this application. The apparatus may include:

[0174] The target information acquisition module 131 is used to acquire target information; the target information represents the invocation status of the first component;

[0175] The target processing mode determination module 132 is used to determine the target processing mode of the second component based on the target information;

[0176] The second component includes at least two processing modes. The output of the second component is applied to the application that calls the first component, and the application cannot modify the output while applying the output of the second component.

[0177] Optionally, the target information acquisition module 131 may include:

[0178] The runtime call parameter acquisition unit is used to obtain the runtime call parameters of the first component; the runtime call parameters can represent the number of applications that have called the first component, the corresponding call mode, and the target call mode of the current request to call the first component;

[0179] Alternatively, a function acquisition unit can be used to obtain the current function being invoked by the application that requested the invocation of the first component.

[0180] In this embodiment, the first component can be invoked by one application in a first invocation mode at the same time, and can be invoked by multiple applications in a second invocation mode at the same time. If the target processing mode is the first processing mode, the second component executes the first parameter from the application that invoked the first component in the first invocation mode; if the target processing mode is the second processing mode, the second component stops executing the first parameter from the application that invoked the first component in the first invocation mode; if the target processing mode is the third processing mode, the second component stops executing any parameter and forwards the output of the first component.

[0181] Based on this, the target processing mode determination module 132 mentioned above may include:

[0182] The first control unit is configured to determine, based on the target information, that the first component has not been called by any application and is currently requested to be called in a first calling mode, and control the second component to be in the first processing mode.

[0183] The second control unit is configured to determine, based on the target information, that the first component has been invoked by at least one application in the second invocation mode, or that the first component has been invoked by multiple applications in different invocation modes, and control the second component to be in the second processing mode.

[0184] The third control unit is configured to determine, based on the target information, that the first component has been invoked by an application in a first invocation mode and is currently requested to be invoked in a second invocation mode, and control the second component to switch from the first processing mode to the second processing mode;

[0185] The fourth control unit is used to determine, based on the target information, whether the application calls the first component to implement the authentication function, and to control the second component to be in the third processing mode.

[0186] When the target processing mode is the first processing mode, the above-mentioned apparatus may further include:

[0187] The first parameter determination module is configured to determine a first parameter from the application requesting to call the first component in response to a call request to the first component in the first call mode.

[0188] The first output image acquisition module is used to control the second component to process the acquired image output by the first component according to the first parameter and the preset second parameter, so as to obtain a first output image with a first special effect;

[0189] The first output image sending module is used to send the first output image to the application that requested to call the first component.

[0190] When the target processing mode is the second processing mode, the above-mentioned apparatus may further include:

[0191] The second parameter determination module is used to determine a preset second parameter in response to a call request to the first component in the first call mode or the second call mode.

[0192] The second output image acquisition module is used to control the second component to process the acquired image output by the first component according to the second parameter, so as to obtain a second output image with the second effect;

[0193] The second output image sending module is used to send the second output image to multiple application outputs that call the first component.

[0194] Optionally, the fourth control unit may include any of the following determining units:

[0195] The first determining unit is used to determine whether the application type of the application requesting to call the first component belongs to the authentication application type.

[0196] The second determining unit is used to determine that the image processing application window output by the application that requested to call the first component belongs to the authentication window;

[0197] The third determining unit is used to determine that a subcomponent of a specific subcomponent type in the first component that is requested to be invoked is in a working state; the subcomponent of the specific component type is invoked and running, which can trigger the application that is requested to be invoked to implement the authentication function.

[0198] In some embodiments, the third determining unit may include:

[0199] The fourth determining unit is used to determine that the power state value of the first sub-component belonging to a specific sub-component type in the first component that is requested to be invoked is a first state value, and the attribute value of the second sub-component belonging to the specific sub-component type in the registry entry of the second component is a first value.

[0200] The power status value includes a first status value and a second status value. The first status value indicates that the first sub-component is in a working state, and the second status value indicates that the first sub-component is in a powered-off state.

[0201] The attribute values ​​for the second sub-component in the registry key of the second component include the first value and the second value. The first value indicates that the second sub-component is in a working state, and the second value indicates that the second sub-component is in a closed state.

[0202] It should be noted that the various modules and units in the above-mentioned device embodiments can all be stored as program modules in the storage medium of the control circuit. The processor of the control circuit executes the above-mentioned program modules stored in the memory to realize the corresponding functions. The functions realized by each program module and its combination, as well as the technical effects achieved, can be referred to the description of the corresponding part of the above-mentioned method embodiments. This embodiment will not repeat them here.

[0203] This application also provides a computer-readable storage medium on which a computer program can be stored, which can be called and loaded by a processor to implement the various steps of the image processing method described in the above embodiments. The specific implementation process can refer to, but is not limited to, the description of the corresponding parts of the above embodiments.

[0204] Finally, it should be noted that the various embodiments in this specification are described in a progressive or parallel manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatuses and electronic devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and relevant parts can be referred to the method section.

[0205] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An image processing method, the method comprising: Obtain target information; The target information represents the invocation status of the first component, which is a camera; Based on the target information, the target processing mode of the second component is determined, wherein the second component is a camera device extension component; The second component includes at least two processing modes. The output of the second component is applied to the application that calls the first component, and the application cannot modify the output while applying the output of the second component. The target processing mode includes a first processing mode, a second processing mode, or a third processing mode; In the first processing mode, the second component executes the first parameter from the application that requested to invoke the first component in the first invocation mode; In the second processing mode, the second component stops executing the first parameter from the application that requested to invoke the first component in the first invocation mode; In the third processing mode, the second component stops executing arbitrary parameters and forwards the output of the first component.

2. The method according to claim 1, wherein obtaining the target information includes: Obtain the runtime call parameters for the first component; The runtime call parameters can represent the number of applications that have called the first component, the corresponding call mode, and the target call mode for the current request to call the first component; Alternatively, obtain the current calling functionality of the application that requested the call to the first component.

3. The method according to claim 1 or 2, wherein the first component can be invoked by one application in a first invocation mode at the same time, and can be invoked by multiple applications in a second invocation mode at the same time.

4. The method according to claim 3, wherein determining the target processing mode of the second component based on the target information includes: Based on the target information, it is determined that the first component has not been called by any application and is currently being requested to be called in the first calling mode, and the second component is controlled to be in the first processing mode; Based on the target information, it is determined that the first component has been invoked by one or more applications in the second invocation mode, or the first component has been invoked by multiple applications in different invocation modes, and the second component is controlled to be in the second processing mode; Based on the target information, it is determined that the first component has been invoked by an application in a first invocation mode and is currently requested to be invoked in a second invocation mode, and the second component is controlled to switch from the first processing mode to the second processing mode; Based on the target information, it is determined that the application calls the first component to implement the authentication function, and the second component is controlled to be in the third processing mode.

5. The method according to claim 3, wherein when the target processing mode is the first processing mode, the method further comprises: In response to a call request to the first component in the first call mode, a first parameter from the application requesting the call to the first component is determined; The second component is controlled to process the acquired image output by the first component according to the first parameter and the preset second parameter to obtain a first output image with a first special effect; The first output image is sent to the application that requested the first component.

6. The method according to claim 3, wherein when the target processing mode is the second processing mode, the method further comprises: In response to a call request to the first component in the first call mode or the second call mode, a preset second parameter is determined; The second component is controlled to process the acquired image output by the first component according to the second parameter to obtain a second output image with a second special effect; The second output image is sent to the outputs of multiple applications that invoke the first component.

7. The method according to claim 4, wherein determining, based on the target information, that the application calls the first component to implement the authentication function comprises: Determine that the application type of the application requesting to invoke the first component belongs to the authentication application type; Alternatively, determine that the image processing application window output by the application that requested to call the first component belongs to the authentication window; Alternatively, it can be determined that a subcomponent of a specific subcomponent type in the first component being called is in a working state; the subcomponent of the specific subcomponent type being called and running can trigger the application being called to implement the authentication function.

8. The method according to claim 7, characterized in that, The determination that a subcomponent of a specific subcomponent type among the first component requested to be invoked is in a working state includes: The power state value of the first sub-component belonging to a specific sub-component type in the first component that is requested to be invoked is determined to be a first state value, and the attribute value of the second sub-component belonging to the specific sub-component type in the registry entry of the second component is determined to be a first value. The power status value includes a first status value and a second status value. The first status value indicates that the first sub-component is in a working state, and the second status value indicates that the first sub-component is in a powered-off state. The attribute values ​​for the second sub-component in the registry key of the second component include the first value and the second value. The first value indicates that the second sub-component is in a working state, and the second value indicates that the second sub-component is in a closed state.

9. An image processing apparatus, the apparatus comprising: The target information acquisition module is used to acquire target information; The target information represents the invocation status of the first component, which is a camera; The target processing mode determination module is used to determine the target processing mode of the second component based on the target information, wherein the second component is a camera device extension component; The second component includes at least two processing modes. The output of the second component is applied to the application that calls the first component, and the application cannot modify the output while applying the output of the second component. The target processing mode includes a first processing mode, a second processing mode, or a third processing mode; In the first processing mode, the second component executes the first parameter from the application that requested to invoke the first component in the first invocation mode; In the second processing mode, the second component stops executing the first parameter from the application that requested to invoke the first component in the first invocation mode; In the third processing mode, the second component stops executing arbitrary parameters and forwards the output of the first component.

10. An electronic device, the electronic device comprising: A first component, a second component connected to the first component, and control circuits connected to the first component and the second component respectively, wherein: The control circuit is used to implement the image processing method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Internet live broadcast beauty processing method and system based on cloud computing

    CN112312157A

  • Image color retention method and device

    CN113395441A