Image Processing Method, Apparatus, Electronic Device, and Medium

By identifying the relative positional relationship between the target area and the edge area in the target image, we can determine whether the target object is truncated, which solves the problem of incomplete image information and improves the accuracy and user experience of image category recognition.

CN114494788BActive Publication Date: 2025-06-27BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210148623.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-17
Publication Date
2025-06-27
Estimated Expiration
2042-02-17

AI Technical Summary

Technical Problem

In image recommendation scenarios, the image information is incomplete, especially the object is truncated, resulting in poor user experience.

Method used

By identifying the target image, the relative positional relationship between the target area and the edge area is determined, and whether the target object is truncated is determined, based on this, the image category is determined to characterize the integrity of the target object.

Benefits of technology

Improve the accuracy and efficiency of image category recognition, ensure the integrity of image information, and thus improve the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114494788B_ABST
    Figure CN114494788B_ABST
Patent Text Reader

Abstract

The present disclosure provides an image processing method, apparatus, device, medium and product, relating to the field of computer technology, specifically to the field of image processing technology. The image processing method includes: identifying a target image to obtain a target area, where the target area includes a target object; determining a first relative position relationship between the target area and an edge area of the target image; in response to determining that the first relative position relationship satisfies a first preset condition, determining a second relative position relationship between the target object and the edge area; and determining an image category of the target image based on the second relative position relationship, where the image category characterizes the integrity of the target object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technologies, specifically to the field of image processing technologies. More specifically, the present disclosure relates to an image processing method, apparatus, electronic device, medium, and program product. Background Art

[0002] In many scenarios, it is necessary to recommend images to users. When the image information is incomplete, it will lead to a poor user experience. The incompleteness of image information includes that the objects in the image are truncated. Summary of the Invention

[0003] The present disclosure provides an image processing method, apparatus, electronic device, storage medium, and program product.

[0004] According to one aspect of the present disclosure, there is provided an image processing method, including: identifying a target image to obtain a target area, where the target area includes a target object; determining a first relative position relationship between the target area and an edge area of the target image for the edge area of the target image; in response to determining that the first relative position relationship satisfies a first preset condition, determining a second relative position relationship between the target object and the edge area; and determining an image category of the target image based on the second relative position relationship, where the image category characterizes the integrity of the target object.

[0005] According to another aspect of the present disclosure, there is provided an image processing apparatus, including: an identification module, a first determination module, a second determination module, and a third determination module. The identification module is configured to identify a target image to obtain a target area, where the target area includes a target object; the first determination module is configured to determine a first relative position relationship between the target area and an edge area of the target image for the edge area of the target image; the second determination module is configured to, in response to determining that the first relative position relationship satisfies a first preset condition, determine a second relative position relationship between the target object and the edge area; and the third determination module is configured to determine an image category of the target image based on the second relative position relationship, where the image category characterizes the integrity of the target object.

[0006] According to another aspect of the present disclosure, there is provided an electronic device, including: at least one processor and a memory communicatively connected to the at least one processor. The memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to execute the above-mentioned image processing method.

[0007] According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the above-described image processing method.

[0008] According to another aspect of the present disclosure, there is provided a computer program product including a computer program / instructions, which when executed by a processor implement the steps of the above-described image processing method.

[0009] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The drawings are used to better understand the solution and do not constitute a limitation to the present disclosure. Among them:

[0011] Figure 1 Schematically shows the system architecture of image processing according to an embodiment of the present disclosure;

[0012] Figure 2 Schematically shows the flowchart of the image processing method according to an embodiment of the present disclosure;

[0013] Figures 3A to 3D Schematically shows the schematic diagram of the image processing method according to an embodiment of the present disclosure;

[0014] Figures 4A to 4B Schematically shows the schematic diagram of the image processing method according to another embodiment of the present disclosure;

[0015] Figure 5 Schematically shows the block diagram of the image processing apparatus according to an embodiment of the present disclosure; and

