Image processing method and electronic device

By collecting the user's detection image on the display screen of the electronic device and determining the target position, automatic amplification of the image is achieved, which solves the problem of complex manual operations and device falling when the user performs image amplification operation, and improves user experience and control flexibility. .

CN117472256BActive Publication Date: 2024-08-23HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311800464.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-26
Publication Date
2024-08-23
Estimated Expiration
2043-12-26

AI Technical Summary

Technical Problem

When users use electronic devices to perform image magnification operations, complex manual operations are required, resulting in a high risk of the device falling and poor user experience.

Method used

By collecting the user's detection image on the display screen of the electronic device, the user's target position is determined, and the image is enlarged with the position as the center, reducing reliance on manual operations and improving the user's flexibility in controlling image amplification.

Benefits of technology

The risk of electronic equipment falling is reduced, and the user's flexibility and user experience in controlling image amplification are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117472256B
    Figure CN117472256B
Patent Text Reader

Abstract

The embodiment of the present application is applied to the field of image processing, and provides an image processing method and electronic device. The method is applied to the electronic device, and the method includes: when the display screen of the electronic device displays the first image, collecting a first detection image, the first detection image records the user who views the first image; processing the first detection image to obtain a first target position in the first image; centering the first target position, enlarging the first image to obtain a second image; and displaying the second image using the display screen. Based on the technical method of the present application, it is possible to reduce dependence on manual operation of the user, improve the flexibility of image enlargement control, and improve user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and more specifically, to an image processing method and an electronic device. Background Art

[0002] As the functions of terminal devices become increasingly rich, people can use the photo taking, audio recording, video recording and other functions of smart terminals such as mobile phones to collect media data, use the editing functions of smart terminals to modify and edit media data, and display, play or share media data with others through smart terminals.

[0003] When a user is watching an image displayed on a display screen of an electronic device, if he needs to zoom in on certain areas of the image, the user can perform a zoom operation on the display screen. The zoom operation may be that the user's two fingers can slide on the display screen in directions away from each other. The electronic device can zoom in on the displayed image with the midpoint of the line connecting the starting positions of the two fingers as the center. The zoom operation is relatively complicated. That is, in the scenario of zooming in on an image, the user needs to perform a complex manual operation so that the electronic device zooms in on the displayed image with the position indicated by the user as the center.

[0004] When using an electronic device, a user generally needs to hold the electronic device firmly with one hand and operate the display screen with the other hand. When a user uses one hand to perform a complex gesture operation such as zooming in, the user's attention is mainly focused on the hand performing the zooming operation, and the attention to the other hand is reduced, resulting in a higher risk of the electronic device falling. Summary of the invention

[0005] The present application provides an image processing method and an electronic device, which can avoid manual operation of the electronic device by the user, such as touch operation, etc., improve the flexibility of image magnification control, reduce the risk of the electronic device falling, and improve the user experience.

[0006] In a first aspect, an image processing method is provided, which is applied to an electronic device, and the method includes: when a display screen of the electronic device displays a first image, collecting a first detection image, the first detection image records a user viewing the first image; processing the first detection image to obtain a first target position in the first image; enlarging the first image with the first target position as the center to obtain a second image; and displaying the second image using the display screen.

[0007] The image processing method provided by the embodiment of the present application determines the first target position in the first image based on the first detection image collected when the display screen displays the first image, and the user is recorded in the first detection image. The first image is thus enlarged with the first target position as the center, and the enlarged second image is displayed on the display screen. While meeting the requirement for the center position of the enlarged first image, the user's manual operation of the electronic device, such as touch operation, is avoided, thereby improving the flexibility of the user's control method for image enlargement and improving the user experience.

[0008] Furthermore, the user does not need to control the electronic device through manual operations such as touch operations, and can hold the electronic device firmly with both hands, thereby reducing the risk of the electronic device falling.

[0009] In a possible implementation, before zooming in on the first image with the first target position as the center, the method further includes: determining a target distance between multiple target nodes of the user's face according to a scale indication image, wherein the scale indication image is an image of the user recorded and captured when the display screen displays the first image; determining a target magnification ratio corresponding to the target distance according to a correspondence between the distance and the magnification ratio; zooming in on the first image with the first target position as the center includes: zooming in on the first image with the first target position as the center according to the target magnification ratio to obtain the second image.

[0010] According to the ratio indication image collected when the display screen displays the first image, the target distance between the user's facial nodes is determined, and the first image is enlarged according to the target magnification ratio corresponding to the target distance, that is, the magnification ratio is determined according to the ratio indication image, and the magnification ratio of the first image is more in line with the user's needs. In addition, the target distance is determined according to the ratio indication image, so that the determination of the target distance does not depend on the user's manual operation of the electronic device, such as touch operation, etc., which reduces the degree of dependence of image magnification on the user's manual operation and improves the user experience.

[0011] It should be understood that the ratio indication image may be the first detection image or may be another image other than the first detection image. The sensor for acquiring the ratio indication image may be the same as or different from the sensor for acquiring the first detection image.

[0012] In a possible implementation, the second image is obtained by enlarging the first target area in the first image according to a preset enlargement ratio; the method also includes: when the second image is displayed on the display screen of the electronic device, collecting a second detection image, the second detection image records the user; processing the second detection image to obtain the second target position in the second image; enlarging the second target area in the second image with the second target position as the center to obtain a third image; and displaying the third image using the display screen.

[0013] When the display screen displays the second image obtained by enlarging the first image, the second detection image of the user can be collected again, so as to determine the second target position in the second image according to the second detection image, and the second image is enlarged with the second target position as the center, and the third image obtained by enlarging the second image is displayed. In other words, the center of each enlargement of the image displayed on the display screen is determined according to the image recorded with the user, so that the enlargement processing of the image displayed on the display screen is more in line with the user's needs.

[0014] In a possible implementation, before zooming in on the first image with the first target position as the center, the method further includes: determining a target distance between multiple target nodes of the user's face according to a scale indication image, wherein the scale indication image is an image of the user recorded and captured when the display screen displays the first image; determining a target magnification ratio corresponding to the target distance according to a correspondence between the distance and the magnification ratio; zooming in on the first image with the first target position as the center to obtain a second image includes: when the target magnification ratio is greater than or equal to a preset magnification ratio, zooming in on the first image according to the preset magnification ratio to obtain the second image.

[0015] By processing the first detection image, there may be a difference between the first target position in the first detection image obtained and the position that the user actually wants to indicate. In the case of a small magnification of the first image, the difference between the magnified image and the image that the user wants to see is small due to the difference. However, as the magnification of the first image increases, the difference between the magnified image and the image that the user wants to see becomes larger and larger. In the case where the target magnification ratio determined according to the ratio indication image is large, greater than or equal to the preset magnification ratio, the first image is magnified according to the preset magnification ratio with the first target position as the center to obtain the second image, and in the case where the magnified second image is displayed on the display screen, the second target position is determined according to the second detection image that records the user, and the second image is magnified with the second target position as the center, so that the image displayed by the electronic device is more consistent with the image that the user wants to see, thereby improving the user experience.

[0016] In a possible implementation, the first detection image is collected by a first camera in the electronic device, the first camera and the display screen are oriented in the same direction, and the first target position is a position where the user is gazing.

[0017] When the user is viewing the first image, the position the user is gazing at is used as the first target position. In other words, the user can indicate the first target position by controlling the position of gazing at, which reduces the difficulty of indicating the first target position for the user and improves the user experience.

[0018] When the user watches the first image displayed on the display screen, the user's eyes are generally located in the image acquisition range of the first camera, that is, the image acquired by the first camera generally records the user's eyes. Therefore, the first target position can be determined based on the first detection image.

[0019] In a possible implementation, the processing of the first detection image to obtain a first target position in the first image includes: processing the first detection image using a gaze point estimation model to obtain a first initial position, wherein the gaze point estimation model is a trained neural network model; determining the first target position corresponding to the first initial position according to a correspondence between the initial position and the target position, wherein the correspondence is determined by multiple second initial positions and a gaze position corresponding to each second initial position, wherein the multiple second initial positions are obtained by processing multiple user gaze images respectively using the gaze point estimation model, and the gaze position corresponding to each second initial position is the position on the display screen that the user gazes at when the first camera captures the user gaze image for obtaining the second initial position.

