Image processing method, model training method, device, equipment and medium

By updating the pixel values ​​of the symmetric point of the target point in the original sub-image and reconstructing the object to be detected, the problem of degradation in model training effect caused by incomplete original sub-image is solved, and the prediction accuracy and recognition ability of the model are improved.

CN114842297BActive Publication Date: 2025-08-29BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210501847.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-09
Publication Date
2025-08-29
Estimated Expiration
2042-05-09

AI Technical Summary

Technical Problem

In the prior art, due to the random interception of the original sub-image, the model training sample image is incomplete, which affects the model recognition and positioning ability, resulting in a decrease in training effect.

Method used

By updating the pixel values ​​of the symmetric point of the target point located outside the boundary in the original sub-image, the object to be detected is reconstructed so that the sample image contains more information about the original object, avoiding model overfitting.

Benefits of technology

It improves the content integrity of the sample image, improves the prediction accuracy of the model, avoids model overfitting, and enhances the recognition and positioning capabilities of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114842297B_ABST
    Figure CN114842297B_ABST
Patent Text Reader

Abstract

The present disclosure provides an image processing method, model training method, apparatus, device, and medium, relating to the fields of artificial intelligence technology, specifically deep learning, image processing, and computer vision technology, and can be applied to scenarios such as object detection. The implementation scheme comprises: intercepting an original sub-image from an original image; in response to some pixels in the original object being outside the original sub-image, determining multiple target points in the original image that are outside the original sub-image, wherein the multiple target points include at least a first pixel in the original object; in response to the presence of a symmetrical point of the target point in the original sub-image, updating the pixel value of the symmetrical point according to the pixel value of the target point; and determining the updated original sub-image as a sample image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the fields of artificial intelligence technology, specifically deep learning, image processing, and computer vision technology, and can be applied to scenarios such as object detection. It specifically relates to an image processing method, a model training method, an apparatus, an electronic device, a computer-readable storage medium, and a computer program product. Background Art

[0002] Artificial intelligence (AI) is the study of how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). It encompasses both hardware and software technologies. AI hardware technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, and big data processing. AI software technologies primarily encompass computer vision, speech recognition, natural language processing, machine learning / deep learning, big data processing, and knowledge graphs.

[0003] The approaches described in this section are not necessarily approaches that have been previously conceived or employed. Unless otherwise indicated, it should not be assumed that any approach described in this section is prior art simply by virtue of its inclusion in this section. Similarly, unless otherwise indicated, the issues raised in this section should not be considered as having been recognized in any prior art. Summary of the Invention

[0004] The present disclosure provides an image processing method, a model training method, an apparatus, an electronic device, a computer-readable storage medium, and a computer program product.

[0005] According to one aspect of the present disclosure, an image processing method is provided, comprising: intercepting an original sub-image from an original image, wherein the original image contains an original object; in response to some pixel points in the original object being outside the original sub-image, determining a plurality of target points in the original image that are outside the original sub-image, wherein the plurality of target points include at least a first pixel point located in the original object; in response to the presence of a symmetrical point of the target point in the original sub-image, updating the pixel value of the symmetrical point according to the pixel value of the target point, wherein the target point and the symmetrical point are symmetrically distributed on both sides of one side of the original sub-image; and determining the updated original sub-image as a sample image, wherein the sample image contains an object to be detected, and the object to be detected includes a second pixel point of the original object located in the original sub-image and a symmetrical point of the first pixel point in the original sub-image.

[0006] According to one aspect of the present disclosure, a model training method is provided, comprising: performing training on a model using sample images, wherein the sample images are processed according to the above method.

[0007] According to one aspect of the present disclosure, an image processing device is provided, comprising: a capture unit configured to capture an original sub-image from an original image, wherein the original image contains an original object; a first determination unit configured to determine, in response to some pixel points in the original object being outside the original sub-image, a plurality of target points in the original image located outside the original sub-image, wherein the plurality of target points include at least a first pixel point located in the original object; an update unit configured to update, in response to the presence of a symmetrical point of the target point in the original sub-image, a pixel value of the symmetrical point according to the pixel value of the target point, wherein the target point and the symmetrical point are symmetrically distributed on both sides of one side of the original sub-image; and a second determination unit configured to determine the updated original sub-image as a sample image, wherein the sample image contains an object to be detected, and the object to be detected includes a second pixel point of the original object located in the original sub-image and a symmetrical point of the first pixel point in the original sub-image.