[0016] Figure 6 is the block diagram of the electronic device for executing image processing used to implement the embodiments of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0017] The following describes exemplary embodiments of the present disclosure with reference to the drawings. Various details of the embodiments of the present disclosure are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted below.

[0018] The terms used herein are for describing specific embodiments only and are not intended to limit the present disclosure. The terms "including", "comprising", etc. used herein indicate the presence of the described features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0019] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.

[0020] In cases where expressions similar to "at least one of A, B, and C, etc." are used, generally, it should be interpreted according to the meaning commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include, but not be limited to, a system having only A, only B, only C, having A and B, having A and C, having B and C, and / or having A, B, and C, etc.).

[0021] Figure 1 The system architecture of image processing according to an embodiment of the present disclosure is schematically shown. It should be noted that Figure 1 What is shown is only an example of the system architecture to which the embodiments of the present disclosure can be applied, to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments, or scenarios.

[0022] As Figure 1 shown, the system architecture 100 according to this embodiment may include clients 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the clients 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.

[0023] Users can use the clients 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications may be installed on the clients 101, 102, 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).

[0024] The clients 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, and desktop computers, etc. The clients 101, 102, 103 of the embodiments of the present disclosure may, for example, run application programs.

[0025] Server 105 may be a server that provides various services. For example, it may be a back-end management server (merely an example) that supports the websites browsed by users using clients 101, 102, and 103. The back-end management server may analyze and process data such as user requests received, and feedback the processing results (such as web pages, information, or data obtained or generated according to user requests) to the clients. Additionally, server 105 may also be a cloud server, that is, server 105 has cloud computing capabilities.

[0026] It should be noted that the image processing method provided by the embodiments of the present disclosure may be executed by clients 101, 102, and 103. Correspondingly, the image processing apparatus provided by the embodiments of the present disclosure may be disposed in clients 101, 102, and 103.

[0027] In one example, server 105 may process a target image to obtain the image category of the target image, then filter some categories of images, and send the remaining categories of images to clients 101, 102, and 103 through network 104 to implement recommending images to users.

[0028] It should be understood that Figure 1 the numbers of clients, networks, and servers in

[0029] are merely illustrative. According to the implementation requirements, there may be any number of clients, networks, and servers. Figure 1 Below, in combination with the Figures 2 to 4B system architecture, with reference to Figure 1 the server shown in Figure 1 the server shown in

[0030] Figure 2 FIG. schematically shows a flowchart of an image processing method according to an embodiment of the present disclosure.

[0031] As Figure 2 shown, the image processing method 200 of the embodiments of the present disclosure may include, for example, operation S210 to operation S240.

[0032] In operation S210, identify a target image to obtain a target region, where the target region includes a target object.

[0033] In operation S220, for the edge region of the target image, determine a first relative position relationship between the target region and the edge region.

[0034] In operation S230, in response to determining that the first relative position relationship satisfies the first preset condition, determine the second relative position relationship between the target object and the edge region.

[0035] In operation S240, based on the second relative position relationship, determine the image category of the target image, where the image category characterizes the integrity of the target object.

[0036] Exemplarily, the target object includes, for example, text and non-text, and the non-text includes, for example, a person or an object. The text in the target image can be recognized using text recognition technology, and the person or object in the target image can be recognized using a target detection algorithm. The text recognition technology can include Optical Character Recognition (OCR) technology. A text box is obtained by recognizing the target image using the text recognition technology, and a detection box is obtained by recognizing the target image using the target detection algorithm. The target region can be the region surrounded by the text box or the detection box, and the target object is included in the target region.

[0037] The target image has an edge region, for example. If the first relative position relationship between the target region and the edge region satisfies the first preset condition, it indicates that the target region is close to the edge of the target image, and in a high probability, it characterizes that the target object in the target region is truncated, resulting in incomplete image information of the target image.

[0038] Considering the situation where the recognition result of the text recognition technology or the target detection algorithm has a certain error, resulting in an overly large area of the target region. Thus, if the area of the target region is much larger than the area where the target object is located, there is a situation where the target object is not truncated but the target region is too close to the edge of the target image.