[0020] According to the second initial position and the gaze position obtained by processing the user gaze image captured by the first camera when the user gazes at the gaze position on the display screen according to the gaze point estimation model, the correspondence between the initial position and the target position can be determined. According to the correspondence between the initial position and the target position, the first target position corresponding to the first initial position obtained by processing the first detection image using the gaze point estimation model is determined, so that the first target position is more accurate. At the same time, the method for determining the correspondence between the initial position and the target position is simple, making it easier to improve the accuracy of the first target position.

[0021] In a possible implementation, the first image is a preview image captured in real time by a second camera in the electronic device; the first image is enlarged with the first target position as the center to obtain the second image, including: zooming with the first target position as the center, and the second image is the zoomed preview image.

[0022] The solution of the present application can be applied when a user uses an electronic device to watch a preview image captured in real time by a second camera, and the enlargement of the first image can be understood as a zoom that increases the proportion of the photographed object in the captured image during the image capture process. In other words, when a user uses the camera function of an electronic device, the solution of the present application can be used to control the zoom.

[0023] In a possible implementation manner, the first detection image is collected by a sensor in the electronic device, and a first orientation of the sensor is different from a second orientation of the second camera.

[0024] In a possible implementation, the enlarging the first image to obtain the second image includes: when the user behavior of the user recorded in the user behavior image is a preset enlargement behavior, enlarging the first image to obtain the second image.

[0025] In the case that the user behavior recorded in the user behavior image collected from the user is a preset magnification behavior, the first image is magnified so that the magnification of the first image better meets the user's needs.

[0026] It should be understood that the user behavior image and the first detection image may be the same or different images. The user behavior image and the first detection image may be collected by the same or different sensors.

[0027] In a second aspect, an image processing apparatus is provided, comprising a unit for executing the method of the first aspect. The apparatus may be a terminal device or a chip in the terminal device. The image processing apparatus comprises a unit for executing the method of the first aspect.

[0028] In a third aspect, an electronic device is provided, comprising a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that the electronic device executes the method of the first aspect.

[0029] In a fourth aspect, a chip is provided, comprising a processor and a data interface, wherein the processor reads instructions stored in a memory through the data interface, and when the processor executes the instructions, the processor executes the method of the first aspect.

[0030] According to a fifth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program code, and the computer program code is used to implement the method according to the first aspect.

[0031] According to a sixth aspect, a computer program product is provided, the computer program product comprising: a computer program code, wherein the computer program code is used to implement the method according to the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 is a schematic diagram of a hardware system of an apparatus suitable for the present application;

[0033] Figure 2 is a schematic diagram of a software system suitable for the device of the present application;

[0034] Figure 3 is a schematic flow chart of an image processing method provided in an embodiment of the present application;

[0035] Figure 4 and Figure 5 is a schematic diagram of a graphical user interface provided in an embodiment of the present application;

[0036] Figure 6 is a schematic flow chart of another image processing method provided in an embodiment of the present application;

[0037] Figure 7 and Figure 8 is a schematic diagram of a graphical user interface provided in an embodiment of the present application;

[0038] Fig. 9 It is a schematic structural diagram of an image processing device provided by the present application. DETAILED DESCRIPTION

[0039] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0040] With the rapid development of electronic technology and image processing technology, the camera functions of electronic devices such as smart phones, tablet computers, and digital cameras are becoming more and more powerful. In the process of using electronic devices to take pictures, users can control the electronic devices to achieve functions such as zooming, focusing, and taking pictures by operating the touch screen of the electronic devices or the buttons and knobs of the electronic devices. Users can control the electronic devices by operating the touch screen of the electronic devices or the buttons and knobs of the electronic devices.

[0041] However, when the user manually controls the camera function of the electronic device, only one hand can be used to control the camera function, and the other hand must firmly hold the electronic device, which increases the risk of the electronic device falling. For electronic devices with full touch screens, when taking pictures, the user must firmly hold the electronic device while avoiding contact with the touch screen, otherwise contact with the touch screen may cause the electronic device to perform other functions, affecting the camera function. In particular, when the user wants to zoom in on the display area of ​​the object recorded in the image, the user's two fingers need to slide away from each other on the display screen to complete the zoom operation, and the midpoint of the line connecting the starting positions of the two fingers of the user is the center of the area to be zoomed in.

[0042] Electronic devices may also have functions such as displaying images and playing videos. When viewing an image, a user may need to observe and appreciate certain areas of the image in more detail. Similar to taking a photo, a user can zoom in on a portion of the image by zooming in.

[0043] However, the user's manual operation is relatively complicated. When using an electronic device, the user generally needs to hold the electronic device firmly with one hand. The other hand operates the display screen. When the user uses one hand to perform a complex gesture operation such as zooming in, the user's attention is mainly focused on the hand performing the zooming operation, and the attention to the other hand is reduced, resulting in a higher risk of the electronic device falling.

[0044] In order to solve the above problems, the embodiments of the present application provide an image processing method and an electronic device.

[0045] Figure 1 A hardware system of an electronic device suitable for the present application is shown.

[0046] The method provided in the embodiments of the present application can be applied to various electronic devices capable of network communication, such as mobile phones, tablet computers, wearable devices, laptop computers, netbooks, personal digital assistants (PDAs), etc. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.

[0047] Figure 1 1 shows a schematic diagram of the structure of the electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0048] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0049] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0050] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0051] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0052] Processor 110 may include one or more interfaces.

[0053] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor.

[0054] The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.

[0055] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0056] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0057] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0058] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0059] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0060] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0061] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0062] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0063] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0064] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

[0065] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.

[0066] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0067] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0068] Motor 191 can generate vibration. Motor 191 can be used for incoming call reminders and can also be used for touch feedback. Motor 191 can generate different vibration feedback effects for touch operations acting on different applications. Motor 191 can also generate different vibration feedback effects for touch operations acting on different areas of display screen 194. Different application scenarios (for example, time reminders, receiving messages, alarm clocks, and games) can correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0069] The indicator 192 may be an indicator light, which may be used to indicate the charging status and the change in the amount of electricity, and may also be used to indicate messages, missed calls, and notifications.

[0070] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.

[0071] Figure 2 1 is a software structure diagram of the electronic device 100 of the embodiment of the present application. The layered architecture divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the system library of the Android runtime (Android runtime), and the kernel layer. The application layer can include a series of application packages.

[0072] like Figure 2 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.

[0073] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0074] like Figure 2 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0075] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0076] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0077] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0078] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).

[0079] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0080] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0081] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0082] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0083] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0084] The system library may include multiple functional modules, such as surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0085] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0086] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0087] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0088] A 2D graphics engine is a drawing engine for 2D drawings.

[0089] The kernel layer is the layer between hardware and software. The kernel layer can include driver modules such as display driver, camera driver, audio driver and sensor driver.

[0090] The camera or gallery in the application layer can be used to send acquisition instruction information to the camera driver in the kernel layer, so that the camera driver drives the camera to achieve image acquisition.

[0091] The camera or gallery can be used to process the images captured by the camera or the images stored in the memory. The camera or gallery can also send display instruction information to the display driver so that the display driver drives the display screen so that the display screen displays the image indicated by the display instruction information.

[0092] Combine the following Figures 3 to 8 The image processing method provided in the embodiment of the present application is described in detail. The execution subject of the method provided in the present application can be an electronic device, or a software / hardware module capable of sound processing in the electronic device. For the sake of convenience, the electronic device is used as an example in the following embodiments.

[0093] Figure 3is a schematic flow chart of an image processing method provided in an embodiment of the present application. The method may include steps S310 to S320, and these steps are described in detail below.

[0094] Step S310: When a display screen of an electronic device displays a first image, a first detection image is collected, where the first detection image records a user viewing the first image.

[0095] The first image may be an image stored in the electronic device, or an image obtained by scaling an image stored in the electronic device, or a preview image displayed in real time on a display screen of the electronic device in a photo or video recording scenario.

