Method for removing moire and related device
By combining the pre-processing and post-processing technology of defocused images through neural networks, the problem of moiré pattern removal when shooting digital screens is solved, high-quality image reconstruction is achieved, and user experience and image quality are improved.
Patent Information
- Application Number
- CN202310172884.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-22
- Publication Date
- 2024-08-27
AI Technical Summary
Existing technology is difficult to effectively remove moiré patterns produced when shooting digital screens, which affects image quality. Moiré patterns vary greatly with the shooting angle, position, focus, etc., making removal more difficult.
Using neural networks combined with defocused images, pre-processing and post-processing techniques are used to accurately determine and remove moiré patterns in the input frames, retaining the texture, color, and brightness details of the image to obtain high-quality reconstructed images.
It achieves accurate removal of moiré when shooting digital screens, obtains clean images without moiré, improves image quality and user experience, and the method is highly robust and suitable for a wide range of scenarios.
Smart Images

Figure CN118552452A
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminals and image processing, and in particular to a method for removing moiré patterns and related devices. Background Art
[0002] When photographing a digital screen, the moiré pattern produced by the interference between the pixel grid of the camera sensor and the digital screen can be seen as a manifestation of the beat principle. Figure 1A As shown, the area where the two squares on the left are stacked on each other, and the area where the two circles on the right are stacked on each other is the area where the moiré pattern is produced.
[0003] The moiré caused by shooting digital screens usually spans a wide frequency range and covers a large area of the entire image, affecting the perception. When shooting digital screens, moiré will vary greatly depending on the angle, position, focus, focal length, etc. of the shooting camera. Figure 1B As shown, the left and right sides are images obtained by the same camera shooting the same digital screen at different angles. By comparison, different angles show different moiré patterns. Summary of the invention
[0004] The present application discloses a method and related device for removing moiré patterns, which can accurately determine the position and size of moiré patterns in an image that needs to have moiré patterns removed, thereby removing the moiré patterns and retaining details such as the texture, color, and brightness of the image to obtain a high-quality reconstructed image, allowing an electronic device to obtain a clean image without moiré patterns when shooting a digital screen.
[0005] In a first aspect, a method for removing moiré is provided, which may include: an electronic device starts a camera application; the electronic device captures an input frame and a reference frame, the input frame is an image captured by a first camera of the electronic device, the reference frame includes an image captured by a second camera of the electronic device in a defocused state, and the contents of the input frame and the reference frame both contain the same digital screen; the electronic device uses a neural network and a reference frame to remove the moiré in the input frame to obtain an output frame without the moiré.
[0006] The method provided in the first aspect is implemented, and the moiré pattern in the input frame is removed using a defocused image. Since the defocused image does not contain moiré patterns, the position and size of the moiré patterns in the input frame can be accurately determined, thereby removing the moiré patterns, and retaining the texture, color, brightness and other details of the image, so that a high-quality reconstructed image can be obtained. The method is highly robust and can be widely used. In addition, removing moiré patterns based on a neural network can improve the efficiency of removing moiré patterns and provide users with a better user experience.
[0007] In conjunction with the first aspect, in some implementations, the electronic device uses a neural network and a reference frame to remove moiré patterns from an input frame to obtain an output frame without moiré patterns, which may specifically include the following:
[0008] 1. The electronic device preprocesses the reference frame; the electronic device inputs the input frame and the preprocessed reference frame into the neural network to obtain an output frame without moiré pattern output by the neural network.
[0009] 2. The electronic device inputs the input frame and the reference frame into the neural network to obtain a result image output by the neural network; the electronic device post-processes the result image to obtain an output frame without moiré patterns.
[0010] 3. The electronic device preprocesses the reference frame; the electronic device inputs the input frame and the preprocessed reference frame into the neural network to obtain a result image output by the neural network; the electronic device post-processes the result image to obtain an output frame without moiré patterns.
[0011] In the above-mentioned methods 1-3, the preprocessing may include: registering the reference frame with the input frame as a reference; and / or mapping the brightness and color of the reference frame with the input frame as a reference. The preprocessing registration may align the position of the reference frame with the input frame, and the mapping may be used to eliminate the deviation of the brightness and color of the reference frame compared with the input frame, thereby ensuring the consistency of the brightness and color of the reference frame and the input frame, thereby ensuring the consistency of the brightness and color of the subsequent output frame and the input frame.
[0012] In the above-mentioned methods 1-3, post-processing may include: mapping the brightness and color of the result image based on the input frame. The post-processing mapping can eliminate the deviation of the brightness and color of the result image compared with the input frame, so that the brightness and color of the output frame are consistent with those of the input frame.
[0013] 4. The electronic device inputs the input frame and the reference frame into the neural network to obtain an output frame without moiré patterns output by the neural network.
[0014] In some embodiments, the neural network may also integrate pre-processing and / or post-processing capabilities, so that there is no need to pre-process the reference frame or post-process the result image. The output frame of the neural network can be obtained by simply inputting the input frame and the reference frame into the neural network.
[0015] In combination with the first aspect, in some implementations, the neural network may be trained by the second device using the training input frame and the training reference frame as input and the training reference frame as output reference.
[0016] The training input frame is a first image without moiré patterns taken by a third device and a fused image of the first moiré pattern image, the training reference frame is an image obtained by blurring the first image, and the training base frame is the first image;
[0017] Alternatively, the training input frame is an image with moiré obtained by photographing the first image displayed on the digital screen by a third device in a focused state, the training reference frame is an image without moiré obtained by photographing the first image displayed on the digital screen by a second device in a defocused state, and the training base frame is the first image.
[0018] Among the data used to train the neural network, the input training input frame, the training reference frame, and the training reference frame used as the benchmark do not have image brightness and color deviations. Only the moiré information is inconsistent. At the same time, the high-frequency information of the image (such as image details) does not need to be repaired through the network. Therefore, the trained neural network can better judge and remove the moiré information, and retain the image texture, color, brightness and other details.
[0019] In combination with the previous embodiment, in some embodiments, the first moiré image is obtained by comparing the second image and the third image, the second image is an image with moiré taken by the third device for a digital screen with white screen content, and the third image is an image without moiré taken by the third device in a defocused state for a digital screen with white screen content.
[0020] Through the above implementation, since the digital screen with white content will not cover the color information of the moiré, the moiré image can be easily extracted from the two images.
[0021] In other implementations, the first moiré image may also be constructed by the electronic device itself, which is not limited here.
[0022] In combination with the first aspect, in some embodiments, the method can be applied to shooting scenes, such as taking photos, shooting animated pictures, or shooting videos. Specifically, before the electronic device collects input frames and reference frames, it also includes: the electronic device receives a user operation for shooting; after the electronic device obtains an output frame without moiré, the method also includes: the electronic device stores the output frame. In this way, implementing the method provided by the present application allows users to obtain high-quality pictures, animated pictures, or videos without moiré when shooting.
[0023] In combination with the first aspect, in some embodiments, the method can be applied to a preview scenario. Specifically, after the electronic device starts a camera application, the method further includes: the electronic device displays a first user interface, and a preview frame is displayed in the first user interface; after the electronic device obtains an output frame without moiré, the method further includes: the electronic device displays the output frame in the preview frame. In this way, the user can also see a high-quality image without moiré during the preview process, which can improve the user experience.
[0024] In combination with the first aspect, in some embodiments, before the electronic device collects the input frame and the reference frame, the method further includes: the electronic device displays a first user interface, the first user interface includes a first control; and the electronic device receives a user operation on the first control. This is equivalent to the electronic device turning on a moiré removal mode when triggered by the user.
[0025] In combination with the first aspect, in some embodiments, before the electronic device captures the input frame and the reference frame, the electronic device further includes: recognizing that the image captured by the first camera contains a digital screen or contains moiré. This is equivalent to the electronic device actively turning on the moiré removal mode when recognizing that the captured image contains a digital screen or moiré, without user operation.
[0026] In combination with the first aspect, in some embodiments, the second camera is the same as the first camera, and there is an interval between the acquisition time of the reference frame and the input frame. The embodiment of the present application does not limit the time interval. Equivalently, the electronic device can use the same camera to acquire input frames and reference frames at different time nodes.
[0027] In combination with the first aspect, in some implementations, the second camera is different from the first camera, which means that the electronic device can use different cameras to collect input frames and reference frames respectively, and different cameras can work at the same time, thereby improving the efficiency of removing moiré patterns.
[0028] In combination with the first aspect, in some embodiments, the first camera is a rear camera of the electronic device, and the second camera is a wide-angle camera of the electronic device.
[0029] In conjunction with the first aspect, in some embodiments, the number of reference frames may include multiple frames. When the number of reference frames is multiple, the position and size of the moiré pattern in the input frame can be more accurately known through comparison compared with one reference frame, thereby removing the moiré pattern more accurately.
[0030] The methods for obtaining multiple reference frames may include the following:
[0031] 1. The multiple reference frames may include images captured by different cameras. For example, in addition to the images captured by the second camera, the multiple reference frames may also include images captured by a third camera, where the third camera is different from the second camera. The third camera may be the same as or different from the first camera.
[0032] In this way, the electronic device can use multiple cameras to collect multiple reference frames. Multiple reference frames from different perspectives can better remove moiré patterns in the input frame and obtain output frames without moiré patterns.
[0033] 2. The multiple reference frames may include defocused images and in-focus images. For example, in addition to the images captured by the second camera, the multiple reference frames may also include images captured by the electronic device in an in-focus state. The in-focus image may be captured by any camera of the electronic device, such as the second camera, the third camera, or the first camera.
[0034] 3. Multiple reference frames may also be composed of defocused images. For example, multiple reference frames may include defocused images captured by the second camera in a defocused state, and may also include defocused images captured by other cameras (such as the third camera) in a defocused state.
[0035] In a second aspect, an embodiment of the application provides an electronic device, comprising: a memory, and one or more processors; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute a method executed by the electronic device in the first aspect or any one of the embodiments of the first aspect.
[0036] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on an electronic device, causes the electronic device to execute a method executed by the electronic device in the first aspect or any one of the embodiments of the first aspect.
[0037] In a fourth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a computer, it enables the computer to execute the method executed by the electronic device in the first aspect or any one of the embodiments of the first aspect.
[0038] In a fifth aspect, an embodiment of the present application provides a chip system, which includes at least one processor for implementing a method executed by an electronic device in the first aspect or any one of the embodiments of the first aspect.
[0039] By implementing the technical solution provided by the present application, when an electronic device photographs a digital screen, it can collect a defocused image, and remove the moiré pattern in the photographed image containing the digital screen based on a neural network and the defocused image. The method can accurately determine the position and size of the moiré pattern in the image, thereby removing the moiré pattern, and retaining the image's texture, color, brightness and other details, and can obtain a high-quality reconstructed image for the digital screen, that is, it can enable the electronic device to obtain a clean image without moiré pattern when photographing the digital screen. The method is highly robust and can be widely used. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1A The principle of moiré generation is shown;
[0041] Figure 1B It shows the moiré pattern produced by the same camera shooting a digital screen at different angles;
[0042] Figure 2A-2F A user interface implemented on an electronic device provided in an embodiment of the present application;
[0043] Figure 3 A flow chart of a method for removing moiré provided in an embodiment of the present application;
[0044] Figure 4A Different moiré patterns captured by different cameras of electronic devices;
[0045] Figure 4B The images with moiré and the images without moiré are respectively captured by different cameras of the electronic device;
[0046] Figure 5A The moiré patterns captured by the focus motor of the electronic device's camera at different positions;
[0047] Figure 5B A specific example process is shown;
[0048] Figure 6 The processing logic for removing moiré provided in this application;
[0049] Fig. 7A and Figure 7B Comparison diagram of two sets of input frames, registration results and output frames;
[0050] Figure 8 A hardware structure block diagram of an electronic device provided in an embodiment of the present application;
[0051] Fig. 9 The software architecture of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0052] The technical solutions in the embodiments of the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0053] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0054] The term "user interface (UI)" in the following embodiments of the present application refers to a medium interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface is a source code written in a specific computer language such as Java and extensible markup language (XML). The interface source code is parsed and rendered on an electronic device, and finally presented as content that can be recognized by the user. The commonly used form of user interface is a graphical user interface (GUI), which refers to a user interface related to computer operation displayed in a graphical manner. It can be a visual interface element such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. displayed on the display screen of an electronic device.
[0055] The following embodiments of the present application provide a method for removing moiré patterns, which can be applied to the process of photographing a digital screen, for example, can be used to remove moiré patterns in preview images, photographed photos, photographed animated images, and photographed videos.
[0056] The digital screen here refers to a display screen including a display panel, such as a computer display screen, a mobile phone screen, a flat panel display screen, an electronic billboard, a traffic sign, etc. The display panel can be a liquid crystal display (LCD). The display panel can also be made of 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, quantum dot light-emitting diodes (QLED), etc.
[0057] In the method for removing moiré provided in the present application, the electronic device can capture two or more images of the same digital screen through one or more cameras, and use the two or more images for comparison to remove the moiré in the image.
[0058] Through this method, two or more frames of images are used for comparison, and the position and size of the moiré in the image that needs to be removed can be accurately determined, thereby removing the moiré and retaining the image's texture, color, brightness and other details, so as to obtain a high-quality reconstructed image. This method is highly robust and can be widely used.
[0059] Below, taking the removal of moiré patterns in digital screen photos taken by an electronic device as an example, the method for removing moiré patterns provided in an embodiment of the present application is described in detail.
[0060] Figure 2A-2F A set of user interfaces implemented on the electronic device 100 provided by the present application is exemplarily shown.
[0061] Figure 2A The user interface 20 is displayed after the electronic device 100 starts the camera application.
[0062] Figure 2A The exemplary user interface 20 may be displayed after the electronic device 100 detects a user operation (such as a click operation, a touch operation, etc.) on the camera application icon on the desktop, or may be triggered to display by other user operations to start the camera application. The user interface 20 may be a user interface of the default shooting mode of the camera application, which can be used by the user to take pictures through the default main camera.
[0063] like Figure 2AAs shown, the user interface 20 may include: an area 201, a shooting mode list 202, a control 203, a control 204, a control 205, and an option 206 for removing a moiré pattern.
[0064] The area 201 may be referred to as a preview frame 201 or a view frame 201. The preview frame 201 may be used to display an image captured in real time by a camera of the electronic device 100. The electronic device 100 may refresh the display content therein in real time so that the user can preview the image currently captured by the camera.
[0065] For example, Figure 2A As shown, the preview frame 201 displays an image of a digital screen captured by the electronic device 100. Due to the beat principle, the image in the preview frame 201 contains moiré patterns.
[0066] Option 206 of the moiré removal mode can be used to monitor the user operation of starting or shutting down the moiré removal mode. After the electronic device 100 monitors the operation acting on option 206, the moiré removal mode can be started or shut down. If the moiré removal mode is started, when the electronic device 100 subsequently shoots a digital screen, if moiré appears, the moiré in the image will be removed.
[0067] like Figure 2A As shown, after receiving the operation on option 206, the electronic device 100 starts the moiré removal mode and adjusts the background of option 206 to Figure 2B The black color in the figure indicates that the electronic device 100 has started the moiré removal mode.
[0068] One or more shooting mode options may be displayed in the shooting mode list 202. The one or more shooting options may include: a photo shooting mode option, a video recording mode option, a portrait mode option, a panoramic mode option, and more options. The one or more shooting options may be displayed as text information on the interface, such as "photo shooting", "video recording", "portrait", "panoramic", and "more". Not limited to this, the one or more shooting options may also be displayed as icons or other forms of interactive elements (IE) on the interface.
[0069] Control 203 can be used to monitor user operations that trigger shooting (taking pictures or recording videos). The electronic device can detect user operations acting on control 203 (such as click operations on control 203). In response to the operation, the electronic device 100 can obtain two or more frames of images captured by the camera and remove the moiré patterns therein, thereby generating pictures in the gallery. When the user switches to the video recording mode, control 203 can be changed to a corresponding video recording control, and the electronic device can detect user operations acting on the video recording control. In response to the operation, the electronic device 100 can obtain two or more frames of images captured by the camera and remove the moiré patterns in the multiple frames of images, thereby generating videos in the gallery. Here, the camera that captures the image can be one or more. For the specific operation of the electronic device 100 to remove the moiré patterns in the image, please refer to the detailed description of the subsequent method embodiments.
[0070] That is to say, the user can click the control 203 or the video control to trigger shooting. Among them, the control 203 or the video control can be a button or other forms of controls. In this application, the control 203 can be called a photo control. The photo control and the video control can be collectively referred to as a shooting control.
[0071] The electronic device 100 may also display a thumbnail of the saved image in the control 204 . The image may be generated by the electronic device 100 after the moiré removal mode is turned on, or may be generated without turning on the moiré removal mode.
[0072] The control 205 can be used to monitor the user operation that triggers the flipping of the camera. The electronic device 100 can detect the user operation acting on the control 205 (such as a click operation on the control 205), and in response to the operation, the electronic device 100 can flip the camera, for example, switching the rear camera to the front camera.
[0073] Figure 2C Another user interface 21 is displayed after the electronic device 100 starts the camera application.
[0074] Figure 2C and Figure 2A The difference is that the user interface 21 does not include the option 206 for removing the moiré pattern.
[0075] like Figure 2D As shown, the electronic device 100 automatically turns on the moiré removal mode when it detects that a digital screen is being photographed, or when it detects that the photographed image contains moiré.
[0076] After the electronic device 100 turns on the moiré removal mode, Figure 2DThe prompt information is output to prompt the user that the moiré removal mode has been entered. The prompt information may be, for example, text, icon, voice, etc. Figure 2D The text 207 in is not limited here.
[0077] Of course, in some embodiments, the electronic device 100 may not only provide the option 206 of the moiré removal mode in the user interface, but also automatically enable the moiré removal mode when conditions are met.
[0078] like Figure 2B or Figure 2D As shown, after the electronic device 100 receives a user operation acting on the control 203, it can obtain two or more frames of images captured by the camera and remove the moiré patterns therein to obtain a frame of image that does not contain the moiré patterns, and display the image that does not contain the moiré patterns in the control 204 in the lower left corner.
[0079] refer to Figure 2E , a frame of image obtained by the electronic device 100 and not containing moiré patterns is displayed in the control 204 .
[0080] like Figure 2E and Figure 2F As shown, after the electronic device 100 receives the user operation acting on the control 204, it can also display the frame image without moiré in the user interface 22 of the gallery application. In this interface, the user can also perform more operations on the image, such as sharing, editing, etc.
[0081] Not limited to the above Figure 2A-2E The exemplary scenario of removing moiré during photo-taking is shown, and the method provided in the present application can also be applied to other scenarios, such as removing moiré in a preview image during preview, removing moiré in a moving picture when shooting a moving picture, removing moiré in a video when shooting a video, and so on.
[0082] The following is an introduction to the method for removing moiré provided in an embodiment of the present application.
[0083] refer to Figure 3 , Figure 3 A schematic flow chart of a method for removing moiré patterns provided in an embodiment of the present application. Figure 3 The following description will be made by taking the removal of moiré patterns from a photograph of a digital screen as an example.
[0084] like Figure 3 As shown, the method may include the following steps:
[0085] S101, the electronic device 100 starts a camera application and displays a first user interface, wherein the first user interface displays a preview frame, and the preview frame displays an image captured by a first camera.
[0086] The electronic device 100 may start the camera application after detecting a user operation for starting the camera application. For example, the electronic device 100 may receive a user operation (such as a click operation, a touch operation, etc.) on the icon of the camera application on the desktop, or receive other types of operations (such as voice commands), or the electronic device 100 may receive an operation to pull up the camera application or enable the camera in other applications, and then start the camera application.
[0087] The electronic device 100 may be equipped with multiple cameras, such as a front camera and a rear camera. The number of the front camera and the rear camera may be multiple. The types of cameras in the electronic device 100 may include but are not limited to a main camera, a wide-angle camera, an ultra-wide-angle camera, a telephoto camera, etc.
[0088] After the electronic device 100 starts the camera application, it can start the first camera and use the first camera to capture images at a certain frame rate. The frame rate can be the maximum frame rate of the first camera, or a value set by the user that is less than the maximum frame rate. The maximum frame rate of the camera is determined by the performance of the photosensitive device in the camera, specifically the number of images that can be captured within 1 second. The focus motor of the first camera can automatically focus and capture images in a focused state.
[0089] The images captured by the first camera when the electronic device 100 is activated can be stored in the cache, and the earliest image captured by the first camera can be discarded after a certain number of images are stored.
[0090] The first camera may be a default main camera or another camera selected by the user, such as a wide-angle camera.
[0091] The image captured by the first camera in real time and displayed in the preview box in the first user interface is refreshed in real time. When the user moves the electronic device 100 or changes the posture of the electronic device 100, changes the camera used, or the object currently photographed by the first camera, such as the digital screen being photographed, changes the displayed content, etc., the image captured by the first camera will change in real time, and the preview box will display the changed image in real time.
[0092] In addition, the image captured by the first camera in real time and displayed in the preview frame can also be obtained after processing on the original image captured by the first camera. For example, the electronic device 100 can perform anti-shake processing on the original image captured by the first camera, and send it to the display screen to display it in the preview frame. For another example, if the user adjusts the focal length of the first camera, the electronic device 100 will crop the original image captured by the first camera, and send the cropped result to the display screen to display it in the preview frame. For another example, the user can select the current shooting mode, and the electronic device 100 can perform different processing on the original image captured by the first camera in different modes, such as blurring the background area in portrait mode, and then send the cropped result to the display screen to display it in the preview frame.
[0093] For example, reference Figure 2A The first user interface may be, for example, the user interface 20, and the preview box in the first user interface may be, for example, Figure 2A The preview box 201 in the image processing unit 100 may be a preview box 201 in which the content displayed may be an image captured by the first camera.
[0094] Again, for example, refer to Figure 2C The first user interface may be, for example, user interface 21, and the preview box in the first user interface may be, for example, Figure 2C The preview box 201 in the image processing unit 100 may be a preview box 201 in which the content displayed may be an image captured by the first camera.
[0095] It should be noted that when the camera shoots a digital screen in the quasi-focus state, due to the principle of differential beats, there is a high probability of capturing an image with moiré patterns, but there is also a certain probability of capturing an image without moiré patterns. When the camera shoots a digital screen in the defocused state, the captured image must not include moiré patterns, that is, the defocused image must not have moiré patterns. Among them, the quasi-focus state refers to the state in which the camera adjusts the object distance and the position of the object distance through the focus motor to make the image of the object clear. The defocus state refers to the state in which the image of the object is not clear. Quasi-focus can also be called focus or focusing.
[0096] S102, the electronic device 100 turns on a moiré removal mode.
[0097] The moiré removal mode supports the electronic device 100 to collect two or more frames of images of the same digital screen through one or more cameras, and use the two or more frames of images for comparison to remove the moiré in the image. Equivalently, in the scenario of removing the moiré in the photograph of the digital screen, the moiré removal mode supports the electronic device 100 to perform the subsequent steps of S102. Of course, in the scenario of shooting animated pictures, videos, and previews, the moiré removal mode supports the electronic device 100 to remove the moiré in the animated pictures, videos, or preview images of the digital screen captured by the camera.
[0098] The moiré removal mode is just a term used in the embodiment of the present application, and its meaning has been recorded in the embodiment, and its name does not constitute any limitation to the embodiment. For example, the moiré removal mode can also be called other terms, such as a clear mode, a clear mode, etc.
[0099] In some embodiments, the electronic device 100 may receive a user operation for turning on the moiré removal mode, and turn on the moiré removal mode in response to the user operation. The present application embodiment does not limit the form of the user operation, for example, it may be a click operation or a long press operation on the first user interface, or it may be an air gesture, a voice command, etc. For example, refer to Figure 2A The user operation for enabling the moiré removal mode may include a user operation (such as a click operation, a touch operation, a long press operation, etc.) acting on the moiré removal mode option 206 in the user interface 20. The user operation for enabling the moiré removal mode may include a user operation acting on a first control in the first user interface. An example of the first control may be Figure 2A Option 206 for removing moiré patterns.
[0100] In other embodiments, after the electronic device 100 starts the camera application, the moiré removal mode may be enabled by default. In this way, if the image captured by the electronic device 100 subsequently contains moiré, the moiré removal mode may be used to remove the moiré therein, thereby obtaining a clean image. Among them, the electronic device 100 may use a moiré detection algorithm to identify whether the captured image contains moiré. There may be multiple moiré detection algorithms, which are not limited here.
[0101] In some other embodiments, the electronic device 100 may analyze the image in the preview frame of the first user interface, that is, analyze the image captured by the first camera, and when the image contains a digital screen or when the image contains moiré, the moiré removal mode is turned on. Figure 2C and Figure 2DWhen the electronic device 100 detects that the image in the preview frame includes a digital screen, the moiré removal mode is automatically turned on. When the image captured by the first camera includes a digital screen, there is a high probability that moiré will appear due to the beat principle, so turning on the moiré removal mode can facilitate the subsequent acquisition of a clean image without moiré.
[0102] S103, when a digital screen is displayed in the preview frame, the electronic device 100 receives a user operation for taking a photo.
[0103] Specifically, after the electronic device 100 turns on the moiré removal mode, the user can change the content in the preview box by adjusting the position of the electronic device 100, adjusting the camera in use, adjusting the focus of the camera, etc. When the content in the preview box is adjusted to the user's satisfaction, the user can input a user operation for taking a photo to take a photo. In an embodiment of the present application, when a digital screen is displayed in the preview box, the user can input a user operation for taking a photo to take a photo containing the digital screen.
[0104] There are many forms of user operations for taking photos, which are not limited here. For example, the user operation can be as follows: Figure 2B or Figure 2D The user operation acting on the control 203 (such as a click operation, a touch operation, etc.) can also be an air gesture, a facial expression, a voice command, etc.
[0105] S104, the electronic device 100 acquires two or more frames of images.
[0106] In the embodiment of the present application, the two or more image frames acquired by the electronic device 100 include: an input frame and a reference frame, wherein the number of the input frame is one, and the number of the reference frame is one or more.
[0107] Taking the electronic device 100 obtaining an input frame and a reference frame as an example, the following describes how the electronic device 100 obtains the input frame and the reference frame:
[0108] Input Frame
[0109] The input frame may be a frame of image most recently captured by the first camera before or after the electronic device 100 receives a user operation for taking a photo in S103 .
[0110] Specifically, the electronic device 100 continuously collects images at a certain frequency in a focused state through the first camera after S101, which is equivalent to collecting a set of image sequences through the first camera. After receiving a user operation for taking a photo in S103, the image collected most recently since the user operation can be determined as the input frame. The image can be collected at the time indicated by the user operation input, or before or after the user operation input, which is not limited here.
[0111] Since the electronic device 100 receives a user operation for taking a photo when the preview frame includes the digital screen in S103, the image content of the input frame includes the digital screen. Due to the beat principle, the input frame has a high probability of having moiré.
[0112] Reference Frame
[0113] The reference frame of the embodiment of the present application can be obtained in the following ways:
[0114] 1. The reference frame includes a frame of image captured by the electronic device 100 through the second camera.
[0115] The second camera may be another camera different from the first camera. In some implementations, the number of the second camera may be one or more.
[0116] In some implementations, the second camera may be a camera that is different from the first camera in any one or more aspects such as shooting angle, field of view, focal length, etc. when the electronic device 100 is fixed in position.
[0117] For example, if the first camera is a main camera, the second camera may include a wide-angle camera with a different angle and a larger field of view. For another example, if the first camera is a main camera, the second camera may include a telephoto camera. For another example, if the first camera is a telephoto camera, the second camera may include a wide-angle camera.
[0118] The corresponding relationship between the first camera and the second camera may be pre-stored in the electronic device 100 .
[0119] In a specific implementation, the electronic device 100 acquires a reference frame through the second camera in the following manner:
[0120] (1) After receiving the user operation for taking a photo in S103, the electronic device 100 starts the second camera, obtains a frame of in-focus image through automatic focusing, and uses the frame of in-focus image as a reference frame.
[0121] Here, there may be multiple automatic focusing methods used by the electronic device 100, which are not limited here. The electronic device 100 may adjust the position of the focus motor in the second camera to achieve automatic focusing.
[0122] The in-focus image is a frame of image with clear image. Since the second camera and the first camera are both located in the electronic device 100, even if the two cameras are located in different positions, fields of view, etc., and the framing of the two cameras is different, the framing will not be completely different. Therefore, the image content of the in-focus image taken by the second camera also includes the digital screen in the input frame, and there is a high probability that moiré patterns exist. In addition, since the second camera and the first camera are different from the first camera in any one or more aspects such as shooting angle, field of view, focal length, etc., the moiré patterns in the in-focus image taken by the second camera are different from the moiré patterns in the input frame.
[0123] For example, reference Figure 4A , Figure 4A Two sets of images of the same object captured by the main camera and wide-angle camera of the electronic device 100 are shown. The left side and the right side are respectively quasi-focus images with moiré captured by the main camera and wide-angle camera of the electronic device 100 at the same position. By comparing the two images, it can be seen that due to differences in any one or more aspects such as shooting angle, field of view, focal length, etc., the moiré generated when the main camera and wide-angle camera capture the digital screen are different.
[0124] Of course, since moiré is affected by the angle, position, focus, focal length, etc. of the shooting camera, the in-focus image captured by the electronic device 100 when the second camera is activated may also have no moiré. Figure 4B , Figure 4B Two sets of images of the same object taken by the main camera and wide-angle camera of the electronic device 100 are shown, wherein the left side is a focus image with moiré taken by the main camera, and the right side is an image without moiré taken by the wide-angle camera when the electronic device 100 is in the same position.
[0125] Regardless of whether the in-focus image captured by the second camera has moiré patterns, there are some differences between the in-focus image and the input frame, and these differences can be used to correct the position and size of the moiré patterns in the input frame to obtain the accurate position and size in the input frame.
[0126] (2) After receiving the user operation for taking a photo in S103, the electronic device 100 starts the second camera, captures one or more frames of images through the second camera, and uses a frame of defocused image without moiré as a reference frame.
[0127] When the focus motor of the camera in the electronic device 100 is in a different position, different moiré patterns may be captured, or images without moiré patterns may be captured. When the focus motor of the camera is in a defocused state, the image captured by the camera must be free of moiré patterns. Figure 5A , Figure 5A The diagram exemplifies images with different moiré patterns obtained when the same camera captures a pure white image when the focus motor is located at different positions.
[0128] The manner in which any camera of the electronic device 100 acquires an image in a defocused state may include any of the following:
[0129] A. The electronic device 100 can capture an image through a camera and analyze whether the image contains moiré patterns. If the image contains moiré patterns, the position of the focus motor in the camera is continuously adjusted until the image captured by the camera does not contain moiré patterns. At this time, the camera is in a defocused state. In this way, by continuously adjusting the position of the focus motor in the camera for multiple times, a frame of defocused image without moiré patterns can be finally obtained.
[0130] In some embodiments, based on method A, the electronic device 100 may also put the camera in a defocused state, and collect multiple frames of images without moiré through the camera, analyze the multiple frames of images, and select a frame with the lowest blur as a reference frame, or any frame may be selected as a reference frame. An image captured in a defocused state may be called a defocused image, which is a blurred image.
[0131] B. The electronic device 100 determines the position where the focus motor of the camera needs to be moved according to the distance between the camera and the digital screen, and the position is the position where the camera can be in a defocused state. Then, the electronic device 100 pushes the focus motor to the position and collects a reference defocused image through the camera. The electronic device 100 can obtain the distance between the camera and the digital screen through infrared sensing, image analysis and other technologies, which are not limited here.
[0132] Therefore, the second camera can capture a defocused image in a defocused state through any one of the above methods A or B, and the defocused image can be used as a reference frame.
[0133] The difference between the defocused image without moiré captured by the second camera and the input frame can reflect the position and size of the moiré in the input frame.
[0134] Through method 1, the image captured by the second camera is used as a reference frame. In this process, the image captured by the second camera can be the result of the internal operation of the electronic device 100, and there is no need to present the image captured by the second camera to the user. In other words, although the electronic device 100 starts the second camera, it does not need to display the preview image of the picture captured by the second camera in the user interface. The electronic device 100 can continue to display the image captured by the first camera in the preview frame of the first user interface.
[0135] 2. The reference frame includes other frame images that are different from the input frame and are captured by the electronic device 100 through the first camera.
[0136] After S101, the electronic device 100 continuously collects images at a certain frequency through the first camera, which is equivalent to collecting a set of image sequences through the first camera. The electronic device 100 can use another frame of image collected at a certain interval of time or number of frames before or after the input frame as a reference frame. The interval time or number of frames is not limited, for example, it can be an interval of 2 frames, an interval of 0.1 seconds, etc.
[0137] In this way, the reference frame and the input frame are both acquired through the first camera, and the only difference is the acquisition time. At different time points, due to some changes in the position of the electronic device 100, the position of the camera, etc., the content of the reference frame and the content of the input frame are different, but these changes will not be so great that the framing is completely different, so the image content of the reference frame also includes the digital screen in the input frame.
[0138] In a specific implementation, the reference frames collected by the first camera include the following two types:
[0139] (1) The reference frame is a focus image captured by the first camera in a focus state.
[0140] In a specific implementation, the electronic device 100 can continuously capture images in a focused state after starting the first camera, and capture images different from the input frame at a certain time interval as reference frames.
[0141] Since it is a near-focus image, the reference frame obtained by method (1) has a high probability of having moiré patterns. In addition, due to the interval between the reference frame and the input frame, the moiré patterns in the reference frame obtained by method (1) vary to a certain extent compared with the moiré patterns in the input frame, that is, the moiré patterns of the reference frame and the input frame are different.
[0142] (2) The reference frame is a defocused image captured by the first camera in a defocused state.
[0143] The way in which the first camera captures images in a defocused state can be referred to in the description of method (2) of method 1 above, regarding how the camera of the electronic device 100 acquires images in a defocused state, that is, refer to the two defocus methods A and B above, which will not be repeated here.
[0144] Not limited to one reference frame, in some other embodiments, the number of reference frames may also include multiple frames. Each reference frame may be obtained in any of the above-described ways. For example, the reference frame may include a frame of image captured by the first camera, and may also include a defocused image captured by the second camera. For another example, the reference frame may include a focused image and a defocused image captured by the second camera. For another example, the reference frame may include a defocused image and two focused images captured by the second camera.
[0145] In some other embodiments, when the reference frame includes multiple images, it may include images captured by the second camera and the third camera respectively. The second camera and the third camera are different. The images captured by the second camera and the third camera may include images captured in any of the above-mentioned ways. For example, the reference frame may include a defocused image captured by the second camera, and may also include a defocused image or an in-focus image captured by the third camera.
[0146] For example, reference Figure 5B , Figure 5B A specific example of S101-S104 is exemplarily shown. As shown in the figure, after the user chooses to turn on the moiré removal mode or the electronic device 100 detects that a digital screen is being photographed, binocular photography can be turned on. Binocular photography here refers to shooting with two cameras or shooting multiple frames with one camera. Then, the main camera can shoot a single frame image or multiple frames, and the wide angle can shoot an in-focus image or a defocused image. The images taken by the main camera and / or the wide angle include input frames and reference frames. The detailed definitions of the input frames and reference frames can refer to the relevant description above.
[0147] From the above introduction to the input frame and the reference frame, it can be seen that the input frame and the reference frame are both shot based on the same scene, and their image contents both contain the same digital screen. Therefore, the reference frame can be used to determine the position and size of the moiré pattern in the input frame.
[0148] S105 , the electronic device 100 removes the moiré patterns in the input frame using the reference frame to obtain an output frame without the moiré patterns.
[0149] In the embodiment of the present application, the specific implementation of S105 may include:
[0150] The electronic device 100 uses a neural network to execute S105. Specifically, the electronic device 100 inputs the input frame and the reference frame into the neural network, and the output result of the neural network is an output frame without moiré.
[0151] refer to Figure 6 , Figure 6 The electronic device 100 exemplarily shows a processing logic for removing moiré patterns in an input frame by using a neural network.
[0152] like Figure 6 As shown, the processing logic may include the following steps:
[0153] 1. First, preprocess the input frame and reference frame.
[0154] Preprocessing may include, but is not limited to, any one or more of registration and mapping.
[0155] Registration can also be called alignment. Registration in preprocessing means that based on the input frame, the electronic device 100 aligns the reference frame based on the same object in the input frame so that the same object in the reference frame and the input frame are in the same position.
[0156] Mapping includes mapping of brightness and color. Specifically, mapping in preprocessing means that the electronic device 100 can also map the brightness and color of the reference frame based on the input frame to eliminate the deviation of the brightness and color of the reference frame compared to the input frame. In this way, the brightness and color of the reference frame and the input frame can be guaranteed to be consistent, thereby ensuring the consistency of the brightness and color of the subsequent output frame and the input frame.
[0157] 2. Then input the input frame and reference frame obtained in step 1 into the neural network and output a result image.
[0158] 3. Post-process the output result image to obtain the output frame.
[0159] Post-processing may include, but is not limited to, mapping.
[0160] Mapping in post-processing means that the electronic device 100 maps the brightness and color of the result image based on the input frame to eliminate the deviation of the brightness and color of the result image compared to the input frame, so as to make the brightness and color of the output frame consistent with the input frame.
[0161] pass Figure 6 The processing logic shown in the figure can obtain the same information of the overall brightness, color, etc. of the output frame as that of the input frame. This means that the method provided by the present application can remove the moiré pattern in the input frame without changing the overall brightness, color, texture, etc. of the input frame, and obtain a clean output frame.
[0162] Figure 6In the processing logic shown, the preprocessing of step 1 and the postprocessing of step 3 are both optional steps. That is, the electronic device 100 may also directly input the input frame and the reference frame into the neural network to obtain the output frame. Alternatively, the electronic device 100 may also perform preprocessing and then input the preprocessing result into the neural network to obtain the output frame. Alternatively, the electronic device 100 may also directly input the input frame and the reference frame into the neural network and then perform postprocessing on the result image to obtain the output frame.
[0163] In some embodiments, the preprocessing of step 1 or the postprocessing of step 3 may also be integrated into the neural network. That is, the neural network may integrate the functions of preprocessing and / or postprocessing. In this way, the electronic device 100 directly inputs the input frame and the reference frame into the neural network, and the result image output by the neural network is already an output frame that is consistent with the brightness and color of the input frame.
[0164] Above Figure 6 The neural network in the processing logic shown can be pre-stored in the electronic device 100. The training process of the neural network can be performed by other devices different from the electronic device 100. After the other devices have trained the neural network, they can send the neural network to the electronic device 100 so that the electronic device 100 can obtain an output frame without moiré. Other devices used to train the neural network may include, for example, computers and other devices.
[0165] Since there are multiple reference frames as described above, different neural networks can be trained for different reference frames, so that the neural network corresponding to the current reference frame can be selected in S105 to obtain the output frame.
[0166] Taking the case where the number of reference frames is 1 as an example, the process of training the neural network is described below.
[0167] The process of training a neural network may include the following steps:
[0168] Step 1. Construct the dataset.
[0169] The dataset includes multiple groups of data. One group of data includes three frames of images: training input frame, training reference frame, and training benchmark frame.
[0170] There are two ways to construct a set of data:
[0171] Method 1. Synthesis scheme. The synthesis scheme can be divided into synthesis scheme 1 and synthesis scheme 2.
[0172] Synthesis Scheme 1 may include the following steps:
[0173] Step 1-1, obtain the moiré image 0.
[0174] In some embodiments, an electronic device including a camera may be used to shoot a digital screen with white screen content. When shooting, most shooting parameters are fixed, and a moiré-patterned image and a moiré-free image in a defocused state are obtained by manual focusing. Then, the moiré-patterned image and the moiré-free image are compared, and the two images are subtracted to obtain a moiré-patterned image 0. Here, the moiré-patterned image and the moiré-free image used to obtain the moiré-patterned image 0 may be referred to as the second image and the third image, respectively. Since the digital screen with white content does not cover the color information of the moiré, the moiré-patterned image can be easily extracted from the two images.
[0175] In some other implementations, the moiré image 0 may be constructed or generated by an electronic device.
[0176] The moiré image 0 may also be referred to as a first moiré image.
[0177] Step 1-2, select a clear image 1 without moiré, merge the moiré image 0 into image 1, and obtain an image 2 with moiré.
[0178] Step 1-3, blur image 1 to obtain a blurred image 3 without moiré patterns.
[0179] Steps 1-4, construct a set of data, in which the training input frame, the training reference frame, and the training base frame are respectively: image 2 with moiré, image 3 without moiré, and clear image 1 without moiré.
[0180] Synthesis Scheme 2 may include the following steps:
[0181] Step 2-1, obtaining moiré image 0 and moiré image 0'.
[0182] The moiré image 0 and the moiré image 0' are different, and their acquisition methods can refer to step 1-1 in the synthesis scheme 1.
[0183] Step 2-2, select a clear image 1 without moiré patterns, fuse the moiré pattern image 0 into the image 1, and obtain an image 2 with moiré patterns.
[0184] Step 2-3, the moiré image 0' is merged into the image 1 to obtain an image 3 with moiré.
[0185] Step 2-4, construct a set of data, wherein the training input frame, the training reference frame, and the training base frame are respectively: image 2 with moiré, image 3 with moiré, and clear image 1 without moiré.
[0186] In the above two synthesis schemes, the training input frames and training reference frames in a set of data are obtained from the training benchmark frames, so the training input frames, training reference frames and training benchmark frames in the set of data have no deviation in color or brightness.
[0187] Method 2: Real-time shooting plan. The real-time shooting plan can be divided into real-time shooting plan 1 and real-time shooting plan 2.
[0188] The actual shooting scheme 1 may include the following steps:
[0189] Step 3-1, select a clear image 1 without moiré.
[0190] Step 3-2, displaying image 1 on a digital screen, photographing the digital screen using an electronic device including a camera, obtaining an image 2 with moiré in a focused state, and obtaining an image 3 without moiré in a defocused state.
[0191] In some implementations, the electronic device may also perform brightness and color mapping on image 2 based on image 1 to eliminate the brightness and color deviation of image 2 compared to image 1. Similarly, brightness and color mapping may also be performed on image 3 based on image 1. This ensures that there is no brightness and color deviation between the input image and the output image in a set of data.
[0192] Step 3-3, construct a set of data, wherein the training input frame, the training reference frame, and the training base frame are respectively: image 2 with moiré, image 3 without moiré, and clear image 1 without moiré.
[0193] The actual shooting scheme 2 may include the following steps:
[0194] Step 4-1, select a clear image 1 without moiré.
[0195] Step 4-2, displaying image 1 on a digital screen, photographing the digital screen using an electronic device including a camera, and obtaining an image 2 with moiré patterns and an image 3 having moiré patterns different from image 2 in a focused state.
[0196] In some implementations, the electronic device may also perform brightness and color mapping on image 2 based on image 1 to eliminate the brightness and color deviation of image 2 compared to image 1. Similarly, brightness and color mapping may also be performed on image 3 based on image 1. This ensures that there is no brightness and color deviation between the input image and the output image in a set of data.
[0197] Step 4-3, construct a set of data, wherein the training input frame, the training reference frame, and the training base frame are respectively: image 2 with moiré, image 3 with moiré, and clear image 1 without moiré.
[0198] Any set of data in the data set used to train a neural network can be constructed using the above method.
[0199] The clear image 1 without moiré mentioned in the above step 1 may also be referred to as a first image.
[0200] The electronic device including a camera used to capture the digital screen to obtain an image in the above step 1 may be referred to as a third device.
[0201] Step 2. Train the neural network.
[0202] The training input frame and training reference frame in a set of data are used as input images and input into the initial neural network, which will output the result image; then, the result image is compared with the reference frame in the set of data, and the loss function of the neural network is corrected to achieve the purpose of making the result image output by the neural network close to the reference frame. Through multiple sets of data in the data set, the neural network is continuously trained and the various parameters in the neural network are adjusted, and finally a trained neural network can be obtained.
[0203] The electronic device used for training the neural network in the above step 2 can be referred to as a second device.
[0204] The electronic device used to capture images in the above training process may be another device different from the electronic device 100. In the above training process, step 1 and step 2 may be performed by different devices respectively, which is not limited here.
[0205] If there are multiple reference frames, each set of data in the corresponding data set should also construct multiple training reference frames, and the construction method is similar to the construction method of one training reference frame mentioned above, which will not be repeated here.
[0206] In an embodiment of the present application, different neural networks are trained for different reference frames, so that a suitable neural network is selected in a targeted manner to obtain a clean output frame without moiré, which can better remove the moiré in the image and provide users with a better user experience.
[0207] The neural network trained using the data sets constructed in different ways can be applied to scenarios with different reference frames.
[0208] For example, if the reference frame obtained by the electronic device 100 in S104 is a defocused image, the output frame may be obtained using a neural network trained with a data set constructed by the above-mentioned synthesis scheme 1 or real shooting scheme 1.
[0209] For another example, if the reference frame obtained by the electronic device 100 in S104 is an in-focus image, the output frame may be obtained using a neural network trained with a data set constructed by the above-mentioned synthesis scheme 2 or real-shooting scheme 2.
[0210] For another example, if the reference frames collected by the electronic device 100 in S104 include multiple images, multiple training reference frames can be constructed from a set of data in the data set, and then a neural network can be trained based on the data set.
[0211] In the above-mentioned neural network training process, since there is no brightness and color deviation of the input image and the output image in the constructed data set, only the moiré information is inconsistent, and the high-frequency information of the image (such as image details) does not need to be repaired through the network, the trained neural network can better judge and remove the moiré information, and retain the image texture, color, brightness and other details.
[0212] refer to Fig. 7A , Fig. 7A A set of comparison diagrams of an input frame, a registered reference frame, and an output frame are exemplarily shown. Fig. 7A The input frame in is an image with moiré taken by the main camera, and the reference frame is a defocused image without moiré taken by the wide-angle camera.
[0213] refer to Figure 7B , Figure 7B A set of comparison diagrams of an input frame, a registered reference frame, and an output frame are exemplarily shown. Figure 7B The input frame in is the image with moiré taken by the main camera, and the reference frame is the image with moiré taken by the wide-angle camera.
[0214] from Fig. 7A and Figure 7B It can be seen that the method provided in the embodiment of the present application can effectively remove the moiré patterns in the input frame, obtain a clean output frame without moiré patterns, and also retain the image's texture, color, brightness and other details.
[0215] S106, the electronic device 100 saves the output frame.
[0216] Specifically, the electronic device 100 may save the output frame obtained in S105 in a memory in a picture format.
[0217] After the electronic device 100 saves the output frame, the output frame can be viewed, edited, moved, shared, etc. Figure 2E, the output frame generated by the electronic device 100 can be displayed in the control 204. The electronic device 100 can respond to the user operation of the control 204, display the output frame in the gallery, and support the user to edit, move, share and other operations on the output frame.
[0218] Above Figure 3 The process of removing moiré patterns from a digital screen photo taken during the photo-taking process is exemplified. Figure 3 The process shown enables electronic devices to obtain clean images without moiré when photographing digital screens.
[0219] Not limited to photo-taking scenarios, the method provided in the embodiments of the present application can also be applied to more scenarios.
[0220] This method can be applied to the scene of shooting video. Specifically, after the electronic device 100 turns on the moiré removal mode, if a user operation to start shooting a video is received, the electronic device 100 can use the first camera to continuously capture multiple frames of images, each of which is an input frame, and obtain a corresponding reference frame for each frame, and use the reference frame to remove the moiré in the corresponding input frame to obtain multiple output frames without moiré during the video shooting process, until a user operation to stop shooting the video is received. Among them, the method for obtaining the corresponding reference frame for each frame of the image can refer to Figure 3 In some embodiments, the electronic device 100 may also enable the moiré removal mode in the middle of shooting a video, which is not limited here. This enables the electronic device to obtain a clean video without moiré during the video shooting process, thereby improving the user experience.
[0221] This method can also be applied to the scene of shooting scene dynamic images. Specifically, after the electronic device 100 turns on the moiré removal mode, if a user operation of shooting a dynamic image is received, the electronic device 100 can use the first camera to continuously capture multiple frames of images, each of which is an input frame, and a corresponding reference frame is obtained for each frame, and the reference frame is used to remove the moiré in the corresponding input frame to obtain multiple output frames without moiré, and the multiple output frames are combined in chronological order into the final output dynamic image. This allows the electronic device to obtain clean dynamic images without moiré in the process of shooting dynamic images, thereby improving the user experience.
[0222] This method can also be applied to preview scenarios. Specifically, after the electronic device 100 starts the camera application and displays the preview frame, the first camera can be used to continuously capture multiple frames of images, each of which is an input frame, and a corresponding reference frame is obtained for each frame, and the reference frame is used to remove the moiré pattern in the corresponding input frame to obtain multiple frames of output frames without moiré patterns, and the multiple frames of images without moiré patterns are displayed in the preview frame. This allows the electronic device to obtain a clean preview image without moiré patterns during the preview process, thereby improving the user experience.
[0223] The electronic device 100 provided in an embodiment of the present application is introduced below.
[0224] The electronic device 100 is a smart terminal device, which can be of various types, and the embodiments of the present application do not limit its specific type. For example, the electronic device 100 can be a mobile phone, a camera, and can also include a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, a smart screen, a wearable device, an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a car machine, a smart headset, a game console, and can also be an Internet of Things (IOT) device or a smart home device such as a smart water heater, a smart lamp, a smart air conditioner, etc. Not limited to this, the electronic device 100 can also include a laptop computer with a touch-sensitive surface or a touch panel, a desktop computer with a touch-sensitive surface or a touch panel, and other non-portable terminal devices, etc.
[0225] refer to Figure 8 , Figure 8 The hardware structure diagram of the electronic device 100 provided in the embodiment of the present application. The device 100 may be the electronic device 100 in the above method embodiment.
[0226] like Figure 8As shown, the electronic device 100 may include: 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, etc. 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.
[0227] 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.
[0228] 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 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.
[0229] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0230] 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.
[0231] In an embodiment of the present application, the processor 110 may be used to call the camera 193 to obtain an input frame and a reference frame, and a processor such as a GPU may also be used to use the reference frame to remove moiré patterns in the input frame to obtain an output frame without moiré patterns.
[0232] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0233] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the electronic device 100.
[0234] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.
[0235] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0236] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.
[0237] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.
[0238] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0239] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.
[0240] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0241] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.
[0242] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0243] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0244] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0245] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0246] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0247] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, demodulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0248] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0249] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects 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 that execute program instructions to generate or change display information.
[0250] 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). The display panel can also be made of 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, quantum dot light emitting diodes (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0251] In the embodiment of the present application, the display screen 194 may provide various user interfaces displayed by the electronic device 100, such as a preview interface of a camera application, a photo taking interface, a video shooting interface, etc. The content displayed by the display screen 194 may include the above Figure 2A-2F The various user interfaces displayed.
[0252] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0253] The ISP is used to process the data fed back by the 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 the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise and brightness of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0254] 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.
[0255] The electronic device 100 may have multiple cameras 193, such as a front camera and a rear camera. The number of the front camera and the rear camera may be multiple. The types of the camera 193 may include but are not limited to a main camera, a wide-angle camera, an ultra-wide-angle camera, a telephoto camera, etc.
[0256] The hardware configuration and physical location of the camera 193 may be different, so the size, range, content or clarity of the images captured by different cameras may be different.
[0257] The image output size of the camera 193 can be different or the same. The image output size of the camera refers to the length and width of the image captured by the camera. The length and width of the image can be measured in pixels. The image output size of the camera can also be called image size, image size, pixel size or image resolution. Common camera output ratios may include: 4:3, 16:9 or 3:2, etc. The image output ratio refers to the approximate ratio of the number of pixels in length and width of the image captured by the camera.
[0258] Camera 193 may correspond to the same focal length or different focal lengths. The larger the focal length corresponding to the camera, the smaller the field of view (FOV) of the camera. The field of view refers to the angle range that an optical system can image.
[0259] The camera 193 can be arranged on both sides of the electronic device. The camera located on the same plane as the display screen 194 of the electronic device can be called a front camera, and the camera located on the plane where the back cover of the electronic device is located can be called a rear camera. The front camera can be used to capture the image of the photographer facing the display screen 194, and the rear camera can be used to capture the image of the subject (such as a person, a landscape, a digital screen, etc.) facing the photographer.
[0260] In some embodiments, the camera 193 can be used to collect depth data. For example, the camera 193 can have a time of flight (TOF) 3D sensing module or a structured light 3D sensing module for acquiring depth information. The camera used to collect depth data can be a front camera or a rear camera.
[0261] 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.
[0262] 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.
[0263] 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.
[0264] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
[0265] Random access memory may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, the fifth generation DDR SDRAM is generally referred to as DDR5 SDRAM), etc.; non-volatile memory may include disk storage devices and flash memory.
[0266] Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle; single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the storage unit potential level; universal flash storage (UFS), embedded multi media card (eMMC), etc. according to the storage specification.
[0267] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data.
[0268] The non-volatile memory may also store executable programs and user and application data, etc., and may be loaded into the random access memory in advance for direct reading and writing by the processor 110 .
[0269] In an embodiment of the present application, the internal memory 121 can be used to store output frames generated by the electronic device 100, such as photos, animated images, video files, etc. without moiré processed by the electronic device 100. The contents of the above photos, animated images, video files, etc. can all include digital screens.
[0270] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external non-volatile memory.
[0271] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0272] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0273] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.
[0274] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.
[0275] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.
[0276] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0277] 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.
[0278] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.
[0279] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
[0280] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover can be automatically unlocked.
[0281] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.
[0282] 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.
[0283] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.
[0284] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
[0285] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
[0286] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
[0287] The touch sensor 180K is also called a "touch control device". The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch control 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.
[0288] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180M can also be set in an earphone and combined into a bone conduction earphone. The audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180M to realize a voice function. The application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.
[0289] 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.
[0290] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0291] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0292] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0293] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The present application embodiment takes a mobile operating system with a layered architecture as an example to exemplify the software structure of the electronic device 100.
[0294] Fig. 9 It is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.
[0295] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the mobile operating system is divided into four layers, from top to bottom: application layer, program framework layer / core service layer, underlying library and runtime, and kernel layer.
[0296] The application layer can include a series of application packages.
[0297] like Fig. 9As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.
[0298] The program framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The program framework layer includes some predefined functions.
[0299] like Fig. 9 As shown, the program 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.
[0300] 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.
[0301] 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.
[0302] 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.
[0303] The phone manager is used to provide communication functions for electronic devices, such as the management of call status (including answering, hanging up, etc.).
[0304] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0305] 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.
[0306] The runtime can refer to all code libraries, frameworks, etc. required for the program to run. For example, for the C language, the runtime includes a series of function libraries required for the C program to run. For the Java language, in addition to the core library, the runtime also includes the virtual machine required for the Java program to run. The above core library may include the function functions that the Java language needs to call.
[0307] The underlying library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0308] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0309] 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.
[0310] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0311] A 2D graphics engine is a drawing engine for 2D drawings.
[0312] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0313] The following is an example of the workflow of the electronic device software and hardware in conjunction with capturing a photo scene.
[0314] When the touch sensor 180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, timestamp of the touch operation, and other information). The raw input event is stored in the kernel layer. The application framework layer obtains the raw input event from the kernel layer and identifies the control corresponding to the input event. For example, if the touch operation is a touch single-click operation and the control corresponding to the single-click operation is the control of the camera application icon, the camera application calls the interface of the application framework layer to start the camera application, and then starts the camera driver by calling the kernel layer to capture static images or videos through the camera 193.
[0315] It should be understood that each step in the above method embodiment can be completed by an integrated logic circuit of hardware in a processor or by instructions in the form of software. The method steps disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware processor, or by a combination of hardware and software modules in a processor.
[0316] The present application also provides an electronic device, which may include: a memory and a processor. The memory may be used to store a computer program; the processor may be used to call the computer program in the memory, so that the electronic device executes the method executed by the electronic device 100 in any of the above embodiments.
[0317] The present application also provides a chip system, which includes at least one processor for implementing the functions involved in the electronic device 100 in any of the above embodiments.
[0318] In one possible design, the chip system also includes a memory, which is used to store program instructions and data, and the memory is located inside or outside the processor.
[0319] The chip system may be composed of the chip, or may include the chip and other discrete devices.
[0320] Optionally, the processor in the chip system may be one or more. The processor may be implemented by hardware or by software. When implemented by hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented by software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.
[0321] Optionally, the memory in the chip system may also be one or more. The memory may be integrated with the processor or may be separately arranged with the processor, which is not limited in the embodiments of the present application. Exemplarily, the memory may be a non-transient processor, such as a read-only memory ROM, which may be integrated with the processor on the same chip or may be arranged on different chips respectively. The embodiments of the present application do not specifically limit the type of memory and the arrangement of the memory and the processor.
[0322] Exemplarily, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips.
[0323] The present application also provides a computer program product, which includes: a computer program (also referred to as code, or instruction), which, when executed, enables a computer to execute the method executed by the electronic device 100 in any of the above embodiments.
[0324] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program (also referred to as code or instruction). When the computer program is executed, the computer executes the method executed by the electronic device 100 in any of the above embodiments.
[0325] The various implementation modes of the present application can be combined arbitrarily to achieve different technical effects.
[0326] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)), etc.
[0327] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
[0328] In short, the above is only an embodiment of the technical solution of this application, and is not intended to limit the protection scope of this application. Any modification, equivalent replacement, improvement, etc. made according to the disclosure of this application shall be included in the protection scope of this application.
Claims
1. A method for removing moiré, characterized in that: The method comprises: The electronic device starts a camera application; The electronic device collects an input frame and a reference frame, wherein the input frame is an image collected by a first camera of the electronic device, and the reference frame includes an image collected by a second camera of the electronic device in a defocused state, and the contents of the input frame and the reference frame both contain the same digital screen; The electronic device uses a neural network and the reference frame to remove moiré patterns in the input frame to obtain an output frame without moiré patterns.
2. The method according to claim 1, characterized in that: The electronic device uses a neural network and the reference frame to remove moiré patterns in the input frame to obtain an output frame without moiré patterns, specifically including: The electronic device preprocesses the reference frame; The electronic device inputs the input frame and the preprocessed reference frame into a neural network to obtain an output frame without moiré patterns output by the neural network.
3. The method according to claim 1, characterized in that The electronic device uses a neural network and the reference frame to remove moiré patterns in the input frame to obtain an output frame without moiré patterns, specifically including: The electronic device inputs the input frame and the reference frame into a neural network to obtain a result image output by the neural network; The electronic device performs post-processing on the result image to obtain an output frame without moiré patterns.
4. The method according to claim 1, characterized in that: The electronic device uses a neural network and the reference frame to remove moiré patterns in the input frame to obtain an output frame without moiré patterns, specifically including: The electronic device preprocesses the reference frame; The electronic device inputs the input frame and the pre-processed reference frame into a neural network to obtain a result image output by the neural network; The electronic device performs post-processing on the result image to obtain an output frame without moiré patterns.
5. The method according to claim 2 or 4, characterized in that: The pre-processing comprises: Taking the input frame as a reference, performing registration processing on the reference frame; and / or, Based on the input frame, brightness and color mapping is performed on the reference frame.
6. The method according to claim 3 or 4, characterized in that: The post-processing includes: Based on the input frame, brightness and color mapping is performed on the result image.
7. The method according to claim 1, characterized in that The electronic device uses a neural network and the reference frame to remove moiré patterns in the input frame to obtain an output frame without moiré patterns, specifically including: The electronic device inputs the input frame and the reference frame into a neural network to obtain an output frame without moiré patterns output by the neural network.
8. The method according to any one of claims 1 to 7, characterized in that: Before the electronic device acquires the input frame and the reference frame, the method further includes: the electronic device receives a user operation for shooting; After the electronic device obtains an output frame without moiré patterns, the method further includes: the electronic device storing the output frame.
9. The method according to any one of claims 1 to 7, characterized in that: After the electronic device starts the camera application, the method further includes: the electronic device displays a first user interface, wherein a preview box is displayed in the first user interface; After the electronic device obtains the output frame without moiré, the method further includes: the electronic device displays the output frame in the preview frame.
10. The method according to any one of claims 1 to 9, characterized in that: Before the electronic device collects the input frame and the reference frame, the method further includes: The electronic device displays a first user interface, wherein the first user interface includes a first control; The electronic device receives a user operation on the first control, where the user operation on the first control is used to trigger the electronic device to remove moiré patterns in the input frame.
11. The method according to any one of claims 1 to 9, characterized in that: Before the electronic device collects the input frame and the reference frame, the method further includes: The electronic device recognizes that the image captured by the first camera contains a digital screen or moiré patterns.
12. The method according to any one of claims 1 to 11, characterized in that: The second camera is the same as the first camera, and there is an interval between the acquisition time of the reference frame and the input frame; or, the second camera is different from the first camera.
13. The method according to any one of claims 1 to 12, characterized in that: The reference frame also includes an image captured by a third camera of the electronic device, where the third camera is different from the second camera.
14. The method according to any one of claims 1 to 13, characterized in that: The reference frame also includes an image captured by the electronic device in a focused state.
15. An electronic device, characterized in that: include: A memory and one or more processors; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute the method as described in any one of claims 1-14.
16. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the electronic device executes the method as described in any one of claims 1 to 14.
Citation Information
Cited By
Shooting method, electronic equipment and storage medium
CN118803168A
Shooting method, electronic device and storage medium
CN118803168B
Image processing method and device
WO2026061049A1