[0039] Therefore, to improve the accuracy of determining whether the target object is truncated, when it is determined that the first relative position relationship between the target region and the edge region satisfies the first preset condition, it is necessary to further determine the second relative position relationship between the target object and the edge region, where the second relative position relationship characterizes whether the target object is close to the edge of the target image. Then, based on the second relative position relationship, determine the image category of the target image. The image category includes, for example, a truncated category or a non-truncated category. The truncated category indicates that the target object in the target image is truncated and incomplete, and the non-truncated category indicates that the target object in the target image is not truncated. In one example, when the second relative position relationship characterizes that the target object is close to the edge of the target image, it can be determined that the target object in the target region is truncated, and thus the image category of the target image is characterized as the truncated category.

[0040] According to an embodiment of the present disclosure, first, it is determined whether the target area is close to the edge of the target image. If so, it is further determined whether the target object in the target area is close to the edge of the target image, so as to determine the image category of the target image, improving the recognition accuracy of the image category. If it is determined that the target area is not close to the edge of the target image, there is no need to continue to determine whether the target object in the target area is close to the edge of the target image, reducing the computational amount of image recognition and improving the image recognition efficiency.

[0041] Figures 3A to 3D FIG. schematically shows a schematic diagram of an image processing method according to an embodiment of the present disclosure.

[0042] As Figure 3A shown, the target image 300 includes, for example, a plurality of edge regions. The plurality of edge regions include, for example, left and right edge regions 311 and 312, and may also include upper and lower edge regions, which will not be elaborated here. For example, the edge region can be determined based on the relaxation variable k1, that is, the width of the edge region is k1, and k1 is, for example, 5, indicating a width of 5 pixels.

[0043] The target image 300 includes, for example, a target object. Taking the object type of the target object as the text type as an example. The target object in the target image 300 is recognized by OCR technology to obtain a plurality of text boxes, and the area within each text box is a target area, thereby obtaining target areas 321 and 322.

[0044] Then, the first relative position relationship between the target areas 321 and 322 and the edge regions 311 and 312 is determined. When the first relative position relationship satisfies the first preset condition, it indicates that the target areas 321 and 322 are outside the edge regions 311 and 312 (the target area and the edge area do not overlap). From this, it can be known that the target areas 321 and 322 are far from the edge of the target image 300, that is, the target object in the target areas 321 and 322 is not truncated. Thus, it can be determined that the image category of the target image 300 is the non-truncated category, that is, the image information of the target image 300 is complete.

[0045] In an example, when the first relative position relationship between the target area and the edge area satisfies the first preset condition, based on the second relative position relationship, a processing result indicating whether at least part of the target object is located within the edge area is obtained. Then, based on the processing result and the object type of the target object, the image category of the target image is determined.

[0046] If it is determined that the processing result indicates that the target object is outside the edge area and the object type is the text type, it is determined that the image category of the target image is the non-truncated category.

[0047] As Figure 3BAs shown, taking the target area 322 as an example, when the first relative position relationship between the target area 322 and the edge area 312 meets the first preset condition, it indicates that at least part of the target area 322 is within the edge area 312 (there is an overlap between the target area and the edge area). From this, it can be known that the target area 322 is close to the edge of the target image 300, and it is highly probable that the target object in the target area 322 is truncated.

[0048] Considering the situation where the recognition result of the text recognition technology has certain errors, resulting in an overly large area of the target area 322, in order to improve the accuracy of determining whether the target object is truncated, when it is determined that the first relative position relationship meets the first preset condition, the second relative position relationship between the target object "WiFi" in the target area 322 and the edge area 312 is further determined. The second relative position relationship, for example, characterizes whether the target object "WiFi" is close to the edge of the target image 300. When the second relative position relationship characterizes that at least part of the target object "WiFi" is within the edge area 312, it indicates that the target object "WiFi" is close to the edge of the target image 300. Figure 3B It is shown that the target object "WiFi" is outside the edge area 312. Therefore, it indicates that the distance between the target object "WiFi" and the edge of the target image 300 is far, which indicates that the target object is not truncated, and then it is determined that the image category of the target image 300 is a non-truncated category.