[0096] Before performing S310, a camera activation operation of a user may be obtained. In response to the camera activation operation of the user, the display screen may display a preview image in real time. The first image may be a preview image displayed in real time.

[0097] Figure 4 (a) in FIG. 1 shows a graphical user interface (GUI) of an electronic device, where the GUI is a desktop 410 of the electronic device. When a camera start operation is detected in which a user clicks an icon 411 of a camera application (APP) on the desktop 410, the electronic device can start the camera application and display a Figure 4 Another GUI shown in (b) of FIG. 4 may be referred to as a shooting interface 420. The shooting interface 420 may include a viewfinder 422. In a preview state, a preview image may be displayed in real time in the viewfinder 422. The first image may be a preview image displayed in the viewfinder 422.

[0098] Alternatively, before performing S310, the image browsing operation of the user may be acquired. In response to the image browsing operation of the user, the display screen may display the image selected by the user.

[0099] Figure 5 (a) in FIG. 5 shows another GUI of the electronic device, which is a gallery interface 510. The gallery interface includes a plurality of image icons. Different image icons correspond to different images. When an image browsing operation is detected in which a user clicks on a certain image icon, the electronic device may display the following: Figure 5 Another GUI in (b) may be referred to as an image display interface 520. The image display interface 520 may include an image display area 521, which is used to display an image corresponding to an image icon clicked by a user. The first image may be an image displayed in the image display area 521.

[0100] Collecting the first detection image can be understood as using a sensor in the electronic device to collect the first detection image. The sensor used to collect the first detection image and the display screen can be in the same direction. The same can also be understood as approximately the same. The sensor can be an infrared sensor, a distance sensor, or a camera in the electronic device.

[0101] When the sensor is an infrared sensor, the first detection image may be a temperature map determined based on temperature information detected by the infrared sensor. When the sensor is a distance sensor, the first detection image may be a depth map determined based on distance information detected by the distance sensor. When the sensor is a camera, the first detection image may be a color map determined based on light information collected by the camera.

[0102] Step S320: Process the first detection image to obtain a first target position in the first image.

[0103] In some embodiments, a first target position in the first image may be determined according to a first indicated position of the user in the first detection image.

[0104] For example, the direction of the first indication position relative to the origin of the first detection image can be used as the direction of the first target position relative to the origin of the first image. The origin of the first detection image and the origin of the first image can be the same type of point in the image. For example, the origin of the first detection image and the origin of the first image can be the midpoint of the first detection image and the first image, the vertex in the same direction, the upper edge bisection point, the lower edge trisection point, etc. Different sizes of the user in the first detection image can correspond to different distances between the first indication position and the origin.

[0105] The size of the user in the first detection image may be the size of the area where the user is located in the first detection image, or the size of the area where one or some preset limbs or organs of the user are located in the first detection image. For example, the size of the user's face or the size of the user's eyes may be used as the size of the user in the first detection image.

[0106] The size of an image can be understood as the width and height of the image, which can be expressed as "width x height". The width of an image can be understood as the number of pixels along the width direction. The height of an image can be understood as the number of pixels along the height direction. The size of an area in an image can be understood as the number of pixels in the area. If the area is a rectangle, the size of the area can be expressed as the width and height of the area.

[0107] The user may adjust the size of the user in the first detection image by adjusting the distance between the user and the sensor in the electronic device for acquiring the first detection image, and / or adjusting the direction relative to the sensor.

[0108] The first indication position represents the position of the user in the first detection image. The first indication position may be the position of the center of the area where the user is located in the first detection image. In the case where the sensor used to acquire the first detection image is a camera, the first indication position may also represent the position of one or more preset limbs or organs of the user in the area where the user is located in the first detection image. For example, the first indication position may represent the facial position where the user's face is located in the first detection image or the pupil position where the user's pupil is located. The position of the preset limb or preset organ of the user in the first detection image may be the position of the center of the area where the preset limb or organ of the user is located in the first detection image.

[0109] The sensor for collecting the first detection image may be a first camera of the electronic device. The first camera and the display screen face the same direction. In other words, the first camera is a front camera.

[0110] When the user is viewing the first image displayed on the display screen, the user's eyes are generally located within the image acquisition range of the first camera, that is, the image acquired by the first camera generally records the user's eyes. When the user is viewing the first image displayed on the display screen, the user's face may not be completely located in the image acquired by the first camera. Therefore, the first indication position indicates the pupil position where the pupil is located in the first detection image, making the determination of the first indication position easier and more accurate.

[0111] For another example, according to the correspondence between the indicated position and the target position, a first target position corresponding to the first indicated position of the user in the first detection image may be determined.

[0112] Different indication positions may represent different positions in the image captured by the first camera.

[0113] The sizes of the first detection image collected by the sensor and the first image may not be complete. The corresponding relationship between the indicated position and the target position can be determined according to the proportional relationship between the size of the image collected by the first sensor and the size of the first image.

[0114] For example, the indicated position representing the upper left corner of the first detection image may correspond to the target position of the upper left corner of the first image, and the target position in the first image corresponding to the indicated position having a horizontal distance x from the upper left corner in the first detection image may have a horizontal distance x from the upper left corner of the first image multiplied by a horizontal dimension ratio, where the horizontal dimension ratio is the ratio of the width of the first image to the width of the first detection image. The width of an image represents the length of a side of the image in the horizontal direction.

[0115] The first target position is determined according to the correspondence between the indicated position and the target position, and the method for determining the first target position is simpler. The user can adjust the position in the first detection image, that is, adjust the relative position with the electronic device, so as to adjust the first target position, and the user operation is also simpler.

[0116] In other embodiments, the first target position may be a position where the user is gazing.

[0117] In order to facilitate determination of the position where the user is looking, the sensor for acquiring the first detection image may be a first camera facing the same direction as the display screen.

[0118] When the user is watching the first image displayed on the display screen, the user's eyes are generally located in the image acquisition range of the first camera, that is, the image acquired by the first camera generally records the user's eyes. According to the first detection image acquired by the first camera, the position where the user is looking can be determined.

[0119] Exemplarily, the first target position in the first image may be obtained by processing the first detection image using a gaze point estimation model.

[0120] The gaze point estimation model may be a trained neural network model. The training process may include training the initial gaze point estimation model using pre-training data.

[0121] A neural network can be composed of neural units. A neural unit can be a s The output of the operation unit with the intercept 1 as input can be:

[0122]

[0123] Where s=1, 2, ... n, n is a natural number greater than 1, W s For x s , b is the bias of the neural unit. f is the activation function of the neural unit, which is used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into the output signal. The output signal of the activation function can be used as the input of the next convolutional layer. The activation function can be a sigmoid function. A neural network is a network formed by connecting many of the above-mentioned single neural units together, that is, the output of one neural unit can be the input of another neural unit. The input of each neural unit can be connected to the local receptive field of the previous layer to extract the features of the local receptive field. The local receptive field can be an area composed of several neural units.

[0124] The gaze point estimation model can be a deep neural network model. A deep neural network (DNN), also known as a multi-layer neural network, can be understood as a neural network with multiple hidden layers. According to the positions of different layers, the DNN can be divided into three categories: input layer, hidden layer, and output layer. Generally speaking, the first layer is the input layer, the last layer is the output layer, and the layers in between are all hidden layers. In a DNN, the layers can be fully connected, that is, any neuron in the i-th layer must be connected to any neuron in the i+1-th layer.

[0125] The pre-training data includes pre-training samples and labeled target positions, where the labeled target positions represent the positions where the person recorded in the pre-training test image is looking at the training display screen in the training electronic device used to collect the pre-training test image. The pre-training test image may be an image collected by the training camera of the training electronic device when the person is looking at the labeled target position. Training electronic device and application Figure 3 The electronic devices of the methods shown may be the same or different.

[0126] During the training process, the initial gaze point estimation model can be used to process the pre-trained samples to obtain the pre-trained target position. According to the difference between the pre-trained target position and the labeled target position, the parameters of the initial gaze point estimation model can be adjusted to minimize the difference.