[0008] According to one aspect of the present disclosure, a model training device is provided, comprising: a unit for training a model using sample images, wherein the sample images are processed according to the above method.

[0009] According to one aspect of the present disclosure, an electronic device is provided, 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 perform the above-mentioned method.

[0010] According to one aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the above method.

[0011] According to one aspect of the present disclosure, a computer program product is provided, including a computer program, wherein the computer program implements the above method when executed by a processor.

[0012] According to one or more embodiments of the present disclosure, the obtained sample image can have higher content integrity.

[0013] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The accompanying drawings illustrate exemplary embodiments and constitute a part of the specification. Together with the description of the specification, they serve to explain exemplary implementation of the embodiments. The illustrated embodiments are for illustrative purposes only and do not limit the scope of the claims. Throughout the drawings, the same reference numerals designate similar, but not necessarily identical, elements.

[0015] Figure 1 A schematic diagram illustrating an exemplary system in which the various methods described herein may be implemented according to an embodiment of the present disclosure;

[0016] Figure 2 A flowchart of an image processing method according to an embodiment of the present disclosure is shown;

[0017] Figure 3 A schematic diagram showing a target point and a symmetric point according to an embodiment of the present disclosure is shown;

[0018] Figure 4 A schematic diagram of a method for determining a second bounding box according to an embodiment of the present disclosure is shown.

[0019] Figure 5A and Figure 5B A schematic diagram showing a relationship between an object to be detected and a second bounding box according to an embodiment of the present disclosure;

[0020] Figure 6A and Figure 6B A schematic diagram illustrating another method for determining a second bounding box according to an embodiment of the present disclosure is shown;

[0021] Figure 7 A structural block diagram of an image processing device according to an embodiment of the present disclosure is shown; and

[0022] Figure 8 A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0023] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be appreciated by those skilled in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0024] In this disclosure, unless otherwise specified, the use of terms such as "first" and "second" to describe various elements is not intended to limit the positional relationship, temporal relationship, or importance relationship of these elements. Such terms are only used to distinguish one element from another. In some examples, the first element and the second element may refer to the same instance of the element, while in some cases, based on the context of the description, they may also refer to different instances.

[0025] The terms used in the descriptions of various examples in this disclosure are for the purpose of describing specific examples only and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element may be one or more. In addition, the term "and / or" used in this disclosure encompasses any one and all possible combinations of the listed items.

[0026] During model training, by providing the model with sample images containing the objects to be detected, the model's ability to identify and locate the objects can be trained. Due to limitations in the number and type of original images used as sample images, it is sometimes necessary to extract sub-images from the original images to expand the sample images used for model training.

[0027] However, due to the randomness of the cropping process, the original sub-image sometimes only contains part of the original object in the original image. This incomplete original object is not conducive to learning the model's recognition and positioning capabilities, resulting in a decrease in the model's training effect.

[0028] To address this issue, the applicant discovered that, compared to the adverse effects of "incomplete" original objects on model training, "incorrect" pixel placement in the original objects has minimal impact on model training. For example, in practice, it has been found that incorrectly arranging facial features in sample images during training does not significantly affect the model's ability to recognize faces.

[0029] Based on this, the present disclosure proposes an image processing method. In response to some pixels in the original object being located outside the original sub-image, the pixel values ​​of multiple symmetrical points located within the original sub-image are updated using the pixel values ​​of multiple target points located outside the original sub-image. Since the multiple target points include a first pixel located in the original object, the update of the multiple symmetrical points by the multiple target points can reconstruct the object to be detected in the original sub-image. The reconstructed object to be detected not only includes the second pixel of the original object located in the original sub-image, but also reflects the pixel value of the first pixel of the original object located outside the original sub-image.

[0030] The reconstructed object under detection within the original sub-image has different elements in terms of their top-to-bottom, left-to-right, and right-to-left arrangement than the original object. However, the reconstructed object includes pixel information for the first pixel of the original object outside the original sub-image, resulting in greater content integrity. Using such original sub-images as sample images for model training can prevent overfitting and improve prediction accuracy.

[0031] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.

[0032] Figure 1 FIG2 is a schematic diagram of an exemplary system 100 in which the various methods and apparatuses described herein may be implemented according to an embodiment of the present disclosure. Figure 1 , the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105, and 106 can be configured to execute one or more applications.

