Image processing method and related equipment
By segmenting, edge expansion, optimization processing and stitching of images, the splicing trace problems that occur during image segmentation and stitching are solved, and a better imaging effect is achieved.
Patent Information
- Application Number
- CN202411228538.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-09-03
AI Technical Summary
The prior art is prone to obvious splicing traces during image segmentation and splicing, which affects the imaging effect.
By segmenting the image, multiple sub-images are obtained, edge expansion processing and image optimization processing are performed, edge expansion areas are eliminated, and stitched based on the association relationship of the sub-images to generate a target image.
It effectively avoids the stitching traces that appear after the image is split and stitched, and improves the image imaging effect.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of terminals, and in particular, relates to an image processing method and related equipment. Background Art
[0002] In order to improve the photo-taking effect, the related technology usually uses a multi-frame fusion algorithm to fuse multiple original frames with different exposure levels to obtain a captured image with a high dynamic range. Since the size of the original frame is large, each original frame is usually segmented when the multi-frame fusion algorithm is called, and the multi-frame fusion algorithm is used to perform multi-frame fusion on multiple segmented block images at the same position (for example, at the upper left corner of the original frame) in multiple original frames to obtain a fused block image, and then the fused block images corresponding to the obtained multiple positions are spliced, and the spliced image is used as the captured image.
[0003] However, due to the large difference in edges between different fusion block images, this method will produce obvious stitching marks in the captured images, affecting the imaging effect. Summary of the invention
[0004] In view of the above, it is necessary to provide an image processing method and related equipment, which can solve the problem of obvious splicing marks in the whole image obtained by splicing after the image is segmented in the related art.
[0005] In a first aspect, the present application provides an image processing method, the method comprising: segmenting an image to obtain a plurality of sub-images; performing edge expansion processing on each sub-image based on an edge region of each sub-image to obtain a first image corresponding to each sub-image, each first image comprising a corresponding sub-image and a corresponding edge expansion region; performing image optimization processing on each first image to obtain an optimized image; performing edge cutting on the corresponding optimized image according to the edge expansion region to obtain a second image corresponding to each first image; and splicing a plurality of second images according to an association relationship between each second image and the corresponding sub-image to obtain a target image.
[0006] Through the above technical solution, the image can be segmented to obtain multiple sub-images; the edge area of the sub-image is edge-expanded to obtain the first image corresponding to each sub-image, so that the edge expansion area of the first image has a mirror mapping relationship with the edge area of the corresponding sub-image; then the first image can be optimized to enhance the edge features of each first image; the edge expansion area in the optimized image is cut to obtain the second image, and the edge expansion in the optimized image can be eliminated, so that the second image has the same size as the corresponding sub-image; based on the association between the second image and the corresponding sub-image, multiple second images are spliced to obtain the target image. It can effectively avoid the appearance of splicing marks in the whole image obtained by splicing after the image is segmented.
[0007] In a possible implementation, segmenting the image to obtain a plurality of sub-images includes: determining a segmentation number according to an image size and a preset segmentation size; and segmenting the image based on the segmentation number to obtain the plurality of sub-images.
[0008] Through the above technical solution, by presetting the segmentation size and determining the number of segmentations based on the ratio of the image size to the segmentation size, the image is segmented to obtain a plurality of sub-images of the same size.
[0009] In a possible implementation, the method further includes: if the ratio between the image size and the segmentation size is not an integer, segmenting the edge area of the image using a preset overlapping strategy so that the sub-image corresponding to the edge area has an overlapping area with an adjacent sub-image.
[0010] In a possible implementation, the preset overlapping strategy includes: based on the principle of minimizing the overlapping area between the multiple sub-images, determining the overlapping area according to the union of the sub-image corresponding to the edge area and the adjacent sub-image.
[0011] The above technical solution can effectively reduce the difficulty of the segmentation algorithm and ensure the standardization of the sub-image size. When processing edge areas with non-integer ratios, a preset overlapping strategy is adopted so that the sub-images in the edge areas overlap with the adjacent sub-images, thereby ensuring the integrity of the image information and improving the flexibility and accuracy of image processing.
[0012] In a possible implementation manner, the method further includes: constructing the edge expansion area based on a preset expansion parameter, wherein the expansion parameter includes the number of pixels corresponding to the size of the edge expansion area.
[0013] Through the above technical scheme, an edge expansion area can be constructed based on preset expansion parameters, and the size of the expansion area can be adjusted according to specific needs, thereby increasing the flexibility and adaptability of edge expansion processing, enabling the edge expansion processing algorithm to cope with image processing requirements in different scenarios, thereby improving the versatility and practicality of the algorithm.
[0014] In a possible implementation, the method for determining the extended parameters includes: obtaining environmental parameters corresponding to the image, and determining the extended parameters based on the environmental parameters; and / or obtaining brightness parameters of the image, and determining the extended parameters based on the brightness parameters.
[0015] In a possible implementation manner, the environmental parameter includes an illumination of a shooting environment corresponding to the image, and determining the extended parameter according to the environmental parameter includes: making the extended parameter inversely proportional to the environmental parameter.
[0016] Through the above technical solution, by making the expansion parameter inversely proportional to the ambient illumination, the expansion parameter can be automatically increased in a dark environment, significantly expanding the edge expansion area of the sub-image, and providing more context information for the edge feature extraction of the sub-image. This helps to capture more complete and accurate sub-image edge features, further reduce the splicing marks or edge blur caused by insufficient lighting, and improve the overall image processing effect.
[0017] In a possible implementation manner, the brightness parameter is proportional to the average brightness of the image, and determining the expansion parameter according to the brightness parameter includes: making the expansion parameter inversely proportional to the brightness parameter.
[0018] Through the above technical solution, the average brightness of the image can be directly calculated, which can more accurately capture the overall brightness and darkness of the image. Adjusting the expansion parameters based on the brightness and darkness characteristics of the image can make the setting of the expansion parameters more in line with the actual needs of the image, which helps to obtain high-quality image processing results in a wider range of scenarios.
[0019] In a possible implementation, the performing edge expansion processing on each sub-image based on the edge region of each sub-image includes: mirror-filling the edge expansion region corresponding to each sub-image based on the pixel value of the first pixel point in the edge region of each sub-image.
[0020] Through the above technical solution, the edge expansion area of the sub-image can be effectively filled based on the mirror filling technology, so that the edge expansion area has the feature of being a mirror image of the edge area of the sub-image.
[0021] In a possible implementation, the mirroring filling of the edge extension area corresponding to each sub-image based on the pixel value of the first pixel point in the edge area of each sub-image includes: determining a second pixel point in the edge extension area that has a corresponding relationship with the first pixel point, the corresponding relationship including a one-to-one mirror mapping relationship; and determining, based on the pixel value of the first pixel point, the pixel value of the second pixel point corresponding to the first pixel point.
[0022] Compared with other filling methods (such as zero filling, etc.), the above technical solution can ensure the consistency and continuity of the feature representation of the edge area of the sub-image, because the pixel values of the edge expansion area and the pixel values of the edge area of the original sub-image have a mirror mapping relationship. Therefore, based on the more complete feature representation of the edge area of the sub-image, the appearance of splicing marks can be avoided in the subsequent splicing process.
[0023] In a possible implementation, performing image optimization processing on each of the first images to obtain an optimized image includes: obtaining image features of each of the first images by performing a convolution operation on each of the first images; and optimizing edge areas of sub-images in each of the first images based on the image features of each of the first images.
[0024] Through the above technical solution, the convolution operation can be used to accurately extract the complete features of the edge area of the sub-image in each first image, and the edge area of adjacent sub-images can be optimized based on these features, which can significantly reduce the edge differences between sub-images and effectively avoid the appearance of stitching marks in subsequent stitched images.
[0025] In a possible implementation, performing edge cutting on the corresponding optimized image according to the edge extension area to obtain the second image corresponding to each first image includes: performing edge cutting on the corresponding optimized image according to the size of the edge extension area so that the second image has the same size as the corresponding sub-image.
[0026] Through the above technical solution, the edge expansion area in the optimized image can be precisely cut to remove unnecessary edge expansion parts, ensuring that the final second image is completely consistent with the original sub-image in size. It can not only retain the edge optimization effect of the sub-image, but also restore the original size of the sub-image, which is convenient for splicing in the subsequent process to obtain an image with the same size as the original complete image.
[0027] In a possible implementation, the step of stitching a plurality of second images according to the association relationship between each second image and the corresponding sub-image to obtain a target image includes: determining the position information of the second image corresponding to the sub-image according to the position information of the sub-image in the image; and stitching the plurality of second images according to the position information of each second image to obtain the target image.
[0028] Through the above technical solution, the position information of the sub-images in the original image can be used to accurately locate and splice these second images, and finally generate a seamless, high-quality target image, which can effectively avoid the appearance of splicing marks in the target image.
[0029] In a second aspect, the present application provides a terminal device, comprising a memory and a processor: wherein the memory is used to store program instructions; the processor is used to read and execute the program instructions stored in the memory, and when the program instructions are executed by the processor, the terminal device executes the above-mentioned image processing method.
[0030] In a third aspect, the present application provides a chip coupled to a memory in a terminal device, wherein the chip is used to control a processor of the terminal device to execute the above-mentioned image processing method.
[0031] In a fourth aspect, the present application provides a computer storage medium storing program instructions, which, when executed on a terminal device, causes a processor of the terminal device to execute the above-mentioned image processing method.
[0032] In addition, the technical effects brought about by the second to fourth aspects can be found in the descriptions related to the methods of each design in the above method part, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 This is an example diagram of a captured image provided by an embodiment of the present application.
[0034] Figure 2 This is a software architecture diagram of a terminal device provided in one embodiment of the present application.
[0035] Figure 3 It is a flowchart of an image processing method provided by an embodiment of the present application.
[0036] Figure 4 This is an example diagram of image segmentation provided by an embodiment of the present application.
[0037] Figure 5 This is an example diagram of image segmentation provided by another embodiment of the present application.
[0038] Figure 6This is an example diagram of a sub-image provided in an embodiment of the present application.
[0039] Figure 7 This is an example diagram of a target distribution histogram corresponding to the target distribution data provided in an embodiment of the present application.
[0040] Figure 8 This is an example diagram of a sub-image after edge expansion provided by an embodiment of the present application.
[0041] Fig. 9 This is an example diagram of the mirror filling process provided by an embodiment of the present application.
[0042] Fig.10 This is an example diagram of a target image provided by an embodiment of the present application.
[0043] Fig.11 It is a flowchart of an image processing method provided by another embodiment of the present application.
[0044] Fig.12 This is a flowchart of an image processing method provided by another embodiment of the present application.
[0045] Fig.13 This is a comparative example of the image processing method provided in one embodiment of the present application.
[0046] Fig.14 This is a flowchart of an image processing method provided in yet another embodiment of the present application.
[0047] Fig.15 A hardware architecture diagram of a terminal device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0048] The terms "first" and "second" involved in an embodiment of the present application are only used for descriptive purposes and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in an embodiment of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way.
[0049] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by technicians in the technical field in this application. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. It should be understood that, unless otherwise specified in this application, " / " means or. For example, A / B can represent A or B. "And / or" in this application is only a description of the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. "At least one" refers to one or more. "Multiple" refers to two or more than two. For example, at least one of a, b or c can represent: a, b, c, a and b, a and c, b and c, a, b and c. In the absence of conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0050] In order to improve the photographic effect, the relevant technology usually uses a multi-frame fusion algorithm to fuse multiple original frames with different exposure levels to obtain a captured image with a high dynamic range. For example, when using the captured image of a terminal device, the image sensor of the terminal device can obtain the original image data corresponding to the captured scene, such as a RAW (Raw Image Format) image. By fusing multiple RAW images taken continuously in a short period of time, a higher quality image can be generated as the captured image.
[0051] However, in order to preserve more image details, raw frames (such as RAW images) usually store image data in a lossless or nearly lossless manner, resulting in raw frames usually having a larger file size than images of other formats (such as JPEG format) of the same size (or resolution). Raw frames require more storage space and may require longer processing time and larger processing memory.
[0052] In one example, in order to save memory space and algorithm processing time, each original frame is usually segmented when calling the multi-frame fusion algorithm to obtain multiple smaller segmented block images corresponding to each original frame. The multi-frame fusion algorithm is used to perform multi-frame fusion on multiple segmented block images located at the same position (for example, located at the upper left corner of the original frame) in multiple original frames to obtain a fused block image corresponding to each position. The obtained fused block images corresponding to the multiple positions are spliced, and the spliced image is used as the captured image. In this way, it is possible to reduce the processing memory and processing time required for the multi-frame fusion algorithm based on the image segmentation algorithm and the image stitching algorithm.
[0053] However, the edge differences between different fused block images obtained by the method in the above example may be large. The main reasons include the following aspects: (a) Due to the lighting conditions corresponding to each original frame, slight changes in camera position or angle, and the movement or deformation of objects in each original frame, the image content of different original frames at the same position may be different. These differences will be magnified in the segmented block images, especially at the edges, because the edges are the areas where the image content changes most dramatically. (b) When using the multi-frame fusion algorithm to process multiple segmented block images at different positions, the fusion results may be inconsistent between the block images at different positions due to the limitations of the algorithm itself or different parameter settings. This inconsistency is particularly obvious at the edges of the block images, because the edges are sensitive areas processed by the algorithm. (c) In the process of segmenting, fusing and splicing the original frames, certain image processing errors will be introduced. These errors accumulate in multiple processing steps and eventually appear as obvious splicing traces in the spliced image, especially at the edges.
[0054] Therefore, the captured image obtained by the above method will have obvious stitching marks, which will affect the imaging effect. Figure 1 As shown in FIG. 1 , an example of a captured image provided by an embodiment of the present application is shown, in which there are obvious splicing traces. For example, the color, brightness, texture, etc. of each fused block image are discontinuous at the splicing point.
[0055] In order to solve the above problems, an embodiment of the present application provides an image processing method, which can effectively avoid the appearance of splicing marks in the entire image obtained by splicing the image after it is segmented through mirror filling and edge optimization algorithms.
[0056] The image processing method can be applied to various terminal devices including display devices, such as mobile phones, tablet computers, wearable devices, camera devices, computers, self-mobile devices, etc. The terminal device includes an application processor, which is used to run an operating system. Figure 2 The software structure of the terminal device is illustrated by way of example.
[0057] See also Figure 2 As shown, it is a software architecture diagram of the terminal device provided in the embodiment of the present application. The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. For example, the Android system is from top to bottom respectively an application layer 101, a framework layer 102, an Android runtime (Android runtime) and a system library 103, a hardware abstraction layer 104, a kernel layer 105, and a hardware layer 106.
[0058] The application layer 101 may include a series of application packages, such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, device control service and other applications.
[0059] The framework layer 102 provides an application programming interface (API) and a programming framework for the application programs of the application layer. The application framework layer includes some predefined functions. For example, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc.
[0060] Among them, the window manager is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc. The content provider is used to store and obtain data and make the data accessible to applications. The data can include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc. The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, the display interface including the SMS notification icon can include a view for displaying text and a view for displaying pictures. The phone manager is used to provide communication functions for terminal devices. For example, the management of call status (including connected, hung up, etc.). The resource manager provides various resources for applications, such as localized strings, icons, pictures, layout files, video files, etc. The notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the top status bar of the system in the form of an icon or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in the status bar, a prompt sound is emitted, the terminal device vibrates, the indicator light flashes, etc.
[0061] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system. The core library contains two parts: one is the function that the Java language needs to call, and the other is the Android core library.
[0062] The application layer 101 and the framework layer 102 run in a virtual machine. The virtual machine executes the Java files of the application layer and the framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0063] The system library 103 may include multiple functional modules, such as a surface manager, a media library, a 3D graphics processing library (eg, Open GLES), a 2D graphics engine (eg, SGL), and the like.
[0064] Among them, the surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of multiple commonly used audio and video formats, as well as static image files. The media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing. The 2D graphics engine is a drawing engine for 2D drawing.
[0065] The hardware abstraction layer 104 runs in the user space, encapsulates the kernel layer driver, and provides a calling interface to the upper layer.
[0066] The kernel layer 105 is a layer between hardware and software, and includes at least a display driver, a touch driver, an audio driver, and a sensor driver.
[0067] The kernel layer 105 is the core of the operating system of the terminal device. It is the first layer of software expansion based on hardware, provides the most basic functions of the operating system, is the basis of the operating system, is responsible for managing the system's processes, memory, device drivers, files and network systems, and determines the performance and stability of the system. For example, the kernel layer can determine the operating time of an application on a certain part of the hardware.
[0068] The kernel layer 105 includes programs closely related to the hardware, such as interrupt handlers, device drivers, etc., and also includes basic, common, and high-frequency modules, such as clock management modules, process scheduling modules, etc., and also includes key data structures. The kernel layer can be set in the processor or solidified in the internal memory.
[0069] The hardware layer 106 includes the hardware of the terminal device, such as a display screen, buttons, a camera, etc.
[0070] See also Figure 3 FIG. 1 is a flowchart of an image processing method provided by an embodiment of the present application. The image processing method can be applied to various terminal devices, and specifically includes the following process.
[0071] S301, segmenting an image to obtain a plurality of sub-images.
[0072] In some embodiments of the present application, an image may be represented as an image to be segmented. For example, the image to be segmented may be an image with a large file size. In one example, in response to a user's shooting operation, a plurality of RAW images may be obtained using an image sensor of a terminal device, and each RAW image may be used as an image to be segmented. The shooting operation may be an operation in which a user enters a shooting application and clicks on a shooting control, or an operation in which a user calls a camera to shoot in other applications (for example, an application with an image shooting or sharing function). In another example, an image input by a user may also be received as an image to be segmented. The present application does not specifically limit the method of obtaining an image.
[0073] In some embodiments of the present application, the image parameters of the image are known data. For example, the image parameters of the image may include but are not limited to image file size, image resolution, image size, etc.
[0074] In some embodiments of the present application, in order to reduce the difficulty of the segmentation algorithm, the segmentation size can be preset according to actual needs, and the segmentation size can be used to define the size (or resolution) of the sub-image obtained after segmentation. In this embodiment, the number of segmentations can be determined according to the image size and the preset segmentation size. The image is segmented based on the number of segmentations to obtain multiple sub-images. In one example, image segmentation according to image size is only one implementation method, and is not limited to this in actual applications.
[0075] In some embodiments of the present application, the image size can be determined according to the image resolution, and the image size can include the size of one or more dimensions (such as height and width), for example, the image size of the first dimension and / or the image size of the second dimension. The segmentation size can include a size that has a corresponding relationship with the image size. For example, if the image size includes the image size of the first dimension, the segmentation size can include the segmentation size of the first dimension accordingly. If the image size includes the image size of the second dimension, the segmentation size can include the segmentation size of the second dimension accordingly.
[0076] In one example, if the resolution of the image is H*W, the image size may include H and W, where H represents the image size of the first dimension (e.g., the height of the image), and W represents the image size of the second dimension (e.g., the width of the image). In one example, if the resolution of the sub-image is h*w, the segmentation size may include h and w, where h represents the segmentation size of the first dimension (e.g., the height of the sub-image), and w represents the segmentation size of the second dimension (e.g., the width of the sub-image). Wherein, h<H, and w<W.
[0077] In the embodiment of the present application, the number of segments can be obtained by rounding up the ratio of the image size to the segmentation size. In one example, the number of segments of the corresponding dimension can be determined according to the ratio of the image size to the segmentation size of each dimension. For example, the number of segments of the first dimension k1= Image size in the first dimension / segmentation size in the first dimension = H / h , the number of divisions in the second dimension k2= Image size in the second dimension / segmentation size in the second dimension = W / w .in, In another example, the number of divisions may be the product of the number of divisions of the first dimension and the number of divisions of the second dimension, such as k1*k2.
[0078] In some embodiments of the present application, the image can be segmented based on the number of segmentations according to a preset overlapping strategy. The preset overlapping strategy includes: based on the principle of minimizing the overlapping area between sub-images, the overlapping area is determined according to the union of the sub-image corresponding to the edge area and the adjacent sub-image. The minimization can be zero, for example, when multiple sub-images do not overlap at all. In one example, if the ratio between the image size and the segmentation size is an integer, the image is evenly segmented according to the number of segmentations to obtain multiple sub-images, so that there is no overlapping area between all sub-images.
[0079] In one example, when segmenting an image in a first dimension, if the ratio of the image size in the first dimension to the segmentation size in the first dimension is an integer, for example, the image size in the first dimension / the segmentation size in the first dimension= Image size in the first dimension / segmentation size in the first dimension = the number of divisions in the first dimension, k1 (e.g. 4). Figure 4 As shown, according to the principle of minimizing the overlapping area, multiple (for example, k1-1=4-1=3) first segmentation lines parallel to each other can be determined according to integer multiples of the segmentation size of the first dimension along the first direction of the first dimension of the image (for example, the direction from top to bottom according to the image height) or the second direction (for example, the opposite direction of the first direction, the direction from bottom to top according to the image height), until the image is evenly divided into k1 first region images according to the multiple first segmentation lines, and each first region image can be used as a sub-image. The size of the first dimension of each first region image is equal to the segmentation size of the first dimension (for example, h), and there is no overlapping area between different first region images.
[0080] In some embodiments of the present application, if the ratio between the image size and the segmentation size is not an integer, the edge area of the image is segmented using a preset overlapping strategy so that the sub-image corresponding to the edge area has an overlapping area with the adjacent sub-image. In one example, the edge area of the image includes pixel rows or columns that lack complete four neighborhoods. For example, if a region of the image lacks neighborhoods in any of the four directions of up, down, left, and right, the region can be determined to be the edge area of the image. In another example, the region within a preset size inward from the image boundary can also be called the edge area, where the preset size can be represented by a preset number of pixels m, for example m=5.
[0081] In one example, if the ratio of the image size of the second dimension to the segmentation size of the second dimension is not an integer, for example, the image size of the second dimension / the segmentation size of the second dimension < Image size in the second dimension / segmentation size in the second dimension .or, Image size in the second dimension / segmentation size in the second dimension +1= Image size in the second dimension / segmentation size in the second dimension = the number of divisions in the second dimension, k2 (e.g. 6). Image size in the second dimension / segmentation size in the second dimension = k2-1 (e.g. 5), Represents the floor function.
[0082] For example Figure 5 As shown in a, multiple (e.g., k2-1) second segmentation lines parallel to each other can be determined along the third direction of the second dimension of the image (e.g., the direction from left to right according to the width of the image) according to the integer multiples of the segmentation size of the second dimension, until the image is segmented according to the multiple second segmentation lines to obtain (k2-1) (e.g., 5) second region images. The size of the second dimension of each second region image is equal to the segmentation size of the second dimension (e.g., w), and there is no overlapping area between different second region images.
[0083] At this time, there is still an undivided edge area at the end of the third direction (for example Figure 5 The edge region in a in FIG), and the size of the second dimension of the edge region is smaller than the segmentation size of the second dimension. For example, the size of the second dimension of the edge region = the image size of the second dimension - (k2-1) * the segmentation size of the second dimension = W - (k2-1) * w < w. For the edge region, for example Figure 5As shown in b, a third segmentation line can be determined according to the boundary line of the end position of the third direction and the segmentation size of the second dimension, and the image is segmented according to the third segmentation line to obtain a third region image. The size of the second dimension of the third region image is equal to the segmentation size of the second dimension (for example, w), and the third image has an overlapping area with the adjacent second region image, for example Figure 5 The overlapping area is shown in b.
[0084] In this way, the second dimension segmentation of the image can be completed, and (k2-1) (for example, 5) second region images and 1 third region image can be obtained, a total of k2 region images. The size of the second dimension of each region image in these k2 region images is equal to the segmentation size of the second dimension. Each region image in the k2 region images can be regarded as a sub-image. And, for example Figure 5 As shown in b in FIG. 1 , only the third region image corresponding to the edge region of the image overlaps with the adjacent second region image (for example, the (k2-1)th second region image). In other embodiments, when the image is segmented in the second dimension, segmentation may also be performed along a fourth direction (for example, the opposite direction of the third direction), which is similar to the segmentation method in the third direction and will not be described again.
[0085] Following the above embodiment, for example Figure 6 As shown in FIG. 1 , an example diagram of a sub-image provided by an embodiment of the present application is shown. In the figure, multiple sub-images are obtained by segmenting the image in the first dimension and the second dimension. The number of the multiple sub-images is equal to the number of segmentations (for example, k1*k2=4*6=24), and the size of each sub-image is equal to the preset segmentation size (for example, h*w). In addition, only when there is an overlap between a sub-image and an adjacent sub-image in the edge area of the image (for example, Figure 6 In another embodiment, if the ratio of the image size of the first dimension to the segmentation size of the first dimension is not an integer, and the ratio of the image size of the second dimension to the segmentation size of the second dimension is not an integer, then segmenting the image to obtain multiple sub-images may be performed, for example: Figure 7 As shown, where the overlapping area is, for example Figure 7 shown.
[0086] Through the above embodiment, by presetting the segmentation size, determining the number of segments based on the ratio of the image size to the segmentation size, and segmenting the image to obtain multiple sub-images of the same size, the difficulty of the segmentation algorithm can be effectively reduced, while ensuring the standardization of the sub-image size. When processing edge areas with non-integer ratios, a preset overlapping strategy is adopted so that the sub-images in the edge areas overlap with adjacent sub-images, thereby ensuring the integrity of the image information and improving the flexibility and accuracy of image processing.
[0087] In some embodiments of the present application, after an image is divided into multiple sub-images, the position information of each sub-image in the image can be determined. For example, the position information may include but is not limited to position coordinates (for example, the coordinates of the center point of the sub-image in the coordinate system where the image is located) and position numbers. Figure 6 As shown, position numbers may be assigned to the sub-images in the order from left to right and from top to bottom in image A, such as A01, A02, and so on.
[0088] Through the above-mentioned embodiment, after the image is divided into multiple sub-images, by assigning position information (such as position coordinates and position numbers) to each sub-image, the precise position of the sub-image in the original image can be identified, which can provide an important basis for the subsequent independent processing of the sub-images and the final stitching, thereby ensuring the continuity and integrity of the image processing.
[0089] S302 , performing edge expansion processing on each sub-image based on the edge region of each sub-image to obtain a first image corresponding to each sub-image.
[0090] In some embodiments of the present application, after the image is segmented to obtain multiple sub-images, the sub-images can be further processed to obtain updated sub-images corresponding to each sub-image. In one example, if the image is each RAW image in multiple RAW images, each RAW image is segmented to obtain multiple sub-images. Further image processing of the sub-images includes: multi-frame fusion of multiple sub-images located at the same position in the multiple RAW images (for example, located in the upper left corner of each RAW image) to obtain a fused image corresponding to each position, and the fused image can be used as an updated sub-image. In other embodiments, if the image is an image input by the user, the image processing of the multiple sub-images of the image may also include but is not limited to: image denoising, image rendering, image enhancement and other processing.
[0091] In some embodiments of the present application, when processing sub-images using an image processing algorithm, since the image edge is a sensitive area for algorithm processing, the edges of adjacent updated sub-images may be inconsistent. For ease of introduction, the sub-images below may represent updated sub-images. If a stitching algorithm is used directly to stitch multiple sub-images, stitching marks are likely to appear in the resulting stitched image.
[0092] In one example, the stitching algorithm may include but is not limited to an artificial intelligence model, such as a convolutional neural network model, and the stitching process of the stitching algorithm may include: using a convolution operation (such as by sliding a convolution kernel or filter) to extract image features of a sub-image, for example, the image features include but are not limited to edge features and texture features. Based on the extracted image features, a feature matching algorithm (such as a scale-invariant feature conversion algorithm) is used to perform feature matching on the sub-images to obtain a corresponding relationship (such as an adjacent relationship) between multiple sub-images. An alignment algorithm (such as an affine transformation algorithm) is used to transform multiple sub-images to the same coordinate system, and the sub-images are stitched based on the corresponding relationship between the multiple sub-images.
[0093] However, due to the limited number of pixels in the edge area of the sub-image, the receptive field of the convolution operation on the pixels in the edge area (hereinafter referred to as edge pixels) will be smaller than the receptive field of the convolution operation on the pixels in the central area (e.g., the area surrounded by the edge area), resulting in the feature representation of the edge pixels containing less contextual information. In addition, the edge pixels of the sub-image may lack adjacent pixels on one or both sides, so the neighborhood information of the edge pixels is incomplete during the convolution operation, resulting in the feature representation of the edge pixels obtained by the convolution operation may not be as accurate and rich as the central pixels. Therefore, the accuracy of the edge pixels of the sub-image may be affected during the feature extraction process, resulting in obvious stitching marks in the stitched image.
[0094] In some embodiments of the present application, the sub-image may be subjected to edge expansion processing so that the sub-image after edge expansion includes the original sub-image and the edge expansion area. Figure 8 As shown, it is an example diagram of a sub-image after edge expansion provided by an embodiment of the present application. Among them, the gray area is the edge expansion area. Using the convolution operation to process the sub-image after edge expansion can make the edge pixels of the sub-image have a receptive field of the same size as the pixels in the central area of the sub-image. In addition, it can also ensure that the neighborhood information of the edge pixels of the sub-image is complete when performing feature extraction, thereby improving the feature extraction quality of the edge pixels of the sub-image.
[0095] In some embodiments of the present application, an edge expansion region may be constructed based on a preset expansion parameter, wherein the expansion parameter includes the number of pixels corresponding to the size of the edge expansion region. For example, the expansion parameter n may be a preset positive integer, such as n=2, which means that 2 pixels are expanded outward in four directions based on the boundary of the sub-image.
[0096] Through the above embodiments, an edge expansion area can be constructed based on preset expansion parameters, and the size of the expansion area can be adjusted according to specific needs, thereby increasing the flexibility and adaptability of the edge expansion processing, so that the edge expansion processing algorithm can cope with image processing requirements in different scenarios, thereby improving the versatility and practicality of the algorithm.
[0097] In some embodiments of the present application, the extended parameters can be set according to actual needs. In one example, the environmental parameters corresponding to the image can be obtained, and the extended parameters can be determined according to the environmental parameters. For example, if the image is a RAW image obtained by the terminal device using an image sensor, the ambient light sensor of the terminal device can be used to obtain the environmental parameters (such as ambient illumination) corresponding to the RAW image, so that the extended parameters are inversely proportional to the environmental parameters.
[0098] The lower the ambient illumination, the darker the image and the corresponding sub-image will be, the less clear the edge details of the sub-image will be, and the more information loss or error will be caused by edge feature extraction of the sub-image. By making the expansion parameter inversely proportional to the ambient illumination, the expansion parameter can be automatically increased in a dark environment, significantly expanding the edge expansion area of the sub-image, and providing more contextual information for edge feature extraction of the sub-image. This helps capture more complete and accurate sub-image edge features, further reduce splicing marks or edge blur caused by insufficient lighting, and improve the overall image processing effect.
[0099] In addition, the overall brightness of the image and the corresponding sub-image obtained when the ambient illumination is high is high. Reducing the expansion parameters can not only save computing resources and improve processing efficiency, but also avoid unnecessary noise or redundant information that may be introduced by over-expanding the edge area under sufficient light conditions. Images in high-illuminance environments are often brighter and have clear edge details. At this time, reducing the size of the expansion area can ensure the accuracy of edge feature extraction and reduce the computational burden of subsequent image processing steps (such as edge feature extraction, image stitching, etc.).
[0100] In another example, the brightness parameter of the image can be obtained, and the expansion parameter can be determined according to the brightness parameter. For example, the brightness parameter can be proportional to the average brightness of the image, and the expansion parameter can be inversely proportional to the brightness parameter. In one example, for an image with three color channels of R (red), G (green), and B (blue), the weight corresponding to each color channel can be preset. For example, the weight corresponding to each color channel is set to 0.299 (R), 0.587 (G), and 0.114 (B), and the gray value or brightness value corresponding to each pixel can be exemplarily expressed as gray-value=0.299×R+0.587×G+0.114×B. The average brightness of the image can be determined based on the average value of the gray value or brightness value of all pixels in the image.
[0101] Through the above embodiment, the average brightness of the image can be directly calculated, and the overall brightness and darkness of the image can be captured more accurately. Adjusting the expansion parameters based on the brightness and darkness characteristics inside the image can make the setting of the expansion parameters more in line with the actual needs of the image, which helps to obtain high-quality image processing results in a wider range of scenarios.
[0102] In other embodiments, the extended parameters may be determined in combination with the environmental parameters and brightness parameters corresponding to the image. For example, the extended parameters are inversely proportional to the illumination and inversely proportional to the average brightness. In addition, the extended parameters may be determined based on other image parameters of the image. For example, the image parameters include but are not limited to image texture richness, image contrast, image saturation, image noise level, and image resolution. The extended parameters may be proportional to the image texture richness, inversely proportional to the image contrast, inversely proportional to the image saturation, inversely proportional to the image noise level, and proportional to the image resolution.
[0103] Through the above embodiments, dynamic adjustment and optimization of image expansion parameters can be achieved to better adapt to the needs of different environmental conditions and image characteristics, improve the intelligent level of image processing, and provide users with a better quality and personalized image processing experience. It can also avoid splicing marks or edge blur problems and improve the overall image processing effect.
[0104] In some embodiments of the present application, the edge-expanded sub-image obtained according to the edge-expanded region can be used as the first image, and each first image includes a corresponding sub-image and a corresponding edge-expanded region (for example Figure 8 In one example, if the size of the sub-image is h*w, the size of the first image is (h+n)*(w+n). The edge extension area can be expressed as [(h+n)*(w+n)-h*w].
[0105] In some embodiments of the present application, the initial pixel value of the pixel point in the edge expansion area can be a null value, and the edge expansion area corresponding to each sub-image can be mirrored or updated based on the pixel value of the first pixel point in the edge area of each sub-image, so that the pixel value of the pixel point in the edge expansion area corresponds to the pixel value of the pixel point in the edge area of the sub-image. If the expansion parameter is n, the area of m=n+1 pixels inward from the boundary of the sub-image can be used as the edge area of the sub-image. For example, if n=2, the area of m=2+1=3 pixels inward from the boundary of the sub-image in each direction can be used as the edge area of the sub-image.
[0106] In some embodiments of the present application, mirror filling the edge extension area corresponding to each sub-image includes: determining a second pixel point in the edge extension area that has a corresponding relationship with the first pixel point, the corresponding relationship including a one-to-one mirror mapping relationship; based on the pixel value of the first pixel point, determining the pixel value of the second pixel point corresponding to the first pixel point.
[0107] For example Fig. 9 FIG. 1 is an example diagram of a mirror filling process provided by an embodiment of the present application. In which, the upper left corner edge area (eg Fig. 9 For example, the edge expansion area corresponding to the edge area shown in the green box in the middle is mirrored and filled. The expansion parameter corresponding to the edge expansion area is n=2, which means that the pixel values of the two pixels outside the boundary of sub-image A01 need to be filled. Therefore, it can be determined that the edge expansion area corresponding to the upper left corner edge area of sub-image A01 is as follows: Fig. 9 The red frame area is shown.
[0108] In one example, the edge expansion area shown in the red frame can be divided into three sub-areas, for example, a blue frame sub-area above the edge area shown in the green frame, a yellow frame sub-area on the left side of the edge area shown in the green frame, and a purple frame sub-area at the upper left corner of the edge area shown in the green frame. The pixel points at the boundary of the sub-image A01 can be used as the reflection axis or reflection center of the mirror mapping, and the mirror mapping area corresponding to each sub-area can be determined from the edge area shown in the green frame.
[0109] For example Fig. 9 As shown, the number of each first pixel in sub-image A01 can be determined. The pixel points 1, 2, and 3 at the boundary of sub-image A01 can be used as the reflection axis, and the mirror mapping area corresponding to the blue frame sub-region can be determined as the dotted blue frame area. The pixel points 1, 8, and 15 at the boundary of sub-image A01 can be used as the reflection axis, and the mirror mapping area corresponding to the yellow frame sub-region can be determined as the dotted yellow frame area. The pixel point 1 at the boundary of sub-image A01 can be used as the reflection center, and the mirror mapping area corresponding to the purple frame sub-region can be determined as the dotted purple frame area.
[0110] According to the above-mentioned mirror mapping relationship and the number of each first pixel point, determine the number of the second pixel point in the edge expansion area that has a mirror mapping relationship with the first pixel point. For example, the number of the first pixel point in the dotted purple frame area {9, 10, 16, 17} is filled in the position of the second pixel point in the purple frame sub-area by mirror flipping with pixel point 1 as the reflection center, so as to determine the number of the second pixel point in the purple frame sub-area as {17, 16, 10, 9}. In this way, the pixel value of the first pixel point corresponding to the number can be used to update the pixel value of the second pixel point to achieve mirror filling. For example Fig. 9As shown, the pixel value of the first pixel numbered 16 in the green frame can be used to update the pixel value of the second pixel numbered 16 in the red frame.
[0111] Through the above-mentioned embodiments, the edge expansion area of the sub-image can be effectively filled based on the mirror filling technology, so that the edge expansion area has the characteristics of being a mirror image of the edge area of the sub-image. In this way, feature extraction of the second image can make the edge area of the sub-image in the second image become the central area, thereby improving the receptive field of the feature representation of the edge area of the sub-image. In addition, compared with other filling methods (such as zero filling, etc.), since the pixel values of the edge expansion area and the pixel values of the edge area of the original sub-image have a mirror mapping relationship, the consistency and continuity of the feature representation of the edge area of the sub-image can be guaranteed. Therefore, based on the more complete feature representation of the edge area of the sub-image, the appearance of splicing marks can be avoided in the subsequent splicing process.
[0112] S303: Perform image optimization processing on each first image to obtain an optimized image.
[0113] In some embodiments of the present application, the image features of each first image can be obtained by performing a convolution operation on each first image; based on the image features of each first image, the edge area of the sub-image in each first image is optimized to obtain an optimized image.
[0114] In some embodiments of the present application, a preset model (e.g., a convolutional neural network model) can be used to perform a convolution operation on each first image. The convolution operation can use the edge area of the sub-image in the first image as the central area of the first image, so that the extracted image features of the first image include complete and accurate features of the edge area of the sub-image.
[0115] In some embodiments of the present application, it is possible to determine whether any sub-image (eg Figure 6 The sub-image A01 shown in FIG. 1 is taken as the first sub-image, and sub-images (eg Figure 6 The sub-images A02 and A07 shown in the figure are used as the second sub-image. The edge region of the first sub-image is optimized based on the image features of the first image corresponding to the first sub-image, and the edge region of the second sub-image is optimized based on the image features of the first image corresponding to the second sub-image, so as to reduce the edge difference between the adjacent edge regions of the first sub-image and the second sub-image. In one example, if the position of the second sub-image in the image is adjacent to the right side of the first sub-image (for example Figure 6As shown in the figure, the first sub-image A01, the second sub-image A02), the adjacent edge regions of the first sub-image and the second sub-image include: the right edge region of the first sub-image, the left edge region of the second sub-image. In another example, if the position of the second sub-image in the image is the lower adjacent position of the first sub-image (for example Figure 6 As shown, the first sub-image A01, the second sub-image A07), the adjacent edge areas of the first sub-image and the second sub-image include: the lower side edge area of the first sub-image, and the upper edge area of the second sub-image.
[0116] In some embodiments of the present application, the image features of the first image obtained by the convolution operation may include multiple feature maps, wherein each feature map corresponds to a feature representation obtained by a convolution operation on a layer or a region of the first image (for example, shallow features generally represent features of edge regions). Feature maps corresponding to edge regions of sub-images may be selected from the multiple feature maps of the first image to obtain feature maps corresponding to each two adjacent sub-images. For example, a first feature map corresponding to the right edge region of the first sub-image is selected from the image features of the first image corresponding to the first sub-image, and a second feature map corresponding to the left edge region of the second sub-image is selected from the image features of the first image corresponding to the second sub-image.
[0117] In one example, the first feature map and the second feature map may be compared to obtain a difference between the first feature map and the second feature map. The edge region of the first sub-image and / or the second sub-image is optimized according to the difference until the difference between the edge region of the first sub-image and the edge region of the second sub-image reaches a preset condition. For example, the preset condition may be that the difference between the optimized feature map of the first sub-image and the optimized feature map of the second sub-image is less than a preset difference value.
[0118] For example, if the positions of the first sub-image A01 and the second sub-image A02 in the image are adjacent, the first image corresponding to the first sub-image A01 is A01D1, and the first image corresponding to the second sub-image A02 is A02D1. Image features A01D1X of the first image A01D1 and image features A02D1X of the first image A02D1 can be obtained based on the convolution operation. Image features A01D1X include complete and accurate edge features of the first sub-image A01, and image features A02D1X include complete and accurate edge features of the second sub-image A02. Feature map A01D1XY of the right edge region of the first sub-image A01 in the image feature A01D1X can be determined, and feature map A02D1XZ of the left edge region of the second sub-image A02 in the image feature A02D1X can be determined. According to the difference between the feature map A01D1XY and the feature map A02D1XZ, the right edge region of the first sub-image A01 and the left edge region of the second sub-image A02 are optimized to reduce the difference between adjacent edge regions of the first sub-image A01 and the second sub-image A02.
[0119] Through the above-mentioned embodiments, the convolution operation can be used to accurately extract the complete features of the edge area of the sub-image in each first image, and the edge area of adjacent sub-images can be optimized based on these features, thereby significantly reducing the edge difference between the sub-images, and effectively avoiding the appearance of stitching marks in subsequent stitched images.
[0120] S304, performing edge cutting on the corresponding optimized image according to the edge expansion region to obtain a second image corresponding to each first image.
[0121] In some embodiments of the present application, the corresponding optimized image can be edge cut according to the size of the edge expansion area so that the second image has the same size as the corresponding sub-image. Continuing from the above embodiment, the size of the optimized image is consistent with the size of the first image, which can be expressed as (h+n)*(w+n). Among them, the edge expansion area can be expressed as [(h+n)*(w+n)- h*w]. The edge expansion area corresponding to [(h+n)*(w+n)- h*w] can be edge cut from the optimized image to eliminate the edge expansion area, so as to obtain a second image with the same size as the original sub-image. The size of the second image can be expressed as h*w.
[0122] Through the above embodiment, the edge expansion area in the optimized image can be precisely cut to remove unnecessary edge expansion parts, ensuring that the final second image is completely consistent with the original sub-image in size. It can not only retain the edge optimization effect of the sub-image, but also restore the original size of the sub-image, which is convenient for splicing in the subsequent process to obtain an image with the same size as the original complete image.
[0123] S305 , according to the association relationship between each second image and the corresponding sub-image, stitching multiple second images together to obtain a target image.
[0124] In some embodiments of the present application, each sub-image is subjected to edge expansion processing, image optimization processing and edge cutting processing to obtain a corresponding second image. The position information of the second image corresponding to the sub-image can be determined based on the position information of the sub-image in the image; multiple second images are spliced based on the position information of each second image to obtain a target image. For example Fig.10 The figure is an example of a target image provided by an embodiment of the present application. Fig.10 The a in represents the spliced image output by the related technology. Fig.10 b in the figure represents the target image outputted after the method provided in some embodiments of the present application is adopted. It can be seen that Fig.10 The a in the figure has obvious splicing traces, and the presentation effect of the target image is obviously better than Fig.10 a in.
[0125] Through the above embodiment, each sub-image can be edge-expanded, optimized, and accurately edge-cut to ensure that each sub-image is converted into a second image with low edge differences between adjacent images. Subsequently, the position information of the sub-image in the original image is used to accurately locate and splice these second images, and finally a seamless, high-quality target image is generated, which can effectively avoid the appearance of splicing marks in the target image.
[0126] The image processing method provided by the embodiment of the present application can divide the image according to the image size to obtain multiple sub-images; perform edge expansion processing on the edge area of the sub-image to obtain the first image corresponding to each sub-image, so that the edge expansion area of the first image and the edge area of the corresponding sub-image have a mirror mapping relationship; then the first image can be optimized to enhance the edge features of each first image; by cutting the edge expansion area in the optimized image to obtain the second image, the edge expansion in the optimized image can be eliminated, so that the second image has the same size as the corresponding sub-image; based on the association relationship between the second image and the corresponding sub-image, multiple second images are spliced to obtain the target image. Using the above method, it is possible to effectively avoid the appearance of splicing marks in the entire image obtained by splicing after the image is segmented.
[0127] See also Fig.11As shown, it is a flow chart of an image processing method provided by another embodiment of the present application. Multiple RAW images can be obtained and each RAW image can be cut into multiple patches. For example, a RAW image with a resolution of H*W can be cut into multiple patches with a resolution of h*w in order from top to bottom and from left to right. There should be no overlapping parts between the patches as much as possible. If H is not divisible by h or W is not divisible by w, the patches that are not divisible are overlapped with the adjacent patches that are divisible by w to ensure that all patches are in the entire large RAW image (for example Figure 7 as shown).
[0128] Use the multi-frame fusion algorithm to fuse multiple blocks at the same position (for example, at the upper left corner of the RAW image) in multiple RAW images to obtain the fused block image corresponding to each position. Mirror fill each fused block image, for example, mirror fill the four sides of each fused block image, and the number of filled pixels is n, for example Fig. 9 As shown in the figure, the larger the number of filling pixels, the smaller the probability of splicing marks appearing, but the greater the computing power required by the algorithm. Therefore, the number of filling pixels n can be set according to actual needs.
[0129] The mirror-filled block graph is input into the preset artificial intelligence AI model, and the edge information in the original fused block graph is better modeled by the AI model, thereby reducing the edge differences between the original fused block graphs. The mirror-filled part in the block graph output by the AI model is removed, and the block graph without the mirror-filled part is spliced to obtain a complete RGB image.
[0130] Through the above embodiments, by fusion of multiple RAW image blocks and AI-assisted edge optimization, the edge differences between fused block images can be effectively reduced to ensure a smooth transition of image stitching. Combining the application of mirror filling technology and AI model, it is possible to avoid stitching marks in RGB images, significantly improve the generation quality of RGB images, and realize the automated and refined conversion from multiple RAW images to high-quality RGB images.
[0131] In some other embodiments of the present application, the image processing method provided in the embodiments of the present application can also be divided into two major processes. For example, the first process includes mirror filling processing, and the second process includes removing the mirror filling part. The first process and the second process can be applied to any method that requires image segmentation, image processing, and image stitching. For example, the image processing can be image processing (such as image denoising, image rendering, image enhancement, etc.) performed on the cut image using any given model (such as a bin model). For example, Fig.12As shown, a mirror filling layer integrating the method of the first process is added at the beginning of any given model, and a process of removing the mirror filling part as in the second process is added at the end of any given model. Thus, a cut image with reduced edge difference can be obtained as the output result of the model, which assists other subsequent applications, such as image stitching.
[0132] Following the above embodiment, for example Fig.14 As shown, it is a flowchart of an image processing method provided by another embodiment of the present application. If the above-mentioned given model is an AI model based on a multi-frame fusion algorithm, multiple RAW images can be obtained and each RAW image can be cut into multiple block images, and the multiple block images are input into the AI model after mirror filling. For example, a mirror filling layer integrating the method of the above-mentioned first process is added to the beginning of the AI model after mirror filling, and a process for removing the mirror filling part as in the above-mentioned second process is added to the end of the AI model after mirror filling. The multiple block images output by the AI model after mirror filling can be directly spliced to obtain a complete RGB image obtained by fusion of multiple RAW images.
[0133] Through the above embodiment, a mirror padding can be performed on the input inside the model, and the mirror padding part can be removed when the model is output, so that the model can better model the input edge information. In this way, a plug-and-play effect can be achieved without retraining the given model in the middle. Fig.13 As shown, compared to Fig.13 Method a in which the image filling process is not used and the image filling part is removed, Fig.13 The stitching traces are effectively avoided in the stitching image output by the method b using the mirror filling process and removing the mirror filling part.
[0134] The present application also provides a terminal device 100, see Fig.15 As shown, the terminal device 100 can be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, as well as a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, a vehicle-mounted device, a smart home device and / or a smart city device. The embodiments of the present application do not impose any special restrictions on the specific type of the terminal device 100.
[0135] The terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a Subscriber Identification Module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0136] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0137] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0138] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0139] The processor 110 may also be provided with a memory for storing instructions and data. In one embodiment of the present application, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use instructions or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0140] In one embodiment of the present application, the processor 110 may include one or more interfaces. The interface may include an Inter-integrated Circuit (I2C) interface, an Inter-integrated Circuit Sound (I2S) interface, a Pulse Code Modulation (PCM) interface, a Universal Asynchronous Receiver / Transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a General-Purpose Input / Output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and / or a Universal Serial Bus (USB) interface, etc.
[0141] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (Serial Data Line, SDA) and a serial clock line (Serial Clock Line, SCL). In one embodiment of the present application, the processor 110 may include multiple groups of I2C buses. The processor 110 can be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 can be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface to realize the touch function of the terminal device 100.
[0142] The I2S interface can be used for audio communication. In one embodiment of the present application, the processor 110 may include multiple I2S buses. The processor 110 may be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In one embodiment of the present application, the audio module 170 may transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call via a Bluetooth headset.
[0143] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In one embodiment of the present application, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In one embodiment of the present application, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0144] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In one embodiment of the present application, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example: the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In one embodiment of the present application, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.
[0145] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In one embodiment of the present application, the processor 110 and the camera 193 communicate via the CSI interface to realize the shooting function of the terminal device 100. The processor 110 and the display screen 194 communicate via the DSI interface to realize the display function of the terminal device 100.
[0146] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In one embodiment of the present application, the GPIO interface can be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0147] The USB interface 130 is an interface that complies with the USB standard specification, and can be a Mini USB interface, a MicroUSB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the terminal device 100, and can also be used to transmit data between the terminal device 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other terminal devices 100, such as AR devices, etc.
[0148] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0149] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the terminal device 100. While the charging management module 140 is charging the battery 142, it may also power the terminal device 100 through the power management module 141.
[0150] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0151] The wireless communication function of the terminal device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0152] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0153] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the terminal device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (Low Noise Amplifier, LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In one embodiment of the present application, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In one embodiment of the present application, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0154] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In one embodiment of the present application, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be arranged in the same device as the mobile communication module 150 or other functional modules.
[0155] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the terminal device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0156] In one embodiment of the present application, the antenna 1 of the terminal device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the terminal device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include Global System For Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the Beidou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS) and / or the Satellite Based Augmentation System (SBAS).
[0157] The terminal device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
[0158] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light-emitting diode or an active matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, Microled, Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In one embodiment of the present application, the terminal device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0159] The terminal device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0160] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, etc. of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In one embodiment of the present application, the ISP can be set in the camera 193.
[0161] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In one embodiment of the present application, the terminal device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0162] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the terminal device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0163] Video codecs are used to compress or decompress digital videos. The terminal device 100 may support one or more video codecs. Thus, the terminal device 100 may play or record videos in various coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0164] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of the terminal device 100 can be realized, such as: image recognition, face recognition, information prompts, voice recognition, text understanding, etc.
[0165] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
[0166] Random access memory may include static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM, for example, the fifth generation DDRSDRAM is generally referred to as DDR5SDRAM), etc.;
[0167] Non-volatile memory may include disk storage devices and flash memory.
[0168] Flash memory can be divided into NORFLASH, NANDFLASH, 3D NANDFLASH, etc. according to the operating principle. It can be divided into single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the storage specification. It can be divided into universal flash storage (UFS), embedded Multi Media Card (eMMC), etc. according to the storage specification.
[0169] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data.
[0170] The non-volatile memory may also store executable programs and user and application data, etc., and may be loaded into the random access memory in advance for direct reading and writing by the processor 110 .
[0171] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the terminal device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external non-volatile memory.
[0172] The internal memory 121 or the external memory interface 120 is used to store one or more computer programs. The one or more computer programs are configured to be executed by the processor 110. The one or more computer programs include multiple instructions. When the multiple instructions are executed by the processor 110, the screen display detection method executed on the terminal device 100 in the above embodiment can be implemented to implement the screen display detection function of the terminal device 100.
[0173] The terminal device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0174] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In one embodiment of the present application, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0175] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The terminal device 100 can listen to music or listen to a hands-free call through the speaker 170A.
[0176] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the terminal device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the ear.
[0177] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The terminal device 100 can be provided with at least one microphone 170C. In other embodiments, the terminal device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the terminal device 100 can also be provided with three, four or more microphones 170C to realize the collection of sound signals, noise reduction, identification of sound sources, realization of directional recording function, etc.
[0178] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130, or a 3.5 mm Open Mobile Terminal Platform (OMTP) standard interface or a Cellular Telecommunications Industry Association of the USA (CTIA) standard interface.
[0179] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The terminal device 100 may receive key input and generate key signal input related to user settings and function control of the terminal device 100.
[0180] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0181] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0182] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the terminal device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The terminal device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The terminal device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In one embodiment of the present application, the terminal device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the terminal device 100 and cannot be separated from the terminal device 100. The embodiment of the present application also provides a computer storage medium, in which computer instructions are stored. When the computer instructions are executed on the terminal device 100, the terminal device 100 executes the above-mentioned related method steps to implement the method in the above-mentioned embodiment.
[0183] The embodiments of the present application also provide a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the method in the above-mentioned embodiments.
[0184] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory so that the chip executes the methods in the above-mentioned method embodiments.
[0185] Among them, the terminal device, computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.
[0186] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0187] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0188] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0189] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0190] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application. 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 code.
[0191] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical solution of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present application.
Claims
1. An image processing method, applied to a terminal device, characterized in that: The method comprises: Segment the image to obtain multiple sub-images; Performing edge expansion processing on each sub-image based on the edge region of each sub-image to obtain first images corresponding to each sub-image, each first image comprising a corresponding sub-image and a corresponding edge expansion region; wherein the edge expansion processing comprises a mirror filling processing; and the size of the edge expansion region is inversely proportional to the illumination of the shooting environment corresponding to the image; Performing image optimization processing on each of the first images to obtain an optimized image, including: taking an edge area of a sub-image in the first image as a central area of the first image, and extracting edge area features of the sub-image using a convolution operation; determining two edge area features corresponding to two adjacent sub-images, and optimizing adjacent edge areas of the two adjacent sub-images based on the two edge area features so that a difference between adjacent edge areas of the two adjacent sub-images meets a preset condition; Performing edge cutting on the corresponding optimized image according to the edge expansion region to obtain a second image corresponding to each first image; According to the association relationship between each second image and the corresponding sub-image, multiple second images are spliced to obtain a target image.
2. The image processing method according to claim 1, characterized in that: The segmenting of the image to obtain a plurality of sub-images comprises: Determine the number of segments according to the image size and the preset segmentation size; The image is segmented based on the segmentation quantity to obtain the multiple sub-images.
3. The image processing method according to claim 2, characterized in that: The method further comprises: If the ratio between the image size and the segmentation size is not an integer, a preset overlapping strategy is used to segment the edge region of the image so that a sub-image corresponding to the edge region has an overlapping region with an adjacent sub-image.
4. The image processing method according to claim 3, characterized in that: The preset overlapping strategy includes: based on the principle of minimizing the overlapping area between the multiple sub-images, determining the overlapping area according to the union of the sub-image corresponding to the edge area and the adjacent sub-images.
5. The image processing method according to claim 1, characterized in that: The method further comprises: The edge expansion region is constructed based on preset expansion parameters, wherein the expansion parameters include the number of pixels corresponding to the size of the edge expansion region.
6. The image processing method according to claim 5, characterized in that: The method for determining the extended parameters includes: Acquire the environment parameters corresponding to the image, and determine the expansion parameters according to the environment parameters; and\or, A brightness parameter of the image is obtained, and the expansion parameter is determined according to the brightness parameter.
7. The image processing method according to claim 6, characterized in that: The environmental parameter includes the illumination of the shooting environment corresponding to the image, and determining the extended parameter according to the environmental parameter includes: making the extended parameter inversely proportional to the environmental parameter.
8. The image processing method according to claim 6, characterized in that: The brightness parameter is proportional to the average brightness of the image, and determining the expansion parameter according to the brightness parameter includes: making the expansion parameter inversely proportional to the brightness parameter.
9. The image processing method according to claim 1, characterized in that: The performing edge expansion processing on each sub-image based on the edge area of each sub-image comprises: Based on the pixel value of the first pixel point in the edge area of each sub-image, the edge expansion area corresponding to each sub-image is mirror-filled.
10. The image processing method according to claim 9, characterized in that: The mirror filling of the edge extension area corresponding to each sub-image based on the pixel value of the first pixel point in the edge area of each sub-image comprises: Determine a second pixel point in the edge expansion area that has a corresponding relationship with the first pixel point, wherein the corresponding relationship includes a one-to-one mirror mapping relationship; Based on the pixel value of the first pixel point, a pixel value of a second pixel point corresponding to the first pixel point is determined.
11. The image processing method according to claim 1, characterized in that: The performing image optimization processing on each of the first images to obtain an optimized image comprises: Obtaining image features of each first image by performing a convolution operation on each first image; Based on the image features of each of the first images, edge regions of the sub-images in each of the first images are optimized.
12. The image processing method according to claim 1, characterized in that: The performing edge cutting on the corresponding optimized image according to the edge expansion region to obtain the second image corresponding to each first image comprises: The corresponding optimized image is edge cut according to the size of the edge expansion area, so that the second image has the same size as the corresponding sub-image.
13. The image processing method according to claim 1, characterized in that: The step of splicing the plurality of second images according to the association relationship between each second image and the corresponding sub-image to obtain the target image comprises: Determining position information of a second image corresponding to the sub-image according to position information of the sub-image in the image; The multiple second images are spliced according to the position information of each second image to obtain the target image.
14. A terminal device, characterized in that: The terminal device includes a memory and a processor: The memory is used to store program instructions; The processor is used to read and execute the program instructions stored in the memory. When the program instructions are executed by the processor, the terminal device executes the image processing method according to any one of claims 1 to 13.
15. A computer storage medium, characterized in that The computer storage medium stores program instructions, and when the program instructions are executed on a terminal device, a processor of the terminal device executes the image processing method according to any one of claims 1 to 13.
Citation Information
Patent Citations
Image processing method and device, electronic equipment and readable storage medium
CN113506304A