[0127] The difference between the pre-trained target positions and the labeled target positions can be expressed as a loss value.

[0128] In the process of training the neural network model, because the output of the neural network model is as close as possible to the value that we really want to predict, we can compare the predicted value of the current network with the target value that we really want, and then update the weight vector of each layer of the neural network according to the difference between the two (of course, there is usually an initialization process before the first update, that is, pre-configuring parameters for each layer in the neural network model). For example, if the model's predicted value is high, adjust the weight vector to make it predict lower, and keep adjusting until the neural network model can predict the target value that we really want or a value that is very close to the target value that we really want. Therefore, it is necessary to pre-define "how to compare the difference between the predicted value and the target value", which is the loss function or objective function, which are important equations used to measure the difference between the predicted value and the target value. Among them, taking the loss function as an example, the higher the output value of the loss function, that is, the loss value (loss), the greater the difference, so the training of the neural network model becomes a process of minimizing this loss as much as possible.

[0129] The back propagation (BP) algorithm can be used to correct the size of the parameters in the initial neural network model during the training process, so that the reconstruction error loss of the neural network model becomes smaller and smaller. Specifically, the forward transmission of the input signal to the output will generate error loss, and the parameters in the initial neural network model are updated by backpropagating the error loss information, so that the error loss converges. The backpropagation algorithm is a backpropagation movement dominated by error loss, which aims to obtain the optimal parameters of the neural network model, such as the weight matrix.

[0130] The pre-training samples may include pre-training detection images and / or pre-training pupil positions, etc. In the case where the pre-training samples include pre-training pupil positions, the pre-training samples may also include pre-training facial positions and / or pre-training eye images.

[0131] Processing the first detection image using the gaze point estimation model can be understood as processing the inference data using the gaze point estimation model to obtain the first target position. The inference data may include the first detection image, and may also include other information determined based on the first detection image.

[0132] In the case where the pre-training samples include pre-training detection images, the inference data may include the first detection image.

[0133] In the case where the pre-trained sample includes a pre-trained pupil position, the inference data may include the pupil position. The pre-trained pupil position indicates the position where the pupil of the person in the pre-trained detection image is located. The pupil position indicates the position where the pupil of the user in the first detection image is located.

[0134] In the case where the pre-training sample includes a pre-trained face position, the inference data may include the face position. The pre-trained face position indicates the position where the face of the person in the pre-trained detection image is located. The face position indicates the position where the face of the user in the first detection image is located.

[0135] The location of a limb or organ such as the pupil or face can also be understood as the area where the limb or organ is located.

[0136] In the case where the pre-training samples include pre-training eye images, the inference data may include eye images. The pre-training face position represents an image of the area where the eyes of the person are located in the pre-training detection image. The eye image represents an image of the area where the eyes of the user are located in the first detection image.

[0137] The pre-training data is used to adjust the parameters of the initial gaze point estimation model, and the adjusted initial gaze point estimation model can be used as the gaze point estimation model. In this case, the pre-training data can also be referred to as training data, the pre-training samples and the pre-training target positions can be referred to as training samples and training target positions, respectively, and the pre-training detection images, pre-training pupil positions, pre-training facial positions, pre-training eye images, etc. can be referred to as training detection images, training pupil positions, pre-training facial positions, training eye images, etc., respectively.

[0138] The characters in the pre-training data can be applications Figure 3 The user of the electronic device of the method shown may also be someone other than the user of the electronic device.

[0139] When the characters in the multiple pre-training data used in the process of adjusting the parameters of the initial gaze point estimation model using the pre-training data include other characters besides the user of the electronic device, the adjusted initial gaze point estimation model can also be used as the pre-trained gaze point estimation model. The training process of adjusting the parameters of the initial gaze point estimation model using the pre-training data can be understood as pre-training.

[0140] The pre-trained gaze point estimation model can be re-trained using the training data, that is, the parameters of the pre-trained gaze point estimation model are continued to be adjusted to obtain the gaze point estimation model.

[0141] The training data includes pre-training samples and labeled target positions, where the labeled target positions represent the positions where the user looks at the display screen of the electronic device recorded in the training detection image. Figure 3 The electronic device of the method shown. The user is a user of the electronic device. The training detection image can be an image captured by the first camera of the electronic device when the user looks at the marked target position.

[0142] During the retraining process, the pre-trained gaze estimation model can be used to process the training samples to obtain the pre-trained target position. According to the difference between the training target position and the labeled target position in the training data, the parameters of the pre-trained gaze estimation model can be adjusted to minimize the difference.

[0143] In the case where the pre-training samples include pre-training detection images, the training samples may include training detection images.

[0144] In the case where the pre-training sample includes the pre-training pupil position, the training sample may include the training pupil position. The training pupil position indicates the position where the pupil of the person in the training detection image is located.

[0145] In the case where the pre-training samples include pre-training face positions, the training samples may include training face positions. The training face positions represent positions where the faces of people in the training detection images are located.

[0146] In the case where the pre-training samples include pre-training eye images, the training samples may include training eye images. The training face positions represent images of areas where the eyes of a person in the training detection images are located.

[0147] The retraining of the pre-trained gaze point estimation model can be understood as calibration of the pre-trained gaze point estimation model for the user.

[0148] The first detection image is processed using a gaze point estimation model, and an output of the gaze point estimation model can be used as a first target position.

[0149] Alternatively, when the characters in the multiple pre-training data used in the process of adjusting the parameters of the initial gaze point estimation model using the pre-training data include other characters besides the user of the electronic device, the adjusted initial gaze point estimation model can also be used as the gaze point estimation model.

[0150] The first detection image is processed using the gaze point estimation model, and the output of the gaze point estimation model can be called the first initial position.

[0151] After the first initial position is determined, a first target position corresponding to the first initial position may be determined according to the correspondence between the initial position and the target position.

[0152] Determining the first initial corresponding first target position according to the correspondence between the initial position and the target position can be understood as a calibration process for the user.

[0153] The correspondence between the initial position and the target position can be determined according to a plurality of second initial positions and a gaze position corresponding to each second initial position. The plurality of second initial positions are obtained by processing a plurality of user gaze images respectively using a gaze point estimation model. The gaze position corresponding to each second initial position is a position on the display screen that the user gazes at when the first camera captures the user gaze image for obtaining the second initial position.

[0154] That is, when the user gazes at multiple gaze positions of the display screen respectively, the first camera can collect the user gaze image corresponding to each gaze position. The user gaze image corresponding to each gaze position is processed respectively using the gaze point estimation model to obtain the second initial position corresponding to each gaze position. According to the second initial position corresponding to each gaze position, the corresponding relationship between the initial position and the target position can be determined.

[0155] In the corresponding relationship, the multiple initial positions may include the multiple second initial positions, and the target position corresponding to each second initial position may be the gaze position corresponding to the second initial position. Alternatively, a curve fitting may be performed for the second initial position corresponding to each gaze position, and the result of the curve fitting, i.e., the functional relationship between the second initial position and the gaze position, may represent the corresponding relationship between the initial position and the target position.

[0156] It should be understood that the training of the gaze point estimation model can be applied Figure 3 The method is performed by the electronic device shown, or by other electronic devices. For example, the pre-trained gaze point estimation model obtained by training with the pre-trained data can be performed by other electronic devices, and the gaze point estimation model obtained by training with the training data can be applied Figure 3 The method is performed by an electronic device.

[0157] By calibrating the user, the first target position obtained is more accurate. Compared with the method of training the pre-trained gaze point estimation model obtained by pre-training, the method of determining the correspondence between the initial position and the target position is relatively simple, making the calibration for the user easier to implement.

[0158] Step S330: zooming in on the first image with the first target position as the center to obtain a second image.

[0159] The magnification ratio of the first image may be preset or determined according to a user's instruction.

[0160] Before performing step S330, it may be determined whether to perform step S330 according to the user behavior of the user recorded in the user behavior image.

[0161] When the user behavior is a preset magnification behavior, step S330 may be performed; otherwise, when the user behavior is not a preset magnification behavior, step S330 may no longer be performed.

[0162] The user behavior image and the first detection image may be the same or different images.

