Image processing method, apparatus and device, and storage medium
By identifying the key content area in the image as the filling restriction area and using the color similarity matching method to fill it, the problem of image filling mismatch in the existing technology is solved, the authenticity and naturalness of the image are improved, and the processing efficiency.
Patent Information
- Application Number
- PCT/CN2024/077584
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-28
- Filing Date
- 2024-02-19
- Publication Date
- 2024-09-06
AI Technical Summary
In existing image filling technology, the content of the filled image area does not match the style of the surrounding image, resulting in the filling effect not meeting expectations and affecting the realism and naturalness of the image.
By identifying the key and significant content areas in the image to be filled as the filling restriction area, the areas outside the areas are excluded for filling search, and the color similarity matching method is used to fill the eliminated areas to ensure that the filled image is consistent with the surrounding areas. The wind is consistent.
It improves the authenticity and naturalness of the image after filling, reduces the calculation amount of the filling process, improves the image processing efficiency, and ensures that the filled image is more harmonious.
Smart Images

Figure CN2024077584_06092024_PF_FP
Abstract
Description
Image processing method, device, equipment and storage medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application is based on the application with CN application number 202310183569.5 and application date February 28, 2023, and claims its priority. The disclosed content of the CN application is hereby introduced as a whole into this application. Technical Field
[0003] The present disclosure relates to the field of image processing technology, and in particular to an image processing method, apparatus, device, and storage medium. Background Art
[0004] Currently, application software with photo or video recording functions also generally provides an image editing function for users to perform personalized editing on images.
[0005] Among the image editing functions provided by the application software, there is an eraser pen, which can be used to erase the selected content to be erased in the edited image. After erasure, other image content in the image can be used to fill the erased area to form a new image.
[0006] However, in the current image filling implementation, the image content presented in the filled image area may not match the style of the surrounding images, and the filling effect does not meet expectations.
[0007] Summary of the Invention
[0008] In a first aspect, an embodiment of the present disclosure provides an image processing method, the image processing method comprising:
[0009] In response to the elimination operation on the original image, an image to be filled having an eliminated area is obtained;
[0010] determining a filling restriction area based on the image to be filled;
[0011] A filling search area is determined based on the filling restriction area, and the elimination area is filled to obtain a target image.
[0012] In a second aspect, an embodiment of the present disclosure further provides an image processing device, the image processing device comprising:
[0013] A response module, configured to obtain an image to be filled with an eliminated area in response to an elimination operation on the original image;
[0014] a restriction determination module, configured to determine a filling restriction area based on the image to be filled;
[0015] The filling module is used to determine a filling search area based on the filling restriction area, fill the elimination area, and obtain a target image.
[0016] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0017] one or more processors;
[0018] a storage device for storing one or more programs,
[0019] When the one or more programs are executed by the one or more processors, the one or more processors implement the image processing method as described in any embodiment of the present disclosure.
[0020] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium comprising computer-executable instructions, which, when executed by a computer processor, are used to execute the image processing method as described in any embodiment of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.
[0022] Figure 1 shows an example of the original image;
[0023] Figure 1a shows an example of an elimination operation on the original image;
[0024] FIG1b shows an example of the effect of performing a fill operation after performing an elimination operation on the original image in the prior art;
[0025] FIG1c is a schematic flow chart of an image processing method provided by an embodiment of the present disclosure;
[0026] FIG1d shows an effect display diagram of a target image during execution of the image processing method provided in this embodiment;
[0027] FIG2 is a schematic structural diagram of an image processing device provided by an embodiment of the present disclosure;
[0028] FIG3 shows a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0029] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0030] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0031] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.
[0032] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0033] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".
[0034] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0035] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0036] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.
[0037] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0038] It is understandable that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0039] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) must comply with the requirements of relevant laws, regulations and relevant provisions.
[0040] It should be noted that application software with photo or video recording functions also typically provides image editing functions for users to personalize image editing. Among the image editing functions provided by the application software, there is an eraser pen, which is used to remove unwanted parts of the original image. Specifically, the eraser pen is used to remove the content selected to be removed from the edited image, and after removal, other image content in the image can be used to fill the removed area to form a new image. However, in existing image filling implementations, the image content presented in the filled image area may not match the style of the surrounding image.
[0041] For example, FIG1 illustrates an example of an original image. As shown in FIG1 , the original image includes a person, a swimming ring, ground, and sky. A user can remove certain areas of the original image through an erase operation. FIG1a illustrates an example of an erase operation on the original image. As shown in FIG1a , when a user wishes to remove the swimming ring-related image area in the original image, they can do so using the erase function provided in the erase edit bar 11. For example, by selecting the swimming ring-related object and clicking the erase pen function button, the swimming ring-related image area can be removed. FIG1b illustrates an example of the effect of performing a fill operation on the original image after performing an erase operation in the prior art. As shown in FIG1b , portions of the person's shoes and clothing are filled into the erase area 12. In addition to the background image, the filled area also includes the shoes, clothing, and other images, resulting in a dissonant image. It can be seen that parts of the person's body appear in the filled area, affecting the realism and naturalness of the resulting image.
[0042] Based on this, this embodiment provides a method for image processing based on determining a fill search area based on areas outside the fill restriction area. Figure 1c shows a flow chart of an image processing method provided by an embodiment of the present disclosure. This embodiment of the present disclosure is applicable to filling an elimination area in image processing. The method can be performed by an image processing device, which can be implemented in software and / or hardware. Optionally, it can be implemented by an electronic device, such as a digital camera, a mobile phone, or a tablet computer.
[0043] As shown in FIG1c , the image processing method provided by the embodiment of the present disclosure may specifically include: S101 to S103 .
[0044] S101 : In response to an elimination operation on an original image, an image to be filled with an eliminated area is obtained.
[0045] The application scenario of the image processing method provided in this embodiment can be understood as follows: in application software with a photo or video recording function, an image editing function is usually provided for users to perform personalized editing of images. Among the function items for image editing provided by the application software, there is a function for erasing a selected area by using an erasure tool (such as an erasure option or an erasure pen, etc.), and after erasure, the erasure area can be filled to form a new image. From the user's perspective, when the user wants to erase a certain picture in the image, the erasure tool can be used to select the picture area, further triggering the erasure operation of the selected area, and the area can be considered as the erasure area.
[0046] In some embodiments, the original image can be specifically understood as an input image to be eliminated and filled. The original image can be an image stored locally in the electronic device, and the input original image can be obtained through the user's selection operation; the original image can also be downloaded from the network or manually uploaded; the original image can also be an original image collected by the electronic device in real time through an image acquisition device, and the input original image can be directly obtained from the image acquisition device, wherein the image acquisition device can be a module integrated in the electronic device, or an external image acquisition device that communicates with the electronic device. In this embodiment, there is no specific limitation on the way to obtain the original image. When it is detected that the image processing function is started, any input original image can be used as the image to be processed, and the original image can be processed.
[0047] It is understood that when a user performs an erasure operation on an original image, this execution entity can receive the erasure operation performed by the user. This step can be considered as a response to the received erasure operation, which is performed on the original image and is intended to eliminate certain frames within the original image. This step determines the result of the erasure operation on the original image, obtaining an image to be filled having an erasure area. In this embodiment, the image formed after erasing certain frames from the original image is the image to be filled, and the corresponding area in the image to be filled after the certain frames are eliminated is the erasure area.
[0048] S102: Determine a filling restriction area based on the image to be filled.
[0049] Considering that in the prior art, when filling the elimination area, the picture selected for filling is searched in the entire image to be filled except the elimination area in the image to be filled, there may be a problem of using a discordant picture to fill the elimination area, resulting in the problem that the image content presented in the filled image area does not match the style of the surrounding images. In order to solve this problem, in this embodiment, before filling the elimination area, the picture that cannot be used for filling is first identified, and the area where the picture that cannot be used for filling is located is recorded as the filling restriction area. Before filling the elimination area, the filling restriction area is first determined, and the filling restriction area is excluded to ensure that the picture in the filling restriction area is not used to fill the elimination area.
[0050] After obtaining the image to be filled, this step is used to analyze the image to be filled and determine the filling restriction area. In some embodiments, the step of determining the filling restriction area in the image to be filled can be described as follows: analyzing the image to be filled, performing feature recognition by detecting and segmenting the image to be filled, detecting key scenes and significant scenes in the image to be filled, and determining the areas containing the detected key scenes and significant scenes as the filling restriction area.
[0051] For example, by analyzing the image to be filled to determine which types of features are present, a feature type priority table can be pre-built for each feature type, with which type of feature has the highest priority and which type has the lowest priority. The priorities of the various feature types are ranked. The features with higher priorities in the image to be filled are considered key and significant features, and the areas within the image containing these features are designated as fill-restricted areas.
[0052] Intelligent analysis is performed on the image to be filled, determining its type, such as a portrait or landscape. Buildings within a landscape photo can be considered significant or key content. Salient or key content refers to features that identify people, animals, buildings, and other indivisible elements as a whole. These indivisible elements, such as people, animals, and buildings, are segmented, and the corresponding image areas are called fill-restricted areas.
[0053] S103 : Determine a filling search area based on the filling restriction area, fill the elimination area, and obtain a target image.
[0054] In some embodiments of the present invention, after the filling restriction area is determined in the above steps, the filling search area can be further determined based on the filling restriction area and the elimination area. It can be known that the picture corresponding to the filling restriction area is a key and significant picture, and after excluding the filling restriction area, the picture corresponding to the background area in the image can be used to fill the area to be filled. After excluding the filling restriction area and the elimination area in the original image, the filling search area can be determined based on other areas. Exemplarily, the remaining area of the original image after excluding the filling restriction area and the elimination area can be used as the filling search area; considering that the features of the picture corresponding to the area far away from the area to be filled may be quite different from the features of the picture near the area to be filled, the remaining area of the original image excluding the filling restriction area and the elimination area can also be restricted again, and a part of the remaining area can be used as the filling search area.
[0055] In some embodiments, the elimination area is used as the area to be filled, and the area to be filled is based on certain images in the filling search area. First, each pixel in the elimination area is centered and divided into different blocks of a certain size. The block at the edge of the elimination area is then determined. It is understood that the block at the edge of the elimination area contains some colors. To ensure a natural and realistic appearance after filling the elimination area, the colors of the image used for filling should be close to the colors contained in the block at the edge. The color similarity between the edge area and the area to be searched is calculated, and the image corresponding to the block with the highest similarity is used as the filling basis. The corresponding block in the edge area is then filled based on the pixel values of the pixels in the image. This process is equivalent to the best matching block search process, that is, finding a block within a known area that is most similar to the block to be filled. For example, the block with the smallest distance calculated by the RGB mean square difference is used as the block most similar to the block to be filled. After determining the block most similar to the block to be filled, the block to be filled is filled based on the pixel values of the most similar block.
[0056] It's important to note that the edge-of-area elimination area is composed of multiple blocks. For each block, a color matching calculation is performed with the fill search area to determine its corresponding matching block. Filling is then performed on the corresponding edge block based on the pixel values of the matching blocks. These steps are performed in parallel for each block in the edge-of-area elimination area.
[0057] It's important to note that color similarity matching can only be performed when a block contains a portion of color. Therefore, the process of filling the elimination area can be understood as an iterative process from the outside in. First, the outermost blocks of the elimination area are filled with color. The resulting elimination area is then used as the new elimination area. The outermost blocks of the new elimination area are searched for matching blocks, and the new outermost blocks are filled with color. This process continues until the elimination area in the image to be filled is completely filled. The filled image can then be used as the target image.
[0058] An image processing method provided by an embodiment of the present disclosure first obtains an image to be filled with an eliminated area in response to an elimination operation on an original image; then determines a filling restriction area based on the image to be filled; and finally determines a filling search area based on the filling restriction area, fills the eliminated area, and obtains a target image. Different from the prior art in which other image content in the image is used to fill the eliminated area, the above technical solution first determines the filling restriction area before filling the eliminated area, and uses the area in the image that presents the key picture content as the filling restriction area, and uses the image content in the original image other than the eliminated area and the filling restriction area as the possible filling picture source, avoiding using the pictures in the filling restriction area to fill the eliminated area, thereby ensuring that the filled image is more realistic and natural; in addition, the filling restriction area is excluded when determining the filling search area. Compared with traversing the entire image and then looking for the filling picture with the highest similarity, the amount of calculation when searching for the filling picture is reduced, thereby improving the efficiency of image processing.
[0059] In some embodiments, determining the filling restriction area based on the image to be filled includes the following steps: a1)-c1).
[0060] a1) performing feature recognition on the image to be filled.
[0061] In some embodiments, the image to be filled is detected and segmented to obtain various types of screen content in the image to be filled. In this embodiment, there is no specific limitation on the method used for special recognition. For example, a pre-trained neural network model can be used as a feature recognition model, and the image to be filled can be input into the feature recognition model to obtain various types of screen content contained in the image to be filled as feature recognition results.
[0062] b1) determining key picture content contained in the image to be filled according to the recognition result.
[0063] The recognition result refers to the various types of screen content contained in the object to be filled. In this embodiment, feature priorities can be pre-set for various types of screens, with features with higher priorities being used as key screen content. The step of determining key screen content contained in the image to be filled based on the recognition result may include: determining the feature type of the screen content in the image to be filled from the recognition result; and determining screen content with a feature type that matches the set feature type as key screen content.
[0064] For example, assuming that for a person image, the priority is set in order, the person is higher than the object and higher than the background. Then, when a person image contains a person, an object, the sky, and the ground, the person is regarded as the key content of the picture.
[0065] c1) determining a screen area presenting the key screen content as a filling restriction area.
[0066] Specifically, the screen area presenting the key screen content is used as the filling restriction area.
[0067] The above embodiment is equivalent to refining the process of determining the filling restriction area. By identifying the image to be filled, the key picture content contained in the area to be filled is determined, and the picture area of the key picture content is used as the filling restriction area. This ensures that the filling restriction area is excluded when determining the filling search area to avoid using the picture content in the filling restriction area to fill the image to be filled, thereby ensuring that the style of the filled image matches, is real and natural.
[0068] In some embodiments, determining a filling search area based on the filling restriction area, filling the elimination area, and obtaining a target image includes the following steps: a2)-d2).
[0069] a2) determining other picture areas other than the filling restriction area and the elimination area as a filling search area.
[0070] After determining the fill restriction area in the above steps, a fill search area needs to be determined based on the fill restriction area, and the eliminated area is filled based on the fill search area. The fill search area can be the area of the original image that excludes the fill restriction area and the eliminated area. Alternatively, considering that the image to be filled is too far from the eliminated area and the image similarity is not high, it is unnecessary to expand the search range too much. Therefore, a new area can be defined from other image areas as the fill search area of the image to be filled.
[0071] b2) For the pixel points in the elimination area, constructing an area block with the pixel points as the center, and determining the filtered non-completely blank area blocks as blocks to be filled.
[0072] It can be understood that the elimination area includes multiple pixel points, and this step can be considered as a parallel execution of each pixel point in the elimination area. For the pixel points in the elimination area, a region block of a set size is constructed with each pixel point as the center. The set size can be set according to a historical experience value. For each pixel point in the elimination area, multiple region blocks are constructed, wherein the region block at the edge of the elimination area is a non-completely blank region block, and the region block closer to the inside of the elimination area may be a completely blank region block. In this embodiment, the non-completely blank region blocks are first filtered out from the multiple constructed region blocks, and the filtered non-completely blank region blocks are used as blocks to be filled. This is equivalent to using the region block at the edge of the elimination area as a block to be filled, and filling this region block first when filling is performed subsequently.
[0073] c2) determining a filling matching block of the block to be filled from the filling search area, and filling the block to be filled based on the filling matching block to obtain a filled intermediate image.
[0074] This step is equivalent to searching for the best matching block in the fill search area, that is, finding a block in the known fill search area that is most similar to the block to be filled. Here, similarity can be judged by minimizing the distance, that is, minimizing the RGB color mean square difference.
[0075] For each block to be filled, a matching block is identified from the filling search area that matches the block to be filled. A matching block can be understood as the block that is most similar to the block to be filled. For each matching block, a corresponding matching block is determined. The block to be filled is filled based on the pixel values of the pixels in the matching block. This filling process can be considered to be performed in parallel on multiple blocks to be filled. After the block to be filled is filled based on the matching blocks, a filled image is obtained, which in this embodiment is referred to as an intermediate image.
[0076] d2) If it is detected that there is still an elimination area in the intermediate image, return to re-execute the determination operation of filling the search area; otherwise, determine the intermediate image as the target image.
[0077] In some embodiments, after filling the perimeter of the elimination area, an intermediate image is obtained, and a check is performed to determine whether the elimination area still exists in the intermediate image. If the elimination area still exists in the intermediate image, the process of determining the fill search area is repeated, iteratively executing the process. As the process is repeated, the elimination area becomes smaller and smaller. When the elimination area no longer exists in the intermediate image, the process terminates, and the resulting image is used as the target image. If the elimination area does not exist in the intermediate image, the intermediate image is used as the target image. The above embodiments specifically specify the steps of determining the fill search area based on the fill restricted area and filling the elimination area to obtain the target image. The fill restricted area is excluded from the determination of the fill search area, preventing the use of images within the fill restricted area to fill the elimination area, thereby ensuring a more realistic and natural filled image. Furthermore, excluding the fill restricted area from the determination of the fill search area reduces the computational effort involved in searching for the fill image, compared to searching the entire image to find the most similar fill image. Furthermore, the process of filling the elimination area can be understood as an iterative process from the outside in, ensuring a natural transition between the filled images and a more realistic filled image.
[0078] Based on the above embodiment, the above image processing method can also be further optimized. Specifically, determining other screen areas outside the filling restriction area and the elimination area as the filling search area includes the following steps: a21)-a22).
[0079] a21) obtaining edge tracks constituting the elimination area, and determining distances from pixels in the other image areas to the edge tracks.
[0080] Considering that using the entire rest of the image area as a fill search area results in a relatively high computational load when searching for fill matching blocks, this embodiment restricts the fill search area to a smaller area than the entire rest of the image area. Specifically, the edge trajectory that constitutes the elimination area is obtained. This edge trajectory can be represented by coordinate information in the image. Similarly, the coordinate information of the pixels in the rest of the image area can also be obtained. Based on the coordinate information of the edge trajectory and the coordinate information of the pixels in the rest of the image area, the distance value from the pixel in the rest of the image area to the edge trajectory can be calculated.
[0081] a22) forming the filling search area based on the pixel points whose distance values are less than a set distance threshold.
[0082] The distance threshold can be determined based on historical experience. Specifically, the area with distance values less than the set distance threshold is used as the fill search area. It is understood that as the blank portion of the elimination area decreases, the range of the fill search area can also be reduced accordingly.
[0083] This technical solution optimizes the fill search area, defining a smaller area than the rest of the image as the fill search area. In the underlying implementation, this randomly searches for fill matching blocks based on local regions, reducing computational effort compared to searching the entire image to find the most similar blocks.
[0084] Based on the above embodiment, the above image processing method may be further optimized. In some embodiments, the filling matching block of the block to be filled is determined from the filling search area and includes: c21-c22.
[0085] c21) Obtaining an adjacent region block whose offset step length from the block to be filled is a set value.
[0086] The offset step size of the block to be filled can be understood as the translation step size when the block to be filled is translated up, down, left, or right. There can be one or more adjacent area blocks. Exemplarily, the offset step size is set to one pixel or five pixels. Specifically, the area block obtained by offsetting the block to be filled by the set offset step size is recorded as the adjacent area block.
[0087] c22) randomly determining an initial matching block for the block to be filled from the filling search area, and recording the randomly determined matching block for each adjacent area block as a propagation block.
[0088] After the adjacent area blocks are determined, matching blocks are determined for the block to be filled and the adjacent area blocks. The matching blocks of the block to be filled can be recorded as initial matching blocks, and the matching blocks of the adjacent area blocks can be recorded as propagation blocks.
[0089] In this embodiment, a random algorithm is used to randomly initialize the matching block position of the block to be filled, and record the matching block as the initial matching block. A matching block is randomly determined for each adjacent area block, and the matching block of the adjacent area block is recorded as the propagation block.
[0090] c23) Determine a region block whose offset step from the propagation block is the set value as a candidate matching block for the block to be filled.
[0091] In this step, after determining the propagation block, the regional blocks surrounding the propagation block are expanded to serve as candidate matching blocks for the block to be filled. Due to local correlation in the image, the best matching block corresponding to a local regional block may also be within the same local area. This means that the offset step value within a local area may be the same. Specifically, a regional block with a set offset step value from the propagation block is determined as a candidate matching block for the block to be filled.
[0092] c24) Determine a filling matching block for the block to be filled based on the initial matching block and the candidate matching blocks.
[0093] Specifically, after obtaining the initial matching block and the candidate matching blocks, a filling matching block of the block to be filled is further determined.
[0094] The above technical solution specifies the process of determining the filling matching block of the block to be filled from the filling search area. Through initialization, propagation, and local search, the best matching block is searched and determined. Compared with traversing the entire image to find the area block with the highest similarity, the above technical solution limits the search for the filling matching block to a smaller area, reducing the computational complexity during the search.
[0095] In some embodiments, determining the filling matching block of the block to be filled based on the initial matching block and the candidate matching block includes: c241)-c243).
[0096] c241) respectively determining the matching similarities between the initial matching block, the candidate matching block and the block to be filled.
[0097] In this embodiment, the matching filler block for the block to be supplemented is determined based on a local search. After the propagation of the above steps, it is possible that the best matching area block has not yet been found. In this case, the search area can be further restricted, and a random search can be performed in a small surrounding area to find the best matching filler block.
[0098] Specifically, the matching similarity of the initial matching block and the candidate matching block to the block to be filled is calculated respectively. The calculation of the matching similarity can be understood as calculating the pixel values of the pixel points in the initial matching block and the candidate matching block with the pixel values of the non-blank area in the block to be filled, such as calculating the variance of the pixel values as the evaluation indicator of the matching similarity.
[0099] c242) Determine the matching block with the highest matching similarity as the local matching reference block, and construct a local matching area with the local matching reference block as the center.
[0100] Specifically, the matching block with the highest matching similarity is determined as the local matching benchmark block. Considering the local correlation of the image, the best matching block corresponding to a block in a local area may also be in the same local area. Therefore, a region of a certain size is constructed with the local matching benchmark block as the center, which is recorded as the local matching region. The local matching region is used as the area for searching for filling matching blocks.
[0101] c243) Determine the matching block with the highest matching similarity with the block to be filled in the local matching area as the filling matching block of the block to be filled.
[0102] Specifically, the matching similarities between the regional blocks in the local matching area and the block to be filled are calculated respectively, and the matching block with the highest matching similarity is determined as the filling matching block of the block to be filled.
[0103] The above technical solution concretizes the steps of determining the filling matching block of the block to be filled based on the initial matching block and the candidate matching blocks, fully considering the local correlation of the image. The best matching block corresponding to a block in a certain local area may also be in the same local area. The search range is limited to a smaller area, which reduces the search calculation amount and improves the image processing efficiency.
[0104] Based on the above embodiment, the above image processing method may be further optimized. In some embodiments, filling the block to be filled based on the filling matching block includes the following steps: e1)-e4).
[0105] e1) For a pixel point included in the block to be filled, if the pixel point is not included in other blocks to be filled, the pixel value corresponding to the pixel point in the filling matching block is used as the filling pixel value.
[0106] In this step, the block to be filled is composed of a certain pixel point as the center. A pixel point does not necessarily fall into one block to be filled, but may fall into many blocks to be filled. A judgment is made for the pixel points contained in the block to be filled to determine whether the pixel point still exists in other blocks to be filled. The pixel points contained in the block to be filled may be contained in other blocks to be filled, or may not be contained in other blocks to be filled. If the pixel point is not contained in other blocks to be filled, it is only necessary to use the pixel value of the relative pixel point (the pixel point corresponding to the pixel point) in the filling matching block as the filling pixel value. Exemplarily, when judging which blocks to be filled the pixel point is contained in, it can be determined based on the coordinate information of the pixel point and the vertex coordinate information of the block to be filled. If the range determined by the vertex coordinate information of the block to be filled contains the coordinate information of the pixel point, it is determined that the pixel point is contained in the block to be filled.
[0107] e2) If the pixel point is included in other blocks to be filled, determine the other blocks to be filled that include the pixel point, and obtain other filling matching blocks corresponding to the other blocks to be filled.
[0108] This step is for the case where the pixel points contained in the block to be filled are contained in other blocks to be filled. If the pixel points are contained in other blocks to be filled, it is necessary to first determine which blocks to be filled contain the pixel points, and determine the filling matching blocks corresponding to the filling blocks containing these pixel points.
[0109] e3) determining a filling pixel value of the pixel point according to the pixel values of the pixel point in the filling matching block and the other filling matching blocks.
[0110] In order to prevent the colors of the blocks in the block to be filled from being so fragmented, this step comprehensively considers the pixel values of the pixel points in the filling matching block and other filling matching blocks, and determines the filling pixel value of the pixel points based on the pixel values of the pixel points in these filling matching blocks. This processing method can play a smoothing role. Exemplarily, the filling pixel value of the pixel point can be determined by calculating the average value of the pixel values of the pixel point in the filling matching block and other filling matching blocks. Calculating the average value of each pixel value is equivalent to a smoothing processing method. For example, if the pixel points contained in the block to be filled exist in ten matching blocks, then determine the ten matching blocks and the pixel values in the ten matching blocks respectively, and then calculate the average value of the ten pixel values to obtain the average value as the filling pixel value of the pixel point. Of course, the pixel point may exist in a completely blank area block, then the completely blank area block is ignored and only the block to be filled is considered.
[0111] e4) Filling the block to be filled with color using the filling pixel value.
[0112] Specifically, the filling pixel value is used to perform color filling on the block to be filled, that is, the pixel value of the pixel point in the block to be filled is set to the filling pixel value.
[0113] The above technical solution further refines the steps for filling the block to be filled based on the filling matching block. The filling pixel value is determined for each case where the pixel of the block to be filled exists in other blocks to be filled, or does not exist in other blocks to be filled. For pixels contained in other blocks to be filled, the pixel values in the filling matching block and the other filling matching blocks are averaged to achieve smoothing. This achieves a natural, smooth, and seamless color transition between blocks within the block to be filled, making the resulting filled target image more realistic and natural.
[0114] For example, Figure 1d illustrates the effect of executing the image processing method provided by this embodiment on the target image. Compared to Figure 1c, the filled image obtained by conventional processing contains mismatched images such as shoes and clothing. As shown in Figure 1d, the image processing method provided by this embodiment produces a filled image in which the image content presented in the eliminated area 12 matches the surrounding image style, resulting in a more realistic and natural-looking target image.
[0115] FIG2 shows a schematic structural diagram of an image processing device provided by an embodiment of the present disclosure. As shown in FIG2 , the device includes: a response module 21 , a restriction determination module 22 , and a filling module 23 .
[0116] The response module 21 is configured to obtain an image to be filled with an eliminated area in response to the elimination operation on the original image.
[0117] The restriction determination module 22 is configured to determine a filling restriction area based on the image to be filled.
[0118] The filling module 23 is configured to determine a filling search area based on the filling restriction area, and fill the elimination area to obtain a target image.
[0119] An image processing device provided by an embodiment of the present disclosure is different from the prior art in which other image contents in an image are used to fill an elimination area. In the above technical solution, before filling the elimination area, a filling restriction area is first determined, and the area in the image presenting key picture contents is used as the filling restriction area. The image contents other than the elimination area and the filling restriction area in the original image are used as possible filling picture sources, thereby avoiding using pictures in the filling restriction area to fill the elimination area, thereby ensuring that the filled image is more realistic and natural. In addition, the filling restriction area is excluded when determining the filling search area. Compared with traversing the entire image and then looking for the filling picture with the highest similarity, the amount of calculation when searching for the filling picture is reduced, thereby improving the image processing efficiency.
[0120] In some embodiments, the restriction determination module 22 may be specifically configured to:
[0121] Performing feature recognition on the image to be filled;
[0122] Determining key picture content contained in the image to be filled according to the recognition result;
[0123] A screen area presenting the key screen content is determined as a filling restriction area.
[0124] In some embodiments, the filling module 23 may include:
[0125] A search area determination unit, configured to determine other picture areas other than the filling restriction area and the elimination area as a filling search area;
[0126] a filling block determining unit, configured to construct a region block with the pixel points in the elimination region as the center, and determine the filtered non-completely blank region blocks as the blocks to be filled;
[0127] an intermediate image determining unit, configured to determine a filling matching block of the block to be filled in the filling search area, and fill the block to be filled based on the filling matching block to obtain a filled intermediate image;
[0128] The loop unit is configured to return to re-execute the determination operation of filling the search area if it is detected that there is still an elimination area in the intermediate image; otherwise, determine the intermediate image as the target image.
[0129] In some embodiments, the search area determination unit may be specifically configured to:
[0130] Acquire an edge track constituting the elimination area, and determine a distance value from a pixel point in the other image area to the edge track;
[0131] The filling search area is formed based on the pixel points whose distance values are less than a set distance threshold.
[0132] In some embodiments, the intermediate image determination unit may be specifically configured to:
[0133] Obtaining an adjacent area block whose offset step length from the block to be filled is a set value;
[0134] Randomly determine an initial matching block for the block to be filled from the filling search area, and record the randomly determined matching block for each adjacent area block as a propagation block;
[0135] Determine a region block whose offset step from the propagation block is the set value as a candidate matching block for the block to be filled;
[0136] A filling matching block of the block to be filled is determined based on the initial matching block and the candidate matching blocks.
[0137] In some embodiments, the step of the filling block determining unit determining the filling matching block of the block to be filled based on the initial matching block and the candidate matching block may specifically include:
[0138] respectively determining matching similarities between the initial matching block, the candidate matching block, and the block to be filled;
[0139] Determine the matching block with the highest matching similarity as the local matching reference block, and construct a local matching area with the local matching reference block as the center;
[0140] The matching block with the highest matching similarity with the block to be filled in the local matching area is determined as the filling matching block of the block to be filled.
[0141] In some embodiments, the intermediate image determination unit may be specifically configured to:
[0142] For a pixel point included in the block to be filled, if the pixel point is not included in other blocks to be filled, the pixel value corresponding to the pixel point in the filling matching block is used as the filling pixel value; otherwise,
[0143] Determine other blocks to be filled that contain the pixel point, and obtain other filling matching blocks corresponding to the other blocks to be filled;
[0144] Determining a filling pixel value of the pixel point according to the pixel values of the pixel point in the filling matching block and the other filling matching blocks;
[0145] The block to be filled is filled with color using the filling pixel value.
[0146] The image processing device provided by the embodiments of the present disclosure can execute the image processing method provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0147] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0148] FIG3 shows a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Referring to FIG3 , a schematic diagram of the structure of an electronic device (such as a terminal device or server in FIG3 ) 300 suitable for implementing an embodiment of the present disclosure is shown below. The terminal device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. The electronic device shown in FIG3 is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
[0149] As shown in FIG3 , the electronic device 300 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 into a random access memory (RAM) 303. Various programs and data required for the operation of the electronic device 300 are also stored in the RAM 303. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An edit / output (I / O) interface 305 is also connected to the bus 304.
[0150] Typically, the following devices may be connected to the I / O interface 305: an input device 306 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 308 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 309. The communication device 309 may allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. Although FIG3 shows the electronic device 300 with various devices, it should be understood that not all of the devices shown are required to be implemented or present. More or fewer devices may alternatively be implemented or present.
[0151] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 309, or installed from the storage device 308, or installed from the ROM 302. When the computer program is executed by the processing device 301, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0152] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0153] The electronic device provided by the embodiment of the present disclosure and the image processing method provided by the above embodiment belong to the same inventive concept. For technical details not fully described in this embodiment, please refer to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0154] An embodiment of the present disclosure provides a computer storage medium having a computer program stored thereon. When the program is executed by a processor, the image processing method provided by the above embodiment is implemented.
[0155] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0156] In some embodiments, the client and server can communicate using any currently known or later developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or later developed network.
[0157] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0158] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device is enabled to: perform material analysis processing on the original material of the business object to obtain the target graphic material of the business object; generate configuration information based on the target graphic material and the poster of the business object, and generate target poster description information; generate and display the target poster image of the business object by rendering the target poster description information.
[0159] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0160] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0161] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."
[0162] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0163] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0164] The present disclosure also provides a computer program product, comprising instructions, which, when executed by a processor, enable the processor to implement the image processing method of any of the aforementioned embodiments.
[0165] The present disclosure also provides a computer program, comprising instructions, which, when executed by a processor, enable the processor to implement the image processing method of any of the aforementioned embodiments.
[0166] According to one or more embodiments of the present disclosure, [Example 1] provides an image processing method, the method comprising:
[0167] In response to the elimination operation on the original image, an image to be filled having an eliminated area is obtained;
[0168] determining a filling restriction area based on the image to be filled;
[0169] A filling search area is determined based on the filling restriction area, and the elimination area is filled to obtain a target image.
[0170] According to one or more embodiments of the present disclosure, [Example 2] provides an image processing method, which may further include:
[0171] Optionally, the step of determining a filling restricted area based on the image to be filled includes:
[0172] Performing feature recognition on the image to be filled;
[0173] Determining key picture content contained in the image to be filled according to the recognition result;
[0174] A screen area presenting the key screen content is determined as a filling restriction area.
[0175] According to one or more embodiments of the present disclosure, [Example 3] provides an image processing method, which may further include:
[0176] Optionally, the step of determining a filling search area based on the filling restriction area, filling the elimination area, and obtaining a target image may include:
[0177] Determine other picture areas outside the filling restriction area and the elimination area as a filling search area;
[0178] For the pixel points in the elimination area, constructing an area block with the pixel points as the center, and determining the filtered non-completely blank area blocks as blocks to be filled;
[0179] Determining a filling matching block of the block to be filled from the filling search area, and filling the block to be filled based on the filling matching block to obtain a filled intermediate image;
[0180] If it is detected that there is still an elimination area in the intermediate image, the process returns to re-execute the determination operation of filling the search area; otherwise, the intermediate image is determined as the target image.
[0181] According to one or more embodiments of the present disclosure, [Example 4] provides an image processing method, which may further include:
[0182] Optionally, determining other picture areas other than the filling restriction area and the elimination area as the filling search area may include:
[0183] Acquire an edge track constituting the elimination area, and determine a distance value from a pixel point in the other image area to the edge track;
[0184] The filling search area is formed based on the pixel points whose distance values are less than a set distance threshold.
[0185] According to one or more embodiments of the present disclosure, [Example 5] provides an image processing method, the method comprising:
[0186] Optionally, the step of determining a filling matching block of the to-be-filled block from the filling search area includes:
[0187] Obtaining an adjacent area block whose offset step length from the block to be filled is a set value;
[0188] Randomly determine an initial matching block for the block to be filled from the filling search area, and record the randomly determined matching block for each adjacent area block as a propagation block;
[0189] Determine a region block whose offset step from the propagation block is the set value as a candidate matching block for the block to be filled;
[0190] A filling matching block of the block to be filled is determined based on the initial matching block and the candidate matching blocks.
[0191] According to one or more embodiments of the present disclosure, [Example 6] provides an image processing method, which may further include:
[0192] The step of determining a filling matching block of the block to be filled based on the initial matching block and the candidate matching blocks includes:
[0193] respectively determining matching similarities between the initial matching block, the candidate matching block, and the block to be filled;
[0194] Determine the matching block with the highest matching similarity as the local matching reference block, and construct a local matching area with the local matching reference block as the center;
[0195] The matching block with the highest matching similarity with the block to be filled in the local matching area is determined as the filling matching block of the block to be filled.
[0196] According to one or more embodiments of the present disclosure, [Example 7] provides an image processing method, which may further include:
[0197] Optionally, the step of filling the block to be filled based on the filling matching block includes:
[0198] For a pixel point included in the block to be filled, if the pixel point is not included in other blocks to be filled, the pixel value corresponding to the pixel point in the filling matching block is used as the filling pixel value; otherwise,
[0199] Determine other blocks to be filled that contain the pixel point, and obtain other filling matching blocks corresponding to the other blocks to be filled;
[0200] Determining a filling pixel value of the pixel point according to the pixel values of the pixel point in the filling matching block and the other filling matching blocks;
[0201] The block to be filled is filled with color using the filling pixel value.
[0202] According to one or more embodiments of the present disclosure, [Example 8] provides an image processing device, the device including:
[0203] A response module, configured to obtain an image to be filled with an eliminated area in response to an elimination operation on the original image;
[0204] a restriction determination module, configured to determine a filling restriction area based on the image to be filled;
[0205] The filling module is used to determine a filling search area based on the filling restriction area, fill the elimination area, and obtain a target image.
[0206] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0207] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0208] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. An image processing method, comprising: In response to the elimination operation on the original image, an image to be filled having an eliminated area is obtained; Determine a filling restriction area based on the image to be filled; A filling search area is determined based on the filling restriction area, and the elimination area is filled to obtain a target image.
2. The image processing method according to claim 1, wherein: The determining of the filling restriction area based on the image to be filled comprises: Performing feature recognition on the image to be filled; Determine the key picture content contained in the image to be filled according to the recognition result; A screen area presenting the key screen content is determined as the filling restriction area.
3. The image processing method according to claim 1 or 2, wherein: Determining a filling search area based on the filling restriction area, filling the elimination area, and obtaining a target image comprises: Determine other picture areas other than the filling restriction area and the elimination area as a filling search area; For the pixel points in the elimination area, constructing an area block with the pixel points as the center, and determining the screened non-completely blank area blocks as blocks to be filled; Determining a filling matching block of the block to be filled from the filling search area, and filling the block to be filled based on the filling matching block to obtain a filled intermediate image; If it is detected that there is still an elimination area in the intermediate image, the process returns to re-execute the determination operation of filling the search area; otherwise, the intermediate image is determined as the target image.
4. The image processing method according to claim 3, wherein: The step of determining other picture areas other than the filling restriction area and the elimination area as the filling search area comprises: Acquire the edge track constituting the elimination area, and determine the distance value from the pixel point in the other picture area to the edge track; The filling search area is formed based on the pixel points whose distance values are less than the set distance threshold.
5. The image processing method according to claim 3 or 4, wherein: Determining a filling matching block of the to-be-filled block from the filling search area comprises: Obtaining an adjacent area block whose offset step length from the block to be filled is a set value; An initial matching block is randomly determined for the block to be filled from the filling search area, and an initial matching block is randomly determined for each adjacent area. The matching blocks randomly determined by the domain blocks are recorded as propagation blocks; Determine a regional block whose offset step from the propagation block is the set value as a candidate matching block of the block to be filled; Based on the initial matching block and the candidate matching block, a filling matching block of the block to be filled is determined.
6. The image processing method according to claim 5, wherein: The determining, based on the initial matching block and the candidate matching block, of the filling matching block of the block to be filled comprises: respectively determining matching similarities between the initial matching block and the candidate matching block and the block to be filled; Determine the matching block with the highest matching similarity as the local matching reference block, and construct a local matching area with the local matching reference block as the center; A matching block in the local matching area with the highest matching similarity to the block to be filled is determined as a filling matching block of the block to be filled.
7. The image processing method according to any one of claims 3 to 6, wherein: The filling the block to be filled based on the filling matching block comprises: For a pixel point included in the block to be filled, if the pixel point is not included in other blocks to be filled, a pixel value corresponding to the pixel point in the filling matching block is used as a filling pixel value; The block to be filled is filled with color using the filling pixel value.
8. The image processing method according to any one of claims 3 to 7, wherein: The filling the block to be filled based on the filling matching block comprises: If the pixel point is not included in other blocks to be filled, determine other blocks to be filled that contain the pixel point, and obtain other filling matching blocks corresponding to the other blocks to be filled; Determine a filling pixel value of the pixel point according to the pixel values of the pixel point in the filling matching block and the other filling matching blocks; The block to be filled is filled with color using the filling pixel value.
9. The image processing method according to any one of claims 3 to 8, wherein: The step of constructing a region block with the pixel points in the elimination region as the center comprises: In the elimination area, in order from the edge to the center, for the pixel points in the elimination area, a regional block is constructed with the pixel points as the center.
10. An image processing device, comprising: A response module, used for obtaining an image to be filled with an eliminated area in response to an elimination operation on the original image; A restriction determination module, used for determining a filling restriction area based on the image to be filled; The filling module is used to determine a filling search area based on the filling restriction area, fill the elimination area, and obtain a target image.
11. An electronic device, comprising: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the image processing method as described in any one of claims 1 to 9.
12. A computer-readable storage medium having a computer program stored thereon, wherein: When the program is executed by a processor, the image processing method as described in any one of claims 1 to 9 is implemented.
13. A computer program product, comprising instructions, which, when executed by a processor, enable the processor to implement the image processing method according to any one of claims 1 to 9.
14. A computer program, comprising instructions, which, when executed by a processor, enable the processor to implement the image processing method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Image repairing method and device
CN106296604A
Image processing method and device, electronic equipment and readable storage medium
CN113066005A
Image processing method and device, equipment and storage medium
CN116051366A
Method for image processing, and image-processing system
US20200202155A1