[0049] Exemplarily, when the first relative position relationship meets the first preset condition, it can be expressed as Satisfying:

[0050] (x text ≤x l +k1 or x r -k1≤x text )or(y text ≤y t +k1 or y b -k1≤y text )

[0051] Wherein, M represents the text box area (target area); x text and y text respectively represent the X-axis coordinate and Y-axis coordinate of the text box area; x l , x r , y t , y b respectively represent the X-axis coordinate of the left boundary, the X-axis coordinate of the right boundary, the Y-axis coordinate of the upper boundary, and the Y-axis coordinate of the lower boundary of the target image, and k1 represents a relaxation variable.

[0052] In another example, when the first relative position relationship between the target region and the edge region satisfies the first preset condition, based on the second relative position relationship, a processing result indicating whether at least part of the target object is located within the edge region is obtained. Then, based on the processing result and the object type of the target object, the image category of the target image is determined.

[0053] If it is determined that the processing result indicates that at least part of the target object is located within the edge region and the object type is a text type, the image category of the target image is determined to be the truncated category.

[0054] As Figure 3C shown, when the first relative position relationship between the target region 322 and the edge region 312 satisfies the first preset condition, it means that at least part of the target region 322 is located within the edge region 312 (there is an overlap between the target region and the edge region). Next, the second relative position relationship between the target object and the edge region 312 is determined. Figure 3C It is shown that the second relative position relationship indicates that at least part of the target object is located within the edge region 312. It can be seen that the target object is close to the edge of the target image 300. Thus, it is determined that the target object is truncated, indicating that the image category of the target image 300 is the truncated category.

[0055] As Figure 3C shown, the edge region 312 includes, for example, the boundary line P1. The partial boundary line located in the target region 322 is determined from the boundary line P1. The length of the partial boundary line is, for example, consistent with the height of the target region 322. As Figure 3D shown, based on the partial boundary line and the preset threshold k2, the boundary region P2 is determined. The preset threshold k2 is a relaxation variable. Next, based on the pixel variance of the boundary region P2, the second relative position relationship between the target object and the edge region 312 is determined. If the pixel variance is greater than the preset variance threshold, it is determined that the second relative position relationship indicates that at least part of the target object is located within the edge region 312. In one example, the preset variance threshold is, for example, 2000.

[0056] For example, the width of the boundary line P1 is one pixel. When the preset threshold k2 is 5, the width of the boundary region P2 is k2 = 5 pixels. If the pixel variance of the boundary region P2 is greater than the preset variance threshold, it indicates that the target object is segmented by the boundary line P1.

[0057] In the embodiments of the present disclosure, when the object type of the target object is a text type, multiple target regions are recognized from the target image. If the text within any one of the target regions is truncated, the image category of the target image is determined to be the text truncated category. When performing image recommendation, target images of this category need to be filtered.

[0058] According to an embodiment of the present disclosure, when the object type is a text category, first determine whether the target area overlaps with the edge area. If so, further determine whether at least part of the target object in the target area is located within the edge area. If so, it indicates that the image category of the target image is a truncated category, thereby improving the recognition accuracy and efficiency of the image category. In addition, when determining whether the target object is located within the edge area, a boundary area is obtained based on the boundary line of the target area, and the pixel variance of the boundary area is used for judgment. It can be seen that the method of increasing the boundary line width to obtain the boundary area improves the accuracy of variance calculation.

[0059] Figures 4A to 4B A schematic diagram schematically shows an image processing method according to another embodiment of the present disclosure.

[0060] As Figure 4A shown, the target image 400 includes a target object, taking the object type of the target object as a non-text type as an example. The target object includes, for example, a person, an object, etc.

[0061] Exemplarily, the target image 400 is recognized by a target detection algorithm to obtain a plurality of detection frames, and the area surrounded by the detection frames is the target area. For example, the target areas 421, 422, and 423 are recognized.