[0163] If the user behavior image is the first detection image, step S320 may also be performed when the user behavior is a preset magnification behavior.

[0164] If the user behavior image is not the first detection image, then when the display screen of the electronic device displays the first image, the electronic device may use the same or different sensor as that used to collect the first detection image to collect the user behavior image. The user behavior image may record the user. Thus, when the user behavior of the user recorded in the user behavior image is a preset magnification behavior, step S310 may be performed to collect the first detection image using the sensor in the electronic device.

[0165] The sensor used to collect the user behavior image and the sensor used to collect the first detection image may be the same or different sensors in the electronic device. The sensor used to collect the user behavior image may be an infrared sensor, a distance sensor or a camera in the electronic device.

[0166] Determine whether the user behavior is a preset magnification behavior based on the first detection image, and determine the first target position using the first detection image if the user behavior is the preset magnification behavior. The user is required to indicate the first target position in the first image while performing the preset magnification behavior. There are many restrictions on the preset magnification behavior and the way to indicate the first target position in the first image. For example, the user's behavior for indicating the first target position in the first image cannot be opposite or contradictory to the preset magnification behavior. The user performs the preset magnification behavior and indicates the first target position in the first image at the same time, which places high demands on the user's actions.

[0167] When it is determined that the user behavior is a preset magnification behavior, the first detection image is collected, and the first target position is determined according to the first detection image, which is more convenient to implement.

[0168] In step S330, the first image may be magnified with the first target position as the center and according to a target magnification ratio to obtain a second image.

[0169] In some embodiments, the second image may be magnified according to a target ratio.

[0170] Before performing step S330, the distance between the user and the electronic device may be acquired. According to the user distance between the user and the electronic device, and the corresponding relationship between the distance and the magnification ratio, the target magnification ratio corresponding to the user distance may be determined.

[0171] The distance between the user and the electronic device may be represented as the distance between the user's head and the electronic device.

[0172] The distance between the user and the electronic device can be determined based on information collected by a distance sensor in the electronic device. Alternatively, the distance between the user and the electronic device can also be determined based on the size of the user's limbs or organs in the scale indication image. The distance sensor can be, for example, a time of flight (TOF) sensor.

[0173] Alternatively, before performing step S330, the target distance between multiple target nodes of the user's face is determined according to the ratio indication image. According to the corresponding relationship between the distance and the magnification ratio, the target magnification ratio corresponding to the target distance can be determined.

[0174] The scale indication image may be an image recorded with the user and acquired when the display screen displays the first image.

[0175] The ratio indication image may be the first detection image or other images. The ratio indication graphic may be the same as or different from the user behavior image. The sensor used to collect the ratio indication image may be the same as or different from the sensor used to collect the first detection image and the sensor used to collect the user behavior image.

[0176] When the sensor used to collect the ratio indication image, the first detection image, and the user behavior image is the same sensor, the requirements for the sensor in the electronic device are reduced, making the image processing method provided in the embodiment of the present application more widely applicable.

[0177] In order to obtain the target distance between multiple target nodes on the user's face, the first detection image may be recognized to obtain multiple target nodes on the user's face, thereby determining the target distance.

[0178] Alternatively, after determining the first target position according to the first detection image, the first camera may be used to collect images again to obtain a scale indication image. The scale indication image records the user viewing the first image. According to the target distance between multiple target nodes of the user's face recorded in the scale indication image, and the corresponding relationship between the distance and the magnification ratio, the target magnification ratio corresponding to the target distance may be determined.

[0179] The target distance between multiple target nodes of the face may represent the distance between the multiple target nodes in the image, or may be represented as a ratio of the distance between the multiple target nodes in the image to the distance between multiple reference nodes in the image.

[0180] The target distance may represent the user's lip distance, pupil distance, etc.

[0181] In the case where the target distance represents the lip distance of the user, the multiple target nodes of the face may include the midpoint of the upper lip and the midpoint of the lower lip, etc. The target distance may be represented as the distance of the multiple target nodes in the image captured by the first camera, or the ratio of the distance of the target nodes in the image captured by the first camera to the distance of the reference nodes. In the case where the target distance is represented as the ratio of the distance of the multiple target nodes in the image to the distance of the multiple reference nodes in the image, the multiple reference nodes may include the left endpoint and the right endpoint of the lip.

[0182] The user can adjust the distance between the midpoint of the upper lip and the midpoint of the lower lip by the degree of mouth opening, thereby adjusting the distance of the target node in the image captured by the first camera, and the target magnification can be set.

[0183] In the case where the target distance represents the pupil distance of the user, the multiple target nodes of the face may include a left eye pupil node and a right eye pupil node. The target distance may be represented as the distance between the multiple target nodes in the image captured by the first camera.

[0184] The user can set the target magnification by adjusting the relative orientation of the face and the camera by shaking the head, or by adjusting the distance between the face and the first camera.

[0185] In other embodiments, the second image may be obtained by enlarging the first image at a preset enlargement ratio.

[0186] In the case where the first image is an image stored in an electronic device, or the first electronic device is obtained by scaling an image stored in the electronic device, the magnification ratio of the first image can be understood as the ratio between the size of the first image and the size of the second image in the area of ​​the first image, that is, the ratio between the width (or length) of the first image and the width (or length) of the second image in the area of ​​the first image. Alternatively, the magnification ratio of the first image can also be the ratio between the size of the stored image and the size of the area where the second image is stored in the electronic device.

[0187] In the case where the first image is a preview image captured in real time by the second camera in the electronic device, the magnification ratio of the first image can be understood as the ratio of the size of an object in the second image to the size of the object in the first image, that is, the ratio between the size of the first image and the size of the area where the second image is located in the first image, when the scene captured by the second camera remains unchanged. Alternatively, the magnification ratio of the first image can also be understood as the ratio between the zoom multiple of the second image and the zoom multiple of the first image. Alternatively, the magnification ratio of the first image can also be expressed as the zoom multiple of the second image.

[0188] In the case where the first image is a preview image captured by the second camera in real time, enlarging the first image with the first target position as the center can also be understood as zooming with the first target position as the center, and the second image can be the zoomed preview image.

[0189] When optical zoom is adopted, the second camera may also be referred to as a preview image captured in real time by the zoomed second camera.

[0190] Step S340: display the second image using the display screen.

[0191] In the case where the second image is obtained by enlarging the first image according to a preset enlargement ratio, the enlargement ratio of the first image may not meet the user's requirements for the enlargement ratio.

[0192] Exemplarily, after step S330, the second image may be enlarged again.

[0193] That is, after step S340, when the display screen of the electronic device displays the second image, the first sensor may be used to capture the second detection image, and the second detection image records the user.

[0194] The second detection image is processed to obtain the second target position in the second image.

[0195] The third image can be obtained by enlarging the second target area in the second image with the second target position as the center. Thus, the third image can be displayed on the display screen.

[0196] In some embodiments, before performing step S330, when determining the target magnification ratio indicated by the user, the size relationship between the target magnification ratio and the preset magnification ratio can be determined. When the target magnification ratio is greater than or equal to the preset magnification ratio, in step S330, the first image can be magnified according to the preset magnification ratio to obtain the second image. When the display screen displays the second image, the first sensor can capture the second detection image, determine the second target position according to the second detection image, and magnify the second image again with the second target position as the center.

[0197] By processing the first detection image, there may be a difference between the first target position in the first detection image obtained and the position that the user actually wants to indicate. In the case where the first image is magnified by a small multiple, the difference between the enlarged image and the image that the user wants to see caused by the difference is small. However, as the magnification of the first image increases, the difference between the enlarged image and the image that the user wants to see becomes larger and larger. In the case where the target magnification ratio is large, greater than or equal to the preset magnification ratio, if the magnification is performed according to the target magnification ratio, the position of the enlarged second image in the first image may not meet the user's needs.

[0198] Therefore, when the target magnification ratio is greater than the preset magnification ratio, the first image is enlarged according to the preset magnification ratio with the first target position as the center, and after obtaining the enlarged second image, the first sensor is used again to capture the image, and the second target position in the second image is determined based on the captured second detection image, and the second image is enlarged with the second target position as the center, so that the third image obtained by enlarging the second image can better meet the needs of users.