[0033] In an embodiment of the present disclosure, the server 120 may run one or more services or software applications that enable execution of the image processing method or the model training method.

[0034] In some embodiments, server 120 may also provide other services or software applications that may include non-virtualized environments and virtualized environments. In some embodiments, these services may be provided as web-based services or cloud services, such as provided to users of client devices 101, 102, 103, 104, 105, and / or 106 under a software as a service (SaaS) model.

[0035] exist Figure 1 In the configuration shown, the server 120 may include one or more components that implement the functions performed by the server 120. These components may include software components, hardware components, or a combination thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 may, in turn, utilize one or more client applications to interact with the server 120 to utilize the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from the system 100. Therefore, Figure 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.

[0036] The user can use client devices 101, 102, 103, 104, 105 and / or 106 to send original images or receive sample images. The client device can provide an interface that enables the user of the client device to interact with the client device. The client device can also output information to the user via the interface. Although Figure 1 Only six client devices are depicted, but one skilled in the art will appreciate that the present disclosure can support any number of client devices.

[0037] Client devices 101, 102, 103, 104, 105, and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptops), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, gaming systems, thin clients, various messaging devices, sensors or other sensing devices, etc. These computer devices may run various types and versions of software applications and operating systems, such as Microsoft Windows, Apple iOS, UNIX-like operating systems, Linux, or Linux-like operating systems; or include various mobile operating systems, such as Microsoft Windows Mobile OS, iOS, Windows Phone, and Android. Portable handheld devices may include cellular phones, smartphones, tablet computers, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Gaming systems may include various handheld gaming devices, internet-enabled gaming devices, etc. Client devices are capable of executing a variety of different applications, such as various internet-related applications, communication applications (such as email applications), and short message service (SMS) applications, and may use various communication protocols.

[0038] The network 110 may be any type of network known to those skilled in the art that can support data communications using any of a variety of available protocols, including but not limited to TCP / IP, SNA, IPX, etc. By way of example only, the one or more networks 110 may be a local area network (LAN), an Ethernet-based network, a token ring, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.

[0039] Server 120 may include one or more general-purpose computers, specialized server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running virtual operating systems, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that may be virtualized to maintain a server's virtual storage device). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.

[0040] The computing units in the server 120 may run one or more operating systems including any of the operating systems described above as well as any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and / or middle-tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, and the like.

[0041] In some implementations, server 120 may include one or more applications to analyze and consolidate data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and / or 106. Server 120 may also include one or more applications to display the data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and / or 106.

[0042] In some embodiments, server 120 may be a distributed system server or a server integrated with blockchain. Server 120 may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host equipped with artificial intelligence technology. A cloud server is a host product within the cloud computing service system that addresses the management difficulties and poor scalability of traditional physical hosts and virtual private servers (VPS) services.

[0043] The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. The databases 130 may reside in a variety of locations. For example, the database used by the server 120 may be local to the server 120, or may be remote from the server 120 and communicate with the server 120 via a network-based or dedicated connection. The databases 130 may be of different types. In some embodiments, the databases used by the server 120 may be, for example, relational databases. One or more of these databases may store, update, and retrieve data to and from the databases in response to commands.

[0044] In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the applications may be different types of databases, such as a key-value store, an object store, or a conventional store backed by a file system.

[0045] Figure 1 The system 100 may be configured and operated in various ways to enable application of the various methods and apparatuses described in accordance with the present disclosure.

[0046] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0047] Figure 2 A flowchart of an image processing method according to an exemplary embodiment of the present disclosure is shown, the method 200 comprising: step S201, intercepting an original sub-image from an original image, wherein the original image contains an original object; step S202, in response to some pixel points in the original object being outside the original sub-image, determining a plurality of target points in the original image that are outside the original sub-image, wherein the plurality of target points include at least a first pixel point located in the original object; step S203, in response to the presence of a symmetrical point of the target point in the original sub-image, updating the pixel value of the symmetrical point according to the pixel value of the target point, wherein the target point and the symmetrical point are symmetrically distributed on both sides of one side of the original sub-image; and step S204, determining the updated original sub-image as a sample image, wherein the sample image contains an object to be detected, and the object to be detected includes a second pixel point of the original object located in the original sub-image and a symmetrical point of the first pixel point in the original sub-image.

