Target detection data enhancement method and device based on white background image
By fusing source image patches into general images, the problem of insufficient labeled data in target detection algorithms is solved, the scalability and robustness of the model are improved, and multi-target recognition capability is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 特赞(上海)信息科技有限公司
- Filing Date
- 2022-08-19
- Publication Date
- 2026-04-21
AI Technical Summary
Existing deep learning-based object detection algorithms suffer from insufficient real-world labeled data, resulting in unsatisfactory model training performance and failing to meet practical application requirements.
A target detection data augmentation method that forms a white background image by fusing appropriately categorized source image patches into a general image involves determining the mapping region in the background area of the general image, obtaining the source white background image and cropping source image patches, adjusting their size and fusing them with the general image to form a fused image for model training.
The model's scalability and robustness have been improved, enabling it to identify multiple types of targets and enhancing its applicability and resistance to interference.
Smart Images

Figure CN115358957B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a method and apparatus for target detection data augmentation based on white background images. Background Technology
[0002] Deep learning-based detection algorithms typically require a large amount of effectively labeled data to achieve robust training. In actual development, common open-source datasets such as Pascal Voc and Microsoft COCO may not contain enough categories or materials to meet the needs of real-world applications. Furthermore, insufficient manpower and budget may prevent the acquisition of enough real-world labeled data, resulting in the inability to train the model properly or achieving unsatisfactory results.
[0003] The information disclosed in the background section of this application is intended only to enhance the understanding of the general background of this application and should not be construed as an admission or in any way implying that the information constitutes prior art known to those skilled in the art. Summary of the Invention
[0004] This disclosure provides a target detection data augmentation method and apparatus based on a white background image. It can fuse appropriately categorized material image blocks into a general image, so that the fused image simultaneously includes the target object of the general image and the material in the material image block, and can also have the annotation information of the target object and the material. This allows the model to learn the appropriate category of target during model training, and can also identify general targets, thereby improving the scalability and robustness of the model.
[0005] A first aspect of this disclosure provides a target detection data augmentation method based on a white background image, comprising:
[0006] In a general image including the target object, a texture region is determined, wherein the texture region is located in a background region outside the region where the target object is located in the general image;
[0007] Obtain a white background image of the source material, wherein the white background image of the source material includes at least one source material;
[0008] Based on the white background image of the material, a material image block is obtained, wherein the material image block includes an image block extracted by a rectangular frame that selects the material in the area of the material white background image, and the background area outside the material in the image block is transparent;
[0009] Based on the texture area, the material image block is fused with the general image to obtain a fused image.
[0010] According to embodiments of this disclosure, determining a mapping region in a general image including a target object includes:
[0011] In the background area, determine the center point of the texture area;
[0012] The height and width of the texture area are obtained based on the height and width of the general image;
[0013] The texture area is obtained based on its height, width, and center point.
[0014] According to embodiments of this disclosure, obtaining the height and width of the texture region based on the height and width of the general image includes:
[0015] Based on the relationships t_s×b_w<bb_w<t_l×b_w and t_s×b_h<bb_h<t_l×b_h, the height and width of the texture region are obtained, where bb_w is the width of the texture region, b_w is the width of the general image, t_s and t_l are truncation thresholds, and t_s<t_l, bb_h is the height of the texture region, and b_h is the height of the general image.
[0016] According to embodiments of this disclosure, obtaining the texture region based on its height, width, and center point includes:
[0017] Based on the randomly set center point, and the height and width of the texture area, a texture area to be determined is obtained;
[0018] Determine the percentage of overlap between the undetermined texture region and the regions where each target object is located in the general image;
[0019] The undetermined texture region is defined as the region where the overlap area between the texture region and the region where each target object is located is less than the ratio threshold.
[0020] According to embodiments of this disclosure, determining the percentage of overlap between the undetermined texture region and the regions where each target object is located in the general image includes:
[0021] The overlap area ratio IOB is determined according to the formula IOB = (area_A ∩ area_B) / area_B, where area_A represents the area to be mapped and area_B represents the area where the target object is located.
[0022] According to embodiments of this disclosure, obtaining image blocks based on the background image includes:
[0023] Set the pixel values of the background area in the white background image of the material to 0 to obtain a transparent background image;
[0024] Obtain the transparent background matrix corresponding to the white background image of the material, wherein the pixel value at the position corresponding to the material in the transparent background matrix is 255, and the pixel value of the background area is 0;
[0025] The findcounter tool is used to process the transparent background matrix to obtain a first rectangular box that selects the area with a pixel value of 255.
[0026] Based on the first rectangle, a second rectangle is obtained to select the material in the transparent background image;
[0027] Remove the area outside the second rectangle in the transparent background image to obtain the material image block.
[0028] According to embodiments of this disclosure, the material image block and the general image are fused according to the texture area to obtain a fused image, including:
[0029] Adjust the size of the material image block according to the size of the texture area to obtain the image block to be pasted;
[0030] The image block to be pasted is pasted onto the texture area to obtain the fused image.
[0031] A second aspect of this disclosure provides a target detection data enhancement device based on a white background image, comprising:
[0032] A region module is used to determine a texture region in a general image including a target object, wherein the texture region is located in a background region outside the region where the target object is located in the general image;
[0033] The white background image module is used to obtain a white background image of a material, wherein the white background image of the material includes at least one material;
[0034] The image block module is used to obtain a material image block based on the material white background image. The material image block includes an image block extracted from the material white background image by a rectangular frame that selects the material in its area. In the image block, the background area outside the material is transparent.
[0035] The fusion module is used to fuse the material image block with the general image according to the texture area to obtain a fused image.
[0036] According to embodiments of this disclosure, the region module is further configured to:
[0037] In the background area, determine the center point of the texture area;
[0038] The height and width of the texture area are obtained based on the height and width of the general image;
[0039] The texture area is obtained based on its height, width, and center point.
[0040] According to embodiments of this disclosure, the region module is further configured to:
[0041] Based on the relationships t_s×b_w<bb_w<t_l×b_w and t_s×b_h<bb_h<t_l×b_h, the height and width of the texture region are obtained, where bb_w is the width of the texture region, b_w is the width of the general image, t_s and t_l are truncation thresholds, and t_s<t_l, bb_h is the height of the texture region, and b_h is the height of the general image.
[0042] According to embodiments of this disclosure, the region module is further configured to:
[0043] Based on the randomly set center point, and the height and width of the texture area, a texture area to be determined is obtained;
[0044] Determine the percentage of overlap between the undetermined texture region and the regions where each target object is located in the general image;
[0045] The undetermined texture region is defined as the region where the overlap area between the texture region and the region where each target object is located is less than the ratio threshold.
[0046] According to embodiments of this disclosure, the region module is further configured to:
[0047] The overlap area ratio IOB is determined according to the formula IOB = (area_A ∩ area_B) / area_B, where area_A represents the area to be mapped and area_B represents the area where the target object is located.
[0048] According to embodiments of this disclosure, the image block module is further configured to:
[0049] Set the pixel values of the background area in the white background image of the material to 0 to obtain a transparent background image;
[0050] Obtain the transparent background matrix corresponding to the white background image of the material, wherein the pixel value at the position corresponding to the material in the transparent background matrix is 255, and the pixel value of the background area is 0;
[0051] The findcounter tool is used to process the transparent background matrix to obtain a first rectangular box that selects the area with a pixel value of 255.
[0052] Based on the first rectangle, a second rectangle is obtained to select the material in the transparent background image;
[0053] Remove the area outside the second rectangle in the transparent background image to obtain the material image block.
[0054] According to embodiments of this disclosure, the fusion module is further configured to:
[0055] Adjust the size of the material image block according to the size of the texture area to obtain the image block to be pasted;
[0056] The image block to be pasted is pasted onto the texture area to obtain the fused image.
[0057] A third aspect of this disclosure provides a target detection data enhancement device based on a white background image, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to invoke the instructions stored in the memory to execute the above-described method.
[0058] A fourth aspect of this disclosure provides a computer-readable storage medium having computer program instructions stored thereon, wherein the computer program instructions, when executed by a processor, implement the above-described method. Attached Figure Description
[0059] Figure 1 A schematic flowchart of a target detection data augmentation method based on a white background image, according to an embodiment of the present disclosure, is shown as an example.
[0060] Figure 2 A flowchart of the addition process according to an embodiment of this disclosure is shown as an example;
[0061] Figure 3 A schematic diagram illustrating a general image of an embodiment of this disclosure is provided;
[0062] Figure 4 A schematic diagram of a material white background image is shown as an example of an embodiment of this disclosure;
[0063] Figure 5 A schematic diagram of a second rectangular frame according to an embodiment of the present disclosure is shown as an example;
[0064] Figure 6 A schematic diagram of a fused image, exemplarily illustrating an embodiment of this disclosure, is shown.
[0065] Figure 7 An exemplary embodiment of the target detection data enhancement apparatus based on a white background image is shown;
[0066] Figure 8 This is a block diagram illustrating a target detection data enhancement device based on a white background image, according to an exemplary embodiment. Detailed Implementation
[0067] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0068] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in this disclosure, claims, and accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such use of data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein.
[0069] It should be understood that in the various embodiments of this disclosure, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this disclosure.
[0070] It should be understood that in this disclosure, "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product, or device.
[0071] It should be understood that in this disclosure, "multiple" refers to two or more. "And / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, "and / or B" can represent: A existing alone, A and B existing simultaneously, or B existing alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "Contains A, B, and C", "Contains A, B, and C" means that all three A, B, and C are contained; "Contains A, B, or C" means that one of A, B, and C is contained; "Contains A, B, and / or C" means that any one, two, or three of A, B, and C are contained.
[0072] It should be understood that in this disclosure, "B corresponding to A", "B corresponding to A", "A corresponds to B", or "B corresponds to A" means that B is associated with A, and B can be determined based on A. Determining B based on A does not mean determining B solely based on A; B can also be determined based on A and / or other information. Matching A and B is defined as a similarity between A and B that is greater than or equal to a preset threshold.
[0073] Depending on the context, "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection."
[0074] The technical solutions of this disclosure will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0075] Figure 1 An exemplary flowchart of a target detection data augmentation method based on a white background image according to an embodiment of this disclosure is shown, such as... Figure 1 As shown, the method includes:
[0076] Step S101: In a general image including the target object, a texture area is determined, wherein the texture area is located in a background area outside the area where the target object is located in the general image;
[0077] Step S102: Obtain a white background image of the material, wherein the white background image of the material includes at least one material;
[0078] Step S103: Obtain material image blocks based on the material white background image, wherein the material image blocks include image blocks extracted by a rectangular frame that selects the material in the area of the material white background image, and the background area outside the material in the image blocks is transparent;
[0079] Step S104: Based on the texture area, the material image block and the general image are fused to obtain a fused image.
[0080] According to embodiments of this disclosure, to address the problem that existing general-purpose images cannot adapt to the training of various types of object detection neural network models, appropriate types of materials can be added to the general-purpose images. For example, if the object detection neural network model is used to detect faces, then face materials can be added to general-purpose images that do not contain faces. For example, if the object detection neural network is used to detect vehicles, then vehicle materials can be added to general-purpose images that do not contain faces. As another example, if the object detection neural network is used to detect goods, then materials of goods, similar goods, and / or related goods can be added to general-purpose images that do not contain goods.
[0081] According to embodiments of this disclosure, after the above-described addition process, the added image (e.g., the fused image) can have multiple targets, namely, the original targets of the general image and the targets formed by the newly added materials. Therefore, annotation information can also be increased. For example, the annotation information of the general image includes the location and type of the original targets, while in the fused image, the annotation information can include the location and type of the materials. Thus, a target detection neural network model can be trained using a fused image with materials of appropriate categories, and the target detection neural network model can also be trained to detect multiple types of targets in the general image, improving the applicability, robustness, and anti-interference ability of the target detection neural network model.
[0082] According to embodiments of this disclosure, the above-described addition process can be performed by cropping the desired material from other images and pasting it into an appropriate position in a general image.
[0083] Figure 2 A flowchart of the addition process of an embodiment of this disclosure is shown as an example.
[0084] According to an embodiment of this disclosure, in step S101, Figure 2 The existing labeled data may include generic images from known databases, which include the target object, and the generic image may include the labeling information of the target object, such as the category label and location label of the target object.
[0085] Figure 3 A schematic diagram of a general image according to an embodiment of this disclosure is shown as an example. The zebra in the figure is the target object. The annotation information of the general image may include the position information of the selection box for selecting the target object, that is, the position annotation, and the category annotation for the category of the target object.
[0086] According to embodiments of this disclosure, a texture area in a general image can be determined, that is, an area that can be used for texture mapping or adding new materials. Step S101 may include: determining the center point of the texture area in the background area; obtaining the height and width of the texture area based on the height and width of the general image; and obtaining the texture area based on the height, width, and center point of the texture area.
[0087] According to embodiments of this disclosure, a background area can be determined based on the location markers of the target object in a general image; that is, an area outside the area where the target object is located can be used to set a texture area in the background area.
[0088] According to embodiments of this disclosure, the width of the general image is represented as b_w, and the height is represented as b_h. The coordinates of the n existing location annotation boxes in the general image are combined as b_box=[(x_center1,y_center1,w1,h1)∪(x_center2,y_center2,w2,h2)...∪(x_centern,y_centern,wn,hn)], where x_centern represents the abscissa of the center of the location annotation box of the nth target object, y_centern represents the total coordinate of the center of the location annotation box of the nth target object, wn represents the width of the location annotation box of the nth target object, and hn represents the height of the location annotation box of the nth target object.
[0089] According to embodiments of this disclosure, a texture area can be set outside the above-mentioned areas. First, the center point of the texture area can be set. For example, any point can be set in the background area outside the above-mentioned areas as the center point of the texture area.
[0090] According to embodiments of this disclosure, the size of the texture region can be obtained. For example, the height and width of the texture region can be set based on the height and width of the general image. For example, the height and width of the general image can be multiplied by a coefficient less than 1 to obtain the texture region, so that the area of the texture region is smaller than that of the general image, and the texture region can occupy a certain proportion in the general image, serving as a prominent target in the synthesized fused image.
[0091] According to embodiments of this disclosure, the height and width of the texture region are obtained according to relation (1).
[0092] t_s×b_w<bb_w<t_l×b_w and t_s×b_h<bb_h<t_l×b_h(1)
[0093] Wherein, bb_w is the width of the texture region, b_w is the width of the general image, t_s and t_l are the truncation thresholds, and t_s < t_l, bb_h is the height of the texture region, and b_h is the height of the general image. In the example, t_s = 0.2, t_l = 0.7, and this disclosure does not limit the specific value of the truncation threshold.
[0094] According to embodiments of this disclosure, a texture region can be generated based on the center point and size determined above, and during the generation process, the texture region does not overlap with the original target location in the general image or the overlap ratio is small. Obtaining the texture region based on its height, width, and center point includes: obtaining a pending texture region based on a randomly set center point, and the height and width of the texture region; determining the overlap area ratio between the pending texture region and the regions where each target object in the general image is located; and determining the pending texture region whose overlap area ratio with each target object's region is less than a certain threshold as the texture region.
[0095] According to embodiments of this disclosure, a region to be mapped can be obtained based on the center point and dimensions (i.e., length and height) determined above, and the percentage of overlap between the region to be mapped and the regions where each target object is located in the general image can be determined.
[0096] According to embodiments of this disclosure, determining the overlap area ratio (IOB) between the undetermined texture region and the regions where each target object is located in the general image includes: determining the overlap area ratio according to formula (2).
[0097] IOB=(area_A∩area_B) / area_B (2)
[0098] Where area_A represents the area to be mapped, and area_B represents the area where the target object is located.
[0099] According to embodiments of this disclosure, the overlap ratio (IOB) between the undetermined texture region and the regions where each target object is located can be determined based on the above formula (2). If the overlap ratio (IOB) between the undetermined texture region and the regions where each target object is located is less than a ratio threshold, the undetermined texture region can be determined as a texture region. If the overlap ratio (IOB) between a certain undetermined texture region and the region where a certain target object is located is greater than or equal to the ratio threshold, the center point and / or size of the undetermined texture region can be adjusted until a texture region is found where the overlap ratio (IOB) with the regions where each target object is located is less than the ratio threshold. The ratio threshold can be set to 0.3, and the specific value of the ratio threshold in this disclosure is not limited.
[0100] According to an embodiment of this disclosure, in step S102, a white background image of the material can be obtained. The white background image of the material may include at least one material, and the background area outside the material is white pixels.
[0101] Figure 4 A schematic diagram of a white background image of material from an embodiment of this disclosure is shown as an example. For example... Figure 4As shown, the white background image may include a single element, such as a light bulb, with the background area outside the element's location consisting of white pixels. This white background image may also include a label indicating the category of the element, i.e., a category label.
[0102] According to an embodiment of this disclosure, in step S103, a material image block can be obtained from the material white background image, for example, by cropping or other means.
[0103] According to an embodiment of this disclosure, step S103 may include: setting the pixel values of the background area in the white background image of the material to 0 to obtain a transparent background image; obtaining a transparent background matrix corresponding to the white background image of the material, wherein the pixel value at the position corresponding to the material in the transparent background matrix is 255, and the pixel value of the background area is 0; processing the transparent background matrix using the findcounter tool to obtain a first rectangle that selects the area with a pixel value of 255; obtaining a second rectangle that selects the material in the transparent background image based on the first rectangle; and removing the area outside the second rectangle in the transparent background image to obtain the material image block.
[0104] According to embodiments of this disclosure, the location of the material in the white background image can be determined first, and the pixels of other background areas outside the location of the material can be set to 0, so that the background area becomes a transparent area, and a transparent background image is obtained.
[0105] According to embodiments of this disclosure, a transparent background matrix can be obtained based on a transparent background image, that is, a matrix in which the pixel value at the location of the material is 255 and the pixel value at the location of the background area is 0.
[0106] According to embodiments of this disclosure, the findcounter tool can be used on the transparent background matrix to determine a first rectangular bounding box for selecting regions with pixel values of 255. This first rectangular bounding box is the smallest rectangular bounding box for selecting regions with pixel values of 255.
[0107] According to embodiments of this disclosure, a second rectangle for selecting materials in a transparent background image can be determined based on the position of the smallest rectangle in the transparent background matrix. For example, the position of the second rectangle in the transparent background image is the same as the position of the first rectangle in the transparent background matrix. For instance, the second rectangle is the smallest rectangle for selecting materials.
[0108] Figure 5 A schematic diagram of a second rectangular frame according to an embodiment of this disclosure is shown as an example. Figure 5 As shown, the second rectangle enclosed by the dashed line is the smallest rectangle used to select the material.
[0109] According to embodiments of this disclosure, the area within the second rectangle can be cropped; for example, the portion outside the second rectangle can be removed to obtain the source image block.
[0110] According to an embodiment of this disclosure, in step S104, the source image block can be merged into a texture area in a general image to obtain a merged image. Step S104 may include: adjusting the size of the source image block according to the size of the texture area to obtain an image block to be pasted; pasting the image block to be pasted into the texture area to obtain the merged image.
[0111] Figure 6 A schematic diagram of a fused image, exemplarily illustrating an embodiment of this disclosure, is shown below. Figure 6 As shown, source image blocks can be merged into texture areas within a general image. For example... Figure 6 As shown in Figure a on the left, at least one texture area can be identified in the general image. The size of the source image block can be adjusted to match the size of the texture area to obtain the image block to be pasted. The image block to be pasted is then pasted onto the texture area to obtain the blended image.
[0112] According to embodiments of this disclosure, such as Figure 6 As shown in Figure b on the right, for example, the size of the texture area is set based on the size of the source image block. Therefore, the source image block can be directly pasted into the texture area to obtain a blended image.
[0113] According to embodiments of this disclosure, the fused image may include annotation information of a general image and annotation information of source image blocks. For example, it may include category and location annotations of target objects in the general image, and may also include category and location annotations of source image blocks. The location annotations of the source image blocks can be determined by the position and size of the texture area.
[0114] According to this disclosure, it is possible to fuse appropriately categorized material image patches into a general image, such that the fused image simultaneously includes the target object of the general image and the material from the material image patch, and can also have annotation information for the target object and the material. This enables the model to learn the appropriate category of target during model training, while also recognizing general targets, thereby improving the scalability and robustness of the model.
[0115] Figure 7 An exemplary embodiment of the target detection data enhancement apparatus based on a white background image of this disclosure is shown, comprising:
[0116] A region module is used to determine a texture region in a general image including a target object, wherein the texture region is located in a background region outside the region where the target object is located in the general image;
[0117] The white background image module is used to obtain a white background image of a material, wherein the white background image of the material includes at least one material;
[0118] The image block module is used to obtain a material image block based on the material white background image. The material image block includes an image block extracted from the material white background image by a rectangular frame that selects the material in its area. In the image block, the background area outside the material is transparent.
[0119] The fusion module is used to fuse the material image block with the general image according to the texture area to obtain a fused image.
[0120] According to embodiments of this disclosure, the region module is further configured to:
[0121] In the background area, determine the center point of the texture area;
[0122] The height and width of the texture area are obtained based on the height and width of the general image;
[0123] The texture area is obtained based on its height, width, and center point.
[0124] According to embodiments of this disclosure, the region module is further configured to:
[0125] Based on the relationships t_s×b_w<bb_w<t_l×b_w and t_s×b_h<bb_h<t_l×b_h, the height and width of the texture region are obtained, where bb_w is the width of the texture region, b_w is the width of the general image, t_s and t_l are truncation thresholds, and t_s<t_l, bb_h is the height of the texture region, and b_h is the height of the general image.
[0126] According to embodiments of this disclosure, the region module is further configured to:
[0127] Based on the randomly set center point, and the height and width of the texture area, a texture area to be determined is obtained;
[0128] Determine the percentage of overlap between the undetermined texture region and the regions where each target object is located in the general image;
[0129] The undetermined texture region is defined as the region where the overlap area between the texture region and the region where each target object is located is less than the ratio threshold.
[0130] According to embodiments of this disclosure, the region module is further configured to:
[0131] The overlap area ratio IOB is determined according to the formula IOB = (area_A ∩ area_B) / area_B, where area_A represents the area to be mapped and area_B represents the area where the target object is located.
[0132] According to embodiments of this disclosure, the image block module is further configured to:
[0133] Set the pixel values of the background area in the white background image of the material to 0 to obtain a transparent background image;
[0134] Obtain the transparent background matrix corresponding to the white background image of the material, wherein the pixel value at the position corresponding to the material in the transparent background matrix is 255, and the pixel value of the background area is 0;
[0135] The findcounter tool is used to process the transparent background matrix to obtain a first rectangular box that selects the area with a pixel value of 255.
[0136] Based on the first rectangle, a second rectangle is obtained to select the material in the transparent background image;
[0137] Remove the area outside the second rectangle in the transparent background image to obtain the material image block.
[0138] According to embodiments of this disclosure, the fusion module is further configured to:
[0139] Adjust the size of the material image block according to the size of the texture area to obtain the image block to be pasted;
[0140] The image block to be pasted is pasted onto the texture area to obtain the fused image.
[0141] Figure 8 This is a block diagram illustrating a target detection data augmentation device based on a white background image, according to an exemplary embodiment. For example, the device 1600 may be provided as a terminal or a server. The device 1600 includes a processing component 1602 and memory resources represented by a memory 1603 for storing instructions executable by the processing component 1602, such as application programs. The application programs stored in the memory 1603 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 1602 is configured to execute instructions to perform the methods described above.
[0142] Device 1600 may also include a power supply component 1606 configured to perform power management of device 1600, a wired or wireless network interface 1605 configured to connect device 1600 to a network, and an input / output (I / O) interface 1608. Device 1600 can operate on an operating system stored in memory 1603, such as Windows Server™, MacOS X™, Unix™, Linux™, FreeBSD™, or similar.
[0143] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.
[0144] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0145] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0146] The computer program instructions used to perform the operations of this invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing state information from the computer-readable program instructions. This electronic circuitry can execute the computer-readable program instructions to implement various aspects of the invention.
[0147] Various aspects of the present invention are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0148] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processing unit of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0149] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions that execute on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0150] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0151] Note that, unless otherwise explicitly stated, all features disclosed in this specification (including any appended claims, abstract, and drawings) may be replaced by alternative features for achieving the same, equivalent, or similar purpose. Therefore, unless explicitly stated otherwise, each disclosed feature is merely one example of a set of equivalent or similar features. Where used, "further," "preferably," "even further," and "more preferably" are simple starting points for describing another embodiment based on the foregoing embodiments, the combination of which with the foregoing embodiments constitutes the complete configuration of another embodiment. Any combination of several "further," "preferably," "even further," or "more preferably" settings following the same embodiment constitutes yet another embodiment.
[0152] Those skilled in the art should understand that the embodiments of the present invention described above and shown in the accompanying drawings are merely examples and do not limit the present invention. The objectives of the present invention have been fully and effectively achieved. The functions and structural principles of the present invention have been shown and explained in the embodiments, and any modifications or variations of the embodiments of the present invention may be made without departing from the stated principles.
[0153] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this disclosure, and are not intended to limit them. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this disclosure.
Claims
1. A target detection data augmentation method based on a white background image, characterized in that, include: In a general image including the target object, a texture region is determined, wherein the texture region is located in a background region outside the region where the target object is located in the general image; Obtain a white background image of the source material, wherein the white background image of the source material includes at least one source material; Based on the white background image of the material, a material image block is obtained, wherein the material image block includes an image block extracted by a rectangular frame that selects the material in the area of the material white background image, and the background area outside the material in the image block is transparent; Based on the texture region, the material image block is fused with the general image to obtain a fused image. Within the general image including the target object, the texture region is determined, including: In the background area, determine the center point of the texture area; The height and width of the texture area are obtained based on the height and width of the general image; The texture region is obtained based on its height, width, and center point. The height and width of the texture region are obtained based on the height and width of the general image, including: Based on the relationships t_s×b_w<bb_w<t_l×b_w and t_s×b_h<bb_h<t_l×b_h, the height and width of the texture region are obtained, where bb_w is the width of the texture region, b_w is the width of the general image, t_s and t_l are truncation thresholds, and t_s<t_l, bb_h is the height of the texture region, and b_h is the height of the general image. The texture region is obtained based on its height, width, and center point, including: Based on the randomly set center point, and the height and width of the texture area, a texture area to be determined is obtained; Determine the percentage of overlap between the undetermined texture region and the regions where each target object is located in the general image; The undetermined texture region is defined as the region where the overlap area ratio between the undetermined texture region and the regions where each target object is located is less than a certain percentage threshold. Determining the overlap area ratio between the undetermined texture region and the regions where each target object is located in the general image includes: The overlap area ratio IOB is determined according to the formula IOB=(area_A∩area_B) / area_B, where area_A represents the area to be mapped, and area_B represents the area where the target object is located. Based on the white background image of the source material, source image blocks are obtained, including: Set the pixel values of the background area in the white background image of the material to 0 to obtain a transparent background image; Obtain the transparent background matrix corresponding to the white background image of the material, wherein the pixel value at the position corresponding to the material in the transparent background matrix is 255, and the pixel value of the background area is 0; The findcounter tool is used to process the transparent background matrix to obtain a first rectangular box that selects the area with a pixel value of 255. Based on the first rectangle, a second rectangle is obtained to select the material in the transparent background image; The area outside the second rectangle in the transparent background image is removed to obtain the material image block. Based on the texture area, the material image block is merged with the general image to obtain a merged image, including: Adjust the size of the material image block according to the size of the texture area to obtain the image block to be pasted; The image block to be pasted is pasted onto the texture area to obtain the fused image.
2. A target detection data enhancement device based on a white background image, wherein the target detection data enhancement device based on a white background image implements the method as described in claim 1, characterized in that, include: A region module is used to determine a texture region in a general image including a target object, wherein the texture region is located in a background region outside the region where the target object is located in the general image; The white background image module is used to obtain a white background image of a material, wherein the white background image of the material includes at least one material; The image block module is used to obtain a material image block based on the material white background image. The material image block includes an image block extracted from the material white background image by a rectangular frame that selects the material in its area. In the image block, the background area outside the material is transparent. The fusion module is used to fuse the material image block with the general image according to the texture area to obtain a fused image.
3. A computer device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method of claim 1.
4. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method of claim 1.
Citation Information
Patent Citations
Image data amplification method, device, equipment, medium and computer program product
CN114842073A