[0199] The processing after the first image is enlarged according to a preset ratio to obtain the second image can be understood as processing the second image again as the first image.

[0200] When the target magnification ratio is greater than the preset magnification ratio, and the display screen displays the second image magnified according to the preset magnification ratio, when the second image is magnified, it can be performed according to the difference between the target magnification ratio and the second target ratio. Alternatively, when the difference between the target magnification ratio and the second target ratio is greater than or equal to the preset magnification ratio, the second image can be magnified according to the preset magnification ratio. After the second image is magnified according to the preset magnification ratio, the third image obtained by magnification can be used as the second image, and the image can be magnified again.

[0201] Alternatively, when the target magnification ratio is greater than the preset magnification ratio and the display screen displays the second image magnified according to the preset magnification ratio, the target magnification ratio can be acquired again and the second image can be enlarged according to the acquired target magnification ratio.

[0202] The method provided in the embodiment of the present application determines the first target position in the first image based on the first detection image collected by the sensor when the display screen displays the first image, and the user is recorded in the first detection image. The first image is thus enlarged with the first target position as the center, and the enlarged second image is displayed on the display screen. While meeting the need for the center position of the first image to be enlarged, the user's manual operation of the electronic device, such as touch operation, is avoided, thereby improving the flexibility of the user's control method for image enlargement and improving the user experience.

[0203] Combine the following Figures 6 to 8 , taking the first image as a preview image displayed in real time in a photo shooting scene as an example, Figure 3 The image processing method shown is described below.

[0204] Figure 6 It is a schematic flowchart of an image processing method provided in an embodiment of the present application. Figure 6 The relationship information determination method shown may include steps S601 to S606, which are described in detail below.

[0205] Step S601: using a display screen to display a first image in real time.

[0206] The first image is an image captured in real time by the second camera.

[0207] The second camera may be a rear camera of the electronic device. The user is taking a photo with the electronic device, and the first image is a preview image captured in real time by the second camera. The first image may be Figure 4 The image in the viewfinder 422 in the shooting interface 420 shown in (b).

[0208] When the display screen displays the first image, step S602 may be performed.

[0209] Step S602: Use the first camera to collect user behavior images.

[0210] The first camera may be a front-facing camera of the electronic device.

[0211] The user behavior image may record a user who views the first image displayed on the display screen.

[0212] The number of images in the user behavior image may be one or more. For example, the user behavior image may be a video including multiple frames of images.

[0213] Step S603 , determining whether the user behavior recorded in the user behavior image is a preset magnification behavior.

[0214] The preset magnification behavior may be an action or expression of the user such as nodding, shaking head, blinking, opening mouth, closing eyes, etc. Alternatively, the preset magnification behavior may also be a certain action or expression maintained by the user within a preset holding time.

[0215] For example, when the preset magnification behavior is opening the mouth, if the lip distance of the user in the user behavior image exceeds the preset lip distance threshold, it can be determined that the user behavior is the preset magnification behavior; when the preset magnification behavior is blinking, if the time interval in which the user's pupil is not recorded in the user behavior image meets the preset time range, it can be determined that the user behavior is the preset magnification behavior. For another example, if the user keeps looking at a certain position on the screen within the preset hold time, it can be determined that the user behavior is the preset magnification behavior.

[0216] In the case that the user behavior is not the preset magnification behavior, step S602 may be performed again. The user behavior image may be collected by the first camera periodically or non-periodically.

[0217] In the case where the user behavior is a preset magnification behavior, step S604 to step S611 may be performed.

[0218] The judgment of whether the user behavior is the preset amplification behavior can be understood as determining the input information of the switch type control of the electronic device. The input of the switch type control is "0" or "1". The inputs "0" and "1" correspond to different operations of the electronic device. As to whether the user behavior is the preset amplification behavior, it is to determine whether the input of the switch type control is "1". For example, in the case where the user action is the preset amplification behavior, it can be determined that the input of the switch type control is "1", and the operation of the electronic device corresponding to the input "1" can be step S604; in the case where the user action is not the preset amplification behavior, it can be determined that the input of the switch type control is "0", and the operation of the electronic device corresponding to the input "0" can be step S602.

[0219] Step S604: using a first camera to capture a first detection image.

[0220] The user is recorded in the first detection image.

[0221] Before performing step S604, first reminder information may also be output to remind the user to indicate the first target location.

[0222] The electronic device can remind the user through the vibration generated by the motor, the flashing of the indicator light, or the sound produced by the speaker. In other words, the reminder information output by the electronic device can be through sound, vibration or flashing of the indicator light.

[0223] Step S605: determining a first target position in the first image according to the first detection image.

[0224] When it is determined in step S603 that the user behavior is a preset magnification behavior, the first camera is used to collect images to obtain a first detection image, and in step S605, a first target position in the first image is determined according to the first detection image.

[0225] The first target position may be the position the user is looking at, or the position in the first image corresponding to the position of the user in the first detection image. The position of the user in the first detection image may be the center of the area of ​​the user's head in the first detection image, or the midpoint of the line connecting the positions of the two pupils of the user in the first detection image.

[0226] Determining the first target position according to the first detection image can be understood as determining input information for coordinate control of the electronic device. The input of the coordinate control is the coordinates of the display screen. The display screen displays the first image. According to the area of ​​the first image in the display screen, the first target position in the first image can be understood as the position on the display screen.

[0227] When the first target position is determined, that is, when the input information of the coordinate control is determined, steps S606 to S609 may be performed. That is, for the input information of the coordinate control, the operation of the electronic device may be to perform steps S606 to S609.

[0228] When the first target position is determined in step S605, the first target position may also be displayed on the first image using a display screen.

[0229] When the electronic device determines the first target location, the electronic device may display Figure 7 The position prompt interface 720 shown in (a) of FIG. 7 includes a viewfinder 721, and the first image can be displayed in real time in the viewfinder 721. The position prompt interface 720 also includes a position icon 724 located in the viewfinder 721. The position icon 724 is used to indicate the first target position in the first image.

[0230] The electronic device may display the first target position in a highlighted or flashing manner.

[0231] like Figure 7 As described in (b), the first target position may be a position where the user is gazing determined based on the first detection image.

[0232] Step S606: using the first camera to collect a scale indication image.

[0233] The scale indicates that the user is recorded in the image.

[0234] Before performing step S606, second reminder information may also be output to remind the user to indicate the target zoom information.

[0235] Step S607: determining target zoom information according to the ratio indication image.

[0236] The target zoom information may indicate a target zoom factor, or the target zoom information may indicate a ratio of the target zoom factor to a current zoom factor.

[0237] Determining the target zoom information according to the ratio indication image can be understood as determining the input information of the adjustment type control performed on the electronic device. The input information of the adjustment type control can be information that changes continuously, or it can be discrete, that is, information that changes discontinuously. The electronic device can determine the output information corresponding to the input information of the adjustment type control based on the input information of the adjustment type control. The output information and the input information can have a linear or nonlinear correlation, and the output information can be positively correlated or negatively correlated with the input information.

[0238] The input information of the adjustment control may be, for example, the head distance, the lip distance and pupil distance of the user in the proportional indication image, or the duration of the state stay, etc.

[0239] The user can adjust the distance between the head and the electronic device, namely the head distance, by adjusting the distance between the head and the electronic device.

[0240] The user can adjust the lip distance of the user recorded in the scale indicator image by adjusting the degree of mouth opening or by adjusting the distance from the electronic device.

[0241] The user may adjust the user's pupil distance recorded in the scale indication image by adjusting the relative orientation of the electronic device or by adjusting the distance between the user and the electronic device.

[0242] The user can adjust the duration of maintaining a preset state by adjusting the duration of the state recorded in the proportional indication image.

[0243] The preset state may be a certain expression or action of the user, etc. For example, the preset state may be that the user's eyes are focused on a certain point on the display screen, or the user opens his mouth, etc.