[0062] For each target area, determine whether the target object in each target area is truncated in the above-mentioned manner. For example, first determine whether the first relative position relationship between the target area and the edge area satisfies a first preset condition. When it is determined that the first relative position relationship satisfies the first preset condition, further determine the second relative position relationship between the target object and the edge area, and then based on the second relative position relationship, obtain a processing result indicating whether at least part of the target object is located within the edge area.

[0063] For each target area, when it is determined that the object type of the target object in the target area is a non-text type, determine the fuzzy data of the target area and the position data of the target area in the target image. Then, based on the processing result, the fuzzy data, and the position data, determine the image category of the target image.

[0064] For example, when the processing result, the fuzzy data, and the position data satisfy a second preset condition, determine that the image category of the target image is a non-truncated category. The second preset condition includes that the target object in the target area is not truncated, the fuzzy data indicates that the fuzziness of the target area is less than the fuzziness threshold, and the position data indicates that the target area is the central area of the target image.

[0065] The target object in the target area is not truncated, including that the first relative position relationship does not meet the first preset condition or the processing result indicates that the target object is outside the edge area. In other words, when the first relative position relationship does not meet the first preset condition, or the first relative position relationship meets the first preset condition but the processing result indicates that the target object is outside the edge area, it means that the target object in the target area is not truncated.

[0066] As Figure 4A shown, for the target area 422, when the target object in the target area 422 is not truncated, the blur degree of the target area 422 is less than the blur degree threshold (less blurred), and the target area 422 is the central area of the target image 400, it means that the main target object (person) in the target image 400 is not truncated. Thus, it is determined that the image category of the target image 400 is the non-truncated category, and this image does not need to be filtered when making image recommendations. The fact that the blur degree of the target area 422 is less than the blur degree threshold and it is in the central area indicates that the target object (person) in the target area 422 is the main object. When there is a main object in the target image, the image category of the target image can be determined based on the main object.

[0067] As Figure 4B shown, the target areas 424 and 425 are identified from the target image 400. Taking the target area 425 as an example, when the processing result, the blur data, and the position data do not meet the second preset condition, it can be not considered whether the target area 425 is in the central area of the target image 400. At this time, if it is determined that the first relative position relationship meets the first preset condition, the processing result indicates that at least part of the target object in the target area 425 is within the edge area (indicating that the target object in the target area 425 is truncated), and the blur data indicates that the blur degree of the target area 425 is greater than or equal to the blur degree threshold, then it is determined that the image category of the target image 400 is the truncated category (person truncated category), and this image needs to be filtered when making image recommendations.

[0068] It can be understood that except for the Figure 4A and Figure 4B situations shown, other situations can be considered that the image category of the target image is the non-truncated category.

[0069] Exemplarily, when the object type of the target object is a non-text type, that the target object in the target area is truncated can mean that the face of the target object is incomplete.

[0070] In one example, when determining the blurriness of a target region, the Laplacian transform can be applied to the target region and then the pixel variance of the target region can be calculated. If the pixel variance is less than a set blurriness threshold, the target region is considered a blurry region. In one example, the set blurriness threshold is, for example, 80. In some cases, due to the display, there is a black border at the image edge. When calculating the blurriness of the target region, the black border can be removed by the solid color border removal method to eliminate the influence of the black border on the blurriness calculation.