[0048] Since the multiple target points include the first pixel located in the original object, the object to be detected can be reconstructed in the original sub-image by updating the multiple symmetric points using the multiple target points. The reconstructed object to be detected not only includes the second pixel of the original object located in the original sub-image, but also reflects the pixel value of the first pixel of the original object located outside the original sub-image. In this way, the object to be detected in the original sub-image can have higher content integrity. Using the original sub-image as a sample image for model training can improve the prediction accuracy of the trained model while avoiding model overfitting.

[0049] In step S201, the original sub-image can be obtained by performing random cutout or random cropping on the original image. It can be understood that the size of the original sub-image in the present disclosure can encompass the entire original object.

[0050] Then, in step S202, in response to some pixels in the original object being outside the original sub-image, a plurality of target points in the original image that are outside the original sub-image are determined. The plurality of target points may include only the first pixel in the original object that is outside the original sub-image, or may include both the first pixel and other pixels outside the original object.

[0051] According to some embodiments, determining the plurality of target points in the original image that are outside the original sub-image may include: determining a plurality of candidate points located on any side outside the original sub-image; and in response to the plurality of candidate points including a first pixel located in the original object, determining the plurality of candidate points as the plurality of target points. The any side outside the original sub-image may be the top, bottom, left, or right side of the original sub-image.

[0052] To avoid the processor resources consumed by identifying the first pixel, the above embodiment uses multiple candidate points located on either side of the original sub-image as multiple target points. In other words, if the first pixel is included in the multiple candidate points, each of these candidate points is processed as a target point, without distinguishing which of these target points are the first pixel and which are not. This ensures that the pixel value of the first pixel can be updated to the original sub-image, while saving processor resources consumed by identifying the first pixel and simplifying the processing process.

[0053] In step S203 , when a symmetrical point of the target point exists in the original sub-image, the pixel value of the symmetrical point is updated according to the pixel value of the target point.

[0054] In one embodiment, for each of the multiple target points, if a symmetrical point of the target point exists in the original sub-image, the pixel value of the symmetrical point may be updated according to the pixel value of the target point.

[0055] Figure 3 Schematic diagram of target point and symmetric point according to an exemplary embodiment of the present disclosure is shown. Figure 3 As shown, an original sub-image 320 is captured from the original image 310 .

[0056] For target point A1, there is a symmetrical point A2 of target point A1 in the original sub-image 320. Target point A1 and symmetrical point A2 are symmetrically distributed on both sides of side a of the original sub-image 320. The pixel value of symmetrical point A2 can be updated according to the pixel value of target point A1.

[0057] For target point B1, there is a symmetrical point B2 of target point B1 in the original sub-image 320. Target point B1 and symmetrical point B2 are symmetrically distributed on both sides of edge b of the original sub-image 320. The pixel value of symmetrical point B2 can be updated according to the pixel value of target point B1.

[0058] It can be understood that based on the aforementioned updating of the original sub-image with multiple target points, the object to be detected can be reconstructed in the original sub-image. Although the various parts of the object to be detected differ from the original object in planar arrangement, the pixels in the object to be detected, i.e., the symmetrical points between the second pixel and the first pixel, still maintain continuity on the plane, allowing it to be used as a whole as the object to be detected by the model during training.

[0059] According to some embodiments, updating the pixel value of the symmetrical point according to the pixel value of the target point may include: updating the pixel value of the symmetrical point based on a weighted sum of the pixel value of the target point and the pixel value of the symmetrical point.

[0060] In this way, the updated symmetrical point not only retains its own pixel features, but also reflects the pixel features of the target point. Based on this, the pixel value of the first pixel among the multiple target points can be reflected in the original sub-image, allowing the original sub-image to contain more information about the original object.

[0061] In step S204, the object to be detected can be the union of the second pixel point and the symmetrical point of the first pixel point in the original object in the original sub-image. Based on this, the content of the object to be detected in the original sub-image is expanded from the initial second pixel point to the symmetrical point between the second pixel point and the first pixel point, thereby improving the content integrity of the object to be detected in the sample image.

[0062] When training an object detection model, it's also necessary to determine the bounding box corresponding to each sample image. This bounding box represents the pixel range occupied by the object to be detected in the sample image. It's typically the smallest circumscribed rectangle surrounding the object to be detected. By using the pixel values ​​of the target point to update the pixel values ​​of the symmetric point, the updated sample image can easily obtain an accurate bounding box.

