Image acquisition method, electronic equipment and storage medium
By periodically displaying coded images on the display screen of foldable electronic devices and performing image processing, the problem of image quality degradation caused by display screen reflections is solved, enabling high-quality selfie photos.
Patent Information
- Application Number
- CN202411105285.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2026-02-13
AI Technical Summary
When taking a selfie in front of a mirror on a foldable screen electronic device, the reflective properties of the display screen cause multiple reflections in the captured image, reducing the quality of the selfie.
By periodically displaying coded images of different colors on the screen and performing image processing on the acquired images, the reflected images in the corresponding areas of the screen can be identified and eliminated.
It improves the image quality of selfies, eliminates reflections on the display screen, and enhances the shooting effect.
Smart Images

Figure CN121531230A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of electronics, and in particular to an image acquisition method, an electronic device, and a storage medium. BACKGROUND
[0002] With the rapid development of mobile device technology, folding screens have become a new type of electronic device form on the market. This design provides a larger display area and a new user experience. However, this innovative design also presents some technical challenges for device photography.
[0003] For example, when a user takes a selfie using a rear camera, the display screen on the side of the rear camera will also appear in the preview image. Due to the reflective properties of the display screen, a "mirror in mirror" effect can occur, that is, a reflected image of the display screen itself appears in the acquired image. This situation can cause multiple reflections in the acquired or photographed image, resulting in the appearance of content other than what the user expects in the selfie image, thereby reducing the photo quality of the selfie photo. SUMMARY
[0004] The purpose of the present application is to provide an image acquisition method, an electronic device, and a storage medium.
[0005] In a first aspect, the present application provides an image acquisition method applied to an electronic device. The electronic device includes a first camera, a first display screen, and a second display screen. The camera and the first display screen are located on a first side of the electronic device, and the second display screen is located on a second side of the electronic device. The method includes detecting entry into a shooting mode and acquiring an image through the first camera; displaying a first encoded image in an encoded area of the first display screen based on a display period; acquiring a first image; detecting a first image area corresponding to the encoded area in the first image; and performing image processing on the first image area.
[0006] That is, in the embodiments of the present application, the first display screen can be an outer screen of the electronic device, and the first image area corresponding to the encoded area is the corresponding area of the outer screen in the first image. Through the method of the embodiments of the present application, the display content of the outer screen can be controlled, so that the electronic device can identify the area corresponding to the display content in the acquired image, thereby accurately identifying the corresponding area of the outer screen, and further performing image processing on the corresponding area of the outer screen to eliminate the part with low picture quality, thereby ensuring the image quality.
[0007] In a possible implementation of the above first aspect, the first display screen displays a first encoded image in an encoded area based on a display period, including: displaying a first encoded image of a first color in a first time unit of each display period; and displaying a first encoded image of a second color in a second time unit of each display period, wherein the first color and the second color are different.
[0008] That is, in the embodiments of the present application, the display period, that is, the encoding period, is, for example, n+1 frames. The length of each frame is determined based on the refresh rate of the first display screen. Each display period is composed of a first time unit and a second time unit. For example, the first time unit is the first n frames, and the second time unit is the n+1 frame. By displaying the first encoded image based on the display period, the encoding information can be added to the display content of the first display screen, so that the electronic device can detect the encoding information in the captured image, thereby detecting the first image region corresponding to the first display screen in the captured image.
[0009] In a possible implementation of the first aspect, a ratio of the second time unit to the display period is less than a duty cycle threshold.
[0010] That is, in the embodiments of the present application, the second color displayed in the second time unit can be a modulated color, and the first color displayed in the first time unit can be a non-modulated color. The ratio of the second time unit to the display period, that is, the duty cycle of the modulated color, can be less than a duty cycle threshold, for example, 20%. In this way, the screen-on time of the screen in a specific color state can be reduced, thereby reducing energy consumption and making it less likely for the user to perceive the color change of the first display screen, thereby ensuring the coordination of the visual effect.
[0011] In a possible implementation of the first aspect, the red (R) value of the first color is different from the R value of the second color; the green (G) value of the first color is different from the G value of the second color; and the blue (B) value of the first color is different from the B value of the second color.
[0012] That is, in the embodiments of the present application, by setting the R value, the G value, and the B value of the first color and the second color to be different, the first color and the second color can be distinguished in the three-channel parameters.
[0013] In a possible implementation of the first aspect, the sum of the R value, the G value, and the B value of the first color is the same as the sum of the R value, the G value, and the B value of the second color.
[0014] That is, in the embodiments of the present application, by setting the sum of the R value, the G value, and the B value of the first color to be the same as the sum of the R value, the G value, and the B value of the second color, the display power of the first display screen in each display period can be relatively stable.
[0015] In a possible implementation of the first aspect, the first image is a plurality of first images in a preview stream, and detecting the first image region corresponding to the encoding region in the first image comprises: performing cyclic difference on the RGB values of each pixel in the plurality of first images to obtain color information difference between first images adjacent in position in the preview stream; and detecting the first image region corresponding to the encoding region based on the color information difference between the first images adjacent in position.
[0016] That is, in the embodiment of the present application, by identifying the color information difference between adjacent captured images, the encoding information of the first color and the second color alternately displayed can be identified, so that the corresponding region of the first display screen can be identified.
[0017] In a possible implementation of the first aspect, the cyclic difference of the RGB values of the pixels in the plurality of first images comprises: cyclically differentiating the sum of the R, G and B values of the pixels in the plurality of first images.
[0018] That is, in the embodiment of the present application, the cyclic difference of the sum of the RGB values of the plurality of first images can reduce the calculation amount of the cyclic difference. For example, the sum of the R, G and B values of the first color can be different from the sum of the R, G and B values of the second color, and the difference result obtained by the cyclic difference based on the sum of the RGB values can reflect the color difference between the adjacent frames of the first images.
[0019] In a possible implementation of the first aspect, the first image region corresponding to the encoding region is detected based on the color information difference between the first images adjacent in position, comprising: performing noise filtering processing on the color information difference between the adjacent first images to obtain a plurality of features to be divided; performing region division based on each feature to be divided to determine a region to be detected; determining the region to be detected as a region to be verified in a case where a reference template corresponding to the region to be detected matches the encoding region, determining the similarity between the region to be verified and the reference template; and determining the first image region based on the region to be verified in a case where the similarity between the region to be verified and the reference template meets a similarity condition.
[0020] That is, in the embodiment of the present application, the first image region can be accurately determined based on the color information difference between the adjacent first images through the steps of noise filtering, region division, feature matching and similarity screening.
[0021] In a possible implementation of the first aspect, the number of the regions to be verified is a plurality, and the first image region corresponding to the encoding region is detected based on the color information difference between the adjacent first images, further comprising: determining the voting number of each verification region based on the similarity between each region to be verified and the reference template; aggregating the voting number of each verification region to obtain a total voting number; and determining that the similarity between the region to be verified and the reference template meets the similarity condition in a case where the total voting number is greater than a verification threshold.
[0022] That is, in the embodiment of the present application, the detected first image region can be verified by voting to exclude the case of false detection.
[0023] In one possible implementation of the first aspect above, image processing of the first image region includes: filling in defective regions in the first image region, wherein the defective regions include at least one of black spots, light spots, and environmental reflection images.
[0024] In this embodiment of the application, by filling in the defective areas of the first image region, the defective parts in the acquired image can be eliminated, thereby improving the image quality of the preview image or the captured image.
[0025] In one possible implementation of the first aspect mentioned above, the electronic device is a foldable screen phone.
[0026] In one possible implementation of the first aspect described above, the first display screen is a low-temperature polycrystalline silicon oxide screen, and the refresh rate of the first display screen is less than the frame rate threshold.
[0027] In this embodiment of the application, the first display screen may be a low-temperature polycrystalline silicon oxide screen capable of achieving a low refresh rate, and its refresh rate may be less than the frame rate threshold, for example, less than 30Hz.
[0028] In a second aspect, this application provides an electronic device, comprising: a memory for storing instructions executable by one or more processors of the electronic device, and a processor for executing instructions of the method described in the first aspect.
[0029] Thirdly, this application provides a storage medium storing instructions that, when executed on an electronic device, cause the electronic device to perform the method described in the first aspect.
[0030] Fourthly, this application provides a computer program product, comprising: a non-volatile computer-readable storage medium, the non-volatile computer-readable storage medium containing computer program code for performing the method described in the first aspect. Attached Figure Description
[0031] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1A This is a first schematic diagram of a mobile phone 10 provided in an embodiment of this application;
[0033] Figure 1B This is a second schematic diagram of a mobile phone 10 provided in an embodiment of this application;
[0034] Figure 1CThis is a third schematic diagram of a mobile phone 10 provided in an embodiment of this application;
[0035] Figure 1D This is a fourth schematic diagram of a mobile phone 10 provided in an embodiment of this application;
[0036] Figure 1E This is a schematic diagram of a scene for taking a selfie in front of a mirror, provided in an embodiment of this application;
[0037] Figure 2 This is a software structure block diagram of the electronic device 100 provided in the embodiments of this application;
[0038] Figure 3 This is a schematic flowchart of an image acquisition method provided in an embodiment of this application;
[0039] Figure 4 This is a flowchart illustrating an encoding / decoding method provided in an embodiment of this application;
[0040] Figure 5A This is a modulation waveform diagram of the first encoding method provided in the embodiments of this application;
[0041] Figure 5B This is a modulation waveform diagram of the second encoding method provided in the embodiments of this application;
[0042] Figure 5C This is a modulation waveform diagram of the third encoding method provided in the embodiments of this application;
[0043] Figure 6 This is a schematic diagram of the hardware structure of an electronic device 100 provided in an embodiment of this application. Detailed Implementation
[0044] The illustrative embodiments of this application include, but are not limited to, an image acquisition method, an electronic device, and a storage medium.
[0045] In this embodiment, the image acquisition method can be applied to an electronic device 100 with a foldable screen. The electronic device 100 may include, but is not limited to, smartphones, desktop computers, tablets, laptops, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, smart wearable devices, and other similar devices. Optionally, the operating system running on the electronic device 100 may include, but is not limited to, Android. TM System, iOS TM System, Linux TM Windows TM Specific details regarding electronic device 100 will be provided below in conjunction with the appendix. Figure 6A detailed introduction will not be elaborated here.
[0046] To facilitate understanding of the image acquisition method of the embodiments of this application, the technical problems to be solved by the embodiments of this application will be analyzed and explained below.
[0047] As mentioned earlier, there are some technical challenges in photographing electronic devices with foldable screens. In particular, in scenarios where mirror selfies are taken using the rear camera, reflected images from the display screen may be captured, thus reducing the quality of the photo.
[0048] The following section will first introduce electronic devices with foldable screens.
[0049] Taking a foldable phone as an example, a foldable phone typically includes at least two displays: a main display and a secondary display. When the foldable phone is folded, the secondary display faces outwards, allowing the user to operate the phone without unfolding it; while the main display is located on the inside, in a folded state. When the foldable phone is unfolded, the main display unfolds for the user to operate, providing a wider field of view compared to the secondary display, while the secondary display and the rear camera are located on the opposite side of the main display.
[0050] In some scenarios, when a foldable phone is in its unfolded state, users may take photos by taking a selfie in front of a mirror. A mirror selfie is a selfie method that utilizes a mirror surface. Users take photos of themselves and their phone in the mirror to obtain a more natural angle and include more elements in the shot.
[0051] When a foldable phone is unfolded, the secondary display and the rear camera are located on the same side.
[0052] by Figure 1A , Figure 1B Taking the phone 10 shown as an example, the phone 10 can be folded horizontally. When the phone 10 is unfolded, the main display screen 13 is active, the secondary display screen 12 is inactive, and the secondary display screen 12 and the rear camera 11 are located on the same side.
[0053] by Figure 1C , Figure 1D Taking the mobile phone 10 shown as an example, the mobile phone 10 can be folded vertically. When the mobile phone 10 is unfolded, the main display screen 13 is in an active state, the secondary display screen 12 is in an inactive state, and the secondary display screen 12 and the rear camera 11 are located on the same side.
[0054] When a user takes a selfie using the rear camera 11, the secondary display screen 12 will also be displayed in the preview image or the captured image. However, due to the reflective properties of the display screen when it is off, that is, the display screen has the ability to reflect light, achieving an effect similar to a plane mirror, the secondary display screen 12 may also reflect images of the environment, resulting in a "mirror within a mirror" situation in the preview image.
[0055] In another embodiment, when the phone 10 is unfolded, the main display screen 13 is in a screen-off state, the secondary display screen 12 is in an active state, and the front-facing camera 14 is located on the same side as the main display screen 13. At this time, if the user uses the front-facing camera 14 to capture an image in front of a mirror, an image of the main display screen 13 may be captured. Due to the reflective properties of the display screen in the screen-off state, the main display screen 13 may also reflect images of the environment, resulting in a "mirror within a mirror" effect in the preview image.
[0056] The following is combined Figure 1E The scenario shown further illustrates the imaging problem of foldable screen phones in mirror selfie scenarios.
[0057] by Figure 1E Taking the scenario shown as an example, if a user takes a selfie in front of a mirror using the rear camera 11 of mobile phone 10, both the rear camera 11 and the secondary display screen 12 are facing the mirror 20. Therefore, the mirror 20 that the mobile phone 10 wants to photograph will reflect the image of the secondary display screen 12, causing the secondary display screen 12 to also appear in the image 30 captured by the rear camera 11. Furthermore, the secondary display screen can also reflect environmental images, such as the overhead light 41, resulting in another reflected image from the secondary display screen 12, such as the reflected image 42 of the overhead light 41, appearing within the image reflected by the mirror 20 in image 30. This creates a "mirror within a mirror" phenomenon.
[0058] In another embodiment, when the phone 10 is unfolded, the main display screen 13 is in a blackout state, while the secondary display screen 12 is in an active state. At this time, if the user operates the camera application through the secondary display screen 12 to capture images using the front-facing camera 14 on the other side, the image on the main display screen 13 may be captured.
[0059] In summary, because the secondary display screen reflects the ambient image, it can cause blurry content in the captured image that is not what the user expects, thus reducing the quality of the photo.
[0060] To address the low image quality issue caused by the external screen mentioned earlier, this application provides an image acquisition method. It is understood that when an electronic device acquires an image, in order to perform image processing on the area of the external screen in the image (such as eliminating reflected images), it is first necessary to accurately identify the external screen in the acquired image, thereby identifying the selfie scene. In this embodiment, the electronic device can control the display content of the external screen, enabling the electronic device to identify areas in the acquired image that match the aforementioned display content, thus accurately identifying the external screen. Specifically, when the electronic device acquires an image through a camera, a first display screen (i.e., the external screen) located on the same side as the camera can display an encoded image containing encoded information. For example, the encoded information may include the color information of the encoded image. After the camera acquires the image, it can detect the encoded information in the image. If encoded information is detected in the image, such as detecting that a first area in the image matches the aforementioned color information of the encoded image, the first area can be determined as the image area of the first display screen. Then, image processing is performed on the first area, such as filling it with black, to eliminate low-quality parts of the image, thereby ensuring image quality.
[0061] According to some embodiments, in Figure 1A , Figure 1B In the mobile phone 10 shown, the outer screen is a secondary display screen, that is, a display screen without a self-folding function. According to other embodiments, in... Figure 1C , Figure 1D In the mobile phone 10 shown, the outer screen is the main display screen, that is, a display screen with a self-folding function.
[0062] According to some embodiments, the camera is a rear camera or main camera of an electronic device. According to other embodiments, the camera is a front camera of an electronic device.
[0063] According to some embodiments, the first display screen can periodically display a first coded image of a first color. For example, the first coded image of the first color and a second coded image of the second color are alternately displayed based on a display cycle. Each display cycle consists of a first time unit and a second time unit. For example, one cycle includes (n+1) frames, where the first time unit is n frames and the second time unit is 1 frame. Within each display cycle, the first coded image of the first color can be displayed in the first time unit, and the second coded image of the second color can be displayed in the second time unit. The second color is the default color when the first display screen is in an inactive or off state. This default color can be black or a near-black color, or the color of the electronic device's casing. The first color is an coded modulated color. The first color and the second color have different red, green, and blue (RGB) values.
[0064] According to some embodiments, multiple frames of images can be continuously acquired, and the RGB values of each frame can be accumulated to obtain the color information of each frame. Then, cyclic difference is performed on the color information of each frame to obtain the color information difference between adjacent frames. Then, based on the color information difference between adjacent frames, a first region, i.e., the image region of the first display screen, can be detected. For example, pixels with color information differences are identified in the image, i.e., pixels where color changes exist between frames, and the region containing these pixels is then determined as the image region of the first display screen.
[0065] According to some embodiments, for m consecutive frames of images, a first region can be detected in n frames. At this point, whether the first region belongs to the image region of the first display screen can be determined by region of interest (ROI) voting. That is, the first region to be detected is the ROI. Based on the similarity between the detected first region in each of the n frames and the template of the first display screen, a number of votes is assigned to each of the n frames, and all votes are aggregated to obtain a total vote count. If the total vote count is greater than a voting threshold, the first region is determined to be an image region of the first display screen; otherwise, the first region is determined not to be an image region of the display screen. In this way, interfering objects with color information similar to the encoding information of the first display screen, such as moving objects, can be excluded.
[0066] It is understandable that the electronic devices applied for can be such as Figures 1A-1D The foldable screen device shown can also be any other device with the camera and screen located on the same side. For example, a mobile phone or tablet with a secondary screen.
[0067] Figure 2 This is a software structure block diagram of the electronic device 100 according to an embodiment of this application.
[0068] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, Android... TM The system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime (Android). TM runtime and system libraries, as well as the kernel layer.
[0069] The application layer can include a series of application packages. For example... Figure 2 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, dual SIM and mobile network. Users can activate the camera application to take pictures or videos.
[0070] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0071] like Figure 2 As shown, the application framework layer may include a content provider, a phone manager, a resource manager, a media stream data processing (MSDP) service, a display management service, a camera service, etc.
[0072] The MSDP service is primarily responsible for processing and integrating data from various sensors, including but not limited to Bluetooth, Wi-Fi, and camera sensors. The MDSP service also provides MSDP encoding algorithm components and MSDP decoding algorithm components. The MSDP encoding algorithm component can be used to encode the content displayed on the screen to obtain multi-frame encoded images for display on the external screen of the electronic device 100; the MSDP decoding algorithm component can be used to decode the acquired images to identify mirror selfie scenes based on the decoding results.
[0073] The camera service provides camera applications with an interface to access or control the camera, enabling the application to interact with it. For example, the camera application can use the service to control the camera's activation, preview, capture photos, or record video, and obtain the results of these actions, such as preview streams, captured images, or videos.
[0074] The display management service controls the display screen's settings, including resolution, color, and content. For example, it controls the display screen to show multi-frame encoded images obtained from the MSDP encoding algorithm component.
[0075] Android TM Runtime includes core libraries and a virtual machine. Android TM The runtime is responsible for scheduling and management of the Android system.
[0076] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0077] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.
[0078] The following is based on Figure 3The embodiments of this application are described in detail.
[0079] Figure 3 A schematic diagram illustrating the implementation flow of an image acquisition method is shown according to an embodiment of this application. For ease of description, the above-mentioned... Figure 2 The camera application, MSDP service, MDSP encoding algorithm component, MDSP decoding algorithm component, and display management service shown are numbered respectively and described below as camera application 31, MSDP service 32, MDSP encoding algorithm component 321, MDSP decoding algorithm component 322, and display management service 33.
[0080] Understandable. Figure 3 The entities responsible for executing each step in the implementation process shown may include... Figures 1A-1D or Figure 1E The foldable screen phone 10 in the scene shown.
[0081] S301: Camera application 31 launched.
[0082] Understandably, the camera application 31 can be launched in response to user actions.
[0083] In some embodiments, in response to a user clicking the application icon of the camera application 31, the operating system can launch the process of the camera application 31. For example, the operating system can load the UI layout file, icons, animations, and other interface elements of the camera application 31 to display the interface of the camera application 31 on the screen.
[0084] The camera application 31 can switch the active camera between the front and rear cameras based on the user's switching operation. For example, in response to the user's click on the button to switch cameras, the camera application 31 will stop the preview of the current camera and start the preview of another camera, that is, start capturing a preview stream through another camera. The preview stream is the visual information captured by the camera, directly reflecting the environment that the camera is pointing at. The user can see a real-time image of the environment through the preview stream.
[0085] The camera application 31 can extract still images from the preview stream based on the user's shooting actions to obtain the captured image.
[0086] In some embodiments, when the camera application 31 is launched and the rear camera is activated, and the camera application 31 captures a preview stream through the rear camera, the process can proceed to step S302 to subscribe to the MSDP service 32 so that the MSDP service 32 encodes the encoded sequence frames displayed on the outer screen (i.e., the secondary display screen described above).
[0087] S302: Camera application 31 Subscribe to MSDP service 32.
[0088] It is understood that camera application 31 can send a subscription request to MSDP service 32 and then receive a subscription confirmation message returned by MSDP service to subscribe to MSDP service 32. After subscribing to MSDP service 32, camera application 31 can receive data from MSDP service 32, such as image data.
[0089] According to some embodiments, the MDSP service can provide MSDP encoding algorithm component 321 and MSDP decoding algorithm component 322.
[0090] MSDP encoding algorithm component 321 can encode the encoded image to be displayed on the external screen, while MSDP decoding algorithm component 322 can decode multiple frames of images in the preview stream captured by camera application 31 and detect whether the shooting scene is a mirror selfie scene.
[0091] S303: MSDP service 32 calls MSDP encoding algorithm component 321.
[0092] In some embodiments, the MSDP service 32 can be invoked by the MSDP encoding algorithm component 321 to encode the image to be displayed on the external screen.
[0093] S304: The MSDP encoding algorithm component 321 encodes the encoded sequence frame.
[0094] After the MSDP encoding algorithm component 321 is invoked, it can encode the encoded sequence frames to be displayed on the external screen.
[0095] In one alternative embodiment, the MSDP encoding algorithm component 321 can perform encoding based on differential encoding technology with duty cycle adjustment. Specifically, the outer screen is treated as a whole pixel block for encoding. In this way, even if the acquisition distance is far, the MSDP decoding algorithm component 322 can still decode the encoded information from the acquired image. The differential encoding based on duty cycle adjustment refers to alternating the display of images of different colors, and the alternation pattern is to display modulated colors according to a preset duty cycle.
[0096] For example, the first m frames are encoded as a non-modulated color, such as black, and the next n frames are encoded as modulated colors, and this process is repeated. For example, the RGB value of black can be (0, 0, 0), and the RGB value of a modulated color can be (30, 0, 0). It can be understood that a modulated color can be a color that is similar to black but also has certain differences from black.
[0097] For example, the non-modulated color can be any color other than black. The difference between the modulated and non-modulated colors can satisfy preset conditions. For instance, the absolute value of the difference between the sums of the R, G, and B values in the RGB values of two colors must fall within a preset range; or, the sum of the absolute values of the differences in the R, G, and B values of two colors must fall within a preset range. For example, the preset range could be [30, 50], but this application does not limit the preset range. In this way, the human eye can hardly perceive the color change on the screen, while the color difference is large enough to ensure a high decoding success rate.
[0098] In some embodiments, the sum of the RGB values of the modulated color can be the same as the sum of the RGB values of the unmodulated color. In this embodiment, when the screen switches from the unmodulated color to the modulated color, the total power of the screen remains unchanged or changes only slightly, thereby avoiding additional power consumption in scenarios where the rear camera is used for shooting.
[0099] In some embodiments, the duty cycle can be a low duty cycle, i.e., m is greater than n. For example, m can be 29 and n can be 1. This application does not limit the specific values of m and n. Encoding the screen display image using a low duty cycle pulse modulation method can reduce the visual perception of screen color changes and reduce the abruptness of changes in screen display content.
[0100] S305: MSDP encoding algorithm component 321 sends an encoded sequence frame to display management service 33.
[0101] After the MDSP encoding algorithm component encodes the encoded sequence frame, it can send the encoded sequence frame to the display management service 33.
[0102] S306: Display Management Service 33 controls the external screen to display encoded sequence frames.
[0103] It can be understood that the external screen displays the encoded sequence frames, that is, the external screen plays the encoded information encoded by the MSDP encoding algorithm component 321.
[0104] In one optional embodiment, the external screen refreshes the page at a low frame rate, such as 1–30 Hz; wherein, as the external screen refreshes, it displays frame-by-frame images from the encoded sequence. Optionally, the camera's sampling rate can be 1–30 fps.
[0105] In this embodiment, since the external screen refreshes at a low frame rate, its power consumption is reduced, thus not affecting the user's normal use of the electronic device 100. Furthermore, because the MSDP encoding algorithm component 321 uses differential encoding to encode changes between consecutive frames, even if the external screen experiences occasional frame drops, it does not affect the decoding and detection process. As long as consecutive frames are captured, the encoded information can be decoded based on the changes between them.
[0106] S307: Camera application 31 obtains preview stream.
[0107] After the encoded sequence frames are displayed on the external screen, the camera application 31 can access or control the phone's camera hardware through the camera service to obtain a preview stream from the camera.
[0108] S308: Camera application 31 calls MSDP decoding algorithm component 322.
[0109] After the camera application 31 obtains the preview stream, it can call the MSDP decoding algorithm component 322 to decode the preview stream and detect whether the shooting scene is a mirror selfie scene.
[0110] S309: MSDP decoding algorithm component 322 detected that the shooting scene was a mirror selfie.
[0111] MSDP decoding algorithm component 322 can decode the preview stream based on the MSDP decoding algorithm to detect whether the shooting scene is a mirror selfie scene.
[0112] In some embodiments, the MSDP decoding algorithm component 322 can perform decoding based on channel accumulation and cyclic differential decoding techniques. For example, based on multiple consecutive frames of images in the preview stream, the RGB values of adjacent frames are subtracted, that is, the RGB value of the next frame is subtracted from the RGB value of the previous frame, and the absolute value of the difference is used as the information difference between adjacent frames. Then, the information difference between adjacent frames is used to detect whether the shooting scene is a mirror selfie.
[0113] For example, a camera preview stream consists of n consecutive frames: f1, f2, f3, f4, ... The MSDP decoding algorithm component 322 can add the RGB three-channel pixel values of each frame to obtain: f1', f2', f3', f4', ... to enhance weak feature signals in the image. Specifically, int values can be converted to float values before addition to obtain a wider data representation range and prevent truncation during the conversion process. Then, the MSDP decoding algorithm component 322 can perform cyclic difference on f1', f2', f3', f4', ..., i.e., using f... n 'Subtract f n-1 Then, calculate the absolute value of the difference to obtain the information difference between adjacent frames: f12 f 23 f 34 , ……
[0114] It can be understood that the RGB values of the above image represent the RGB values of each pixel in the image, and the information difference between adjacent frames represents the difference in RGB information between each pixel in adjacent frames.
[0115] In some embodiments, after obtaining the information difference between adjacent frames, the information difference can be thresholded and binarized to filter out noise points, resulting in a filtered information difference between adjacent frames. For example, when the information difference between adjacent frames is less than a threshold, the information difference is considered a first value, such as 0; when the information difference between adjacent frames is greater than the threshold, the information difference is considered a second value, such as 1. In this way, noise in the information difference can be filtered out, improving the accuracy of the detection results.
[0116] In some embodiments, a dual connected component lookup can be performed based on the information difference between adjacent frames to detect the coded region. The coded region can be understood as the display area of the outer screen. The dual connected component lookup identifies adjacent pixels as having the same connected component. By comparing the features of the identified connected components with those of the coded region, the coded region can be detected. For example, the shape features of each connected component, such as rectangularity, corner points, and boundary straightness, can be analyzed to determine if they match the shape features of the coded region. If a match is found, the connected component is identified as the coded region.
[0117] In some embodiments, after detecting the encoded regions, region of interest (ROI) voting can be performed on the encoded regions of multiple frames to obtain the voting results. Based on the voting results, it can be determined whether it is a mirror selfie scene. For example, the encoded region is defined as an ROI in each frame, and the ROI features of each frame are matched with a predefined template to calculate a similarity score. Based on the similarity score of each frame, a number of votes is assigned to the ROI of each frame. The votes of all frames are aggregated, and if the total number of aggregated votes is greater than a voting threshold, the shooting scene is determined to be a mirror selfie scene.
[0118] S310: Display management service 33 completes the pattern on the outer screen in the preview stream.
[0119] Understandably, given that the shooting scene is a mirror selfie, the display management service 33 performs image processing on the outer screen area in the preview stream to complete the pattern on the outer screen. Directly completing the wallpaper on the display area of the outer screen in the preview stream allows for real-time processing of the outer screen's display content, avoiding secondary image transmission and thus preventing image data from being transferred to another location for additional processing.
[0120] According to some embodiments, wallpaper can be added to the outer screen display area, for example, by splicing a solid color wallpaper onto the outer screen area in the preview stream. Figure 1B For example, wallpaper patching can be performed on the secondary display screen 12 to eliminate black spots or reflective images in the area of the secondary display screen 12, resulting in a preview image with a harmonious visual effect.
[0121] According to other embodiments, wallpaper completion can be performed on the outer screen display area based on a preset screen image. The preset screen image can be a natural screen image, such as a solid color background with light spots or halos, to obtain a visually natural preview image.
[0122] S311: Camera app 31 captures pictures or videos.
[0123] After the pattern on the outer screen is completed, the camera application 31 can take pictures or videos to capture single or multiple frames of images in the preview stream, resulting in visually coordinated pictures or videos.
[0124] The method described in this application allows for scene recognition using external screen-based encoding and decoding technology, eliminating reliance on other sensors and reducing costs. By differentially encoding the image displayed on the screen, the color difference between modulated and unmodulated colors is minimized, and the external screen is controlled to display the encoded image at a low frame rate. This not only reduces the human eye's perception of screen color changes but also ensures high decoding detection success rate while reducing power consumption. Image processing of the external screen area in the preview stream eliminates black spots or reflections, resulting in more harmonious visual effects in the captured images or videos and improving the quality of the final product.
[0125] The following is combined Figure 4 The flow of the encoding / decoding method in the embodiments of this application is further described below. For example... Figure 4 As shown, this process can be used for electronic device 100, i.e. Figure 4 In the process shown, each step can be performed by an electronic device 100, such as a mobile phone.
[0126] For example, the process may include the following steps:
[0127] S401: External screen encoding.
[0128] It is understandable that when the rear camera of a foldable screen device is activated, the outer screen, i.e., the secondary display on the outer side, can play encoded information at a low refresh rate, such as displaying multiple frames of encoded images. The outer screen can be an LTPO screen.
[0129] In one optional embodiment, the encoding of the content displayed on the outer screen can be achieved using differential coding technology based on duty cycle adjustment. In this method, the outer screen is treated as a single pixel block for encoding. For example, in consecutive frames, except for the nth frame which displays a specific modulated color, the preceding (n-1) frames are displayed as black. This allows for precise control over the display time of the content, reducing the human eye's perception of changes and achieving the covert transmission of encoded information without significantly impacting the visual experience.
[0130] By considering the differences in how the human eye and a camera perceive different colors, the modulated colors can be fine-tuned to maximize concealment while ensuring that the encoded information can be correctly decoded. For example, modulated colors can be chosen from colors within the color gamut where the human eye has lower visual sensitivity, or colors that are only slightly different from non-modulated colors, to improve the security of information transmission while reducing interference with the user's visual experience.
[0131] As we can understand, a low refresh rate refers to a low frame rate, such as 1–30Hz. This low frame rate refresh strategy helps reduce power consumption while maintaining the continuity of information transmission.
[0132] The following describes three optional differential coding methods based on duty cycle adjustment:
[0133] The first type: The R, G, and B values of the non-modulated color and the modulated color are all different, and the absolute values of the differences in R, G, and B values are all less than the difference threshold. For example, the difference threshold can be 30, and this application does not limit the value of the difference threshold.
[0134] It is understood that in the embodiments of this application, the duty cycle refers to the ratio of the time the external screen displays the modulated color to the display cycle time of the external screen within one modulation period.
[0135] by Figure 5A For example, the RGB value of the non-modulated color is (0, 0, 0), the RGB value of the modulated color is (20, 20, 20), and the duty cycle of the modulation is 50%.
[0136] Using the first encoding method for LTPO screen encoding, since the three channel color values of the modulated and unmodulated colors are all different, the differences between them are significant, which can improve the success rate of decoding detection. That is, in this embodiment, the color difference between adjacent frames can be identified by subtracting only one of the R, G, and B values of adjacent frames; or, the difference between two or three of the R, G, and B values of adjacent frames can be calculated separately, and region detection can be performed based on the color value difference to improve the detection accuracy.
[0137] The second type: The sum of the R, G, and B values of the non-modulated color and the modulated color is the same, but their RGB values are not exactly the same.
[0138] by Figure 5B For example, the RGB value of the unmodulated color is (30, 0, 0), the RGB value of the modulated color is (0, 0, 30), and the duty cycle of the modulation is 50%.
[0139] When using the second encoding method for LTPO screen encoding, the total power of the screen remains unchanged or changes only slightly when the screen switches from non-modulated color to modulated color, thus avoiding additional power consumption in scenarios where the rear camera is used for shooting.
[0140] It is understood that in this embodiment, the RGB value of the non-modulated color can also be (20,10,0), and the RGB value of the modulated color can also be (0,20,10). This application embodiment does not limit the specific RGB values of the two colors.
[0141] The third type: The duty cycle is less than the preset duty cycle.
[0142] It is understandable that the preset duty cycle can be a percentage value less than 50%, such as 20%.
[0143] by Figure 5C For example, the RGB value of the non-modulated color is (0, 0, 0), the RGB value of the modulated color is (0, 0, 30), and the duty cycle of the modulation is less than 20%.
[0144] Using the third encoding method for LTPO screen encoding, a low duty cycle pulse modulation method can be used to encode the screen display image, thereby reducing the visual perception of screen color changes and reducing the abruptness of changes in screen display content.
[0145] It is understandable that after encoding to obtain the encoded sequence frame, the external screen can display the encoded sequence frame.
[0146] It is understandable that when the electronic device 100 with the foldable screen is in the unfolded state, the camera application 31 is launched, and the image is captured using the rear camera, step S401 is executed.
[0147] S402: Get the camera preview stream.
[0148] After the encoded sequence frames are displayed on the external screen, a camera preview stream can be obtained.
[0149] In one alternative embodiment, the camera preview stream comprises n consecutive frames of images: f1, f2, f3, f4, ...
[0150] S403: Extract effective features based on camera preview stream.
[0151] After obtaining the camera preview stream, effective features can be extracted based on it. Specifically, each frame of the camera preview stream can be decoded to extract effective features.
[0152] In one alternative implementation, based on multiple consecutive frames in the preview stream, the RGB values of adjacent frames can be subtracted. Specifically, the RGB value of the next frame is subtracted from the RGB value of the previous frame, and the absolute value of the difference is used as the information difference between adjacent frames, which is then used as the extracted effective feature. For example, the difference in R, G, and B values between adjacent frames can be obtained as effective features. It can be understood that effective features are those that can be directly used to detect coded regions.
[0153] For example, step S403 may include the following steps S4031 to S4033:
[0154] S4031: Perform signal enhancement on each frame of the camera preview stream.
[0155] Signal enhancement is performed on each frame of the camera preview stream, which involves adding the RGB three-channel pixel values of each frame. In this process, int values can be converted to float values before addition to obtain a wider data representation range and prevent truncation during the conversion process.
[0156] For example, for n consecutive frames of images: f1, f2, f3, f4, ..., the RGB three-channel pixel values of each frame in the n frames are added together to obtain the RGB pixel values of the enhanced n frames: f1', f2', f3', f4', ..., in order to enhance the weak feature signals in the image.
[0157] S4032: Perform cyclic differential on the signals of each enhanced frame image.
[0158] After signal enhancement, the RGB pixel values of the enhanced n frames are cyclically differencing, that is, the RGB value of the next frame is subtracted from the RGB value of the previous frame, and the absolute value of the difference is used as the information difference between adjacent frames.
[0159] For example, performing cyclic differences on f1', f2', f3', f4'... using f n 'Subtract f n-1 Then, calculate the absolute value of the difference to obtain the information difference between adjacent frames: f 12 f 23 f 34 , ……
[0160] S4033: Filter background noise based on the information difference between adjacent frames.
[0161] After obtaining the information difference between adjacent frames, the information difference between adjacent frames can be thresholded and binarized to filter out noise points, and the filtered information difference between adjacent frames can be used as an effective feature.
[0162] For example, when the information difference between adjacent frames is less than a threshold, the information difference is treated as a first value, such as 0; when the information difference between adjacent frames is greater than the threshold, the information difference is treated as a second value, such as 1. In this way, noise in the information difference can be filtered out, improving the accuracy of the detection results.
[0163] S404: Detection of coding regions based on effective features.
[0164] After obtaining the effective features, i.e., the information difference between adjacent frames after thresholding and binarization, a dual connected component search can be performed based on these features to detect the coded region. The coded region can be understood as the display area of the outer screen. Specifically, the dual connected component search marks adjacent pixels as the same connected component. By comparing the marked connected components with the features of the coded region, the coded region can be detected. For example, the shape features of each connected component, such as rectangularity, corner points, and boundary straightness, can be analyzed to determine whether they match the shape features of the coded region. If a match is found, the connected component is identified as the coded region.
[0165] S405: Verify the encoded regions of multiple frames to obtain verification parameters.
[0166] After detecting the encoded regions, a Region of Interest (ROI) voting process can be performed on the encoded regions across multiple frames. The voting results are then used to determine whether the scene is a mirror selfie, thus validating the detection results. For example, for each frame with a detected encoded region (corresponding to the information difference between adjacent frames mentioned above), the encoded region can be defined as an ROI. The ROI features of each frame are matched with a predefined template to calculate a similarity score. Based on the similarity score of each frame, a number of votes is assigned to the ROI of each frame. The votes of all frames are then aggregated to obtain the validation parameters.
[0167] By using ROI voting to verify the encoded regions of multiple frames, even in the presence of interference factors, such as the interference of dynamic objects in a small number of frames, such as someone walking by, which may cause the encoded regions to not be detected in those small number of frames, as long as the encoded regions are detected in most frames, the obtained verification parameters can meet the detection threshold, thereby enabling the detection of mirror selfie scenes based on the verification parameters.
[0168] S406: Detects a selfie scene based on the verification results.
[0169] After obtaining the verification parameters, it can be determined whether the parameters meet the verification conditions for a mirror selfie scene. If they do, then the shooting scene can be determined to be a mirror selfie scene.
[0170] For example, the verification condition could be that the verification parameters meet a detection threshold. That is, if the total number of votes obtained from aggregation is greater than the detection threshold, the shooting scene is determined to be a mirror selfie scene.
[0171] After detecting a selfie scene, image processing can be performed on the image area corresponding to the outer screen encoding area in the preview stream, such as wallpaper completion, to adjust the preview image displayed on the electronic device 100 or the captured image, so that there are no black spots or reflections in the outer screen area of the image, thus improving the quality of the captured image.
[0172] The image acquisition method of this application reduces the amount of encoding by encoding the entire external screen as a single pixel block. Furthermore, differential encoding is used on low refresh rate LTPO screens, and the differences between modulated and unmodulated colors are kept small, making color differences imperceptible to the human eye and avoiding abruptness in the displayed content. By employing channel addition and cyclic differential decoding techniques to decode the image in the preview stream, mirror selfie scenes can be determined without additional sensors, thus saving costs while ensuring detection accuracy.
[0173] Figure 6 A schematic diagram of the hardware structure of the electronic device 100 is shown.
[0174] Electronic device 100 may include processor 110, external memory interface 120, internal memory 121, universal serial bus (USB) interface 130, charging management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity 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.
[0175] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0176] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.
[0177] The processor 110 may also include a memory for storing instructions and data corresponding to the image acquisition method provided in this embodiment. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0178] In some embodiments, the processor 110 of the electronic device 100 executes the image acquisition method mentioned in this application by calling program instructions stored in the memory. For example, it detects the entry into shooting mode and acquires an image through a first camera; it periodically displays a first coded image in the coded area of a first display screen; it acquires a first image; it detects a first image area corresponding to the coded area in the first image and performs image processing on the first image area. The wireless communication function of the electronic device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor, etc.
[0179] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0180] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1, for example, including one such display screen. Figure 1A The main display screen shown, and a screen like Figure 1B The secondary display screen shown.
[0181] Electronic device 100 can achieve the acquisition function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0182] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the scene being captured. In some embodiments, the ISP can be integrated into the camera 193.
[0183] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.
[0184] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0185] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons, such as the capture button in a camera application. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.
[0186] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses a layered architecture of Android. TM Taking the system as an example, the software structure of electronic device 100 is illustrated.
[0187] Accordingly, embodiments of this application provide an electronic device, including: a memory for storing instructions executed by one or more processors of the electronic device, and a processor for executing the above-described image acquisition method.
[0188] Accordingly, this application provides a storage medium storing instructions, which, when executed on an electronic device, cause the electronic device to perform the image acquisition method described above.
[0189] Accordingly, embodiments of this application provide a computer program product, including: a non-volatile computer-readable storage medium, the non-volatile computer-readable storage medium containing computer program code for performing the above-described image acquisition method.
[0190] This specification provides the methods or processes shown in the embodiments or flowcharts, but based on conventional or non-inventive labor, more or fewer operation steps may be included. The order of steps listed in the embodiments is merely one of many execution orders and does not represent the only execution order. In actual execution, the methods or processes shown in the embodiments or drawings can be executed in sequence or in parallel (e.g., in a parallel controller or multi-threaded processing environment).
[0191] The embodiments disclosed in this application can be implemented in hardware, software, firmware, or a combination of these implementation methods. Embodiments of this application can be implemented as computer programs or program code executable on a programmable system, the programmable system including at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.
[0192] Program code can be applied to input instructions to execute the functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, the processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application-specific integrated circuit (ASIC), or a microprocessor.
[0193] The program code can be implemented using a high-level procedural language or an object-oriented programming language to communicate with the processing system. Assembly language or machine language can also be used when needed. In fact, the mechanisms described in this application are not limited to any particular programming language. In either case, the language can be a compiled language or an interpreted language.
[0194] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored thereon on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, the instructions may be distributed via a network or through other computer-readable media. Therefore, machine-readable media may include any mechanism for storing or transmitting information in a machine-readable (e.g., computer-readable) form, including but not limited to floppy disks, optical disks, CD-ROMs, magneto-optical disks, read-only memory (ROM), random access memory (RAM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic cards or optical cards, flash memory, or tangible machine-readable storage for transmitting information (e.g., carrier waves, infrared signals, digital signals, etc.) using the Internet in the form of electrical, optical, acoustic, or other propagation signals. Therefore, machine-readable media include any type of machine-readable medium suitable for storing or transmitting electronic instructions or information in a machine-readable (e.g., computer-readable) form.
[0195] As used herein, the term “module” may refer to, as part of, or include: a memory (shared, dedicated, or grouped) for running one or more software or firmware programs, an application-specific integrated circuit (ASIC), electronic circuitry and / or a processor (shared, dedicated, or grouped), combinational logic circuitry, and / or other suitable components that provide the said functionality.
[0196] In the accompanying drawings, some structural or methodological features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order is not necessary. Rather, in some embodiments, these features may be illustrated in a manner and / or order different from that shown in the illustrative drawings. Furthermore, the inclusion of structural or methodological features in a particular drawing does not mean that all embodiments need to include such features; in some embodiments, these features may be omitted, or they may be combined with other features.
[0197] The embodiments of this application have been described in detail above with reference to the accompanying drawings. However, the use of the technical solutions of this application is not limited to the various applications mentioned in the embodiments of this patent. Various structures and modifications can be easily implemented with reference to the technical solutions of this application to achieve the various beneficial effects mentioned herein. Within the scope of knowledge possessed by those skilled in the art, all changes made without departing from the spirit of this application should be considered within the scope of this patent application.
Claims
1. An image acquisition method, applied to electronic devices, characterized in that, The electronic device includes a first camera, a first display screen, and a second display screen, wherein the camera and the first display screen are located on a first side of the electronic device, and the second display screen is located on a second side of the electronic device; and, The method includes: The system detects that the camera has entered shooting mode and captures images through the first camera. The first coded image is displayed in the coded area of the first display screen based on the display cycle; The first image was acquired; A first image region corresponding to the encoded region is detected in the first image, and image processing is performed on the first image region.
2. The method according to claim 1, characterized in that, Displaying the first encoded image in the encoding area of the first display screen based on a display cycle includes: The first encoded image of the first color is displayed in the first time unit of each display cycle; In the second time unit of each display cycle, a first coded image of a second color is displayed, wherein the first color is different from the second color.
3. The method according to claim 2, characterized in that, The ratio of the second time unit to the display period is less than the duty cycle threshold.
4. The method according to claim 2, characterized in that, The red (R) value of the first color is different from the R value of the second color; The green (G) value of the first color is different from the G value of the second color; The blue (B) value of the first color is different from the B value of the second color.
5. The method according to claim 4, characterized in that, The sum of the red (R) value, green (G) value, and blue (B) value of the first color is the same as the sum of the R value, G value, and B value of the second color.
6. The method according to claim 1, characterized in that, The first image is a plurality of first images in the preview stream, and, Detecting the first image region corresponding to the encoded region in the first image includes: By performing cyclic difference on the RGB values of each pixel in multiple first images, the color information difference between adjacent first images in the preview stream is obtained; Based on the color information difference between adjacent first images, the first image region corresponding to the encoded region is detected.
7. The method according to claim 6, characterized in that, The step of performing cyclic difference on the RGB values of each pixel in multiple first images includes: Cyclic difference is performed on the sum of the R, G, and B values of each pixel in the plurality of first images.
8. The method according to claim 6, characterized in that, The step of detecting the first image region corresponding to the encoded region based on the color information difference between the first images that are adjacent in position includes: The color information difference between adjacent first images is subjected to noise filtering to obtain multiple features to be segmented. The region to be detected is determined by dividing the region based on each feature to be segmented. The region to be detected is matched with the reference template of the encoded region, and the region to be detected is determined as the region to be verified. The similarity between the region to be verified and the reference template is then determined. If the similarity between the region to be verified and the reference template meets the similarity condition, the first image region is determined based on the region to be verified.
9. The method according to claim 8, characterized in that, The number of regions to be verified is multiple, and the step of detecting the first image region corresponding to the encoded region based on the color information difference between adjacent first images further includes: Based on the similarity between each region to be verified and the reference template, determine the number of votes for each region to be verified; The vote counts for each verification region are aggregated to obtain the total number of votes; If the total number of votes is greater than the verification threshold, it is determined that the similarity between the region to be verified and the reference template meets the similarity condition.
10. The method according to claim 1, characterized in that, The image processing of the first image region includes: The defective areas in the first image region are filled in, wherein the defective areas include at least one of black spots, light spots, and environmental reflection images.
11. The method according to any one of claims 1-10, characterized in that, The electronic device is a foldable screen phone.
12. The method according to any one of claims 1-10, characterized in that, The first display screen is a low-temperature polycrystalline silicon oxide screen, and the refresh rate of the first display screen is less than the frame rate threshold.
13. An electronic device, characterized in that, include: Memory, used to store instructions executed by one or more processors of an electronic device, and A processor for executing instructions of the method as described in any one of claims 1-12.
14. A storage medium, characterized in that, The storage medium stores instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1-12.
15. A computer program product, characterized in that, include: A non-volatile computer-readable storage medium comprising computer program code for performing the method as described in any one of claims 1-12.