[0071] When determining whether the target region is located in the central region of the target image, when it is determined that the center of the target region on the horizontal axis is located in the interval img [x - r*w img , x img + r*w img , it indicates that the target region is located in the central region of the target image. Among them, x img represents the center point of the horizontal axis of the target image, w img represents the width of the target image, and r represents the central region ratio. In one example, r is, for example, 0.15.

[0072] According to an embodiment of the present disclosure, when the object type of the target object in the target image is a non-text type, after determining whether the target region is truncated, it is also necessary to determine the blurriness and position of the target region, and thus comprehensively determine the image category of the target image based on the truncation situation, blurriness, and position, improving the accuracy of image category determination.

[0073] When the object type of the target object in the target image includes a text type and a non-text type, regardless of whether the image category of the target image is a text truncation category or a person truncation category, when performing image recommendation, the target image can be filtered.

[0074] Figure 5 Schematically shows a block diagram of an image processing apparatus according to an embodiment of the present disclosure.

[0075] As Figure 5 shown, the image processing apparatus 500 according to an embodiment of the present disclosure includes, for example, an identification module 510, a first determination module 520, a second determination module 530, and a third determination module 540.

[0076] The identification module 510 can be used to identify the target image to obtain a target region, where the target region includes a target object. According to an embodiment of the present disclosure, the identification module 510 can, for example, execute the operation S210 described above Figure 2 and will not be elaborated here.

[0077] The first determination module 520 may be configured to determine a first relative position relationship between a target area and an edge area for an edge area of a target image. According to an embodiment of the present disclosure, the first determination module 520 may, for example, perform operation S220 described above with reference to Figure 2 and will not be elaborated herein.

[0078] The second determination module 530 may be configured to determine a second relative position relationship between a target object and an edge area in response to determining that the first relative position relationship satisfies a first preset condition. According to an embodiment of the present disclosure, the second determination module 530 may, for example, perform operation S230 described above with reference to Figure 2 and will not be elaborated herein.

[0079] The third determination module 540 may be configured to determine an image category of the target image based on the second relative position relationship, where the image category characterizes the integrity of the target object. According to an embodiment of the present disclosure, the third determination module 540 may, for example, perform operation S240 described above with reference to Figure 2 and will not be elaborated herein.

[0080] According to an embodiment of the present disclosure, the first preset condition includes: at least a part of the target area is located within the edge area.

[0081] According to an embodiment of the present disclosure, the third determination module 540 includes: an obtaining sub-module and a first determination sub-module. The obtaining sub-module is configured to obtain a processing result indicating whether at least a part of the target object is located within the edge area based on the second relative position relationship; the first determination sub-module is configured to determine the image category of the target image based on the processing result and the object type of the target object.

[0082] According to an embodiment of the present disclosure, the first determination sub-module includes: a first determination unit configured to determine that the image category of the target image is a truncated category in response to determining that the processing result indicates that at least a part of the target object is located within the edge area and the object type is a text type.

[0083] According to an embodiment of the present disclosure, the first determination sub-module includes: a second determination unit and a third determination unit. The second determination unit is configured to determine the fuzzy data of the target area and the position data of the target area in the target image in response to determining that the object type is a non-text type; the third determination unit is configured to determine the image category of the target image based on the processing result, the fuzzy data, and the position data.

[0084] According to an embodiment of the present disclosure, the third determination unit includes: a first determination subunit and a second determination subunit. The first determination subunit is configured to determine that the image category of the target image is a non-truncated category when the processing result, the fuzzy data, and the position data meet a second preset condition, where the second preset condition includes that the first relative position relationship does not meet the first preset condition or the processing result indicates that the target object is located outside the edge region, the fuzzy data indicates that the blurriness of the target region is less than a blurriness threshold, and the position data indicates that the target region is the central region of the target image; the second determination subunit is configured to, when the processing result, the fuzzy data, and the position data do not meet the second preset condition, in response to determining that the first relative position relationship meets the first preset condition, the processing result indicates that at least part of the target object is located within the edge region, and the fuzzy data indicates that the blurriness of the target region is greater than or equal to the blurriness threshold, determine that the image category of the target image is a truncated category.

[0085] According to an embodiment of the present disclosure, the edge region includes a boundary line; the second determination module 530 includes: a second determination sub-module, a third determination sub-module, and a fourth determination sub-module. The second determination sub-module is configured to determine a partial boundary line in the boundary line that is in the target region; the third determination sub-module is configured to determine a boundary region based on the partial boundary line and a preset threshold; the fourth determination sub-module is configured to determine a second relative position relationship between the target object and the edge region based on the pixel variance of the boundary region, where, when the pixel variance is greater than a preset variance threshold, it indicates that at least part of the target object is located within the edge region.

[0086] In the technical solution of the present disclosure, the processing of collection, storage, use, processing, transmission, provision, disclosure, and application of the user's personal information involved all comply with the provisions of relevant laws and regulations, take necessary confidentiality measures, and do not violate public order and good customs.

[0087] In the technical solution of the present disclosure, before obtaining or collecting the user's personal information, the authorization or consent of the user is obtained.

[0088] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0089] Figure 6 It is a block diagram of an electronic device for implementing the image processing of the embodiments of the present disclosure.