[0063] According to some embodiments, the original image has a corresponding first bounding box, which is a minimum rectangular box circumscribed to the original object. The method may further include: determining a second bounding box corresponding to the sample image based on the boundary of the first bounding box and the boundary of the original sub-image.

[0064] Thus, the second bounding box corresponding to the sample image can be determined efficiently and accurately based on the boundary of the first bounding box and the boundary of the original sub-image, thereby avoiding the consumption of processor resources for identifying and locating the object to be detected in the sample image.

[0065] Figure 4 A method for determining a second bounding box according to an exemplary embodiment of the present disclosure is shown.

[0066] like Figure 4 As shown, an original sub-image 420 is captured from an original image 410 , wherein the original object is a baseball bat 412 in the original image 410 , and the original image 410 has a corresponding first bounding box 411 .

[0067] exist Figure 4 In the illustrated exemplary embodiment, a boundary 421 of an overlapping area between the area enclosed by the first bounding box 411 and the original sub-image 420 may be used as a second bounding box corresponding to the original sub-image (ie, the sample image) 420 .

[0068] based on Figure 4 Based on the second bounding box determined, Figure 5A and Figure 5B The relationship between the object to be detected and the second bounding box is further shown.

[0069] like Figure 5A As shown, using Figure 4 In the manner shown, a second bounding box 511 of the original sub-image 510 is determined. Before performing the update of multiple target points to multiple symmetric points, the object to be detected 512 in the original sub-image 510 only includes the second pixel point of the original object in the original sub-image 510.

[0070] from Figure 5AAs can be seen from the image, second bounding box 511 is not the minimum bounding rectangle of the object to be detected 512. In other words, in this case, the second bounding box 511 corresponding to the original sub-image 510 is inaccurate. Using such an original sub-image 510 and second bounding box 511 for model training will result in inaccurate annotations of the bounding box of the object to be detected by the trained model.

[0071] On the contrary, if Figure 5B As shown, the same use Figure 4 In the manner shown, a second bounding box 521 of the original sub-image 520 is determined. The original sub-image 520 is updated using multiple target points located on the right side of the original sub-image 520 and multiple target points located above the original sub-image 520 in the original image, so that the object to be detected 522 in the original sub-image 520 includes the second pixel point of the original object in the original sub-image 520 and the symmetrical point of the first pixel point in the original sub-image 520.

[0072] from Figure 5B As can be seen from FIG, the object to be detected 522 is a baseball bat bent into three sections, and the second bounding box 521 is the minimum circumscribed rectangular box of the object to be detected 522. In other words, in this case, the second bounding box 521 corresponding to the original sub-image 520 is accurate.

[0073] It should be noted that although the object to be detected 522 and the original object differ in the plane arrangement of pixels, performing model training with such an object to be detected 522 and a second bounding box 521 does not affect the training effect of the model.

[0074] For example, the original sub-image 520 is used as a sample image to perform model training. During the training process, based on the boundary information of the object to be detected 522 provided by the second bounding box 521, the model can learn the edge feature information of the object to be detected 522. Figure 4 The edge feature information of the baseball bat 412 in the image has a high degree of overlap, so that the model trained on the original sub-image 520 can also identify the edge of the original object in practical applications and then accurately mark the bounding box of the original object.

[0075] It is understandable that the above Figure 4 , Figure 5A and Figure 5B The method for determining the second bounding box shown in is only an example, and the method for determining the second bounding box will be described in detail below.

[0076] According to some embodiments, determining the second bounding box corresponding to the sample image based on the boundary of the first bounding box and the boundary of the original sub-image may include: for two parallel edges in any direction in the first bounding box, in response to the two parallel edges intersecting with the original sub-image, determining the edges of the second bounding box in that direction using the two parallel edges.

[0077] When two parallel edges in any direction of the first bounding box intersect with the original sub-image, it means that these two parallel edges simultaneously define the pixel range of the original object on the original image and the pixel range of the object to be detected on the sample image. These two parallel edges can be directly used to determine the edge of the second bounding box in that direction.