[0244] According to the ratio indication image, the input information of the adjustment control can be determined. According to the input information of the adjustment control, the output information can be determined. The target zoom information can be understood as the output information determined by the electronic device according to the input information of the adjustment control.

[0245] Step S608: zooming with the first target position as the center according to the target zoom information to obtain a second image.

[0246] Zooming can be achieved through one or more zooming methods such as optical zoom, digital zoom, and hybrid zoom.

[0247] Before performing step S608, an image area can also be determined based on the target zoom information and the first target position, and the image area can be displayed using a display screen. The image area can be understood as the area of ​​the second image corresponding to the first image. The second image is an image zoomed according to the target zoom information based on the first image and centered on the target position in the first image. When the scene captured by the second camera is changed, the second image is an image obtained by magnifying and zooming the image area in the first image.

[0248] The image area is determined according to the target zoom information and the first target position.

[0249] When the electronic device determines the image area, the electronic device can display Figure 8 The zoom prompt interface 810 shown in (a) of FIG. 8 includes a viewfinder 811 , in which the first image can be displayed in real time. The zoom prompt interface 810 also includes a frame 812 of the image area located in the viewfinder 811 .

[0250] Step S609: display the second image using the display screen.

[0251] Before performing step S609 , it may also be determined whether the user confirms the image area.

[0252] In some embodiments, when the display screen displays the first image and the image area in the first image, the first camera may be used to capture the area confirmation indication image. The user's confirmation of the image area may be determined by the user's behavior in the area confirmation indication image.

[0253] The user is recorded in the area confirmation indication image. In the case where the user behavior in the area confirmation indication image is a preset confirmation behavior, the user confirmation image area can be determined.

[0254] Alternatively, in the case where the user behavior in the area indication image is a preset denial behavior, a user denial image area, ie, a user unconfirmed image area, may be determined.

[0255] In other embodiments, the user may express his or her disapproval of the image region by manually performing a disapproval operation on the electronic device.

[0256] For example, while the display screen displays the image area on the first image, it can also display a cancel icon. Figure 8The zoom prompt interface 810 shown in (a) may also include a cancel icon 813. In the case where the user clicks the cancel icon 813, the electronic device may determine that the user has denied the image area. In the case where the zoom prompt interface 810 is displayed for a time length exceeding a preset time length and the user does not click the cancel icon 813, it may be determined that the user has confirmed the image area.

[0257] When the user denies the image area, steps S604 to S607 may be performed.

[0258] When the user confirms the image area, step S609 may be performed.

[0259] Figure 8 (b) in FIG. 8 shows another GUI of the electronic device, which is a zoom image interface 820. The zoom image interface 820 may include a viewfinder 821. The viewfinder 821 is used to display the second image obtained after zooming. The second image may also be an image captured in real time by the second camera, or the second image may be an image obtained by processing the image captured by the second camera.

[0260] Similar to the determination before step S609 , after step S605 , it may also be determined whether the user confirms the first target position.

[0261] When the display screen displays the first target position on the first image, the first camera may be used to capture the position confirmation indication image. The user's confirmation of the first target position may be determined by the user's behavior in the position confirmation indication image. The user is recorded in the position confirmation indication image.

[0262] Alternatively, when the display screen displays the first target position on the first image, it can be determined that the user has denied the first target position according to a manual denial operation of the user, that is, the user has not confirmed the first target position.

[0263] After step S609, the first camera may be used to collect images to obtain a new user behavior image. When the user behavior in the new user behavior image is a preset shooting behavior, the user shooting image is stored, and the user shooting image is the second image when it is determined that the user behavior is the preset shooting behavior. It should be understood that the preset shooting behavior and the preset magnification behavior may be different behaviors.

[0264] When the user's action in the captured image is a preset shooting action, the user's captured image may also be displayed in the viewfinder. In other words, the second image captured in real time by the second camera may no longer be displayed in the viewfinder.

[0265] It should be understood that, in some embodiments, step S606 may also be performed before or simultaneously with step S604. That is, the embodiment of the present application does not limit the order in which the electronic device collects the scale indication image used to determine the target zoom information and the first detection image used to determine the first target position, and the order in which the target zoom information and the first target position are determined.

[0266] Through steps S601 to S609, the parameters in the shooting process are adjusted according to the user's behavior, expression or action recorded in the image captured by the first camera, thereby reducing the user's manual operation during the shooting process, improving the user's flexibility in controlling the shooting process, reducing the possibility of user misoperation during the shooting process, reducing the risk of the electronic device falling, and improving the user experience.

[0267] It should be understood that the above examples are intended to help those skilled in the art understand the embodiments of the present application, rather than to limit the embodiments of the present application to the specific numerical values ​​or specific scenarios illustrated. Those skilled in the art can obviously make various equivalent modifications or changes based on the above examples, and such modifications or changes also fall within the scope of the embodiments of the present application.

[0268] Combination of the above Figures 3 to 8 , describes in detail the image processing method of the embodiment of the present application, and will now be combined with Fig. 9 It should be understood that the image processing device in the embodiment of the present application can execute various image processing methods in the aforementioned embodiment of the present application, that is, the specific working process of the following various products can refer to the corresponding process in the aforementioned method embodiment.

[0269] Fig. 9 It is a schematic diagram of an image processing device provided in an embodiment of the present application.

[0270] It should be understood that the image processing apparatus 900 may execute Figure 3 and Figure 6 The image processing method shown in the figure. The image processing device 900 may be located in an electronic device. The image processing device 900 includes: a collection unit 910, a processing unit 920 and a display unit 930.

[0271] The acquisition unit 910 is used to acquire a first detection image when the display screen of the electronic device displays the first image, and the first detection image records a user who views the first image.

[0272] The processing unit 920 is used to process the first detection image to obtain a first target position in the first image.

[0273] The processing unit 920 is further configured to magnify the first image with the first target position as the center to obtain a second image.

[0274] The display unit 930 is used to display the second image using a display screen.

[0275] Optionally, the processing unit 920 is further used to determine the target distance between multiple target nodes of the user's face according to the scale indication image, where the scale indication image is an image recorded with the user and captured when the display screen displays the first image.

[0276] The processing unit 920 is further configured to determine a target magnification ratio corresponding to the target distance according to a corresponding relationship between the distance and the magnification ratio.

[0277] The processing unit 920 is further configured to, with the first target position as the center, enlarge the first image according to a target enlargement ratio to obtain a second image.

[0278] Optionally, the second image is obtained by enlarging the first target area in the first image according to a preset enlargement ratio.

[0279] The acquisition unit 910 is further configured to acquire a second detection image when the display screen of the electronic device displays the second image, and the second detection image records the user.

[0280] The processing unit 920 is further configured to process the second detection image to obtain a second target position in the second image.

[0281] The processing unit 920 is further configured to magnify the second target area in the second image with the second target position as the center to obtain a third image.

[0282] The display unit 930 is further configured to display a third image using the display screen.

[0283] Optionally, the processing unit 920 is further used to determine the target distance between multiple target nodes of the user's face according to the scale indication image, where the scale indication image is an image recorded with the user and captured when the display screen displays the first image.

[0284] The processing unit 920 is further configured to determine a target magnification ratio corresponding to the target distance according to a corresponding relationship between the distance and the magnification ratio.

[0285] The processing unit 920 is further configured to, when the target magnification ratio is greater than or equal to the preset magnification ratio, magnify the first image according to the preset magnification ratio to obtain the second image.

[0286] Optionally, the first detection image is collected by a first camera in the electronic device, the first camera and the display screen are oriented in the same direction, and the first target position is a position where the user is gazing.

[0287] Optionally, the processing unit 920 is specifically used to process the first detection image using a gaze point estimation model to obtain a first initial position, and the gaze point estimation model is a trained neural network model.

[0288] The processing unit 920 is also used to determine the first target position corresponding to the first initial position based on the correspondence between the initial position and the target position, the correspondence being determined by multiple second initial positions and the gaze position corresponding to each second initial position, the multiple second initial positions being obtained by processing multiple user gaze images respectively using the gaze point estimation model, and the gaze position corresponding to each second initial position is the position on the display screen that the user gazes at when the first camera captures the user gaze image for obtaining the second initial position.