[0090] Figure 6FIG. shows a schematic block diagram of an exemplary electronic device 600 that may be used to implement embodiments of the present disclosure. The electronic device 600 is intended to represent various forms of digital computers, such as, for example, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as, personal digital processors, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely exemplary and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0091] As Figure 6 shown, the device 600 includes a computing unit 601 that can perform various appropriate actions and processes in accordance with a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0092] A plurality of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a magnetic disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0093] The computing unit 601 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 executes the various methods and processes described above, such as the image processing method. For example, in some embodiments, the image processing method can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as the storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the image processing method described above can be executed. Alternatively, in other embodiments, the computing unit 601 can be configured to execute the image processing method by any other suitable means (e.g., by means of firmware).

[0094] Various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuitry, integrated circuit systems, field-programmable gate arrays (FPGA), application-specific integrated circuits (ASIC), application-specific standard products (ASSP), systems-on-a-chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor, receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting the data and instructions to the storage system, the at least one input device, and the at least one output device.

[0095] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to the processor or controller of a general-purpose computer, a special-purpose computer, or other programmable image processing device, such that when the program codes are executed by the processor or controller, the functions / operations specified in the flowchart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as an independent software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0096] In the context of this disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. 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, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0097] To provide for interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can also be used to provide for interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic, speech, or tactile input).

[0098] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of a communication network include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0099] A computer system can include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, a server of a distributed system, or a server incorporating a blockchain.

[0100] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and no limitations are imposed herein.

[0101] The above specific embodiments do not constitute a limitation on the protection scope of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub - combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the protection scope of this disclosure.

Claims

1. An image processing method, comprising: Identifying a target image to obtain a target area, where the target area includes a target object; For the edge area of the target image, determining a first relative position relationship between the target area and the edge area; In response to determining that the first relative position relationship meets a first preset condition, determining a second relative position relationship between the target object and the edge area; and Based on the second relative position relationship, determining an image category of the target image, where the image category characterizes the integrity of the target object; Wherein, the edge area includes a boundary line; the determining the second relative position relationship between the target object and the edge area includes: Determining a partial boundary line in the boundary line that is within the target area; Based on the partial boundary line and a preset threshold, determining a boundary line area; In response to the pixel variance of the boundary line area being greater than a preset variance threshold, determining that the target object is segmented by the boundary line area; In response to determining that the target object is segmented by the boundary line area, determining that the second position relationship is that at least a part of the target object is located within the edge area.

2. The method according to claim 1, wherein, The first preset condition includes: at least a part of the target area is located within the edge area.

3. The method according to claim 1, wherein, The determining the image category of the target image based on the second relative position relationship includes: Based on the second relative position relationship, obtaining a processing result indicating whether at least a part of the target object is located within the edge area; and Based on the processing result and the object type of the target object, determining the image category of the target image.

4. The method according to claim 3, wherein, The determining the image category of the target image based on the processing result and the object type of the target object includes: In response to determining that the processing result indicates that at least a part of the target object is located within the edge area and the object type is a text type, determining that the image category of the target image is a truncated category.

5. The method according to claim 3, wherein The determining the image category of the target image based on the processing result and the object type of the target object includes: In response to determining that the object type is a non-text type, determining the blur data of the target area and the position data of the target area in the target image; and Based on the processing result, the blur data, and the position data, determining the image category of the target image.