[0078] Figure 6A A method for determining a second bounding box according to an exemplary embodiment of the present disclosure is shown. Figure 6A As shown, an original sub-image 611 is captured from an original image 610 , and the original image 610 has a corresponding first bounding box 612 .

[0079] like Figure 6A As shown, in the first bounding box 612 , two parallel lines p1 and m1 in the horizontal direction both intersect with the original sub-image 611 , so the horizontal edges of the second bounding box can be determined by the parallel lines p1 and m1 .

[0080] According to some embodiments, in response to a first side of the two parallel sides intersecting with the original sub-image and a second side of the two parallel sides not intersecting with the original sub-image, a third side of the original sub-image located between the two parallel sides is determined as one of the sides of the second bounding box in the direction; with the third side as the axis of symmetry, a symmetrical side of the second side is determined; and one of the symmetrical sides of the first side and the second side that is farther away from the third side is determined as the other side of the second bounding box in the direction.

[0081] Therefore, regardless of the proportion of the first pixel points of the original object outside the original sub-image in the entire original object, all symmetrical points of the first pixel points can be included in the second bounding box.

[0082] Still Figure 6AFor example, of two parallel lines n1 and q1 in the vertical direction of first bounding box 612, first side n1 intersects original sub-image 611, while second side q1 does not. In this case, third side l1 of original sub-image 611, located between n1 and q1, is determined as one of the sides of the second bounding box in that direction. Using third side l1 as the axis of symmetry, symmetric side q1' of second side q1 is determined. Of the two, q1', which is farther away from third side l1, is determined as the other side of the second bounding box in that direction. Thus, the second bounding box can be determined to be the rectangular frame enclosed by p1, l1, m1, and q1'.

[0083] Figure 6B Another method for determining a second bounding box according to an exemplary embodiment of the present disclosure is shown. Figure 6B As shown, an original sub-image 621 is captured from an original image 620, and the original image 620 has a corresponding first bounding box 622. In the first bounding box 622, two horizontal parallel lines p2 and m2 intersect with the original sub-image 621, so the horizontal edges of the second bounding box can be determined by the parallel lines p2 and m2.

[0084] Of the two parallel lines n2 and q2 in the vertical direction of first bounding box 622, first side n2 intersects original sub-image 621, while second side q2 does not. In this case, third side l2 of original sub-image 621, located between n2 and q2, is determined as one of the sides of the second bounding box in that direction. Using third side l2 as the axis of symmetry, symmetric side q2' of second side q2 is determined. Of the first side n2 and symmetric side q2', n2, which is farther away from third side l2, is determined as the other side of the second bounding box in that direction. Thus, the second bounding box can be determined to be a rectangular frame enclosed by p2, l2, m2, and n2.

[0085] According to an embodiment of the present disclosure, a model training method is also provided, comprising: performing training on a model using sample images, wherein the sample images are processed according to any one of the above methods.

[0086] Figure 7 FIG. 1 shows a structural block diagram of an image processing apparatus according to an exemplary embodiment of the present disclosure. Figure 7As shown, the device 700 includes: a capture unit 701, configured to capture an original sub-image from an original image, wherein the original image contains an original object; a first determination unit 702, configured to determine a plurality of target points in the original image that are located outside the original sub-image in response to some pixel points in the original object being located outside the original sub-image, wherein the plurality of target points include at least a first pixel point located in the original object; an updating unit 703, configured to update a pixel value of a symmetrical point of the target point according to a pixel value of the target point in response to the presence of a symmetrical point of the target point in the original sub-image, wherein the target point and the symmetrical point are symmetrically distributed on both sides of one side of the original sub-image; and a second determination unit 704, configured to determine the updated original sub-image as a sample image, wherein the sample image contains an object to be detected, and the object to be detected includes a second pixel point of the original object located in the original sub-image and a symmetrical point of the first pixel point in the original sub-image.

[0087] In one embodiment, the updating unit 703 may be configured to update the pixel value of each of the multiple target points according to the pixel value of the target point in response to the existence of a symmetrical point of the target point in the original sub-image.

[0088] According to some embodiments, the first determination unit includes: a first determination subunit, configured to determine a plurality of alternative points located on any side outside the original sub-image; and a second determination subunit, configured to determine the plurality of alternative points as a plurality of target points in response to the plurality of alternative points including a first pixel point located in the original object.