[0289] Optionally, the first image is a preview image captured in real time by a second camera in the electronic device.

[0290] The processing unit 920 is specifically configured to perform zooming with the first target position as the center, and the second image is a preview image after zooming.

[0291] Optionally, the first detection image is collected by a sensor in the electronic device, and a first orientation of the sensor is different from a second orientation of the second camera.

[0292] Optionally, the processing unit 920 is specifically used to amplify the first image to obtain a second image when the user behavior of the user recorded in the user behavior image is a preset magnification behavior, and the user behavior image is an image recorded with the user captured when the display screen displays the first image.

[0293] Optionally, the display unit 930 is further configured to display an image region using a display screen, where the image region is a region where the second image is located in the first image.

[0294] It should be noted that the above-mentioned image processing device 900 is embodied in the form of a functional unit. The term "unit" here can be implemented in the form of software and / or hardware, and is not specifically limited to this.

[0295] For example, a "unit" may be a software program, a hardware circuit, or a combination of the two that implements the above functions. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a dedicated processor, or a group processor, etc.) and a memory for executing one or more software or firmware programs, a combined logic circuit, and / or other suitable components that support the described functions.

[0296] Therefore, the units of each example described in the embodiments of the present application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.

[0297] The present application also provides a chip, the chip comprising a data interface and one or more processors. When the one or more processors execute instructions, the one or more processors read the instructions stored in the memory through the data interface to implement the image processing method described in the above method embodiment.

[0298] The one or more processors may be general-purpose processors or special-purpose processors. For example, the one or more processors may be a central processing unit (CPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices such as discrete gates, transistor logic devices, or discrete hardware components.

[0299] The chip may be used as a component of a terminal device or other electronic devices. For example, the chip may be located in the electronic device 100 .

[0300] The processor and the memory may be provided separately or integrated together. For example, the processor and the memory may be integrated on a system on chip (SOC) of a terminal device. That is, the chip may also include a memory.

[0301] The memory may store a program, which may be executed by the processor to generate instructions, so that the processor executes the image processing method described in the above method embodiment according to the instructions.

[0302] Optionally, data may be stored in the memory. Optionally, the processor may read data stored in the memory, and the data may be stored at the same storage address as the program, or may be stored at a different storage address than the program.

[0303] Exemplarily, the memory can be used to store the relevant program of the image processing method provided in the embodiment of the present application, and the processor can be used to call the relevant program of the image processing method stored in the memory to implement the image processing method of the embodiment of the present application. For example, when the display screen of the electronic device displays a first image, a first detection image is collected, and the first detection image records a user who views the first image; the first detection image is processed to obtain a first target position in the first image; the first image is enlarged with the first target position as the center to obtain a second image; and the second image is displayed using the display screen.

[0304] The chip may be arranged in an electronic device. Collecting the first detection image may also be understood as using a sensor in the electronic device to collect the first detection image, or controlling the sensor to collect the first detection image.

[0305] The present application also provides a computer program product, which, when executed by a processor, implements the image processing method described in any method embodiment of the present application.

[0306] The computer program product may be stored in a memory, for example, a program, which is finally converted into an executable target file that can be executed by a processor after preprocessing, compiling, assembling and linking.

[0307] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a computer, the image processing method described in any method embodiment of the present application is implemented. The computer program can be a high-level language program or an executable target program.

[0308] The computer-readable storage medium is, for example, a memory 1302. The memory 1302 may be a volatile memory or a nonvolatile memory, or the memory 1302 may include both a volatile memory and a nonvolatile memory. Among them, the nonvolatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0309] The embodiments of this application may involve the use of user data. In actual applications, user-specific personal data may be used in the scheme described herein within the scope permitted by applicable laws and regulations, subject to the requirements of applicable laws and regulations of the country where the user is located (for example, with the user's explicit consent, effective notification to the user, etc.).

[0310] In the description of this application, the terms "first", "second", etc. are used only for descriptive purposes and should not be understood as indicating or implying relative importance, or a specific order or sequence. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0311] In this application, "at least one" means one or more, and "plurality" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0312] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0313] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0314] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0315] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic; for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation; for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0316] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0317] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0318] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. An image processing method, characterized in that: Applied to electronic equipment, the method comprises: When the display screen of the electronic device displays a first image, collecting a first detection image, the first detection image records a user viewing the first image; Processing the first detection image to obtain a first target position in the first image; Taking the first target position as the center, enlarging the first image to obtain a second image; displaying the second image using the display screen; The processing of the first detection image to obtain a first target position in the first image includes: Processing the first detection image using a gaze point estimation model to obtain a first initial position, wherein the gaze point estimation model is a neural network model trained using training data, wherein the training data includes pre-training samples and annotated target positions, wherein the pre-training samples include training detection images, and the annotated target position is a position where a person recorded in the training detection image is looking at, and the person is different from the user; According to the correspondence between the initial position and the target position, the first target position corresponding to the first initial position is determined, the correspondence is determined based on multiple second initial positions and the gaze position corresponding to each second initial position, the multiple second initial positions are obtained by processing multiple user gaze images respectively using the gaze point estimation model, and the gaze position corresponding to each second initial position is the position on the display screen that the user gazes at when the electronic device collects the user gaze image for obtaining the second initial position.

2. The method according to claim 1, characterized in that Before enlarging the first image with the first target position as the center, the method further includes: determining a target distance between multiple target nodes on the face of the user according to a ratio indication image, wherein the ratio indication image is an image of the user recorded and acquired when the display screen displays the first image; Determine the target magnification ratio corresponding to the target distance according to the corresponding relationship between the distance and the magnification ratio; The enlarging the first image with the first target position as the center includes: enlarging the first image with the first target position as the center according to the target enlargement ratio to obtain the second image.

3. The method according to claim 1, characterized in that The second image is obtained by enlarging the first target area in the first image according to the preset enlargement ratio when the target enlargement ratio indicated by the user is greater than the preset ratio; the method further includes: When the display screen of the electronic device displays the second image, collecting a second detection image, wherein the second detection image records the user; Processing the second detection image to obtain a second target position in the second image; Taking the second target position as the center, enlarging the second target area in the second image to obtain a third image; The third image is displayed using the display screen.

4. The method according to claim 3, characterized in that Before enlarging the first image with the first target position as the center, the method further includes: determining a target distance between multiple target nodes on the face of the user according to a ratio indication image, wherein the ratio indication image is an image of the user recorded and acquired when the display screen displays the first image; Determine the target magnification ratio corresponding to the target distance according to the corresponding relationship between the distance and the magnification ratio; The step of enlarging the first image with the first target position as the center to obtain the second image includes: when the target enlargement ratio is greater than or equal to the preset enlargement ratio, enlarging the first image according to the preset enlargement ratio to obtain the second image.

5. The method according to any one of claims 1 to 4, characterized in that The first detection image is collected by a first camera in the electronic device, the first camera and the display screen are facing the same direction, and the first target position is the position where the user is gazing.

6. The method according to any one of claims 1 to 4, characterized in that The first image is a preview image captured in real time by a second camera in the electronic device; The step of enlarging the first image with the first target position as the center to obtain the second image includes: zooming with the first target position as the center, and the second image is a preview image after zooming.

7. The method according to claim 6, characterized in that The first detection image is collected by a sensor in the electronic device, and a first orientation of the sensor is different from a second orientation of the second camera.

8. The method according to any one of claims 1 to 4, characterized in that The enlarging the first image to obtain the second image includes: when the user behavior of the user recorded in the user behavior image is a preset enlarged behavior, enlarging the first image to obtain the second image, and the user behavior image is an image recorded with the user captured when the display screen displays the first image.

9. The method according to any one of claims 1 to 4, characterized in that: Before displaying the second image using the display screen, the method further includes: displaying an image area using the display screen, where the image area is a region where the second image is located in the first image.

10. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that the electronic device executes the method according to any one of claims 1 to 9.

11. A chip, characterized in that: The device comprises a processor and a data interface, wherein the processor is used to execute instructions read from a memory through the data interface to implement the method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program for implementing the method according to any one of claims 1 to 9.