6. The method according to claim 5, wherein The determining the image category of the target image based on the processing result, the blur data, and the position data includes: When the processing result, the blur data, and the position data meet a second preset condition, determining that the image category of the target image is a non-truncated category, where the second preset condition includes that the first relative position relationship does not meet the first preset condition or the processing result indicates that the target object is located outside the edge area, the blur data indicates that the blur degree of the target area is less than a blur degree threshold, and the position data indicates that the target area is the central area of the target image; and In the case where the processing result, the fuzzy data, and the position data do not meet the second preset condition, in response to determining that the first relative position relationship meets the first preset condition, the processing result indicates that at least a part of the target object is located within the edge region, and the fuzzy data indicates that the fuzziness of the target region is greater than or equal to the fuzziness threshold, determine that the image category of the target image is the truncation category.

7. An image processing apparatus, comprising: an identification module configured to identify a target image to obtain a target region, where the target region includes a target object; a first determination module configured to determine a first relative position relationship between the target region and an edge region for the edge region of the target image; a second determination module configured to determine a second relative position relationship between the target object and the edge region in response to determining that the first relative position relationship meets a first preset condition; and a third determination module configured to determine the image category of the target image based on the second relative position relationship, where the image category represents the integrity of the target object; where the edge region includes a boundary line; the second determination module includes: a second determination sub-module configured to determine a partial boundary line within the target region from the boundary line; a third determination sub-module configured to determine a boundary line region based on the partial boundary line and a preset threshold; a fourth determination sub-module configured to determine that the target object is segmented by the boundary line region in response to the pixel variance of the boundary line region being greater than a preset variance threshold; and determine that the second position relationship is that at least a part of the target object is located within the edge region in response to determining that the target object is segmented by the boundary line region.

8. The apparatus according to claim 7, wherein, The first preset condition includes: at least a part of the target region is located within the edge region.

9. The apparatus according to claim 7, wherein The third determination module includes: an acquisition sub-module configured to obtain a processing result indicating whether at least a part of the target object is located within the edge region based on the second relative position relationship; and a first determination sub-module configured to determine the image category of the target image based on the processing result and the object type of the target object.

10. The apparatus according to claim 9, wherein The first determination sub-module includes: a first determination unit configured to determine that the image category of the target image is the truncation category in response to determining that the processing result indicates that at least a part of the target object is located within the edge region and the object type is a text type.

11. The device according to claim 9, wherein, The first determination sub-module includes: a second determination unit configured to determine the fuzzy data of the target region and the position data of the target region within the target image in response to determining that the object type is a non-text type; and a third determination unit configured to determine the image category of the target image based on the processing result, the fuzzy data, and the position data.

12. The device according to claim 11, wherein, The third determination unit includes: A first determination subunit, configured to determine that the image category of the target image is a non-truncated category when the processing result, the blurred data, and the position data satisfy a second preset condition, where the second preset condition includes that the first relative position relationship does not satisfy the first preset condition or the processing result indicates that the target object is located outside the edge region, the blurred data indicates that the blur degree of the target region is less than a blur degree threshold, and the position data indicates that the target region is the central region of the target image; and A second determination subunit, configured to determine that the image category of the target image is a truncated category when the processing result, the blurred data, and the position data do not satisfy the second preset condition, in response to determining that the first relative position relationship satisfies the first preset condition, the processing result indicates that at least a part of the target object is located within the edge region, and the blurred data indicates that the blur degree of the target region is greater than or equal to the blur degree threshold.

13. An electronic device, comprising: At least one processor; And A memory communicatively connected to the at least one processor; wherein The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1-6.

14. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to execute the method according to any one of claims 1-6.

15. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, the steps of the method according to any one of claims 1-6 are implemented.

Citation Information

Patent Citations

  • Target detection method and circuit, visual impairment auxiliary equipment, electronic equipment and medium

    CN111163261A

  • Image processing method and device, electronic equipment and storage medium

    CN111860475A