[0089] According to some embodiments, the original image has a corresponding first bounding box, which is a minimum rectangular box circumscribed to the original object. The device also includes: a third determination unit, configured to determine a second bounding box corresponding to the sample image based on the boundary of the first bounding box and the boundary of the original sub-image.

[0090] According to some embodiments, the third determination unit includes: a third determination subunit, configured to determine, for two parallel edges in any direction in the first bounding box, in response to the two parallel edges intersecting with the original sub-image, the edges of the second bounding box in the direction using the two parallel edges.

[0091] According to some embodiments, the device further includes: a fourth determining subunit configured to determine, in response to the first of the two parallel edges intersecting with the original sub-image and the second of the two parallel edges not intersecting with the original sub-image, a third edge in the original sub-image located between the two parallel edges as one of the edges of the second bounding box in the direction; a fifth determining subunit configured to determine a symmetrical edge of the second edge with the third edge as an axis of symmetry; and a sixth determining subunit configured to determine one of the symmetrical edges of the first edge and the second edge, which is farther away from the third edge, as the other edge of the second bounding box in the direction.

[0092] According to some embodiments, the updating unit includes: an updating subunit configured to update the pixel value of the symmetrical point based on a weighted sum of the pixel value of the target point and the pixel value of the symmetrical point.

[0093] According to an embodiment of the present disclosure, a model training device is also provided, comprising: a unit for training a model using sample images, wherein the sample images are processed according to any one of the above-mentioned image processing methods.

[0094] According to an embodiment of the present disclosure, an electronic device is also provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed 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 any one of the above methods.

[0095] According to an embodiment of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is further provided, wherein the computer instructions are used to enable a computer to execute any one of the above methods.

[0096] According to an embodiment of the present disclosure, a computer program product is further provided, including a computer program, wherein the computer program implements any one of the above methods when executed by a processor.

[0097] refer to Figure 8 , a block diagram of an electronic device 800 that can serve as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0098] like Figure 8 As shown, the electronic device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0099] Multiple components within electronic device 800 are connected to I / O interface 805, including an input unit 806, an output unit 807, a storage unit 808, and a communication unit 809. Input unit 806 can be any type of device capable of inputting information into electronic device 800. Input unit 806 can receive input numeric or character information and generate key signal input related to user settings and / or function control of the electronic device. It may include, but is not limited to, a mouse, keyboard, touch screen, trackpad, trackball, joystick, microphone, and / or remote control. Output unit 807 can be any type of device capable of presenting information, and may include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. Storage unit 808 may include, but is not limited to, a magnetic disk or an optical disk. Communication unit 809 allows electronic device 800 to exchange information / data with other devices via computer networks such as the Internet and / or various telecommunication networks. It may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver and / or chipset, such as a Bluetooth™ device, an 802.11 device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.

[0100] The computing unit 801 can be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 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 that run machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as image processing methods or model training methods. For example, in some embodiments, the image processing method or model training method can be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the image processing method or model training method described above can be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to execute the image processing method or the model training method in any other appropriate manner (e.g., by means of firmware).

[0101] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0102] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0103] 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.

[0104] To provide 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 pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the 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 input, voice input, or tactile input).

[0105] 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 a user can interact with implementations 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 communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0106] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.

[0107] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not limited herein.

[0108] Although the embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-mentioned methods, systems and devices are merely exemplary embodiments or examples, and the scope of the present invention is not limited by these embodiments or examples, but is only limited by the claims after authorization and their equivalents. Various elements in the embodiments or examples may be omitted or replaced by their equivalents. In addition, the steps may be performed in an order different from that described in this disclosure. Further, the various elements in the embodiments or examples may be combined in various ways. It is important that as technology evolves, many of the elements described herein may be replaced by equivalent elements that appear after this disclosure.

Claims

1. An image processing method, comprising: intercepting an original sub-image from an original image, wherein the original image contains an original object; In response to some pixels in the original object being outside the original sub-image, determining a plurality of target points in the original image that are outside the original sub-image, wherein the plurality of target points include at least a first pixel located in the original object; In response to the presence of a symmetrical point of the target point in the original sub-image, updating the pixel value of the symmetrical point based on a weighted sum of the pixel value of the target point and the pixel value of the symmetrical point, wherein the target point and the symmetrical point are symmetrically distributed on both sides of one side of the original sub-image; and The updated original sub-image is determined as a sample image, wherein the sample image contains an object to be detected, and the object to be detected includes a second pixel point of the original object located in the original sub-image and a symmetrical point of the first pixel point in the original sub-image.

