Image processing method, electronic device and chip
By acquiring multi-frame images and determining the maximum boundary point of the dynamic area, the problem of poor micro-motion image generation in the existing technology is solved, and better micro-motion image generation is achieved. It is suitable for electronic devices such as mobile phones and provides a quality judgment method. .
Patent Information
- Application Number
- CN202310226620.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-09
- Publication Date
- 2024-09-10
AI Technical Summary
The existing micro-motion picture background generation algorithm cannot obtain the optimal static background area, resulting in poor micro-motion picture generation effects, especially on mobile phones where the application scenarios are limited, and there is a lack of methods to distinguish between advantages and disadvantages, which affects the quality of the generated results.
By acquiring multiple frames of images, the static background area corresponding to each frame of image is determined, and the maximum boundary point of the dynamic area is determined based on these areas, and then the target static background area is determined, the target micro-motion map is generated, and the generation effect of the micro-motion map is improved.
It achieves the optimal static background area, improves the effect of micro-motion image generation, solves problems such as blur, ghosting, and occlusion in the process of micro-motion image generation, provides a method to judge the quality of micro-motion images, and ensures the accuracy of the generated results. Quality.
Smart Images

Figure CN118628520A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an image processing method, an electronic device and a chip. Background Art
[0002] The micro-animation contains a moving image area and a static background area. The moving image area is the area formed by the object that moves during the shooting, and the background area is the static background photo obtained by removing the moving image area from the captured photo.
[0003] During the time period of photo shooting, the moving image area is a continuously moving part. Therefore, the range covered by the moving image area is different for each frame of the image, so the static background area obtained after removing the moving image area is also different. In the process of generating micro-motion images, the adaptability of the static background area will directly affect the generation effect of the micro-motion images. However, the existing algorithms related to the background of micro-motion images cannot obtain the optimal static background area, resulting in poor generation effect of micro-motion images. Summary of the invention
[0004] The embodiments of the present application provide an image processing method, an electronic device, and a chip, which can improve the generation effect of micro-animation.
[0005] The technical solution of the embodiment of the present application is implemented as follows:
[0006] In a first aspect, an embodiment of the present application provides an image processing method, the method comprising:
[0007] Acquire multiple frames of images corresponding to the photographed target, and determine multiple static background areas corresponding to the multiple frames of images;
[0008] Based on the multiple static background areas, determining the maximum boundary point of the dynamic area in the multiple frames of images;
[0009] A target static background area is determined based on the maximum boundary point of the dynamic area, and a target micro-motion image corresponding to the photographed target is generated according to the target static background area.
[0010] In a second aspect, an embodiment of the present application provides an electronic device, the electronic device comprising an acquisition unit, a determination unit, and a generation unit.
[0011] The acquisition unit is used to acquire multiple frames of images corresponding to the photographed target;
[0012] The determining unit is used to determine a plurality of static background regions corresponding to the plurality of frames of images; and based on the plurality of static background regions, determine a maximum boundary point of a dynamic region in the plurality of frames of images; and based on the maximum boundary point of the dynamic region, determine a target static background region;
[0013] The generating unit is used to generate a target micro-motion image corresponding to the photographed target according to the target static background area.
[0014] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory storing instructions executable by the processor, a microprocessor, and an application processor; when the instructions are executed by the processor, the image processing method as described above is implemented.
[0015] In a fourth aspect, an embodiment of the present application provides a chip, which includes a programmable logic circuit and / or program instructions. When the chip is running, the image processing method as described above is implemented.
[0016] The embodiment of the present application provides an image processing method, an electronic device and a chip, wherein the electronic device obtains multiple frames of images corresponding to a photographed target, and determines multiple static background areas corresponding to the multiple frames of images; determines the maximum boundary point of the dynamic area in the multiple frames of images based on the multiple static background areas; determines the target static background area based on the maximum boundary point of the dynamic area, and generates a target micro-motion image corresponding to the photographed target according to the target static background area. It can be seen that in the embodiment of the present application, the electronic device can obtain multiple frames of images during the process of photographing the photographed target, and determine the maximum boundary point of the dynamic area by determining the multiple static background areas corresponding to each of the multiple frames of images, thereby obtaining the maximum range of the dynamic area; thereby determining the target static background area based on the maximum boundary point of the dynamic area, and obtaining the optimal static background area, and further, when generating the target micro-motion image corresponding to the photographed target according to the target static background area, the generation effect of the micro-motion image can also be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 Schematic diagram of the implementation process of the image processing method proposed in this application embodiment Figure 1 ;
[0018] Figure 2 Schematic diagram of the implementation of the image processing method proposed in the embodiment of the present application Figure 1 ;
[0019] Figure 3 Schematic diagram of the implementation of the image processing method proposed in the embodiment of the present application Figure 2 ;
[0020] Figure 4 Schematic diagram of the implementation of the image processing method proposed in the embodiment of the present application Figure 3 ;
[0021] Figure 5 Schematic diagram of the implementation process of the image processing method proposed in this application embodiment Figure 2 ;
[0022] Figure 6 Schematic diagram of the implementation process of the image processing method proposed in this application embodiment Figure 3 ;
[0023] Figure 7 Schematic diagram of the structure of the electronic device proposed in the embodiment of the present application Figure 1 ;
[0024] Figure 8 Schematic diagram of the structure of the electronic device proposed in the embodiment of the present application Figure 2 . DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. It is understood that the specific embodiments described herein are only used to explain the related applications, rather than to limit the applications. It should also be noted that, for ease of description, only the parts related to the related applications are shown in the drawings.
[0026] Micro-animated images contain a dynamic image area and a static background area. The dynamic image area is the area formed by objects that move during shooting, or the area of objects whose movement amplitude is greater than or equal to a certain threshold. The background area is the static background photo obtained by removing the dynamic image area from the captured photo.
[0027] During the time period of photo shooting, the moving image area is a continuously moving part. Therefore, the range covered by the moving image area is different for each frame of the image, so the static background area obtained after removing the moving image area is also different. To merge these different static background areas into a new background photo, a complete algorithm solution is required.
[0028] The main problems that need to be solved in the process of merging the background areas of each frame are: how to determine the best background area? How to merge the conflicting areas so that the final micro-motion image has no anomalies such as blur and ghosting.
[0029] The existing micro-animation background generation solution can solve some conflicts in the merging process, but it is not supported on mobile phones, which limits the application scenarios of micro-animations. Moreover, the background area obtained by its algorithm is not the optimal result. It is not the best solution in solving occlusion, blur, ghosting, etc. Although the most concerned part of the micro-animation is the animation part, if the background image is obviously mismatched, it will affect the effect of the entire micro-animation. In addition, the current micro-animation solution does not provide a method to judge the pros and cons, resulting in no effective trade-off judgment on the generated results to obtain a better quality micro-animation.
[0030] In order to solve the above problems, in the embodiments of the present application, the electronic device can obtain multiple frames of images corresponding to the shooting target, and determine multiple static background areas corresponding to the multiple frames of images; based on the multiple static background areas, determine the maximum boundary point of the dynamic area in the multiple frames of images; determine the target static background area based on the maximum boundary point of the dynamic area, and generate the target micro-motion image corresponding to the shooting target according to the target static background area. The optimal static background area can be obtained, thereby improving the generation effect of the micro-motion image
[0031] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0032] Figure 1 Schematic diagram of the implementation process of the image processing method proposed in this application embodiment Figure 1 ,like Figure 1 As shown, in an embodiment of the present application, a method for an electronic device to implement image processing may include the following steps:
[0033] Step 101: Acquire multiple frames of images corresponding to a photographed target, and determine multiple static background areas corresponding to the multiple frames of images.
[0034] In an embodiment of the present application, the electronic device may first acquire a plurality of frames of images corresponding to the photographed target, and determine a plurality of static background areas corresponding to the plurality of frames of images.
[0035] It should be noted that in the embodiments of the present application, the electronic device can be any electronic device with communication and storage functions, such as: tablet computers, mobile phones, e-readers, remote controls, personal computers (PCs), laptop computers, vehicle-mounted electronic devices, network televisions, wearable electronic devices, personal digital assistants (PDAs), portable media players (PMPs), navigation devices and other electronic devices.
[0036] It can be understood that, in the embodiments of the present application, the shooting target can be a dynamic target, so that the electronic device can generate a corresponding micro-motion image during the process of shooting the shooting target.
[0037] Furthermore, in an embodiment of the present application, during the process of photographing a target, for example, within a photographing time period, multiple frames of images corresponding to the target may be obtained, and since the target may be dynamic, the images in the multiple frames are not exactly the same.
[0038] Exemplarily, in an embodiment of the present application, a moving object (shooting target) is photographed, and the shooting time is 2 seconds. After 2 seconds of shooting, 6 frames of images corresponding to the moving object are obtained.
[0039] Further, in an embodiment of the present application, the electronic device may determine multiple static background areas corresponding to multiple frames of images. Specifically, the electronic device may determine the static background area corresponding to each frame of image, thereby obtaining multiple static background areas.
[0040] Illustratively, in an embodiment of the present application, after acquiring three frames of images, the electronic device respectively determines the static background areas corresponding to the three frames of images, that is, obtains three static background areas.
[0041] Furthermore, in some embodiments of the present application, when determining multiple static background areas corresponding to multiple frames of images, the electronic device may remove dynamic areas in the multiple frames of images respectively to obtain multiple static background areas.
[0042] It can be understood that in the embodiments of the present application, since the shooting target may be dynamic, the pictures in multiple frames are not exactly the same, so that there are dynamic areas and static background areas in each frame, and as the dynamic areas in each frame are different, the corresponding static background areas are also different.
[0043] It can also be understood that, in the embodiments of the present application, in each frame of image, the dynamic area is removed and the remaining area is the static background area.
[0044] Exemplarily, in an embodiment of the present application, the electronic device acquires two frames of images corresponding to the photographed target. Figure 2 Schematic diagram of the implementation of the image processing method proposed in the embodiment of the present application Figure 1 ,like Figure 2 As shown in the figure, in one of the acquired frames, the dynamic area is a hexagonal area, and the area other than the hexagonal area in the image is the static background area of the frame image. Figure 3 Schematic diagram of the implementation of the image processing method proposed in the embodiment of the present application Figure 2 ,like Figure 3 As shown in the figure, in the other frame of the two acquired images, the dynamic area is a trapezoidal area, and the static background area of the frame is the area other than the trapezoidal area. It can be seen that the dynamic area and static background area corresponding to each of the two frames of images are different.
[0045] Step 102: Based on multiple static background areas, determine the maximum boundary point of the dynamic area in multiple frames of images.
[0046] In an embodiment of the present application, after acquiring multiple frames of images corresponding to the shooting target and determining multiple static background areas corresponding to the multiple frames of images, the electronic device can determine the maximum boundary point of the dynamic area in the multiple frames of images based on the multiple static background areas.
[0047] It should be noted that, in the embodiment of the present application, the maximum boundary point of the dynamic area represents the maximum boundary point in each coordinate direction after the dynamic areas of the multiple frames of images are merged.
[0048] Furthermore, in some embodiments of the present application, when the electronic device determines the maximum boundary point of the dynamic area in multiple frame images based on multiple static background areas, it can first determine multiple dynamic area boundary points corresponding to the multiple static background areas; and then determine the maximum boundary point of the dynamic area among the multiple dynamic area boundary points based on a preset maximum boundary rule.
[0049] It should be noted that, in the embodiment of the present application, the preset maximum boundary rule is a union of boundary points determined based on multiple dynamic area boundary points, which is used as the maximum boundary point of the dynamic area.
[0050] It should be noted that, in the embodiments of the present application, the reason for determining the maximum boundary point of the dynamic area based on the union of boundary points determined by multiple dynamic area boundary points is to ensure that the dynamic area has sufficient display area. Since the focus of the micro-animation is the dynamic area, which is also the object that users focus on observing, if pixel missing occurs in the dynamic area, it is easy to find that the micro-animation has failed. On the contrary, the static background area will not be affected so much.
[0051] It should be noted that in the embodiments of the present application, when determining the union of the boundary points of the dynamic area based on the preset maximum boundary rule, thereby determining the maximum boundary point of the dynamic area, it is equivalent to selecting the point corresponding to the maximum displacement in each coordinate direction. For example, taking two-dimensional coordinates as an example, when the point is on the left, select the point with the smallest x value, when the point is on the right, select the point with the largest x value, and when the point is on the top, select the point with the largest y value. When the point is on the bottom, select the point with the smallest y value; three-dimensional coordinates have an additional z-axis direction compared to two-dimensional coordinates, and the same applies, that is, when the point is on the positive direction of the z-axis, select the point with the largest z value, and when the point is on the negative direction of the z-axis, select the point with the smallest z value.
[0052] It should be noted that, in the embodiment of the present application, among the multiple static background areas, there may be multiple corresponding dynamic area boundary points in each static background area.
[0053] For example, in the embodiment of the present application, during the micro-motion picture shooting, the area where the moving object (shooting target) is located may change, resulting in different areas after removing the moving object in each frame. If it is directly merged, there will be conflicts. Based on the above Figure 2 The two frames of images in Figure 4 Schematic diagram of the implementation of the image processing method proposed in the embodiment of the present application Figure 3 ,like Figure 4 As shown, after removing the dynamic area, the multiple dynamic area boundary points corresponding to the static background area of the first frame image are 1, 2, 3, 4, 5, and 6, and the multiple dynamic area boundary points corresponding to the static background area of the second frame image are 7, 8, 9, and 10; directly merging the two static background areas will result in an overlapping area as shown in the right figure. The present application marks the boundary points of the overlapping area according to the preset maximum boundary rule. The six points A to F in the figure are the maximum boundary points of the dynamic areas of the two frames of images.
[0054] Step 103: determine the target static background area based on the maximum boundary point of the dynamic area, and generate a target micro-motion image corresponding to the photographed target according to the target static background area.
[0055] In an embodiment of the present application, after the electronic device determines the maximum boundary point of the dynamic area in multiple frames of images based on multiple static background areas, it can determine the target static background area based on the maximum boundary point of the dynamic area, and generate a target micro-motion image corresponding to the photographed target based on the target static background area.
[0056] Furthermore, in some embodiments of the present application, when the electronic device determines the target static background area based on the maximum boundary points of the dynamic area, it can first connect the maximum boundary points of the dynamic area to obtain the maximum dynamic area; and determine other areas in the overall image area outside the maximum dynamic area as the target static background area; wherein the overall image area is the overall area corresponding to any one frame of the multiple frames.
[0057] For example, in the embodiments of the present application, as mentioned above Figure 3 As shown, the area obtained by connecting the six points A to F is determined as the maximum dynamic area, so that in the entire image area, other areas except the maximum dynamic area are determined as the target static background area.
[0058] It can be understood that in the embodiment of the present application, the newly determined maximum dynamic area can cover the range of changes of dynamic objects in the image within this shooting time period. If there is any range that cannot be covered, it means that the selection of this maximum dynamic area is unreasonable.
[0059] Furthermore, in an embodiment of the present application, if there is a situation where the dynamic area is incompletely filled, that is, the maximum dynamic area is large and there are still unfilled parts, it can be adapted according to the new target static background area. The adaptation method mainly involves expanding the previous dynamic area. The specific expansion method is not limited in this application.
[0060] Furthermore, in some embodiments of the present application, when the electronic device generates a target micro-motion image corresponding to the photographed target based on the target static background area, it can perform fusion processing based on the maximum dynamic area, the target static background area and multiple frames of images to obtain the target micro-motion image.
[0061] Furthermore, in some embodiments of the present application, the electronic device can determine the depth information corresponding to each pixel in each frame of multiple frames of images; then compare and process the depth information corresponding to multiple pixels in the multiple frames of images at the same pixel position to determine the maximum depth information; thereby determining the pixel corresponding to the maximum depth information as the target pixel at the pixel position in the target micro-motion image to generate a target micro-motion image.
[0062] It should be noted that, in an embodiment of the present application, depth information includes image depth information, pixel depth information and bit depth information; wherein, image depth information is used to describe the number of bits occupied by the RGB color of a pixel, pixel depth information is used to describe the number of bits occupied by all pixels, and bit depth information is used to describe the number of bits occupied by pixels constituting a channel.
[0063] Furthermore, in an embodiment of the present application, there is a conversion relationship between image depth information, pixel depth information and bit depth information. Therefore, when using depth information for comparison processing, any one of the information can be selected for comparison; illustratively, the present application uses pixel depth information for comparison processing, and by determining the pixel depth information corresponding to each pixel in each frame of multiple frames of images, the pixel depth information corresponding to multiple pixels in multiple frames of images at the same pixel position is compared and processed to determine the maximum value therein; even if the acquired depth information is image depth information, the image depth information can be converted into pixel depth information by calculating the conversion relationship for comparison; similarly, if bit depth information is acquired, the bit depth information can also be converted into pixel depth information for comparison.
[0064] It should be noted that in the embodiments of the present application, in the actual shooting process, due to factors such as the environment and equipment, the clarity of the same position between different frames is different, and the essence of this is that the depth information is different. Figure 3As shown, point C and point D are overlapped points in both frames. During the merging process, for point C and point D, the specific pixel point of which frame in the two frames should be selected needs to be selected based on the depth information of the points at the same position between the two frames, that is, the points corresponding to point C and point D. This application gives priority to selecting pixels with large depth information as the target pixels after merging, so as to ensure clarity during the merging process.
[0065] Furthermore, in an embodiment of the present application, in the process of fusing multiple frame images to obtain a target micro-motion image, both the dynamic area and the static background area are selected based on the depth information of the pixel points; for example, the pixel points in the target static background area are the pixel points with the largest depth information at the same position in the static background areas of multiple frames during the merging process, so as to ensure the clarity of the final target micro-motion image.
[0066] Furthermore, in an embodiment of the present application, after the electronic device determines the target static background area based on the maximum boundary point of the dynamic area and generates a target micro-motion image corresponding to the photographed target according to the target static background area, it can also execute a judgment process of whether to store the target micro-motion image.
[0067] Specifically, in some embodiments of the present application, if the target micro-motion image meets the preset storage condition, the generation time of the target micro-motion image is obtained; if the generation time is less than the preset threshold, the target micro-motion image is stored.
[0068] It should be noted that, in the embodiment of the present application, the preset storage conditions include: there is no dynamic area occlusion, no ghosting, and no blur.
[0069] That is to say, in the embodiment of the present application, only when the target micro-motion image has no dynamic area occlusion, no ghosting, no blur, and the generation time is less than a preset threshold, that is, only when the target micro-motion image satisfies these four conditions at the same time, the electronic device will retain the target micro-motion image for storage.
[0070] Further, in an embodiment of the present application, if the target micro-motion image does not meet the preset storage condition, the target micro-motion image is deleted; or, if the generation time is greater than or equal to a preset threshold, the target micro-motion image is deleted.
[0071] Among them, in the embodiments of the present application, the preset threshold can be set in combination with relevant parameters of the electronic device, and the present application does not limit it; for example, it can be set based on information such as the response speed of the camera application in the electronic device, or the time length for generating ordinary photos.
[0072] It should be noted that in an embodiment of the present application, the electronic device can also determine the above-mentioned dynamic area occlusion, ghosting, blurring and generation duration conditions during the process of generating the target micro-motion image. If any one of the conditions is not met, the target micro-motion image will not be generated.
[0073] Exemplarily, in an embodiment of the present application, in the process of generating any micro-motion image, there is no dynamic area occlusion, ghosting, or blurring. However, at this time, the generation time is already 3 seconds, and the preset threshold is 2 seconds, then the target micro-motion image will not be generated.
[0074] In addition, in the embodiments of the present application, after determining the target micro-motion image using the method proposed in the present application, the electronic device can use the above-mentioned dynamic area occlusion, ghosting, blurring and generation time to judge the quality of the target micro-motion image and decide whether to store it. In addition, the electronic device can also use the above-mentioned method to judge the quality of any acquired micro-motion image.
[0075] Furthermore, in the embodiments of the present application, the importance of the four situations of dynamic area occlusion, ghosting, blurring and generation duration can be ranked, with dynamic area occlusion being the most important influencing factor, followed by ghosting, followed by blurring, and finally generation duration; that is, if the static background area blocks the dynamic area, resulting in pixel loss in the dynamic area, it affects the viewing experience and is the most serious problem, because the dynamic area is the part of the micro-animation that users pay the most attention to. If there is no dynamic area occlusion, then it can be determined whether there is a ghosting situation, that is, the pixels at the same point are ghosted. The ghosting is caused by the inconsistent pixel depth information of the same point in different frames, and no trade-offs are made during the merging process, resulting in direct overlapping merging, which is especially obvious when the difference in pixel depth information is relatively large. If there is no ghosting problem, the next thing to judge is whether there are blurred pixels in the background image. There are two types of blurry situations. One is that the pixels at the same point in all frames are blurred, resulting in the inability to obtain a clear pixel during the merging process, even if the pixel with the largest depth information is selected. In this case, there is no better way except to use some artificial intelligence (AI) repair methods. The other is that during the merging process, the pixels at the same point do not select the pixels with the largest depth information, but select the pixels with small depth information, resulting in the generated background image being blurred. After all these judgments are completed, the generated target micro-motion image can be regarded as meeting the requirements, but a time-consuming judgment needs to be added, because the target micro-motion image needs to be deployed on an electronic device. If it takes too much time, it will also affect the efficiency of the micro-motion image generation, for example, causing the user to press the shooting button and not get the generated micro-motion image for a long time.
[0076] Exemplarily, in an embodiment of the present application, it is first determined whether there is any dynamic area occlusion in the target micro-motion image. If so, the target micro-motion image is directly deleted. If not, it is further determined whether there is a ghosting problem in the target micro-motion image. If so, the target micro-motion image is deleted. If not, it is further determined whether there is pixel blur in the target micro-motion image. If so, the target micro-motion image is deleted. If not, it is further determined whether the generation time of the target micro-motion image is greater than a preset threshold. If so, the target micro-motion image is deleted. If not, the target micro-motion image is retained and stored.
[0077] Furthermore, in an embodiment of the present application, after the electronic device determines to delete the target micro-motion image, it can continue to generate a new micro-motion image; specifically, the electronic device can output prompt information for generating the target micro-motion image, and then determine whether to continue generating a new micro-motion image by receiving instruction information corresponding to the prompt information; it can also directly use the already obtained multiple frames of images to re-fusion process after deleting the target micro-motion image to obtain a new micro-motion image.
[0078] In addition, in the embodiments of the present application, the above-mentioned image processing method can be used not only for micro-animations, but also for other graphics processing fields, such as the user interface (UI) view part of a mobile phone.
[0079] In summary, in the embodiments of the present application, it can support deployment on electronic devices such as mobile phones, solving the problem that there is no function to generate micro-motion pictures on current mobile phone cameras. In addition, the static background area generation method of the present application can effectively solve the problems of blur, ghosting, occlusion, etc. in the static background generation process of micro-motion pictures. It is a better solution for static background generation and can obtain better quality micro-motion pictures. Finally, the present application also provides a method for judging the quality of micro-motion pictures, which can be used to judge whether the micro-motion pictures meet the requirements during the actual shooting process. Those that do not meet the requirements will be eliminated, and only those that meet the requirements will be retained.
[0080] The embodiment of the present application provides an image processing method, in which an electronic device obtains multiple frames of images corresponding to a photographic target, and determines multiple static background areas corresponding to the multiple frames of images; based on the multiple static background areas, determines the maximum boundary point of the dynamic area in the multiple frames of images; determines the target static background area based on the maximum boundary point of the dynamic area, and generates a target micro-motion image corresponding to the photographic target according to the target static background area. It can be seen that in the embodiment of the present application, the electronic device can obtain multiple frames of images in the process of photographing the photographic target, and determine the maximum boundary point of the dynamic area by determining the multiple static background areas corresponding to each of the multiple frames of images, thereby obtaining the maximum range of the dynamic area; thereby determining the target static background area based on the maximum boundary point of the dynamic area, and obtaining the optimal static background area, and further when generating the target micro-motion image corresponding to the photographic target according to the target static background area, the generation effect of the micro-motion image can also be improved.
[0081] Based on the above embodiment, in another embodiment of the present application, exemplarily, Figure 5 Schematic diagram of the implementation process of the image processing method proposed in the embodiment of the present application Figure 2 ,like Figure 5As shown, assuming that the electronic device acquires two frames of images during the process of photographing the target, when the electronic device performs fusion processing based on the two frames of images, when determining the pixels in the merged micro-motion image, the following steps may be included: acquiring two frames of images pos1 and pos2 to be merged (step 201), acquiring the depth information of the two frames of images at the same pixel position (step 202), and then determining whether the depth information depth1 of pos1 is greater than the depth information depth2 of pos2? (step 203), if depth1 is greater than depth2, then selecting the pixel of pos1 (step 204), if depth2 is greater than depth1, then selecting the pixel of pos2 (step 205).
[0082] It should be noted that in the embodiments of the present application, during the actual shooting process, due to factors such as the environment and equipment, there are differences in the clarity of the same position between different frames, which is essentially due to different depth information.
[0083] For example, for the aforementioned Figure 3 Points C and D in the figure are the coincident points in the two frames. In the merging process, the specific pixel of one frame needs to be selected based on the depth information of the pixels at the same position between the two frames. The principle given here is: give priority to selecting pixels with large depth as the merged pixels, so as to ensure the clarity during the merging process.
[0084] Furthermore, in an embodiment of the present application, in the process of fusing multiple frame images to obtain a target micro-motion image, both the dynamic area and the static background area are selected based on the depth information of the pixel points; for example, the pixel points in the target static background area are the pixel points with the largest depth information at the same position in the static background areas of multiple frames during the merging process, so as to ensure the clarity of the final target micro-motion image.
[0085] Furthermore, in an embodiment of the present application, the depth information may include image depth information for describing the number of bits occupied by the RGB colors of a pixel, pixel depth information for describing the number of bits occupied by the entire pixel, and bit depth information for the number of bits occupied by a channel composed of pixels.
[0086] For example, in the embodiments of the present application, Figure 6 Schematic diagram of the implementation process of the image processing method proposed in this application embodiment Figure 3 ,like Figure 6The figure shows the steps taken by the electronic device when determining whether to store a target micro-motion image: first, determine whether the target micro-motion image has an occluded motion image area (step 301); if so, delete the target micro-motion image; if not, continue to determine whether there is a ghosting phenomenon (step 302); if so, delete the target micro-motion image; if not, continue to determine whether there are blurred pixels (step 303); if so, delete the target micro-motion image; if not, continue to determine whether it is time-consuming (step 304); if so, delete the target micro-motion image; if not, store it (step 305).
[0087] Among them, in an embodiment of the present application, when judging whether it is time-consuming, that is, when the electronic device executes step 304, it can be judged by setting a preset threshold. For example, if the generation time is greater than or equal to the preset threshold, it is determined that time is consumed and the target micro-animation is deleted.
[0088] Furthermore, in an embodiment of the present application, when the electronic device sets the time-consuming standard, that is, the value of the preset threshold, is not limited by the present application; for example, it can be set based on information such as the response speed of the camera application in the electronic device, or the time length to generate an ordinary photo.
[0089] Furthermore, in the embodiments of the present application, the importance of the four situations of dynamic area occlusion, ghosting, blurring and generation duration can be ranked, with dynamic area occlusion being the most important influencing factor, followed by ghosting, followed by blurring, and finally generation duration; that is, if the static background area blocks the dynamic area, resulting in pixel loss in the dynamic area, it affects the viewing experience and is the most serious problem, because the dynamic area is the part of the micro-animation that users pay the most attention to. If there is no dynamic area occlusion, then it can be determined whether there is a ghosting situation, that is, the pixels at the same point are ghosted. The ghosting is caused by the inconsistent pixel depth information of the same point in different frames, and no trade-offs are made during the merging process, resulting in direct overlapping merging, which is especially obvious when the difference in pixel depth information is relatively large. If there is no ghosting problem, the next thing to judge is whether there are blurred pixels in the background image. There are two types of blurry situations. One is that the pixels at the same point in all frames are blurred, resulting in the inability to obtain a clear pixel during the merging process, even if the pixel with the largest depth information is selected. In this case, there is no better way except to use some artificial intelligence (AI) repair methods. The other is that during the merging process, the pixels at the same point do not select the pixels with the largest depth information, but select the pixels with small depth information, resulting in the generated background image being blurred. After all these judgments are completed, the generated target micro-motion image can be regarded as meeting the requirements, but a time-consuming judgment needs to be added, because the target micro-motion image needs to be deployed on an electronic device. If it takes too much time, it will also affect the efficiency of the micro-motion image generation, for example, causing the user to press the shooting button and not get the generated micro-motion image for a long time.
[0090] Furthermore, in an embodiment of the present application, since the photographed target may be dynamic, the pictures in multiple frames are not exactly the same, so that there are dynamic areas and static background areas in each frame, and as the dynamic areas in each frame are different, the corresponding static background areas are also different.
[0091] As mentioned above Figure 3 As shown, after removing the dynamic area, the multiple dynamic area boundary points corresponding to the static background area of the first frame image are 1, 2, 3, 4, 5, and 6, and the multiple dynamic area boundary points corresponding to the static background area of the second frame image are 7, 8, 9, and 10; directly merging the two static background areas will result in an overlapping area as shown in the right figure. The present application marks the boundary points of the overlapping area according to the preset maximum boundary rule. The six points A to F in the figure are the maximum boundary points of the dynamic areas of the two frames of images.
[0092] It should be noted that, in the embodiment of the present application, the maximum boundary point of the dynamic area represents the maximum boundary point in each coordinate direction after the dynamic areas of the multiple frames of images are merged.
[0093] Furthermore, in some embodiments of the present application, when the electronic device determines the maximum boundary point of the dynamic area in multiple frame images based on multiple static background areas, it can first determine multiple dynamic area boundary points corresponding to the multiple static background areas; and then determine the maximum boundary point of the dynamic area among the multiple dynamic area boundary points based on a preset maximum boundary rule.
[0094] It should be noted that, in the embodiment of the present application, the preset maximum boundary rule is a union of boundary points determined based on multiple dynamic area boundary points, which is used as the maximum boundary point of the dynamic area.
[0095] It should be noted that, in the embodiments of the present application, the reason for determining the maximum boundary point of the dynamic area based on the union of boundary points determined based on multiple dynamic area boundary points is to ensure that the dynamic area has sufficient display area. Since the focus of the micro-animation is the dynamic area, which is also the object that users focus on observing, if pixel missing occurs in the dynamic area, it is easy to find that the micro-animation fails. On the contrary, the static background area will not be affected so much.
[0096] It should be noted that in the embodiments of the present application, when determining the union of the boundary points of the dynamic area based on the preset maximum boundary rule, thereby determining the maximum boundary point of the dynamic area, it is equivalent to selecting the point corresponding to the maximum displacement in each coordinate direction. For example, taking two-dimensional coordinates as an example, when the point is on the left, select the point with the smallest x value, when the point is on the right, select the point with the largest x value, and when the point is on the top, select the point with the largest y value. When the point is on the bottom, select the point with the smallest y value; three-dimensional coordinates have an additional z-axis direction compared to two-dimensional coordinates, and the same applies, that is, when the point is on the positive direction of the z-axis, select the point with the largest z value, and when the point is on the negative direction of the z-axis, select the point with the smallest z value.
[0097] Furthermore, in some embodiments of the present application, when the electronic device determines the target static background area based on the maximum boundary points of the dynamic area, it can first connect the maximum boundary points of the dynamic area to obtain the maximum dynamic area; and determine other areas in the overall image area outside the maximum dynamic area as the target static background area; wherein the overall image area is the overall area corresponding to any one frame of the multiple frames.
[0098] For example, in the embodiments of the present application, as mentioned above Figure 3 As shown, the area obtained by connecting the six points A to F is determined as the maximum dynamic area, so that in the entire image area, other areas except the maximum dynamic area are determined as the target static background area.
[0099] Furthermore, in an embodiment of the present application, if there is a situation where the dynamic area is incompletely filled, that is, the maximum dynamic area is large and there are still unfilled parts, it can be adapted according to the new target static background area. The adaptation method mainly involves expanding the previous dynamic area. The specific expansion method is not limited in this application.
[0100] It can be seen that in the embodiments of the present application, the range of the static background area is determined by using image data of multiple frames, that is, the matching problem of the static background and the dynamic area in the micro-motion image generation process is solved based on the maximum boundary point method; at the same time, in the process of fusion processing, the depth information of multiple frames of images is used to select pixel points in the overlapping area to obtain the clearest pixel points in the same group of images, which can improve the clarity and further improve the quality of the micro-motion image. In addition, a method for judging the quality of the micro-motion image is proposed, which provides a basis for whether to retain the micro-motion image.
[0101] The embodiment of the present application provides an image processing method, in which an electronic device obtains multiple frames of images corresponding to a photographic target, and determines multiple static background areas corresponding to the multiple frames of images; based on the multiple static background areas, determines the maximum boundary point of the dynamic area in the multiple frames of images; determines the target static background area based on the maximum boundary point of the dynamic area, and generates a target micro-motion image corresponding to the photographic target according to the target static background area. It can be seen that in the embodiment of the present application, the electronic device can obtain multiple frames of images in the process of photographing the photographic target, and determine the maximum boundary point of the dynamic area by determining the multiple static background areas corresponding to each of the multiple frames of images, thereby obtaining the maximum range of the dynamic area; thereby determining the target static background area based on the maximum boundary point of the dynamic area, and obtaining the optimal static background area, and further when generating the target micro-motion image corresponding to the photographic target according to the target static background area, the generation effect of the micro-motion image can also be improved.
[0102] Based on the above embodiment, in another embodiment of the present application, Figure 7 Schematic diagram of the structure of the electronic device proposed in the embodiment of the present application Figure 1 ,like Figure 7 As shown, the electronic device 10 proposed in the embodiment of the present application may include: an acquisition unit 11, a determination unit 12, a generation unit 13 and a storage unit 14.
[0103] The acquisition unit 11 is used to acquire multiple frames of images corresponding to the photographed target;
[0104] The determining unit 12 is used to determine a plurality of static background regions corresponding to the plurality of frames of images; and based on the plurality of static background regions, determine a maximum boundary point of a dynamic region in the plurality of frames of images; and based on the maximum boundary point of the dynamic region, determine a target static background region;
[0105] The generating unit 13 is used to generate a target micro-motion image corresponding to the photographed target according to the target static background area.
[0106] Furthermore, the determination unit 12 is further configured to determine a plurality of dynamic area boundary points corresponding to the plurality of static background areas; and determine the dynamic area maximum boundary point among the plurality of dynamic area boundary points based on a preset maximum boundary rule.
[0107] Furthermore, the determination unit 12 is also used to connect the maximum boundary points of the dynamic area to obtain the maximum dynamic area; and determine other areas in the overall image area outside the maximum dynamic area as the target static background area; wherein the overall image area is the overall area corresponding to any one frame of the multiple frames.
[0108] Furthermore, the generating unit 13 is further configured to perform fusion processing based on the maximum dynamic area, the target static background area and the multiple frames of images to obtain the target micro-motion image.
[0109] Furthermore, the determination unit 12 is further configured to remove the dynamic regions in the multiple frames of images respectively to obtain the multiple static background regions.
[0110] Furthermore, the determination unit 12 is also used to determine the depth information corresponding to each pixel point in each frame of the multiple frames of images; compare the depth information corresponding to multiple pixel points in the multiple frames of images at the same pixel point position to determine the maximum depth information; determine the pixel point corresponding to the maximum depth information as the target pixel point at the pixel point position in the target micro-motion image to generate the target micro-motion image.
[0111] Furthermore, the depth information includes image depth information, pixel depth information and bit depth information.
[0112] Furthermore, the acquisition unit 11 is further configured to acquire a generation time of the target micro-motion image after the generation unit 13 generates a target micro-motion image corresponding to the photographed target according to the target static background area, if the target micro-motion image meets a preset storage condition.
[0113] The storage unit 14 is configured to store the target micro-animation image if the generation time is less than a preset threshold.
[0114] Furthermore, the preset storage conditions include: there is no dynamic area occlusion, no ghosting, and no blur.
[0115] Furthermore, the generating unit 13 is further configured to delete the target micro-motion image if the target micro-motion image does not satisfy the preset storage condition; or to delete the target micro-motion image if the generating time is greater than or equal to the preset threshold.
[0116] In the embodiments of the present application, further, Figure 8 Schematic diagram of the structure of the electronic device proposed in the embodiment of the present application Figure 2 ,like Figure 8 As shown, the electronic device 10 proposed in the embodiment of the present application may also include a processor 15 and a memory 16 storing executable instructions of the processor 15; further, the electronic device 10 may also include a communication interface 17, and a bus 18 for connecting the processor 15, the memory 16 and the communication interface 17.
[0117] In the embodiment of the present application, the processor 15 can be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, and a microprocessor. It can be understood that for different devices, the electronic device used to implement the function of the processor can also be other, and the embodiment of the present application is not specifically limited. The electronic device 10 can also include a memory 16, which can be connected to the processor 15, wherein the memory 16 is used to store executable program code, the program code includes computer operation instructions, and the memory 16 may include a high-speed RAM memory, and may also include a non-volatile memory, for example, at least two disk memories.
[0118] In the embodiment of the present application, the bus 18 is used to connect the communication interface 17, the processor 15 and the memory 16, and the mutual communication between these devices.
[0119] In the embodiment of the present application, the memory 16 is used to store instructions and data.
[0120] Furthermore, in an embodiment of the present application, the above-mentioned processor 15 is used to obtain multiple frames of images corresponding to the photographed target, and determine multiple static background areas corresponding to the multiple frames of images; based on the multiple static background areas, determine the maximum boundary points of the dynamic areas in the multiple frames of images; determine the target static background area based on the maximum boundary points of the dynamic area, and generate a target micro-motion image corresponding to the photographed target according to the target static background area.
[0121] In practical applications, the memory 16 may be a volatile memory, such as a random access memory (RAM); or a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk (HDD) or a solid-state drive (SSD); or a combination of the above types of memory, and provide instructions and data to the processor 15.
[0122] In addition, each functional module in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or software functional modules.
[0123] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method of this embodiment. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0124] An embodiment of the present application provides an electronic device, which obtains multiple frames of images corresponding to a photographic target, and determines multiple static background areas corresponding to the multiple frames of images; determines the maximum boundary point of the dynamic area in the multiple frames of images based on the multiple static background areas; determines the target static background area based on the maximum boundary point of the dynamic area, and generates a target micro-motion image corresponding to the photographic target according to the target static background area. It can be seen that in an embodiment of the present application, the electronic device can obtain multiple frames of images during the process of photographing the photographic target, and determine the maximum boundary point of the dynamic area by determining the multiple static background areas corresponding to each of the multiple frames of images, thereby obtaining the maximum range of the dynamic area; thereby determining the target static background area based on the maximum boundary point of the dynamic area, and obtaining the optimal static background area, and further, when generating a target micro-motion image corresponding to the photographic target according to the target static background area, the generation effect of the micro-motion image can also be improved.
[0125] Specifically, the program instructions corresponding to a detection method in this embodiment can be stored in a storage medium such as a CD, a hard disk, a USB flash drive, etc. When the program instructions corresponding to a detection method in the storage medium are read or executed by an electronic device, the following steps are included:
[0126] Acquire multiple frames of images corresponding to the photographed target, and determine multiple static background areas corresponding to the multiple frames of images;
[0127] Based on the multiple static background areas, determining the maximum boundary point of the dynamic area in the multiple frames of images;
[0128] A target static background area is determined based on the maximum boundary point of the dynamic area, and a target micro-motion image corresponding to the photographed target is generated according to the target static background area.
[0129] The present application provides a chip, which includes a programmable logic circuit and / or program instructions. When the chip is running, the detection method described above is implemented, which specifically includes the following steps:
[0130] Acquire multiple frames of images corresponding to the photographed target, and determine multiple static background areas corresponding to the multiple frames of images;
[0131] Based on the multiple static background areas, determining the maximum boundary point of the dynamic area in the multiple frames of images;
[0132] A target static background area is determined based on the maximum boundary point of the dynamic area, and a target micro-motion image corresponding to the photographed target is generated according to the target static background area.
[0133] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of hardware embodiments, software embodiments, or embodiments in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.
[0134] The present application is described with reference to implementation flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0135] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which is implemented in the implementation flow diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0136] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing the steps in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0137] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application.
Claims
1. An image processing method, It is characterized in that The method comprises: Acquire multiple frames of images corresponding to the photographed target, and determine multiple static background areas corresponding to the multiple frames of images; Based on the multiple static background areas, determining the maximum boundary point of the dynamic area in the multiple frames of images; A target static background area is determined based on the maximum boundary point of the dynamic area, and a target micro-motion image corresponding to the photographed target is generated according to the target static background area.
2. The method according to claim 1, It is characterized in that The step of determining the maximum boundary point of the dynamic area in the multiple frames of images based on the multiple static background areas includes: Determine a plurality of dynamic area boundary points corresponding to the plurality of static background areas; Based on a preset maximum boundary rule, the dynamic area maximum boundary point is determined among the multiple dynamic area boundary points.
3. The method according to claim 2, It is characterized in that The determining of the target static background area based on the maximum boundary point of the dynamic area includes: Connecting the maximum boundary points of the dynamic area to obtain the maximum dynamic area; The other areas in the overall image area except the maximum dynamic area are determined as the target static background area; wherein the overall image area is the overall area corresponding to any one frame of the multiple frames of images.
4. The method according to claim 3, It is characterized in that The step of generating a target micro-motion image corresponding to the photographed target according to the target static background area includes: The target micro-motion image is obtained by performing fusion processing based on the maximum dynamic area, the target static background area and the multiple frames of images.
5. The method according to claim 4, It is characterized in that The determining of a plurality of static background areas corresponding to the plurality of frames of images comprises: The dynamic areas in the multiple frames of images are removed respectively to obtain the multiple static background areas.
6. The method according to claim 1, It is characterized in that The method further comprises: Determine depth information corresponding to each pixel in each frame of the multiple frames of images; Comparing the depth information corresponding to the multiple pixels in the multiple frames of images at the same pixel position to determine the maximum depth information; The pixel point corresponding to the maximum depth information is determined as the target pixel point at the pixel point position in the target micro-motion image, so as to generate the target micro-motion image.
7. The method according to claim 6, It is characterized in that The depth information includes image depth information, pixel depth information and bit depth information.
8. The method according to claim 1, It is characterized in that After determining the target static background area based on the maximum boundary point of the dynamic area, and generating a target micro-motion image corresponding to the photographed target according to the target static background area, the method further includes: If the target micro-motion image meets the preset storage condition, obtaining the generation time of the target micro-motion image; If the generation time is less than a preset threshold, the target micro-animation image is stored.
9. The method according to claim 8, It is characterized in that The preset storage conditions include: there is no dynamic area occlusion, no ghosting, and no blur.
10. The method according to claim 9, It is characterized in that The method further comprises: If the target micro-motion image does not meet the preset storage condition, deleting the target micro-motion image; or, If the generation time is greater than or equal to the preset threshold, the target micro-animation image is deleted.
11. An electronic device, It is characterized in that The electronic device includes an acquisition unit, a determination unit and a generation unit. The acquisition unit is used to acquire multiple frames of images corresponding to the photographed target; The determining unit is used to determine a plurality of static background areas corresponding to the plurality of frames of images; and determining the maximum boundary point of the dynamic area in the multiple frames of images based on the multiple static background areas; and determining a target static background area based on the maximum boundary point of the dynamic area; The generating unit is used to generate a target micro-motion image corresponding to the photographed target according to the target static background area.
12. An electronic device, It is characterized in that The electronic device includes a processor and a memory storing instructions executable by the processor; when the instructions are executed by the processor, the method according to any one of claims 1 to 10 is implemented.
13. A chip, It is characterized in that The chip includes a programmable logic circuit and / or program instructions, and when the chip is running, the method according to any one of claims 1 to 10 is implemented.