2. The method according to claim 1, wherein The determining of a plurality of target points in the original image that are outside the original sub-image includes: determining a plurality of candidate points located on any side outside the original sub-image; and In response to the plurality of candidate points including a first pixel point located in the original object, the plurality of candidate points are determined as the plurality of target points.

3. The method according to claim 1 or 2, wherein: The original image has a corresponding first bounding box, where the first bounding box is a minimum rectangular box circumscribed around the original object. The method further includes: A second bounding box corresponding to the sample image is determined based on a boundary of the first bounding box and a boundary of the original sub-image.

4. The method according to claim 3, wherein: The determining, based on the boundary of the first bounding box and the boundary of the original sub-image, a second bounding box corresponding to the sample image includes: For two parallel edges in any direction of the first bounding box, in response to both of the two parallel edges intersecting with the original sub-image, the edges of the second bounding box in the direction are determined using the two parallel edges.

5. The method according to claim 4, further comprising: In response to a first side of the two parallel sides intersecting the original sub-image and a second side of the two parallel sides not intersecting the original sub-image, determining a third side of the original sub-image between the two parallel sides as one of the sides of the second bounding box in the direction; Taking the third side as the axis of symmetry, determining a symmetric side of the second side; and One of the symmetric sides of the first side and the second side, which is farther from the third side, is determined as the other side of the second bounding box in the direction.

6. A model training method comprising: Training the model using sample images, The sample image is obtained by processing according to the method according to any one of claims 1 to 5.

7. An image processing device comprising: a cutting unit configured to cut out an original sub-image from an original image, wherein the original image contains an original object; a first determining unit configured to determine, in response to some pixels in the original object being outside the original sub-image, a plurality of target points in the original image that are outside the original sub-image, wherein the plurality of target points include at least a first pixel located in the original object; an updating unit configured to, in response to the presence of a symmetrical point of the target point in the original sub-image, update a pixel value of the symmetrical point based on a weighted sum of a pixel value of the target point and a pixel value of the symmetrical point, wherein the target point and the symmetrical point are symmetrically distributed on both sides of one edge of the original sub-image; and The second determination unit is configured to determine the updated original sub-image as a sample image, wherein the sample image contains an object to be detected, and the object to be detected includes a second pixel point in the original object located in the original sub-image and a symmetrical point of the first pixel point in the original sub-image.

8. The device according to claim 7, wherein The first determining unit includes: a first determining subunit, configured to determine a plurality of candidate points located on any side outside the original sub-image; and The second determining subunit is configured to determine the multiple candidate points as the multiple target points in response to the multiple candidate points including the first pixel point located in the original object.

9. The device according to claim 7 or 8, wherein The original image has a corresponding first bounding box, where the first bounding box is a minimum rectangular box circumscribed to the original object. The apparatus further includes: The third determining unit is configured to determine a second bounding box corresponding to the sample image based on a boundary of the first bounding box and a boundary of the original sub-image.

10. The device according to claim 9, wherein The third determining unit includes: The third determining subunit is configured to determine, for two parallel edges in any direction of the first bounding box, in response to both of the two parallel edges intersecting with the original sub-image, edges of the second bounding box in the direction using the two parallel edges.

11. The apparatus according to claim 10, further comprising: a fourth determining subunit, configured to, in response to a first side of the two parallel sides intersecting the original sub-image and a second side of the two parallel sides not intersecting the original sub-image, determine a third side of the original sub-image located between the two parallel sides as one of the sides of the second bounding box in the direction; a fifth determining subunit, configured to determine a symmetric side of the second side with the third side as a symmetry axis; as well as The sixth determining subunit is configured to determine one of the symmetric sides of the first side and the second side, which is farther from the third side, as the other side of the second bounding box in the direction.

12. A model training device comprising: means for performing training on the model using sample images, The sample image is obtained by processing according to the method according to any one of claims 1 to 5.

13. An electronic device comprising: at least one processor; as well as a memory communicatively coupled to the at least one processor; in The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.

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

15. A computer program product comprising a computer program, wherein When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Object detection model training method and target object detection method

    CN109697460A

  • Image data expansion method based on feature similarity and linear smoothing combination

    CN113723500A