Foaming area detection method and device, electronic equipment and storage medium
By detecting the visible light and infrared images of the product, and calculating the location of the foamed area, the problem of poor detection accuracy of the foamed area is solved and the accuracy of the detection results is improved.
Patent Information
- Application Number
- CN202411863734.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2044-12-17
AI Technical Summary
When manufacturing insulation products, the uniformity of the foaming area is closely related to the insulation performance of the product. However, since the foaming area is located inside the shell of the product, it is difficult to accurately detect, resulting in poor accuracy of the test results.
By obtaining the visible light image and infrared image of the product to be tested, the contour information of the target panel is detected, and the area position of the foamed area in the visible light image is calculated based on the relative position relationship, and the detection result of the foamed area is determined based on the temperature difference.
The accuracy of foamed area detection is improved, the impact of regional position error on the detection results is reduced, and the accuracy of the detection results is enhanced.
Smart Images

Figure CN119310134A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of product testing technology, and in particular to a method, device, electronic equipment and storage medium for detecting a foaming area. Background Art
[0002] When manufacturing heat preservation products such as refrigerators and water heaters, a foaming process is usually used to generate a foaming area between the outer shell and the inner shell of the product to achieve the heat preservation function of the product and improve the energy saving effect. Taking a refrigerator as an example, by filling a foaming agent and a hard foam material between the outer shell and the inner shell of the refrigerator, a foaming area is formed between the outer shell and the inner shell of the refrigerator, reducing the leakage of cold air and the entry of hot air, and achieving the heat preservation effect.
[0003] Since the thermal insulation performance of the product is closely related to the uniformity of the foaming area, it is necessary to test whether the foaming area of the product is uniform during the production process. However, the foaming area is located inside the shell, and it is difficult to directly and accurately determine the specific position of the foaming area, resulting in low accuracy in the marking of the foaming area, which in turn leads to poor accuracy in the test results. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a method, device, electronic device and storage medium for detecting a foaming area, so as to calculate the area position of the foaming area of a product in a visible light image, thereby improving the accuracy of the detection result of the foaming area. The specific technical solution is as follows:
[0005] In a first aspect, an embodiment of the present application provides a method for detecting a foaming area, the method comprising:
[0006] Acquire the relative positional relationship between the foaming area of the product to be tested and the target panel where it is located, as well as the visible light image and infrared image of the product to be tested, wherein the visible light image and infrared image include the target panel;
[0007] Detecting contour information of the target panel from the visible light image;
[0008] Calculating the regional position of the foaming region in the visible light image according to the contour information and the relative position relationship;
[0009] The detection result of the foaming area is determined based on the temperature difference between the temperature corresponding to the area position in the infrared image and the ambient temperature.
[0010] Optionally, the step of calculating the regional position of the foaming region in the visible light image according to the contour information and the relative position relationship includes:
[0011] Calculating an image margin between the bubbled area and the target panel in the visible light image according to the contour information and the relative position relationship, wherein the contour information includes vertex coordinates and / or contour size of the target panel; and the relative position relationship includes a proportional relationship between an actual margin between the bubbled area and the target panel and an actual size of the target panel;
[0012] The region position of the foaming region in the visible light image is calculated according to the contour information and the image margin.
[0013] Optionally, the target panel and the foaming area are rectangular areas;
[0014] The step of calculating the image margin between the foaming area and the target panel in the visible light image according to the contour information and the relative position relationship comprises:
[0015] Calculating the contour length and multiplying the lengthwise proportional relationship between the target panel and the foaming region to obtain at least one image margin between the foaming region and the target panel in the visible light image;
[0016] The contour width is calculated and multiplied by the proportional relationship corresponding to the margins of the target panel and the foaming area in the width direction to obtain at least one image margin of the foaming area and the target panel in the visible light image in the width direction.
[0017] Optionally, the step of calculating the regional position of the foaming area in the visible light image according to the contour information and the image margin includes:
[0018] Calculate the vertex coordinates of the first target vertex of the foaming area corresponding to the first panel vertex according to the vertex coordinates of the first panel vertex of the target panel, the image margin corresponding to the first panel vertex in the length direction, and the image margin corresponding to the first panel vertex in the width direction;
[0019] Based on the contour information, vertex coordinates of other target vertices of the foaming area are calculated.
[0020] Optionally, the step of calculating the vertex coordinates of other target vertices of the foaming area based on the contour information includes:
[0021] Based on the contour information, calculating vertex coordinates of a second target vertex adjacent to the first target vertex;
[0022] Based on the first target vertex, the second target vertex, and the relative positional relationship, vertex coordinates of other target vertices in the foaming area are calculated.
[0023] Optionally, the step of calculating the vertex coordinates of other target vertices of the foaming area based on the contour information includes:
[0024] Calculate the vertex coordinates of the second target vertex corresponding to the second panel vertex in the foaming area according to the vertex coordinates of the second panel vertex of the target panel, the image margin corresponding to the second panel vertex in the length direction, and the image margin corresponding to the second panel vertex in the width direction;
[0025] Calculate the vertex coordinates of the third target vertex corresponding to the third panel vertex in the foaming area according to the vertex coordinates of the third panel vertex of the target panel, the image margin corresponding to the third panel vertex in the length direction, and the image margin corresponding to the third panel vertex in the width direction;
[0026] The vertex coordinates of the fourth target vertex corresponding to the fourth panel vertex in the foaming area are calculated based on the vertex coordinates of the fourth panel vertex of the target panel, the image margin corresponding to the fourth panel vertex in the length direction, and the image margin corresponding to the fourth panel vertex in the width direction.
[0027] Optionally, the relative position relationship further includes a preset first proportional relationship between the foaming area and the target panel in the length direction, and a preset second proportional relationship between the foaming area and the target panel in the width direction;
[0028] The step of calculating the vertex coordinates of a second target vertex adjacent to the first target vertex based on the contour information comprises:
[0029] Calculating the vertex coordinates of a second target vertex adjacent to the first target vertex in the length direction according to the first target vertex, the contour length, and the first proportional relationship;
[0030] The step of calculating the vertex coordinates of other target vertices in the foaming area based on the first target vertex, the second target vertex and the relative position relationship comprises:
[0031] Calculating the vertex coordinates of a third target vertex adjacent to the first target vertex in the width direction according to the first target vertex, the contour width, and the second proportional relationship;
[0032] The vertex coordinates of a fourth target vertex adjacent to the second target vertex in the width direction are calculated according to the second target vertex, the contour width, and the second proportional relationship.
[0033] Optionally, the relative position relationship further includes a preset actual length-to-width ratio of the foaming area;
[0034] The step of calculating the vertex coordinates of a second target vertex adjacent to the first target vertex based on the contour information comprises:
[0035] Calculate the vertex coordinates of a second target vertex adjacent to the first target vertex according to the vertex coordinates of the adjacent panel vertices of the first panel vertex, the image margins corresponding to the adjacent panel vertices in the length direction, and the image margins corresponding to the adjacent panel vertices in the width direction;
[0036] The step of calculating the vertex coordinates of other target vertices in the foaming area based on the first target vertex, the second target vertex and the relative position relationship comprises:
[0037] Calculate, according to the first target vertex and the second target vertex, a first length of a first edge where the first target vertex and the second target vertex are located;
[0038] Calculating a second length of an adjacent side of the first edge according to the first length and an actual length-to-width ratio of the foaming area;
[0039] The vertex coordinates of other target vertices in the foaming area are calculated according to the second length, the first target vertex, and the second target vertex.
[0040] Optionally, the step of calculating the regional position of the foaming area in the visible light image according to the contour information and the image margin includes:
[0041] For each edge of the target panel in the visible light image, construct a straight line within the contour of the target panel that is parallel to the edge and at a distance from the edge that is a target image margin, wherein the target image margin is an image margin between an edge of the foaming region in the visible light image that is parallel to and close to the edge and the edge;
[0042] The regional position of the region enclosed by the four constructed straight lines is determined as the regional position of the foaming region in the visible light image.
[0043] Optionally, the relative position relationship further includes a preset actual length-to-width ratio of the foaming area; before the step of determining the detection result of the foaming area based on the temperature difference between the temperature corresponding to the position of the area in the infrared image and the ambient temperature, the method further includes:
[0044] Calculating the length and width of the bubble region in the visible light image based on vertex coordinates of four target vertices of the bubble region, and calculating the current length-to-width ratio of the bubble region in the visible light image;
[0045] When the difference between the current aspect ratio and the actual aspect ratio is greater than a preset ratio threshold, adjusting the region position of the foaming region according to the difference;
[0046] The step of determining the detection result of the foaming area based on the temperature difference between the temperature corresponding to the area position in the infrared image and the ambient temperature comprises:
[0047] The detection result of the foaming area is determined based on the temperature difference between the temperature corresponding to the adjusted area position in the infrared image and the ambient temperature.
[0048] Optionally, the foaming area is between the target panel and the inner shell of the product to be tested, and the target panel shields the foaming area.
[0049] Optionally, the step of obtaining the relative position relationship between the foaming area of the product to be tested and the target panel where it is located includes:
[0050] Identifying a product identification of the product to be tested in a visible light image of the product to be tested;
[0051] Determine the product size of the product to be tested based on the product identification and the correspondence between the preset product identification and the product size, wherein the product size includes the actual margin between the foaming area and the target panel, the actual size of the target panel where the foaming area of the product to be tested is located, and the actual size of the foaming area;
[0052] Based on the actual margin and the actual size of the target panel, a proportional relationship between the actual margin between the foaming area and the target panel and the actual size of the target panel is calculated.
[0053] Optionally, the step of determining the detection result of the foaming area based on the temperature difference between the temperature corresponding to the area position in the infrared image and the ambient temperature includes:
[0054] Determine whether the temperature difference between the temperature corresponding to the area position in the infrared image and the ambient temperature is greater than a preset temperature threshold;
[0055] When the temperature difference is greater than the preset temperature threshold, generating a first type of detection result characterizing the non-uniformity of the foaming area;
[0056] When the temperature difference is not greater than the preset temperature threshold, a second type of detection result indicating that the foaming area is uniform is generated.
[0057] In a second aspect, an embodiment of the present application provides a device for detecting a foaming area, the device comprising:
[0058] A position relationship acquisition module, used to acquire the relative position relationship between the foaming area of the product to be tested and the target panel where it is located, as well as a visible light image and an infrared image of the product to be tested, wherein the visible light image and the infrared image include the target panel;
[0059] An information detection module, used for detecting contour information of the target panel from the visible light image;
[0060] A position calculation module, used for calculating the regional position of the foaming area in the visible light image according to the contour information and the relative position relationship;
[0061] The result determination module is used to determine the detection result of the foaming area based on the temperature difference between the temperature corresponding to the area position in the infrared image and the ambient temperature.
[0062] Optionally, the position calculation module includes:
[0063] a margin calculation submodule, configured to calculate an image margin between the foaming region and the target panel in the visible light image according to the contour information and the relative position relationship, wherein the contour information includes vertex coordinates and / or contour size of the target panel; and the relative position relationship includes a proportional relationship between an actual margin between the foaming region and the target panel and an actual size of the target panel;
[0064] The position calculation submodule is used to calculate the regional position of the foaming area in the visible light image according to the contour information and the image margin.
[0065] Optionally, the target panel and the foaming area are rectangular areas; and the margin calculation submodule includes:
[0066] A first calculation unit is used to calculate the contour length and the product of the proportional relationship corresponding to the margins of the target panel and the foaming area in the length direction to obtain at least one image margin between the foaming area and the target panel in the visible light image in the length direction;
[0067] The second calculation unit is used to calculate the contour width and multiply it by the proportional relationship corresponding to the margins of the target panel and the foaming area in the width direction to obtain at least one image margin of the foaming area and the target panel in the visible light image in the width direction.
[0068] Optionally, the position calculation submodule includes:
[0069] a third calculating unit, configured to calculate the vertex coordinates of the first target vertex of the foaming area corresponding to the first panel vertex according to the vertex coordinates of the first panel vertex of the target panel, the image margin corresponding to the first panel vertex in the length direction, and the image margin corresponding to the first panel vertex in the width direction;
[0070] The fourth calculation unit is used to calculate the vertex coordinates of other target vertices in the foaming area based on the contour information.
[0071] Optionally, the fourth computing unit includes:
[0072] A first calculation subunit, configured to calculate, based on the contour information, vertex coordinates of a second target vertex adjacent to the first target vertex;
[0073] The second calculation subunit is used to calculate the vertex coordinates of other target vertices in the foaming area based on the first target vertex, the second target vertex and the relative position relationship.
[0074] Optionally, the fourth computing unit includes:
[0075] a third calculating subunit, configured to calculate the vertex coordinates of the second target vertex corresponding to the second panel vertex of the foaming area according to the vertex coordinates of the second panel vertex of the target panel, the image margin corresponding to the second panel vertex in the length direction, and the image margin corresponding to the second panel vertex in the width direction;
[0076] a fourth calculation subunit, configured to calculate the vertex coordinates of the third target vertex corresponding to the third panel vertex of the target panel, based on the vertex coordinates of the third panel vertex of the target panel, the image margin corresponding to the third panel vertex in the length direction, and the image margin corresponding to the third panel vertex in the width direction;
[0077] The fifth calculation subunit is used to calculate the vertex coordinates of the fourth target vertex corresponding to the fourth panel vertex in the bubble area based on the vertex coordinates of the fourth panel vertex of the target panel, the image margin corresponding to the fourth panel vertex in the length direction, and the image margin corresponding to the fourth panel vertex in the width direction.
[0078] Optionally, the relative position relationship further includes a preset first proportional relationship between the foaming area and the target panel in the length direction, and a preset second proportional relationship between the foaming area and the target panel in the width direction; the first calculation subunit is specifically used to:
[0079] Calculating the vertex coordinates of a second target vertex adjacent to the first target vertex in the length direction according to the first target vertex, the contour length, and the first proportional relationship;
[0080] The second computing subunit is specifically configured to:
[0081] According to the first target vertex, the contour width and the second proportional relationship, the vertex coordinates of the third target vertex adjacent to the first target vertex in the width direction are calculated; according to the second target vertex, the contour width and the second proportional relationship, the vertex coordinates of the fourth target vertex adjacent to the second target vertex in the width direction are calculated.
[0082] Optionally, the relative position relationship further includes a preset actual length-to-width ratio of the foaming area; the first calculation subunit is specifically used for:
[0083] Calculate the vertex coordinates of a second target vertex adjacent to the first target vertex according to the vertex coordinates of the adjacent panel vertices of the first panel vertex, the image margins corresponding to the adjacent panel vertices in the length direction, and the image margins corresponding to the adjacent panel vertices in the width direction;
[0084] The second computing subunit is specifically configured to:
[0085] Calculate, according to the first target vertex and the second target vertex, a first length of a first edge where the first target vertex and the second target vertex are located;
[0086] Calculating a second length of an adjacent side of the first edge according to the first length and an actual length-to-width ratio of the foaming area;
[0087] The vertex coordinates of other target vertices in the foaming area are calculated according to the second length, the first target vertex, and the second target vertex.
[0088] Optionally, the position calculation submodule includes:
[0089] a straight line construction unit, for constructing, within the contour of the target panel, for each edge of the target panel in the visible light image, a straight line parallel to the edge and at a distance from the edge equal to a target image margin, wherein the target image margin is an image margin between an edge of the foaming region in the visible light image that is parallel to and close to the edge and the edge;
[0090] The position determination unit is used to determine the regional position of the region surrounded by the four constructed straight lines as the regional position of the foaming region in the visible light image.
[0091] Optionally, the device further comprises:
[0092] A ratio calculation module, for the relative position relationship further including a preset actual length-to-width ratio of the foaming area; before the step of determining the detection result of the foaming area based on the temperature difference between the temperature corresponding to the position of the area in the infrared image and the ambient temperature, the length and width of the foaming area in the visible light image are calculated based on the vertex coordinates of the four target vertices of the foaming area, and the current length-to-width ratio of the foaming area in the visible light image is calculated;
[0093] an adjustment module, configured to adjust the region position of the foaming region according to the difference between the current aspect ratio and the actual aspect ratio when the difference between the current aspect ratio and the actual aspect ratio is greater than a preset ratio threshold;
[0094] The result determination module comprises:
[0095] The result determination submodule is used to determine the detection result of the foaming area based on the temperature difference between the temperature corresponding to the adjusted area position in the infrared image and the ambient temperature.
[0096] Optionally, the foaming area is between the target panel and the inner shell of the product to be tested, and the target panel shields the foaming area.
[0097] Optionally, the position relationship acquisition module includes:
[0098] The identification recognition submodule is used to identify the product identification of the product to be tested in the visible light image of the product to be tested;
[0099] A size determination submodule, for determining the product size of the product to be tested based on the product identification and the correspondence between the preset product identification and the product size, wherein the product size includes the actual margin between the foaming area and the target panel, the actual size of the target panel where the foaming area of the product to be tested is located, and the actual size of the foaming area;
[0100] The relationship determination submodule is used to calculate the proportional relationship between the actual margin between the foaming area and the target panel and the actual size of the target panel based on the actual margin and the actual size of the target panel.
[0101] Optionally, the result determination module includes:
[0102] A temperature difference determination submodule, used to determine whether the temperature difference between the temperature corresponding to the regional position in the infrared image and the ambient temperature is greater than a preset temperature threshold; if the temperature difference is greater than the preset temperature threshold, triggering the first generation submodule; if the temperature difference is not greater than the preset temperature threshold, triggering the second generation submodule;
[0103] The first generating submodule is used to generate a first type of detection result characterizing the non-uniformity of the foaming area;
[0104] The second generation submodule is used to generate a second type of detection result that characterizes the uniformity of the foaming area.
[0105] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0106] Memory, used to store computer programs;
[0107] The processor is used to implement any method described in the first aspect when executing a program stored in the memory.
[0108] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any method described in the first aspect is implemented.
[0109] In a fifth aspect, an embodiment of the present application further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the above-described methods for detecting a foaming area.
[0110] Beneficial effects of the embodiments of the present application:
[0111] According to the technical solution provided by the embodiment of the present application, the electronic device can obtain the relative position relationship between the foaming area of the product to be tested and the target panel where it is located, as well as the visible light image and infrared image of the product to be tested, wherein the visible light image and the infrared image include the target panel; detect the contour information of the target panel from the visible light image; calculate the regional position of the foaming area in the visible light image based on the contour information and the relative position relationship; and determine the detection result of the foaming area based on the temperature difference between the temperature corresponding to the regional position in the infrared image and the ambient temperature.
[0112] For the product to be tested, the relative position relationship between the target panel and the foaming area of the product to be tested is determined. When the position of the target panel is determined, the regional position of the foaming area in the visible light image can be calculated based on the relative position relationship. By calculating the regional position of the foaming area, the accuracy of the foaming area detection is improved, and then the difference between the temperature of the regional position and the ambient temperature is used to detect whether the foaming area is uniform, which can reduce the impact of the regional position error on the detection result and improve the accuracy of the detection result. Of course, it is not necessary to achieve all the advantages described above at the same time when implementing any product or method of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0113] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0114] Figure 1 A flow chart of a method for detecting a foaming area provided in an embodiment of the present application;
[0115] Figure 2 A schematic diagram of the margin between the foaming area of the product to be tested and the panel on which it is located provided in an embodiment of the present application;
[0116] Figure 3 for Figure 1 A specific flow chart of step S103 in the illustrated embodiment;
[0117] FIG4 (a) is another schematic diagram of the margin between the foaming area of the product to be tested and the panel on which it is located provided in an embodiment of the present application;
[0118] FIG4( b ) is a schematic diagram of an image margin between a foaming area of a product to be tested and a panel on which the foaming area is located provided in an embodiment of the present application;
[0119] FIG5 (a) is a schematic diagram of a target vertex of a foaming area provided in an embodiment of the present application;
[0120] FIG5( b ) is another schematic diagram of the target vertex of the foaming area provided in an embodiment of the present application;
[0121] FIG6 (a) is a schematic diagram of the length ratio and width ratio of the foaming area and the target panel provided in an embodiment of the present application;
[0122] FIG6 ( b ) is a schematic diagram of the length-to-width ratio of the foaming area provided in an embodiment of the present application;
[0123] Figure 7 A schematic diagram of a foaming area provided in an embodiment of the present application;
[0124] Figure 8 Another schematic diagram of the foaming area provided in the embodiment of the present application;
[0125] FIG9 (a) is a schematic diagram of a module included in an electronic device in a specific example provided in an embodiment of the present application;
[0126] FIG9 ( b ) is a schematic diagram of the execution process of the method for detecting the foaming area in the specific example provided in the embodiment of the present application;
[0127] Fig.10 A schematic diagram of the structure of a detection device for a foaming area provided in an embodiment of the present application;
[0128] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0129] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.
[0130] In order to accurately determine the foaming area of a product in the visible light image of the product, and thereby improve the accuracy of the detection results of the foaming area, an embodiment of the present application provides a foaming area detection method, device, electronic device, computer-readable storage medium and computer program product. The following is first an introduction to a foaming area detection method provided in an embodiment of the present application.
[0131] The foaming area detection method provided in the embodiment of the present application can be applied to any electronic device that can perform image detection. For example, it can be an image processing device in an image detection system, a server for performing image detection, etc., which is not specifically limited here. For the sake of clarity of description, it is subsequently referred to as an electronic device.
[0132] like Figure 1 As shown, a method for detecting a foaming area, the method comprising:
[0133] S101: Acquire the relative position relationship between the foaming area of the product to be tested and the target panel where it is located, as well as the visible light image and infrared image of the product to be tested.
[0134] Wherein, the visible light image and the infrared image include the target panel.
[0135] S102: Detecting contour information of the target panel from the visible light image.
[0136] S103: Calculating the regional position of the foaming region in the visible light image according to the contour information and the relative position relationship.
[0137] S104: Determine the detection result of the foaming area based on the temperature difference between the temperature corresponding to the area position in the infrared image and the ambient temperature.
[0138] According to the technical solution provided by the embodiment of the present application, the electronic device can obtain the relative position relationship between the foaming area of the product to be tested and the target panel where it is located, as well as the visible light image and infrared image of the product to be tested, wherein the visible light image and the infrared image include the target panel; detect the contour information of the target panel from the visible light image; calculate the regional position of the foaming area in the visible light image based on the contour information and the relative position relationship; and determine the detection result of the foaming area based on the temperature difference between the temperature corresponding to the regional position in the infrared image and the ambient temperature.
[0139] For the product to be tested, the relative position relationship between the target panel and the foaming area of the product to be tested is determined. When the position of the target panel is determined, the regional position of the foaming area in the visible light image can be calculated based on the relative position relationship. By calculating the regional position of the foaming area, the accuracy of foaming area detection is improved, and then the difference between the temperature of the regional position and the ambient temperature is used to detect whether the foaming area is uniform, which can reduce the influence of the regional position error on the detection result and improve the accuracy of the detection result.
[0140] For heat preservation products such as refrigerators and water heaters, the heat preservation function is achieved by the foaming area between the outer shell and the inner shell. The uniformity of the foaming area directly affects the product performance. Based on this, testing whether the foaming area of the product is uniform is an important part of production.
[0141] Since the foaming area can prevent the temperature of the product from diffusing, when the foaming area is uniform, the temperature difference between the panel where the foaming area is located in the infrared image and the ambient temperature is small. However, when the foaming area is uneven, since the internal temperature of the product diffuses to the panel where the foaming area is located, under the influence of the internal temperature of the product, the temperature difference between the panel where the foaming area is located in the infrared image and the ambient temperature is large.
[0142] Therefore, the uniformity of the foaming area of the product to be tested can be tested based on the visible light image and the infrared image of the target panel where the foaming area of the product to be tested is located.
[0143] In the above step S101, the electronic device can obtain the relative position relationship between the foaming area of the product to be tested and the target panel where it is located, as well as the visible light image and infrared image of the product to be tested, wherein the visible light image and infrared image include the target panel.
[0144] When testing the uniformity of the foaming area of a product, the electronic device can obtain a visible light image and an infrared image of the product to be tested, wherein both the visible light image and the infrared image of the product to be tested include the target panel where the foaming area is located.
[0145] In one implementation, the electronic device may be equipped with a first image acquisition device for acquiring visible light images, and a second image acquisition device for acquiring infrared images. The electronic device may use the first image acquisition device and the second image acquisition device carried by the electronic device to acquire visible light images and infrared images of the product to be tested. Since both the visible light image and the infrared image are carried on the same electronic device, by setting the acquisition parameters of the visible light image and the infrared image, the visible light image and the infrared image can acquire the image of the product to be tested at the same viewing angle, and the position of the target panel in the visible light image and the infrared image is corresponding, and accordingly, the position of the foaming area in the visible light image and the infrared image is corresponding.
[0146] In one implementation, an image acquisition device communicating with the electronic device may be used to acquire visible light images and infrared images of the product to be tested, and the electronic device may obtain visible light images and infrared images of the product to be tested acquired by other image acquisition devices.
[0147] In one implementation, the electronic device may be equipped with a first image acquisition device for acquiring visible light images. The electronic device may acquire visible light images of the product to be tested, and acquire infrared images of the product to be tested by communicating with the image acquisition device for acquiring infrared images.
[0148] Accordingly, in one implementation, the electronic device may be equipped with a second image acquisition device for acquiring infrared images. The electronic device may acquire infrared images of the product to be tested, and obtain visible light images of the product to be tested by communicating with other image acquisition devices for acquiring visible light images.
[0149] As an implementation manner of the embodiment of the present application, the foaming area is between the target panel and the inner shell of the product to be tested, and the target panel covers the foaming area.
[0150] Since the foaming area of the product to be tested is located between the target panel and the inner shell of the product to be tested, and the foaming area is located inside the target panel, the foaming area is blocked by the target panel both on the actual product and in the visible light image of the product. The position of the foaming area cannot be directly determined either on the target panel of the product to be tested or in the visible light image and infrared image of the product to be tested.
[0151] For the product to be tested, the foaming area of the product is fixed, and the relative position relationship between the foaming area of the product and the target panel where the foaming area is located is determined.
[0152] The relative position relationship may include the actual margin between the foaming area and the target panel, the proportional relationship between the actual margin between the foaming area and the target panel and the actual size of the target panel, and other data that can characterize the relative position between the foaming area and the target panel. Of course, the relative position relationship may also include the actual aspect ratio of the foaming area, the first proportional relationship between the foaming area and the target panel in the length direction, etc., which are not specifically limited here.
[0153] For example, Figure 2 As shown, a foaming area 210 can be provided between the back plate and the inner shell of the refrigerator, and a foaming area 220 can be provided between the side plate and the inner shell of the refrigerator. After filling, the left margin, right margin, top margin and bottom margin between the foaming area 210 and the back plate are all determined, and the margins between the foaming area 220 and the side plate are also determined.
[0154] Since the relative positional relationship between the foaming area and the target panel where it is located is fixed, in the visible light image of the product to be tested, the position of the foaming area and the target panel where it is located also satisfies the above relative positional relationship. Based on this, the electronic device can obtain the relative positional relationship between the foaming area of the product to be tested and the target panel where it is located, and use the relative positional relationship to determine the regional position of the foaming area in the visible light image.
[0155] In one implementation, when the relative position relationship between the bubble area and the target panel where it is located is the actual margin between the bubble area and the target panel, the electronic device can also obtain the actual size of the target panel after obtaining the relative position relationship between the bubble area and the target panel where it is located, and calculate the proportional relationship between the actual margin between the bubble area and the target panel and the actual size of the target panel.
[0156] Furthermore, in the above step S102, the electronic device may detect contour information of the target panel from the visible light image.
[0157] After acquiring the visible light image of the product to be tested, the electronic device can detect the contour information of the target panel of the product to be tested from the visible light image, wherein the contour information includes the vertex coordinates of the target panel and the contour size of the target panel.
[0158] In one implementation, the electronic device may use a preset contour extraction algorithm to extract contour information of the target panel in the visible light image.
[0159] In one implementation, the electronic device may use a preset instance segmentation algorithm to segment a target panel of the product to be tested from the visible light image, and then extract contour information of the target panel.
[0160] In the above step S103, the electronic device may calculate the regional position of the foaming region in the visible light image according to the contour information and the relative position relationship.
[0161] After acquiring the contour information of the target panel in the visible light image and the relative position relationship between the foaming area and the target panel, the electronic device can calculate the area position of the foaming area in the visible light image using the contour information and the relative position relationship.
[0162] In one implementation, when the relative position relationship is a ratio relationship between the actual margin between the foaming region and the target panel and the actual size of the target panel, the electronic device can calculate the image margin between the foaming region and the target panel in the visible light image using the above contour information and the above ratio relationship, and then calculate the regional position of the foaming region in the visible light image using the coordinates of each vertex of the target panel and the above image margin.
[0163] In one implementation, when the relative position relationship is a ratio relationship between the actual margin between the foaming region and the target panel and the actual size of the target panel, the electronic device can calculate the image margin between the foaming region and the target panel in the visible light image using the above contour information and the above ratio relationship. Then, using the contour of the target panel and the above image margin, a straight line where the edge of the foaming region is located is constructed to obtain the regional position of the foaming region.
[0164] In the above step S104, the electronic device may determine the detection result of the foaming area based on the temperature difference between the temperature corresponding to the area position in the infrared image and the ambient temperature.
[0165] Since the foaming area can prevent the temperature of the product from diffusing, when the foaming area is uniform, the temperature difference between the panel where the foaming area is located in the infrared image and the ambient temperature is small. However, when the foaming area is uneven, since the internal temperature of the product diffuses to the panel where the foaming area is located, under the influence of the internal temperature of the product, the temperature difference between the panel where the foaming area is located in the infrared image and the ambient temperature is large.
[0166] Since infrared images can present the temperature values of each area in the image, after the electronic device determines the regional position of the foaming area in the visible light image, it can further determine the temperature corresponding to the regional position in the infrared image, and then determine the detection result of the foaming area based on the temperature difference between the temperature of the regional position in the infrared image and the ambient temperature.
[0167] In one implementation, when the image acquisition parameters of the visible light image and the infrared image match, the temperature of the area in the infrared image that is at the same position as the area can be determined as the temperature corresponding to the area position in the infrared image, and the temperature difference between the temperature and the ambient temperature can be calculated to determine the detection result of the foaming area.
[0168] In one implementation, when the image acquisition parameters of the visible light image and the infrared image do not match, the visible light image and the infrared image can be matched, and the temperature of the area in the infrared image that matches the position of the area is determined as the temperature corresponding to the position of the area in the infrared image, and the temperature difference between the temperature and the ambient temperature is calculated to determine the detection result of the foaming area.
[0169] In one implementation, when it is determined that the temperature difference between the temperature corresponding to the area in the infrared image and the ambient temperature is greater than a preset temperature difference threshold, the detection result of the foaming area is determined to be that the foaming area is uneven; when it is determined that the temperature difference between the temperature corresponding to the area in the infrared image and the ambient temperature is not greater than the preset temperature difference threshold, the detection result of the foaming area is determined to be that the foaming area is uniform.
[0170] It can be seen that the technical solution provided by the embodiment of the present application can obtain the relative position relationship between the foaming area of the product to be tested and the target panel where it is located, as well as the visible light image and infrared image of the product to be tested, wherein the visible light image and the infrared image include the target panel; detect the contour information of the target panel from the visible light image; calculate the regional position of the foaming area in the visible light image based on the contour information and the relative position relationship; determine the detection result of the foaming area based on the temperature difference between the temperature corresponding to the regional position in the infrared image and the ambient temperature. For the product to be tested, the relative position relationship between the target panel and the foaming area of the product to be tested is determined. When the position of the target panel is determined, the regional position of the foaming area in the visible light image can be calculated based on the relative position relationship. By calculating the regional position of the foaming area, the accuracy of the foaming area detection is improved, and then the uniformity of the foaming area is detected based on the difference between the temperature of the regional position and the ambient temperature, which can reduce the influence of the regional position error on the detection result and improve the accuracy of the detection result.
[0171] As an implementation method of the present application, Figure 3 As shown, the above step S103, i.e. the step of calculating the regional position of the foaming region in the visible light image according to the contour information and the relative position relationship, may include:
[0172] S301: Calculating an image margin between the foaming area and the target panel in the visible light image according to the contour information and the relative position relationship.
[0173] The contour information includes vertex coordinates and / or contour size of the target panel; the relative position relationship includes a proportional relationship between an actual margin between the foaming area and the target panel and an actual size of the target panel.
[0174] The relative positional relationship between the foaming area and the target panel where the foaming area is located obtained by the electronic device includes a proportional relationship between an actual margin between the foaming area and the target panel and an actual size of the target panel. Whether in an actual product or in various images of the target panel, the positional relationship between the foaming area and the target panel satisfies the above relative positional relationship, that is, whether in an actual product or in various images of the target panel, the margin between the foaming area and the target panel and the size of the target panel satisfy the above proportional relationship.
[0175] The contour information includes the vertex coordinates and / or contour size of the target panel in the visible light image, that is, the contour information can be the vertex coordinates and contour size of the target panel in the visible light image; the contour information can be the vertex coordinates of the target panel in the visible light image; the contour information can be the contour size of the target panel in the visible light image.
[0176] In one implementation, the contour information may be the vertex coordinates of the target panel in the visible light image. Based on the vertex coordinates of the target panel in the visible light image, the electronic device may calculate the contour size of the target panel. For example, when the target panel is a rectangle, the contour length of the target panel may be calculated based on the two vertex coordinates in the length direction, and the contour width of the target panel may be calculated based on the two vertex coordinates in the width direction; when the target panel is a circle, the radius of the target panel may be calculated based on the coordinates of the center of the target panel and the points on the circumference.
[0177] According to the contour information of the target panel in the visible light image and the proportional relationship between the actual margin between the foaming area and the target panel and the actual size of the target panel, the electronic device can calculate the image margin between the foaming area and the target panel in the visible light image.
[0178] In one implementation, the contour information may be the vertex coordinates of the target panel in the visible light image. Based on the vertex coordinates of the target panel in the visible light image, the electronic device may calculate the contour size of the target panel, and calculate the product of the contour size and the proportional relationship between the actual margin between the bubbled area and the target panel and the actual size of the target panel to obtain the image margin between the bubbled area and the target panel in the visible light image.
[0179] In one implementation, the contour information may be the contour size of the target panel in the visible light image. The electronic device may calculate the contour size of the target panel and the product of the proportional relationship between the actual margin between the bubble area and the target panel and the actual size of the target panel to obtain the image margin between the bubble area and the target panel in the visible light image.
[0180] S302: Calculate the region position of the bubble region in the visible light image according to the contour information and the image margin.
[0181] The electronic device may calculate the regional position of the foaming region in the visible light image according to the contour information of the target panel in the visible light image and the image margin between the foaming region and the target panel.
[0182] In one implementation, the contour information may be the vertex coordinates of the target panel in the visible light image, and the electronic device may calculate the vertex coordinates of the four target vertices of the bubble area in the visible light image based on the four vertex coordinates of the target panel in the visible light image and the image margin between the bubble area and the target panel.
[0183] In one implementation, the contour information may be the vertex coordinates of the target panel in the visible light image. The electronic device may construct, for each edge of the target panel in the visible light image, a straight line within the contour of the target panel that is parallel to the edge and at a distance from the edge being the target image margin, based on the image margin of the target panel in the visible light image and between the foaming area and the target panel, wherein the target image margin is the image margin between the edge of the foaming area in the visible light image that is parallel to and close to the edge and the edge; and the regional position of the area enclosed by the four constructed straight lines is determined as the regional position of the foaming area in the visible light image.
[0184] In this embodiment, the electronic device can calculate the image margin between the foaming area and the target panel in the visible light image according to the contour information of the target panel in the visible light image and the proportional relationship between the actual margin between the foaming area and the target panel and the actual size of the target panel, and then calculate the regional position of the foaming area in the visible light image according to the contour information and the image margin. Since the proportional relationship between the actual margin between the foaming area and the target panel and the actual size of the target panel is fixed, and the image margin between the foaming area and the target panel in the visible light image and the contour size of the target panel also satisfy the above proportional relationship, then according to the proportional relationship and the contour information of the target panel, the image margin between the foaming area and the target panel in the visible light image can be calculated, and according to the above contour information and the image margin, the regional position of the foaming area can be further calculated, thereby accurately calculating the regional position of the foaming area in the visible light image.
[0185] As an implementation method of the embodiment of the present application, the target panel and the foaming area are rectangular areas;
[0186] The above step S301, i.e., the step of calculating the image margin between the foaming area in the visible light image and the target panel according to the contour information and the relative position relationship, may include:
[0187] Calculating the contour length and multiplying the lengthwise proportional relationship between the target panel and the foaming region to obtain at least one image margin between the foaming region and the target panel in the visible light image;
[0188] The contour width is calculated and multiplied by the proportional relationship corresponding to the margins of the target panel and the foaming area in the width direction to obtain at least one image margin of the foaming area and the target panel in the visible light image in the width direction.
[0189] The image margin between the bubbled area and the target panel in the visible light image satisfies the proportional relationship between the actual margin between the target panel and the bubbled area and the actual size of the target panel, and the image margin between the target panel and the bubbled area can be calculated based on the proportional relationship between the actual margin between the target panel and the bubbled area and the actual size of the target panel, as well as the contour size of the target panel in the visible light image.
[0190] In the case where the target panel and the foaming area are rectangular areas, in order to facilitate understanding of a foaming area detection method provided in an embodiment of the present application, the implementation method of the embodiment of the present application is described by taking the case where each side of the target panel is parallel to the coordinate axis of the image coordinate system, and each side of the foaming area is parallel to the corresponding side of the target panel as an example. In the case where each side of the target panel is at a certain angle to the coordinate axis of the image coordinate system, and / or each side of the foaming area is at a certain angle to the corresponding side of the target panel, the position information of the foaming area can be calculated according to the angle relationship according to the method provided in the present application. The electronic device can calculate the contour length, the product of the proportional relationship corresponding to the margin of the target panel and the foaming area in the length direction, and obtain at least one image margin between the foaming area and the target panel in the length direction in the visible light image; and calculate the contour width, the product of the proportional relationship corresponding to the margin of the target panel and the foaming area in the width direction, and obtain at least one image margin between the foaming area and the target panel in the width direction in the visible light image.
[0191] When the contour information is the vertex coordinates of the target panel in the visible light image, the electronic device can calculate the contour size of the target panel according to the vertex coordinates of the target panel in the visible light image to obtain the contour length and width of the target panel.
[0192] For example, as shown in Fig. 4(a), the direction where the edge 410 of the target panel is located is the length direction, and the direction where the edge 420 of the target panel is located is the width direction. The actual length of the target panel is a, and the actual width is b.
[0193] The actual margins of the target panel and the foaming area in the width direction are the upper margin margin (difference) 1 and the lower margin margin (difference) 2. The corresponding proportional relationship of the margins of the target panel and the foaming area in the width direction includes the ratio of the upper margin margin1 to the actual width b of the target panel margin1 / b, and the ratio of the lower margin margin2 to the actual width b of the target panel margin2 / b. Correspondingly, the actual margins of the target panel and the foaming area in the length direction are the left margin margin (difference) 3 and the right margin margin (difference) 4. The corresponding proportional relationship of the margins of the target panel and the foaming area in the length direction is the ratio of the left margin margin3 to the actual length a of the target panel margin3 / a, and the ratio of the right margin margin4 to the actual length a of the target panel margin4 / a.
[0194] As shown in FIG4( b ), in the visible light image, the contour length of the target panel is L, the contour width is W, and the image margin between the foaming area and the target panel in the visible light image in the width direction (Y direction) includes the upper image margin W×margin (difference) 1 / b and the lower image margin W×margin (difference) 2 / b; the image margin between the foaming area and the target panel in the visible light image in the length direction (X direction) includes the left image margin L×margin (difference) 3 / a and the right image margin L×margin (difference) 4 / a.
[0195] In one implementation, when the target panel and the foaming area are circular, the contour information of the target panel includes the image radius of the target panel in the visible light image; the relative position relationship is the proportional relationship between the radius difference between the foaming area and the target panel and the actual radius of the target panel. The electronic device can calculate the image radius of the target panel and multiply it by the proportional relationship between the target panel and the foaming area to obtain the image radius of the foaming area in the visible light image. According to the distance between the center of the foaming area and the center of the target panel, and the image radius of the foaming area, the position information of the foaming area can be calculated.
[0196] In one implementation, when the target panel is rectangular and the foaming area is circular, the relative position relationship is the proportional relationship between the actual distance between the center of the foaming area and each side of the target panel and the actual size of the target panel, and the proportional relationship between the radius of the foaming area and the length of the target panel. The electronic device can calculate the contour size of the target panel and the product of the proportional relationship between the target panel and the foaming area to obtain the image distance between the center of the foaming area and each side of the target panel in the visible light image. The center of the foaming area, the contour size, and the proportional relationship between the radius of the foaming area and the length of the target panel are calculated based on the image distance, and the position information of the foaming area can be calculated.
[0197] The above is merely an example and not a limitation of the method for calculating the regional position of the foaming area when the target panel and the foaming area are in different shapes.
[0198] In this embodiment, when the target panel and the foaming area are rectangular, the electronic device can calculate the contour length, multiply the product of the proportional relationship between the target panel and the foaming area in the length direction, and obtain at least one image margin between the foaming area and the target panel in the length direction in the visible light image; and calculate the contour width, multiply the product of the proportional relationship between the target panel and the foaming area in the width direction, and obtain at least one image margin between the foaming area and the target panel in the width direction in the visible light image. In this way, since the image margin between the foaming area and the target panel and the contour size of the target panel in the visible light image meet the proportional relationship between the actual margin between the foaming area and the target panel and the actual size of the target panel, the image margin between the foaming area and the target panel can be accurately calculated by using the proportional relationship and the contour size of the target panel, and then the regional position of the foaming area can be further calculated by using the image margin, thereby improving the accuracy of the calculated regional position of the foaming area.
[0199] As an implementation of an embodiment of the present application, the above step S302, i.e., the step of calculating the regional position of the bubble region in the visible light image according to the contour information and the image margin, may include:
[0200] Calculate the vertex coordinates of the first target vertex of the foaming area corresponding to the first panel vertex according to the vertex coordinates of the first panel vertex of the target panel, the image margin corresponding to the first panel vertex in the length direction, and the image margin corresponding to the first panel vertex in the width direction;
[0201] Based on the contour information, vertex coordinates of other target vertices of the foaming area are calculated.
[0202] Based on the first panel vertex and the positional relationship between the bubble region and the first target vertex corresponding to the first panel vertex, the electronic device can calculate the vertex coordinates of the first target vertex corresponding to the bubble region and the first panel vertex according to the vertex coordinates of the first panel vertex of the target panel, the image margin corresponding to the first panel vertex in the length direction, and the image margin corresponding to the first panel vertex in the width direction. The image margin corresponding to the first panel vertex in the length direction is the image margin related to the first panel vertex in the two image margins in the length direction of the bubble region and the target panel, for example, when the first panel vertex is the upper left corner vertex, the image margin related to the first panel vertex is the upper image margin; the image margin corresponding to the first panel vertex in the width direction is the image margin related to the first panel vertex in the two image margins in the width direction of the bubble region and the target panel, for example, when the first panel vertex is the upper left corner vertex, the image margin related to the first panel vertex is the left image margin.
[0203] In one implementation, when the coordinate value of the first panel vertex in the length direction is greater than the coordinate value of the first target vertex in the length direction, and the coordinate value of the first panel vertex in the width direction is greater than the coordinate value of the first target vertex in the length direction, the electronic device can calculate the difference between the coordinate value in the length direction of the vertex coordinates of the first panel vertex and the image margin corresponding to the first panel vertex in the length direction, and calculate the difference between the coordinate value in the width direction of the vertex coordinates of the first panel vertex and the image margin corresponding to the first panel vertex in the width direction, to obtain the vertex coordinates of the first target vertex.
[0204] In one implementation, when the coordinate value of the first panel vertex in the length direction is greater than the coordinate value of the first target vertex in the length direction, and the coordinate value of the first panel vertex in the width direction is less than the coordinate value of the first target vertex in the length direction, the electronic device can calculate the difference between the coordinate value in the length direction of the vertex coordinates of the first panel vertex and the image margin corresponding to the first panel vertex in the length direction, and calculate the sum of the coordinate value in the width direction of the vertex coordinates of the first panel vertex and the image margin corresponding to the first panel vertex in the width direction, to obtain the vertex coordinates of the first target vertex.
[0205] In one implementation, when the coordinate value of the first panel vertex in the length direction is smaller than the coordinate value of the first target vertex in the length direction, and the coordinate value of the first panel vertex in the width direction is larger than the coordinate value of the first target vertex in the length direction, the electronic device can calculate the sum of the coordinate value in the length direction of the vertex coordinates of the first panel vertex and the image margin corresponding to the first panel vertex in the length direction, and calculate the difference between the coordinate value in the width direction of the vertex coordinates of the first panel vertex and the image margin corresponding to the first panel vertex in the width direction, to obtain the vertex coordinates of the first target vertex.
[0206] In one implementation, when the coordinate value of the first panel vertex in the length direction is smaller than the coordinate value of the first target vertex in the length direction, and the coordinate value of the first panel vertex in the width direction is smaller than the coordinate value of the first target vertex in the length direction, the electronic device can calculate the sum of the coordinate value in the length direction of the vertex coordinates of the first panel vertex and the image margin corresponding to the first panel vertex in the length direction, and calculate the sum of the coordinate value in the width direction of the vertex coordinates of the first panel vertex and the image margin corresponding to the first panel vertex in the width direction, to obtain the vertex coordinates of the first target vertex.
[0207] For example, as shown in FIG5(a), the contour length of the target panel is L, the contour width is W, and the vertex coordinates of the first panel vertex A of the target panel in the image coordinate system XY are (M, N). The image margins corresponding to the first panel vertex A include the image top margin W×margin1 / b and the image left margin L×margin3 / a, and the vertex coordinates of the first target vertex a corresponding to the foaming area and the first panel vertex are (M+L×margin3 / a, NW×margin1 / b).
[0208] After calculating the vertex coordinates of the first target vertex in the foaming area corresponding to the vertex of the first panel, the electronic device may continue to calculate the vertex coordinates of other target vertices in the foaming area based on the contour information of the target panel.
[0209] In one implementation, the electronic device may calculate the vertex coordinates of the second target vertices corresponding to the second panel vertices of the bubble area based on the vertex coordinates of the second panel vertices of the target panel, the image margin corresponding to the second panel vertices in the length direction, and the image margin corresponding to the second panel vertices in the width direction. Accordingly, the electronic device may calculate the vertex coordinates of the third target vertices corresponding to the bubble area and the third panel vertices based on the vertex coordinates of the third panel vertices of the target panel, the image margin corresponding to the third panel vertex in the length direction, and the image margin corresponding to the third panel vertex in the width direction, and calculate the vertex coordinates of the fourth target vertex corresponding to the bubble area and the fourth panel vertex based on the vertex coordinates of the fourth panel vertex of the target panel, the image margin corresponding to the fourth panel vertex in the length direction, and the image margin corresponding to the fourth panel vertex in the width direction.
[0210] In one implementation, the relative positional relationship between the bubble area and the target panel may also include a preset actual length-to-width ratio of the bubble area. The electronic device may calculate the vertex coordinates of the second target vertex corresponding to the bubble area and the second panel vertex based on the vertex coordinates of the second panel vertex of the target panel, the image margin corresponding to the second panel vertex in the length direction, and the image margin corresponding to the second panel vertex in the width direction. The length or width of the bubble area is calculated based on the positional relationship between the first target vertex and the second target vertex, and then the image size of the bubble area is calculated based on the actual length-to-width ratio of the bubble area, and then the third target vertex and the fourth target vertex of the bubble area are calculated based on the first target vertex, the second target vertex and the image size of the bubble area.
[0211] In this embodiment, the electronic device can calculate the vertex coordinates of the first target vertex corresponding to the first panel vertex of the foaming area according to the vertex coordinates of the first panel vertex of the target panel, the image margin corresponding to the first panel vertex in the length direction, and the image margin corresponding to the first panel vertex in the width direction; and calculate the vertex coordinates of other target vertices in the foaming area based on the contour information. In this way, by calculating the coordinates of each target vertex in the foaming area, each target vertex in the foaming area can be calculated to obtain the regional position of the foaming area in the visible light image.
[0212] As an implementation of an embodiment of the present application, the step of calculating the vertex coordinates of other target vertices of the foaming area based on the contour information includes:
[0213] Based on the contour information, calculating vertex coordinates of a second target vertex adjacent to the first target vertex;
[0214] Based on the first target vertex, the second target vertex, and the relative positional relationship, vertex coordinates of other target vertices in the foaming area are calculated.
[0215] After calculating the first target vertex of the foaming area, the electronic device can continue to calculate the vertex coordinates of the second target vertex adjacent to the first target vertex based on the contour information. Thereafter, based on the first target vertex, the second target vertex and the relative position relationship, the vertex coordinates of other target vertices in the foaming area are calculated.
[0216] Since the first target vertex and the second target vertex are adjacent to each other, the length or width of the foaming area can be calculated based on the first target vertex and the second target vertex.
[0217] In one implementation, the relative position relationship also includes a first proportional relationship between the preset foaming area and the target panel in the length direction, and a second proportional relationship between the preset foaming area and the target panel in the width direction. The electronic device can calculate the vertex coordinates of the third target vertex adjacent to the first target vertex in the width direction according to the first target vertex, the contour width, and the second proportional relationship; and calculate the vertex coordinates of the fourth target vertex adjacent to the second target vertex in the width direction according to the second target vertex, the contour width, and the second proportional relationship.
[0218] In one implementation, the relative position relationship also includes a preset actual length-to-width ratio of the foaming area. The electronic device can calculate the first length of the first edge where the first target vertex and the second target vertex are located based on the first target vertex and the second target vertex; and calculate the second length of the adjacent side of the first edge based on the first length and the actual length-to-width ratio of the foaming area; and then calculate the vertex coordinates of other target vertices in the foaming area based on the first length, the second length, the first target vertex and the second target vertex.
[0219] In this embodiment, the electronic device can calculate the vertex coordinates of the second target vertex adjacent to the first target vertex based on the contour information, and calculate the vertex coordinates of other target vertices in the foaming area based on the first target vertex, the second target vertex and the relative position relationship. In this way, each target vertex in the foaming area can be calculated in turn to obtain the area position of the foaming area.
[0220] As an implementation of an embodiment of the present application, the step of calculating the vertex coordinates of other target vertices of the foaming area based on the contour information includes:
[0221] Calculate the vertex coordinates of the second target vertex corresponding to the second panel vertex in the foaming area according to the vertex coordinates of the second panel vertex of the target panel, the image margin corresponding to the second panel vertex in the length direction, and the image margin corresponding to the second panel vertex in the width direction;
[0222] Calculate the vertex coordinates of the third target vertex corresponding to the third panel vertex in the foaming area according to the vertex coordinates of the third panel vertex of the target panel, the image margin corresponding to the third panel vertex in the length direction, and the image margin corresponding to the third panel vertex in the width direction;
[0223] The vertex coordinates of the fourth target vertex corresponding to the fourth panel vertex in the foaming area are calculated based on the vertex coordinates of the fourth panel vertex of the target panel, the image margin corresponding to the fourth panel vertex in the length direction, and the image margin corresponding to the fourth panel vertex in the width direction.
[0224] When the electronic device obtains the vertex coordinates of each panel vertex of the target panel and the image area between the target panel and the bubble area, the electronic device can continue to calculate the vertex coordinates of the second target vertex corresponding to the bubble area and the second panel vertex based on the vertex coordinates of the second panel vertex of the target panel, the image margin corresponding to the second panel vertex in the length direction, and the image margin corresponding to the second panel vertex in the width direction.
[0225] The electronic device can also calculate the vertex coordinates of the third target vertex corresponding to the third panel vertex of the bubble area based on the vertex coordinates of the third panel vertex of the target panel, the image margin corresponding to the third panel vertex in the length direction, and the image margin corresponding to the third panel vertex in the width direction, and calculate the vertex coordinates of the fourth target vertex corresponding to the bubble area and the fourth panel vertex based on the vertex coordinates of the fourth panel vertex of the target panel, the image margin corresponding to the fourth panel vertex in the length direction, and the image margin corresponding to the fourth panel vertex in the width direction.
[0226] For each target vertex, the numerical relationship between the vertex coordinates of the target vertex and the vertex coordinates of the corresponding panel vertex can be determined according to the positional relationship between the vertex coordinates of the target vertex and the vertex coordinates of the corresponding panel vertex. Taking the second target vertex as an example, the calculation method of the second target vertex, the third target vertex and the fourth target vertex is explained.
[0227] In two implementation methods, when the coordinate value of the second panel vertex in the length direction is greater than the coordinate value of the second target vertex in the length direction, and the coordinate value of the second panel vertex in the width direction is greater than the coordinate value of the second target vertex in the length direction, the electronic device can calculate the difference between the coordinate value in the length direction of the vertex coordinates of the second panel vertex and the image margin corresponding to the second panel vertex in the length direction, and calculate the difference between the coordinate value in the width direction of the vertex coordinates of the second panel vertex and the image margin corresponding to the second panel vertex in the width direction, to obtain the vertex coordinates of the second target vertex.
[0228] In two implementations, when the coordinate value of the second panel vertex in the length direction is greater than the coordinate value of the second target vertex in the length direction, and the coordinate value of the second panel vertex in the width direction is less than the coordinate value of the second target vertex in the length direction, the electronic device can calculate the difference between the coordinate value in the length direction of the vertex coordinates of the second panel vertex and the image margin corresponding to the second panel vertex in the length direction, and calculate the sum of the coordinate value in the width direction of the vertex coordinates of the second panel vertex and the image margin corresponding to the second panel vertex in the width direction to obtain the vertex coordinates of the second target vertex.
[0229] In two implementations, when the coordinate value of the second panel vertex in the length direction is smaller than the coordinate value of the second target vertex in the length direction, and the coordinate value of the second panel vertex in the width direction is larger than the coordinate value of the second target vertex in the length direction, the electronic device can calculate the sum of the coordinate value in the length direction of the vertex coordinates of the second panel vertex and the image margin corresponding to the second panel vertex in the length direction, and calculate the difference between the coordinate value in the width direction of the vertex coordinates of the second panel vertex and the image margin corresponding to the second panel vertex in the width direction, to obtain the vertex coordinates of the second target vertex.
[0230] In two implementations, when the coordinate value of the second panel vertex in the length direction is smaller than the coordinate value of the second target vertex in the length direction, and the coordinate value of the second panel vertex in the width direction is smaller than the coordinate value of the second target vertex in the length direction, the electronic device can calculate the sum of the coordinate value in the length direction of the vertex coordinates of the second panel vertex and the image margin corresponding to the second panel vertex in the length direction, and calculate the sum of the coordinate value in the width direction of the vertex coordinates of the second panel vertex and the image margin corresponding to the second panel vertex in the width direction, to obtain the vertex coordinates of the second target vertex.
[0231] For example, as shown in FIG5(b), the contour length of the target panel is L, the contour width is W, and in the image coordinate system XY, the vertex coordinates of the first panel vertex A of the target panel are (M, N). The image margins corresponding to the first panel vertex A include the image top margin W×margin1 / b, and the image left margin L×margin3 / a, and the vertex coordinates of the first target vertex a corresponding to the foaming area and the first panel vertex are (M+L×margin3 / a, NW×margin1 / b).
[0232] The vertex coordinates of the second panel vertex B of the target panel are (H, I). The image margins corresponding to the second panel vertex B include the image top margin W×margin1 / b and the image right margin L×margin4 / a, and the vertex coordinates of the second target vertex b corresponding to the second panel vertex of the foaming area are (HL×margin4 / a, IW×margin1 / b).
[0233] The vertex coordinates of the third panel vertex C of the target panel are (J, K). The image margins corresponding to the third panel vertex C include the image bottom margin W×margin2 / b and the image left margin L×margin3 / a, and the vertex coordinates of the third target vertex c corresponding to the third panel vertex and the foaming area are (J+L×margin3 / a, K+W×margin2 / b).
[0234] The vertex coordinates of the fourth panel vertex D of the target panel are (O, P). The image margins corresponding to the fourth panel vertex D include the image bottom margin W×margin2 / b and the image right margin L×margin4 / a, and the vertex coordinates of the fourth target vertex d corresponding to the fourth panel vertex of the foaming area are (OL×margin4 / a, P+W×margin2 / b).
[0235] In this embodiment, the electronic device can calculate the vertex coordinates of the second target vertex corresponding to the second panel vertex of the foaming area according to the vertex coordinates of the second panel vertex of the target panel, the image margin corresponding to the second panel vertex in the length direction, and the image margin corresponding to the second panel vertex in the width direction; calculate the vertex coordinates of the third target vertex corresponding to the third panel vertex of the foaming area according to the vertex coordinates of the third panel vertex of the target panel, the image margin corresponding to the third panel vertex in the length direction, and the image margin corresponding to the third panel vertex in the width direction; and calculate the vertex coordinates of the fourth target vertex corresponding to the fourth panel vertex of the target panel according to the vertex coordinates of the fourth panel vertex of the target panel, the image margin corresponding to the fourth panel vertex in the length direction, and the image margin corresponding to the fourth panel vertex in the width direction. In this way, using the four panel vertices and image margins of the target panel, each target vertex of the foaming area can be calculated to determine the regional position of the foaming area.
[0236] As an implementation manner of the embodiment of the present application, the relative position relationship further includes a preset first proportional relationship between the foaming area and the target panel in the length direction, and a preset second proportional relationship between the foaming area and the target panel in the width direction;
[0237] The step of calculating the vertex coordinates of the second target vertex adjacent to the first target vertex based on the contour information may include:
[0238] Calculating the vertex coordinates of a second target vertex adjacent to the first target vertex in the length direction according to the first target vertex, the contour length, and the first proportional relationship;
[0239] The step of calculating the vertex coordinates of other target vertices in the foaming area based on the first target vertex, the second target vertex and the relative position relationship comprises:
[0240] Calculating the vertex coordinates of a third target vertex adjacent to the first target vertex in the width direction according to the first target vertex, the contour width, and the second proportional relationship;
[0241] The vertex coordinates of a fourth target vertex adjacent to the second target vertex in the width direction are calculated according to the second target vertex, the contour width, and the second proportional relationship.
[0242] The relative position relationship between the foaming area and the target panel may further include a preset first proportional relationship between the foaming area and the target panel in the length direction, and a preset second proportional relationship between the foaming area and the target panel in the width direction.
[0243] The electronic device can calculate the vertex coordinates of the second target vertex adjacent to the first target vertex in the length direction based on the first target vertex, the contour length and the first proportional relationship; calculate the vertex coordinates of the third target vertex adjacent to the first target vertex in the width direction based on the first target vertex, the contour width and the second proportional relationship; and calculate the vertex coordinates of the fourth target vertex adjacent to the second target vertex in the width direction based on the second target vertex, the contour width and the second proportional relationship.
[0244] Specifically, after determining the contour information of the target panel, the electronic device can calculate the contour length and contour width of the target panel, and then calculate the product of the contour length and the first proportional relationship to obtain the region length of the foaming region, and calculate the product of the contour width and the second proportional relationship to obtain the region width of the foaming region.
[0245] When the edges of the target panel are respectively parallel to the coordinate axes of the image coordinate system, the coordinate difference in the length direction between the first target vertex and the second target vertex adjacent to it in the length direction is the area length. According to the positional relationship between the first target vertex and the second target vertex, the vertex coordinates of the second target vertex adjacent to the first target vertex in the length direction can be calculated using the vertex coordinates of the first target vertex and the area length.
[0246] The coordinate difference in the width direction between the first target vertex and the third target vertex adjacent to it in the width direction is the area width. The electronic device can calculate the vertex coordinates of the third target vertex adjacent to the first target vertex in the width direction based on the positional relationship between the first target vertex and the third target vertex, using the vertex coordinates of the first target vertex and the area width.
[0247] Correspondingly, the coordinate difference in the width direction between the second target vertex and the fourth target vertex adjacent to it in the width direction is the area width. The electronic device can calculate the vertex coordinates of the fourth target vertex adjacent to the second target vertex in the width direction based on the positional relationship between the second target vertex and the fourth target vertex, using the vertex coordinates of the second target vertex and the area width.
[0248] Exemplarily, the relative position relationship also includes a first proportional relationship between the preset foaming area and the target panel in the length direction, and a second proportional relationship between the preset foaming area and the target panel in the width direction. As shown in FIG6 (a), the contour length of the target panel in the visible light image is L. According to the contour length and the first proportional relationship, the region length l of the foaming area in the visible light image can be calculated. In the image coordinate system XY, the first target vertex a and its adjacent second target vertex b in the length direction have a distance l in the length direction. According to the vertex coordinates (x1, y1) of the first target vertex a and l, the vertex coordinates (x1+l, y1) of b can be calculated.
[0249] The contour width of the target panel in the visible light image is W. According to the contour width and the second proportional relationship, the area width w of the foaming area in the visible light image can be calculated. The distance between the first target vertex a and the third target vertex c adjacent to it in the width direction is w. According to the vertex coordinates (x1, y1) and w of the first target vertex a, the vertex coordinates (x1, y1-w) of c can be calculated.
[0250] The distance between the second target vertex b and the fourth target vertex d adjacent to it in the width direction is w. According to the vertex coordinates (x1+l, y1) of the second target vertex b and w, the vertex coordinates (x1+l, y1-w) of d can be calculated.
[0251] In this embodiment, when the relative position relationship also includes a first proportional relationship between the preset foaming area and the target panel in the length direction, and a second proportional relationship between the preset foaming area and the target panel in the width direction, the electronic device can calculate the vertex coordinates of the second target vertex adjacent to the first target vertex in the length direction according to the first target vertex, the contour length and the first proportional relationship; calculate the vertex coordinates of the third target vertex adjacent to the first target vertex in the width direction according to the first target vertex, the contour width and the second proportional relationship; and calculate the vertex coordinates of the fourth target vertex adjacent to the second target vertex in the width direction according to the second target vertex, the contour width and the second proportional relationship. In this way, using the contour information of the target panel, the first target vertex, the first proportional relationship between the foaming area and the target panel in the length direction, and the second proportional relationship between the foaming area and the target panel in the width direction, the vertex coordinates of the other three target vertices of the foaming area can be calculated to determine the regional position of the foaming area.
[0252] As an implementation of the embodiment of the present application, the relative position relationship further includes a preset actual length-to-width ratio of the foaming area;
[0253] The step of calculating the vertex coordinates of a second target vertex adjacent to the first target vertex based on the contour information comprises:
[0254] Calculate the vertex coordinates of a second target vertex adjacent to the first target vertex according to the vertex coordinates of the adjacent panel vertices of the first panel vertex, the image margins corresponding to the adjacent panel vertices in the length direction, and the image margins corresponding to the adjacent panel vertices in the width direction;
[0255] The step of calculating the vertex coordinates of other target vertices in the foaming area based on the first target vertex, the second target vertex and the relative position relationship comprises:
[0256] Calculate, according to the first target vertex and the second target vertex, a first length of a first edge where the first target vertex and the second target vertex are located;
[0257] Calculating a second length of an adjacent side of the first edge according to the first length and an actual length-to-width ratio of the foaming area;
[0258] The vertex coordinates of other target vertices in the foaming area are calculated according to the second length, the first target vertex, and the second target vertex.
[0259] The relative positional relationship between the foaming region and the target panel where the foaming region is located may also include a preset actual length-to-width ratio of the foaming region.
[0260] The electronic device can calculate the second target vertex of the bubble area based on the vertex coordinates of the adjacent panel vertex of the first panel vertex, the image margin corresponding to the adjacent panel vertex in the length direction, and the image margin corresponding to the adjacent panel vertex in the width direction. Since the adjacent panel vertex is adjacent to the first panel vertex, the second target vertex determined based on the adjacent panel vertex is adjacent to the first target vertex.
[0261] According to the first target vertex and the second target vertex, a first length of a first edge where the first target vertex and the second target vertex are located can be calculated, and the first length is the length or width of the foaming area.
[0262] By calculating the first length and the actual length-to-width ratio of the foaming area, the second length of the adjacent side of the first edge can be calculated, wherein the first length is the length of the foaming area and the second length is the width of the foaming area; or the first length is the width of the foaming area and the second length is the length of the foaming area.
[0263] After determining the second length of the foaming area, the second length and the first target vertex can be used to calculate the third target vertex adjacent to the first target vertex on the second edge; correspondingly, the second length and the second target vertex can be used to calculate the fourth target vertex adjacent to the second target vertex on the second edge.
[0264] In one implementation, the first length and the third target vertex may be used to calculate a fourth target vertex adjacent to the third target vertex on a third edge, wherein the length of the third edge is the first length.
[0265] Exemplarily, the relative position relationship also includes a preset actual length-to-width ratio of the foaming area of 1: 2. As shown in FIG6(b), in the image coordinate system XY, the first length f1 of the first edge where the first target vertex a (x1, y1) and the second target vertex b (x2, y1) of the foaming area are located is x2-x1.
[0266] According to the first length x2-x1 and the actual length-to-width ratio of the foaming area, the second length f2 of the adjacent side of the first edge is calculated to be 2f1.
[0267] The distance between the first target vertex a and the third target vertex c adjacent to it in the width direction is 2f1. According to the vertex coordinates (x1, y1) of the first target vertex a and 2f1, the vertex coordinates (x1, y1-2f1) of c can be calculated.
[0268] The distance between the second target vertex b and the fourth target vertex d adjacent to it in the width direction is 2f1. According to the vertex coordinates (x2, y1) of the second target vertex b and 2f1, the vertex coordinates (x2, y1-2f1) of d can be calculated.
[0269] In this embodiment, when the relative position relationship also includes the preset actual length-width ratio of the foaming area, the electronic device can calculate the vertex coordinates of the second target vertex adjacent to the first target vertex according to the vertex coordinates of the adjacent panel vertices of the first panel vertex, the image margins corresponding to the adjacent panel vertices in the length direction, and the image margins corresponding to the adjacent panel vertices in the width direction; calculate the first length of the first edge where the first target vertex and the second target vertex are located according to the first target vertex and the second target vertex; calculate the second length of the adjacent side of the first edge according to the first length and the actual length-width ratio of the foaming area; and calculate the vertex coordinates of other target vertices in the foaming area according to the second length, the first target vertex and the second target vertex. In this way, using two adjacent panel vertices of the target panel, any three image margins and the preset actual length-width ratio of the foaming area, the vertex coordinates of the four target vertices in the foaming area can be calculated to determine the regional position of the foaming area.
[0270] As an implementation of an embodiment of the present application, the above step S302, i.e., the step of calculating the regional position of the bubble region in the visible light image according to the contour information and the image margin, may include:
[0271] For each edge of the target panel in the visible light image, construct a straight line within the contour of the target panel that is parallel to the edge and at a distance from the edge that is a target image margin, wherein the target image margin is an image margin between an edge of the foaming region in the visible light image that is parallel to and close to the edge and the edge;
[0272] The regional position of the region enclosed by the four constructed straight lines is determined as the regional position of the foaming region in the visible light image.
[0273] When the image margin between the bubble area and the target panel in the visible light image is calculated, the electronic device can construct a straight line parallel to each edge of the target panel in the visible light image and at a distance from the edge equal to the target image margin within the contour of the target panel.
[0274] The target image margin is the image margin between the edge of the foaming area in the visible light image that is parallel to and close to the edge and the edge.
[0275] The four constructed straight lines can enclose an image region within the contour of the target panel, and the image region is the foaming region in the visible light image.
[0276] For example, Figure 7 As shown, for the edges M1-M4 of the target panel, parallel lines parallel to each edge are constructed respectively. Among them, the image margin between the edge M1 of the target panel and the straight line m1 where the edge of the foaming area is located is h1, and within the contour of the target panel, a straight line m1 is constructed which is parallel to the edge M1 and has a distance of h1 from the edge M1; the image margin between the edge M2 of the target panel and the straight line m2 where the edge of the foaming area is located is h2, and within the contour of the target panel, a straight line m2 is constructed which is parallel to the edge M2 and has a distance of h2 from the edge M2; the image margin between the edge M3 of the target panel and the straight line m3 where the edge of the foaming area is located is h3, and within the contour of the target panel, a straight line m3 is constructed which is parallel to the edge M3 and has a distance of h3 from the edge M3; the image margin between the edge M4 of the target panel and the straight line m4 where the edge of the foaming area is located is h4, and within the contour of the target panel, a straight line m4 is constructed which is parallel to the edge M4 and has a distance of h4 from the edge M4. The area enclosed by the straight lines m1 - m4 within the contour of the target panel is the foaming area in the visible light image.
[0277] In this embodiment, the electronic device can construct, for each edge of the target panel in the visible light image, a straight line within the contour of the target panel that is parallel to the edge and at a distance from the edge equal to the target image margin, wherein the target image margin is the image margin between the edge of the foaming area in the visible light image that is parallel to and close to the edge and the edge; and determine the regional position of the area surrounded by the four constructed straight lines as the regional position of the foaming area in the visible light image. In this way, the regional position of the foaming area can be calculated using the regional contour of the target panel and the image margin between the target panel and the foaming area in the visible light image.
[0278] As an implementation of an embodiment of the present application, the relative position relationship also includes a preset actual length-to-width ratio of the foaming area; before the above step S104, that is, the step of determining the detection result of the foaming area based on the temperature difference between the temperature corresponding to the position of the area in the infrared image and the ambient temperature, the foaming area detection method provided by the present application may also include:
[0279] Calculating the length and width of the bubble region in the visible light image based on vertex coordinates of four target vertices of the bubble region, and calculating the current length-to-width ratio of the bubble region in the visible light image;
[0280] When the difference between the current aspect ratio and the actual aspect ratio is greater than a preset ratio threshold, adjusting the region position of the foaming region according to the difference;
[0281] Accordingly, the above step S104, i.e., the step of determining the detection result of the foaming area based on the temperature difference between the temperature corresponding to the area position in the infrared image and the ambient temperature, may include:
[0282] The detection result of the foaming area is determined based on the temperature difference between the temperature corresponding to the adjusted area position in the infrared image and the ambient temperature.
[0283] The relative position relationship may also include a preset actual length-to-width ratio of the foaming area.
[0284] After calculating the four target vertices of the bubble area, in order to verify the accuracy of the calculated position information of the bubble area, a method of constructing a bubble area within the outline of the target panel is adopted using the four panel vertices of the target panel and the four image margins, or using the two panel vertices of the target panel, the contour length, the contour width, the first proportional relationship between the preset bubble area and the target panel in the length direction, and the second proportional relationship between the preset bubble area and the target panel in the width direction, or using the image margin and the contour area of the target panel, and obtaining the four target vertices of the bubble area, in order to verify the accuracy of the calculated position information of the bubble area, the length and width of the bubble area in the visible light image can be calculated according to the vertex coordinates of the four target vertices of the bubble area.
[0285] Afterwards, the current aspect ratio of the foaming area in the visible light image may be calculated, and then the difference between the current aspect ratio and the actual aspect ratio may be determined.
[0286] When the difference is not greater than the preset ratio threshold, the regional position of the current foaming area is relatively accurate, and the temperature difference between the temperature corresponding to the regional position of the foaming area in the infrared image and the ambient temperature can be used to determine the detection result of the foaming area.
[0287] When the difference is greater than the preset ratio threshold, the regional position of the current bubble area is inaccurate, and the regional position of the bubble area can be adjusted according to the difference until the difference between the current aspect ratio of the adjusted bubble area in the visible light image and the actual aspect ratio is no greater than the preset ratio threshold. The detection result of the bubble area is determined based on the temperature difference between the temperature corresponding to the adjusted regional position in the infrared image and the ambient temperature.
[0288] In this embodiment, the electronic device can calculate the length and width of the bubble area in the visible light image based on the vertex coordinates of the four target vertices of the bubble area, and calculate the current length-to-width ratio of the bubble area in the visible light image; when the difference between the current length-to-width ratio and the actual length-to-width ratio is greater than the preset ratio threshold, adjust the regional position of the bubble area according to the difference; and determine the detection result of the bubble area based on the temperature difference between the temperature corresponding to the adjusted regional position in the infrared image and the ambient temperature. In this way, by using the preset actual length-to-width ratio of the bubble area to verify the determined bubble area, the accuracy of the regional position of the determined bubble area can be improved, and then, by using the temperature difference between the temperature corresponding to the relatively accurate regional position in the infrared image and the ambient temperature, the detection result of the bubble area is determined, and the accuracy of the detection result is high.
[0289] As an implementation of the embodiment of the present application, the step of obtaining the relative position relationship between the foaming area of the product to be tested and the target panel where it is located includes:
[0290] Identifying a product identification of the product to be tested in a visible light image of the product to be tested;
[0291] Determine the product size of the product to be tested based on the product identification and the correspondence between the preset product identification and the product size, wherein the product size includes the actual margin between the foaming area and the target panel, the actual size of the target panel where the foaming area of the product to be tested is located, and the actual size of the foaming area;
[0292] Based on the actual margin and the actual size of the target panel, a proportional relationship between the actual margin between the foaming area and the target panel and the actual size of the target panel is calculated.
[0293] The electronic device can store a correspondence between a preset product identification and a product size, wherein the product size includes the actual margin between the foaming area and the target panel, the actual size of the target panel where the foaming area of the product to be tested is located, and the actual size of the foaming area.
[0294] After obtaining the visible light image of the product to be tested, the electronic device can recognize the visible light image and identify the product identification of the product to be tested. For example, OCR (Optical Character Recognition) can be used to recognize the product identification of the product to be tested; or a recognition algorithm can be used to recognize identification information such as a product logo to obtain the product identification.
[0295] Afterwards, the product size corresponding to the product identification of the product to be tested is searched in the preset corresponding relationship between the product identification and the product size, so as to obtain the product size of the product to be tested.
[0296] The electronic device can calculate the ratio between each actual margin between the foaming area and the target panel and the actual size of the edge of the target panel corresponding to the actual margin, and obtain the proportional relationship between the actual margin between the foaming area and the target panel and the actual size of the target panel.
[0297] In one implementation, the ratio of the actual length and the actual width of the foaming area is calculated to obtain the actual length-to-width ratio of the foaming area; the ratio of the actual length of the foaming area to the actual length of the target panel is calculated to obtain a first proportional relationship between the foaming area and the target panel in the length direction, and the ratio of the actual width of the foaming area to the actual width of the target panel is calculated to obtain a second proportional relationship between the foaming area and the target panel in the width direction.
[0298] The electronic device can also calculate the ratio of the actual length and the actual width of the foaming area to obtain the actual length-to-width ratio of the foaming area; calculate the ratio of the actual length of the foaming area to the actual length of the target panel to obtain a first proportional relationship between the foaming area and the target panel in the length direction; and calculate the ratio of the actual width of the foaming area to the actual width of the target panel to obtain a second proportional relationship between the foaming area and the target panel in the width direction. Thus, the relative position relationship between the foaming area and the target panel is obtained.
[0299] In this embodiment, the electronic device can identify the product identification of the product to be tested in the visible light image, and determine the product size of the product to be tested by using the product identification and the correspondence between the preset product identification and the product size. Then, based on the actual margin and the actual size of the target panel, the proportional relationship between the actual margin between the foaming area and the target panel and the actual size of the target panel is calculated to obtain the relative position relationship between the foaming area and the target panel, and the relative position relationship is used to calculate the regional position of the foaming area in the visible light image, thereby improving the accuracy of the regional position of the foaming area.
[0300] As an implementation of an embodiment of the present application, the above step S104, i.e., the step of determining the detection result of the foaming area based on the temperature difference between the temperature corresponding to the area position in the infrared image and the ambient temperature, may include:
[0301] Determine whether the temperature difference between the temperature corresponding to the area position in the infrared image and the ambient temperature is greater than a preset temperature threshold;
[0302] When the temperature difference is greater than the preset temperature threshold, generating a first type of detection result characterizing the non-uniformity of the foaming area;
[0303] When the temperature difference is not greater than the preset temperature threshold, a second type of detection result indicating that the foaming area is uniform is generated.
[0304] The electronic device can determine whether the temperature difference between the temperature corresponding to the regional position in the infrared image and the ambient temperature is greater than a preset temperature threshold. The preset temperature threshold can be set according to actual needs, for example, it can be 0.1 degrees, 0.5 degrees, etc., which is not specifically limited here.
[0305] When the temperature difference is greater than a preset temperature threshold, the electronic device may generate a first type of detection result characterizing the non-uniformity of the foaming area, and output the first type of detection result.
[0306] When the temperature difference is not greater than the preset temperature threshold, the electronic device can generate a second type of detection result that characterizes the uniformity of the foaming area, and output the second type of detection result.
[0307] In one implementation, when the electronic device detects that the temperature difference is greater than a preset temperature threshold, it can further determine the number of holes in the foaming area in the infrared image whose temperature difference with the environment is greater than the preset temperature threshold, and determine the numerical relationship between the number of holes and the preset hole number threshold. When the number of holes is greater than the preset hole number threshold, the electronic device can generate a first type of detection result characterizing the unevenness of the foaming area and output the first type of detection result. Exemplarily, the preset hole number threshold is 1. When the foaming area of the refrigerator is detected, the number of holes in the foaming area whose temperature difference with the environment is greater than the preset temperature threshold is as follows: Figure 8 As shown, the number of holes with uneven foaming is 5, which is greater than the preset hole number threshold. The electronic device can generate a first type of detection result characterizing the uneven foaming area and output the first type of detection result.
[0308] In one implementation, when the electronic device detects that the temperature difference is greater than a preset temperature threshold, it can further determine the area of holes in the foaming area in the infrared image whose temperature difference with the ambient temperature is greater than the preset temperature threshold. If there are holes whose area is greater than the preset area threshold, the electronic device can generate a first type of detection result characterizing the unevenness of the foaming area and output the first type of detection result.
[0309] In the embodiment of the present application, the electronic device can determine whether the temperature difference between the temperature corresponding to the regional position in the infrared image and the ambient temperature is greater than a preset temperature threshold; when the temperature difference is greater than the preset temperature threshold, a first type of detection result characterizing the unevenness of the foaming area is generated; when the temperature difference is not greater than the preset temperature threshold, a second type of detection result characterizing the uniformity of the foaming area is generated. By determining the temperature difference between the temperature corresponding to the regional position in the infrared image and the ambient temperature, and the numerical relationship with the preset temperature threshold, the detection result of the foaming area can be obtained. By using multi-dimensional sensing means to detect the foaming area, the detection efficiency and detection accuracy can be improved, and the method of detecting the foaming area can be adapted to the changes in the test environment. Good temperature measurement accuracy and relatively accurate detection results can be obtained by using the foaming area detection method.
[0310] To facilitate understanding of the implementation process of a method for detecting a foaming area provided in an embodiment of the present application, the module composition of an electronic device for executing the method and the execution process of the method are described below in conjunction with FIG. 9 (a)-FIG. 9 (b).
[0311] As shown in FIG9( a ), an electronic device for executing a foaming area detection method provided by the embodiment of the present application may include a production data import module, a database module, a product identification module, a comparison module, a contour extraction module, a detection area contour calculation module, a temperature detection module, and a detection area temperature calculation module.
[0312] The production data import module supports users to enter product information by manually entering or connecting to production system data, for example, MES (Manufacturing Execution System), where the product information may include product name, external panel size, foaming area size, margin between the foaming area and the panel where it is located, etc. The database module is used to store product information and report product size information. The product identification module is used to obtain product identification to identify product information. Specifically, the product identification module can use OCR to identify product identification, or use detection algorithms to identify product logos and other information to obtain product identification. The comparison module is used to compare the data information of the database and the product identification module to determine the product information of the product to be tested, and report the corresponding product size information. The contour extraction module is used to extract product contours, and the segmentation algorithm can be used to extract product contour information. The detection area contour calculation module is used to calculate the regional position of the foaming area of the product to be tested in the visible light image, and report the detection area. The temperature detection module is used for global temperature detection. The detection area temperature calculation module is used to determine whether the temperature in the foaming area is normal by using a preset temperature threshold, and output an alarm message if there is an abnormality.
[0313] The software system and hardware system of the electronic device cooperate to implement the detection process of the foaming area of the product to be tested. As shown in Figure 9 (b), the detection process includes the following steps:
[0314] S901: Enter product model and product specification parameters into the software system;
[0315] The software system can input product models and product specification parameters, and store product models and product specification parameters.
[0316] S902: The hardware system obtains a unique product identifier through a product identification algorithm;
[0317] The hardware system can collect visible light images of the product to be tested, obtain the product's unique identification through a product recognition algorithm, and send the product's unique identification to the software system.
[0318] S903: The software system compares the unique identifier of the product to obtain detailed specification parameters of the product;
[0319] The software system can compare the product's unique identifier with its own recorded data information to obtain detailed product specifications of the product to be tested.
[0320] S904: The software system obtains a detailed proportional relationship between the foaming area and the back panel through product specification parameters;
[0321] The software system can calculate the detailed proportional relationship between the foaming area and the back panel on which it is located through product specification parameters, and obtain the detailed proportional relationship between the foaming area and the back panel (ie, the relative position relationship).
[0322] S905: The hardware system obtains contour data of the product in the picture through a contour extraction algorithm;
[0323] The hardware system can extract the contour data of the back panel of the product to be tested in the picture through the contour extraction algorithm, and send the contour data to the software system.
[0324] S906: The software system calculates the actual size of the foaming area in the picture through the proportional relationship and the contour data;
[0325] The software system can calculate the actual size and position information of the foaming area in the picture through the above-mentioned proportional relationship and the received contour data of the product to be tested.
[0326] S907: The hardware system obtains temperature data of the product in the picture through infrared temperature measurement;
[0327] The hardware system uses infrared temperature measurement to collect infrared images of the product to be tested.
[0328] S908: The software system records the temperature data within the size area through the actual size data;
[0329] The software system records the temperature data within the size area through the actual size data of the foaming area.
[0330] S909: The software system determines whether the temperature is abnormal based on a preset temperature threshold.
[0331] The software system uses the preset temperature threshold to calculate the temperature difference between the foaming area and the ambient temperature, determine whether there is a temperature abnormality, and determine the temperature abnormality area to obtain the detection result of the foaming area.
[0332] Corresponding to the method for detecting the foaming area, the present embodiment also provides a device for detecting the foaming area.
[0333] like Fig.10 As shown, a detection device for a foaming area includes:
[0334] A position relationship acquisition module 1010 is used to acquire the relative position relationship between the foaming area of the product to be tested and the target panel where it is located, as well as the visible light image and infrared image of the product to be tested, wherein the visible light image and infrared image include the target panel;
[0335] An information detection module 1020, configured to detect contour information of the target panel from the visible light image;
[0336] A position calculation module 1030, configured to calculate the regional position of the foaming region in the visible light image according to the contour information and the relative position relationship;
[0337] The result determination module 1040 is used to determine the detection result of the foaming area based on the temperature difference between the temperature corresponding to the area position in the infrared image and the ambient temperature.
[0338] The technical solution provided by the embodiment of the present application is that the electronic device can obtain the relative position relationship between the foaming area of the product to be tested and the target panel where it is located, as well as the visible light image and infrared image of the product to be tested, wherein the visible light image and the infrared image include the target panel; detect the contour information of the target panel from the visible light image; calculate the regional position of the foaming area in the visible light image based on the contour information and the relative position relationship; determine the detection result of the foaming area based on the temperature difference between the temperature corresponding to the regional position in the infrared image and the ambient temperature. For the product to be tested, the relative position relationship between the target panel and the foaming area of the product to be tested is determined. When the position of the target panel is determined, the regional position of the foaming area in the visible light image can be calculated based on the relative position relationship. By calculating the regional position of the foaming area, the accuracy of the foaming area detection is improved, and then the uniformity of the foaming area is detected based on the difference between the temperature of the regional position and the ambient temperature, which can reduce the influence of the regional position error on the detection result and improve the accuracy of the detection result.
[0339] As an implementation of the embodiment of the present application, the position calculation module 1030 includes:
[0340] a margin calculation submodule, configured to calculate an image margin between the foaming region and the target panel in the visible light image according to the contour information and the relative position relationship, wherein the contour information includes vertex coordinates and / or contour size of the target panel; and the relative position relationship includes a proportional relationship between an actual margin between the foaming region and the target panel and an actual size of the target panel;
[0341] The position calculation submodule is used to calculate the regional position of the foaming area in the visible light image according to the contour information and the image margin.
[0342] As an implementation method of the embodiment of the present application, the target panel and the foaming area are rectangular areas;
[0343] The margin calculation submodule includes:
[0344] A first calculation unit is used to calculate the contour length and the product of the proportional relationship corresponding to the margins of the target panel and the foaming area in the length direction to obtain at least one image margin between the foaming area and the target panel in the visible light image in the length direction;
[0345] The second calculation unit is used to calculate the contour width and multiply it by the proportional relationship corresponding to the margins of the target panel and the foaming area in the width direction to obtain at least one image margin of the foaming area and the target panel in the visible light image in the width direction.
[0346] As an implementation of an embodiment of the present application, the position calculation submodule includes:
[0347] a third calculating unit, configured to calculate the vertex coordinates of the first target vertex of the foaming area corresponding to the first panel vertex according to the vertex coordinates of the first panel vertex of the target panel, the image margin corresponding to the first panel vertex in the length direction, and the image margin corresponding to the first panel vertex in the width direction;
[0348] The fourth calculation unit is used to calculate the vertex coordinates of other target vertices in the foaming area based on the contour information.
[0349] As an implementation of the embodiment of the present application, the fourth calculation unit includes:
[0350] A first calculation subunit, configured to calculate, based on the contour information, vertex coordinates of a second target vertex adjacent to the first target vertex;
[0351] The second calculation subunit is used to calculate the vertex coordinates of other target vertices in the foaming area based on the first target vertex, the second target vertex and the relative position relationship.
[0352] As an implementation of the embodiment of the present application, the fourth calculation unit includes:
[0353] a third calculating subunit, configured to calculate the vertex coordinates of the second target vertex corresponding to the second panel vertex of the foaming area according to the vertex coordinates of the second panel vertex of the target panel, the image margin corresponding to the second panel vertex in the length direction, and the image margin corresponding to the second panel vertex in the width direction;
[0354] a fourth calculation subunit, configured to calculate the vertex coordinates of the third target vertex corresponding to the third panel vertex of the target panel, based on the vertex coordinates of the third panel vertex of the target panel, the image margin corresponding to the third panel vertex in the length direction, and the image margin corresponding to the third panel vertex in the width direction;
[0355] The fifth calculation subunit is used to calculate the vertex coordinates of the fourth target vertex corresponding to the fourth panel vertex in the bubble area based on the vertex coordinates of the fourth panel vertex of the target panel, the image margin corresponding to the fourth panel vertex in the length direction, and the image margin corresponding to the fourth panel vertex in the width direction.
[0356] As an implementation manner of the embodiment of the present application, the relative position relationship further includes a preset first proportional relationship between the foaming area and the target panel in the length direction, and a preset second proportional relationship between the foaming area and the target panel in the width direction;
[0357] The first computing subunit is specifically configured to:
[0358] Calculating the vertex coordinates of a second target vertex adjacent to the first target vertex in the length direction according to the first target vertex, the contour length, and the first proportional relationship;
[0359] The second computing subunit is specifically configured to:
[0360] According to the first target vertex, the contour width and the second proportional relationship, the vertex coordinates of the third target vertex adjacent to the first target vertex in the width direction are calculated; according to the second target vertex, the contour width and the second proportional relationship, the vertex coordinates of the fourth target vertex adjacent to the second target vertex in the width direction are calculated.
[0361] As an implementation of the embodiment of the present application, the relative position relationship further includes a preset actual length-to-width ratio of the foaming area;
[0362] The first computing subunit is specifically configured to:
[0363] Calculate the vertex coordinates of a second target vertex adjacent to the first target vertex according to the vertex coordinates of the adjacent panel vertices of the first panel vertex, the image margins corresponding to the adjacent panel vertices in the length direction, and the image margins corresponding to the adjacent panel vertices in the width direction;
[0364] The second computing subunit is specifically configured to:
[0365] Calculate, according to the first target vertex and the second target vertex, a first length of a first edge where the first target vertex and the second target vertex are located;
[0366] Calculating a second length of an adjacent side of the first edge according to the first length and an actual length-to-width ratio of the foaming area;
[0367] The vertex coordinates of other target vertices in the foaming area are calculated according to the second length, the first target vertex, and the second target vertex.
[0368] As an implementation of an embodiment of the present application, the position calculation submodule includes:
[0369] a straight line construction unit, for constructing, within the contour of the target panel, for each edge of the target panel in the visible light image, a straight line parallel to the edge and at a distance from the edge equal to a target image margin, wherein the target image margin is an image margin between an edge of the foaming region in the visible light image that is parallel to and close to the edge and the edge;
[0370] The position determination unit is used to determine the regional position of the region surrounded by the four constructed straight lines as the regional position of the foaming region in the visible light image.
[0371] As an implementation of the embodiment of the present application, the device further includes:
[0372] A ratio calculation module, for the relative position relationship further including a preset actual length-to-width ratio of the foaming area; before the step of determining the detection result of the foaming area based on the temperature difference between the temperature corresponding to the position of the area in the infrared image and the ambient temperature, the length and width of the foaming area in the visible light image are calculated based on the vertex coordinates of the four target vertices of the foaming area, and the current length-to-width ratio of the foaming area in the visible light image is calculated;
[0373] an adjustment module, configured to adjust the region position of the foaming region according to the difference between the current aspect ratio and the actual aspect ratio when the difference between the current aspect ratio and the actual aspect ratio is greater than a preset ratio threshold;
[0374] The result determination module 1040 includes:
[0375] The result determination submodule is used to determine the detection result of the foaming area based on the temperature difference between the temperature corresponding to the adjusted area position in the infrared image and the ambient temperature.
[0376] As an implementation manner of the embodiment of the present application, the foaming area is between the target panel and the inner shell of the product to be tested, and the target panel covers the foaming area.
[0377] As an implementation of the embodiment of the present application, the position relationship acquisition module 1010 includes:
[0378] The identification recognition submodule is used to identify the product identification of the product to be tested in the visible light image of the product to be tested;
[0379] A size determination submodule, for determining the product size of the product to be tested based on the product identification and the correspondence between the preset product identification and the product size, wherein the product size includes the actual margin between the foaming area and the target panel, the actual size of the target panel where the foaming area of the product to be tested is located, and the actual size of the foaming area;
[0380] The relationship determination submodule is used to calculate the proportional relationship between the actual margin between the foaming area and the target panel and the actual size of the target panel based on the actual margin and the actual size of the target panel.
[0381] As an implementation of the embodiment of the present application, the result determination module 1040 includes:
[0382] A temperature difference determination submodule, used to determine whether the temperature difference between the temperature corresponding to the regional position in the infrared image and the ambient temperature is greater than a preset temperature threshold; if the temperature difference is greater than the preset temperature threshold, triggering the first generation submodule; if the temperature difference is not greater than the preset temperature threshold, triggering the second generation submodule;
[0383] The first generating submodule is used to generate a first type of detection result characterizing the non-uniformity of the foaming area;
[0384] The second generation submodule is used to generate a second type of detection result that characterizes the uniformity of the foaming area.
[0385] The present application also provides an electronic device, such as Fig.11 As shown, including:
[0386] Memory 1101, used for storing computer programs;
[0387] The processor 1102 is used to implement the foaming area detection method provided in the embodiment of the present application when executing the program stored in the memory 1101.
[0388] In addition, the electronic device may further include a communication bus and / or a communication interface, and the processor 1102, the communication interface, and the memory 1101 communicate with each other via the communication bus.
[0389] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0390] The communication interface is used for communication between the above electronic device and other devices.
[0391] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0392] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0393] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned methods for detecting a foaming area are implemented.
[0394] In another embodiment provided in the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any of the foaming area detection methods in the above embodiments.
[0395] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a solid-state hard disk (SSD), etc.
[0396] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0397] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, electronic device, computer-readable storage medium, and computer program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0398] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims
1. A method for detecting a foaming area, characterized in that: The method comprises: Acquire the relative positional relationship between the foaming area of the product to be tested and the target panel where it is located, as well as the visible light image and infrared image of the product to be tested, wherein the visible light image and infrared image include the target panel; Detecting contour information of the target panel from the visible light image; Calculating the regional position of the foaming region in the visible light image according to the contour information and the relative position relationship; The detection result of the foaming area is determined based on the temperature difference between the temperature corresponding to the area position in the infrared image and the ambient temperature.
2. The method according to claim 1, characterized in that The step of calculating the regional position of the foaming area in the visible light image according to the contour information and the relative position relationship comprises: Calculating an image margin between the bubbled area and the target panel in the visible light image according to the contour information and the relative position relationship, wherein the contour information includes vertex coordinates and / or contour size of the target panel; and the relative position relationship includes a proportional relationship between an actual margin between the bubbled area and the target panel and an actual size of the target panel; The region position of the foaming region in the visible light image is calculated according to the contour information and the image margin.
3. The method according to claim 2, characterized in that The target panel and the foaming area are rectangular areas; The step of calculating the image margin between the foaming area and the target panel in the visible light image according to the contour information and the relative position relationship comprises: Calculating the contour length and multiplying the lengthwise proportional relationship between the target panel and the foaming region to obtain at least one image margin between the foaming region and the target panel in the visible light image; The contour width is calculated and multiplied by the proportional relationship corresponding to the margins of the target panel and the foaming area in the width direction to obtain at least one image margin of the foaming area and the target panel in the visible light image in the width direction.
4. The method according to claim 3, characterized in that The step of calculating the regional position of the foaming area in the visible light image according to the contour information and the image margin comprises: Calculate the vertex coordinates of the first target vertex of the foaming area corresponding to the first panel vertex according to the vertex coordinates of the first panel vertex of the target panel, the image margin corresponding to the first panel vertex in the length direction, and the image margin corresponding to the first panel vertex in the width direction; Based on the contour information, vertex coordinates of other target vertices of the foaming area are calculated.
5. The method according to claim 4, characterized in that The step of calculating the vertex coordinates of other target vertices of the foaming area based on the contour information comprises: Based on the contour information, calculating vertex coordinates of a second target vertex adjacent to the first target vertex; Based on the first target vertex, the second target vertex, and the relative positional relationship, vertex coordinates of other target vertices in the foaming area are calculated.
6. The method according to claim 4, characterized in that The step of calculating the vertex coordinates of other target vertices of the foaming area based on the contour information comprises: Calculate the vertex coordinates of the second target vertex corresponding to the second panel vertex in the foaming area according to the vertex coordinates of the second panel vertex of the target panel, the image margin corresponding to the second panel vertex in the length direction, and the image margin corresponding to the second panel vertex in the width direction; Calculate the vertex coordinates of the third target vertex corresponding to the third panel vertex in the foaming area according to the vertex coordinates of the third panel vertex of the target panel, the image margin corresponding to the third panel vertex in the length direction, and the image margin corresponding to the third panel vertex in the width direction; The vertex coordinates of the fourth target vertex corresponding to the fourth panel vertex in the foaming area are calculated based on the vertex coordinates of the fourth panel vertex of the target panel, the image margin corresponding to the fourth panel vertex in the length direction, and the image margin corresponding to the fourth panel vertex in the width direction.
7. The method according to claim 5, characterized in that The relative position relationship further includes a preset first proportional relationship between the foaming area and the target panel in the length direction, and a preset second proportional relationship between the foaming area and the target panel in the width direction; The step of calculating the vertex coordinates of a second target vertex adjacent to the first target vertex based on the contour information comprises: Calculating the vertex coordinates of a second target vertex adjacent to the first target vertex in the length direction according to the first target vertex, the contour length, and the first proportional relationship; The step of calculating the vertex coordinates of other target vertices in the foaming area based on the first target vertex, the second target vertex and the relative position relationship comprises: Calculating the vertex coordinates of a third target vertex adjacent to the first target vertex in the width direction according to the first target vertex, the contour width, and the second proportional relationship; The vertex coordinates of a fourth target vertex adjacent to the second target vertex in the width direction are calculated according to the second target vertex, the contour width, and the second proportional relationship.
8. The method according to claim 5, characterized in that The relative position relationship also includes a preset actual length-to-width ratio of the foaming area; The step of calculating the vertex coordinates of a second target vertex adjacent to the first target vertex based on the contour information comprises: Calculate the vertex coordinates of a second target vertex adjacent to the first target vertex according to the vertex coordinates of the adjacent panel vertices of the first panel vertex, the image margins corresponding to the adjacent panel vertices in the length direction, and the image margins corresponding to the adjacent panel vertices in the width direction; The step of calculating the vertex coordinates of other target vertices in the foaming area based on the first target vertex, the second target vertex and the relative position relationship comprises: Calculate, according to the first target vertex and the second target vertex, a first length of a first edge where the first target vertex and the second target vertex are located; Calculating a second length of an adjacent side of the first edge according to the first length and an actual length-to-width ratio of the foaming area; The vertex coordinates of other target vertices in the foaming area are calculated according to the second length, the first target vertex, and the second target vertex.
9. The method according to claim 3, characterized in that: The step of calculating the regional position of the foaming area in the visible light image according to the contour information and the image margin comprises: For each edge of the target panel in the visible light image, construct a straight line within the contour of the target panel that is parallel to the edge and at a distance from the edge that is a target image margin, wherein the target image margin is an image margin between an edge of the foaming region in the visible light image that is parallel to and close to the edge and the edge; The regional position of the region enclosed by the four constructed straight lines is determined as the regional position of the foaming region in the visible light image.
10. The method according to claim 6 or 7, characterized in that: The relative position relationship also includes a preset actual length-to-width ratio of the foaming area; before the step of determining the detection result of the foaming area based on the temperature difference between the temperature corresponding to the position of the area in the infrared image and the ambient temperature, the method also includes: Calculating the length and width of the bubble region in the visible light image based on vertex coordinates of four target vertices of the bubble region, and calculating the current length-to-width ratio of the bubble region in the visible light image; When the difference between the current aspect ratio and the actual aspect ratio is greater than a preset ratio threshold, adjusting the region position of the foaming region according to the difference; The step of determining the detection result of the foaming area based on the temperature difference between the temperature corresponding to the area position in the infrared image and the ambient temperature comprises: The detection result of the foaming area is determined based on the temperature difference between the temperature corresponding to the adjusted area position in the infrared image and the ambient temperature.
11. The method according to any one of claims 1 to 9, characterized in that: The foaming area is between the target panel and the inner shell of the product to be tested, and the target panel shields the foaming area.
12. The method according to any one of claims 1 to 9, characterized in that: The step of obtaining the relative position relationship between the foaming area of the product to be tested and the target panel where it is located comprises: Identifying a product identification of the product to be tested in a visible light image of the product to be tested; Determine the product size of the product to be tested based on the product identification and the correspondence between the preset product identification and the product size, wherein the product size includes the actual margin between the foaming area and the target panel, the actual size of the target panel where the foaming area of the product to be tested is located, and the actual size of the foaming area; Based on the actual margin and the actual size of the target panel, a proportional relationship between the actual margin between the foaming area and the target panel and the actual size of the target panel is calculated.
13. The method according to any one of claims 1 to 9, characterized in that: The step of determining the detection result of the foaming area based on the temperature difference between the temperature corresponding to the area position in the infrared image and the ambient temperature comprises: Determine whether the temperature difference between the temperature corresponding to the area position in the infrared image and the ambient temperature is greater than a preset temperature threshold; When the temperature difference is greater than the preset temperature threshold, generating a first type of detection result characterizing the non-uniformity of the foaming area; When the temperature difference is not greater than the preset temperature threshold, a second type of detection result indicating that the foaming area is uniform is generated.
14. A detection device for a foaming area, characterized in that: The device comprises: A position relationship acquisition module, used to acquire the relative position relationship between the foaming area of the product to be tested and the target panel where it is located, as well as a visible light image and an infrared image of the product to be tested, wherein the visible light image and the infrared image include the target panel; An information detection module, used for detecting contour information of the target panel from the visible light image; A position calculation module, used for calculating the regional position of the foaming area in the visible light image according to the contour information and the relative position relationship; The result determination module is used to determine the detection result of the foaming area based on the temperature difference between the temperature corresponding to the area position in the infrared image and the ambient temperature.
15. The device according to claim 14, characterized in that The position calculation module comprises: a margin calculation submodule, configured to calculate an image margin between the foaming region and the target panel in the visible light image according to the contour information and the relative position relationship, wherein the contour information includes vertex coordinates and / or contour size of the target panel; and the relative position relationship includes a proportional relationship between an actual margin between the foaming region and the target panel and an actual size of the target panel; a position calculation submodule, used to calculate the regional position of the foaming area in the visible light image according to the contour information and the image margin; and / or, The target panel and the foaming area are rectangular areas; the margin calculation submodule includes: A first calculation unit is used to calculate the contour length and the product of the proportional relationship corresponding to the margins of the target panel and the foaming area in the length direction to obtain at least one image margin between the foaming area and the target panel in the visible light image in the length direction; A second calculation unit is used to calculate the contour width and the product of the proportional relationship corresponding to the margins of the target panel and the foaming area in the width direction to obtain at least one image margin of the foaming area and the target panel in the visible light image in the width direction; and / or, The position calculation submodule includes: a third calculating unit, configured to calculate the vertex coordinates of the first target vertex of the foaming area corresponding to the first panel vertex according to the vertex coordinates of the first panel vertex of the target panel, the image margin corresponding to the first panel vertex in the length direction, and the image margin corresponding to the first panel vertex in the width direction; a fourth calculation unit, configured to calculate vertex coordinates of other target vertices of the foaming area based on the contour information; and / or, The fourth computing unit comprises: A first calculation subunit, configured to calculate, based on the contour information, vertex coordinates of a second target vertex adjacent to the first target vertex; A second calculation subunit is configured to calculate vertex coordinates of other target vertices in the foaming area based on the first target vertex, the second target vertex and the relative position relationship; and / or The fourth computing unit comprises: a third calculating subunit, configured to calculate the vertex coordinates of the second target vertex corresponding to the second panel vertex of the foaming area according to the vertex coordinates of the second panel vertex of the target panel, the image margin corresponding to the second panel vertex in the length direction, and the image margin corresponding to the second panel vertex in the width direction; a fourth calculation subunit, configured to calculate the vertex coordinates of the third target vertex corresponding to the third panel vertex of the target panel, based on the vertex coordinates of the third panel vertex of the target panel, the image margin corresponding to the third panel vertex in the length direction, and the image margin corresponding to the third panel vertex in the width direction; a fifth calculating subunit, configured to calculate the vertex coordinates of a fourth target vertex corresponding to the fourth panel vertex of the foaming area and the fourth panel vertex according to the vertex coordinates of the fourth panel vertex of the target panel, the image margin corresponding to the fourth panel vertex in the length direction, and the image margin corresponding to the fourth panel vertex in the width direction; and / or, The relative position relationship further includes a preset first proportional relationship between the foaming area and the target panel in the length direction, and a preset second proportional relationship between the foaming area and the target panel in the width direction; the first calculation subunit is specifically used for: Calculating the vertex coordinates of a second target vertex adjacent to the first target vertex in the length direction according to the first target vertex, the contour length, and the first proportional relationship; The second computing subunit is specifically configured to: According to the first target vertex, the contour width and the second proportional relationship, the vertex coordinates of a third target vertex adjacent to the first target vertex in the width direction are calculated; according to the second target vertex, the contour width and the second proportional relationship, the vertex coordinates of a fourth target vertex adjacent to the second target vertex in the width direction are calculated; and / or, The relative position relationship also includes a preset actual length-to-width ratio of the foaming area; the first calculation subunit is specifically used for: Calculate the vertex coordinates of a second target vertex adjacent to the first target vertex according to the vertex coordinates of the adjacent panel vertices of the first panel vertex, the image margins corresponding to the adjacent panel vertices in the length direction, and the image margins corresponding to the adjacent panel vertices in the width direction; The second computing subunit is specifically configured to: Calculate, according to the first target vertex and the second target vertex, a first length of a first edge where the first target vertex and the second target vertex are located; Calculating a second length of an adjacent side of the first edge according to the first length and an actual length-to-width ratio of the foaming area; Calculating vertex coordinates of other target vertices of the foaming area according to the second length, the first target vertex and the second target vertex; and / or, The position calculation submodule includes: a straight line construction unit, for constructing, within the contour of the target panel, for each edge of the target panel in the visible light image, a straight line parallel to the edge and at a distance from the edge equal to a target image margin, wherein the target image margin is an image margin between an edge of the foaming region in the visible light image that is parallel to and close to the edge and the edge; a position determination unit, used for determining the regional position of the region enclosed by the four constructed straight lines as the regional position of the foaming region in the visible light image; and / or, The device also includes: A ratio calculation module, for the relative position relationship further including a preset actual length-to-width ratio of the foaming area; before the step of determining the detection result of the foaming area based on the temperature difference between the temperature corresponding to the position of the area in the infrared image and the ambient temperature, the length and width of the foaming area in the visible light image are calculated based on the vertex coordinates of the four target vertices of the foaming area, and the current length-to-width ratio of the foaming area in the visible light image is calculated; an adjustment module, configured to adjust the region position of the foaming region according to the difference between the current aspect ratio and the actual aspect ratio when the difference between the current aspect ratio and the actual aspect ratio is greater than a preset ratio threshold; The result determination module comprises: A result determination submodule is used to determine the detection result of the foaming area based on the temperature difference between the temperature corresponding to the adjusted area position in the infrared image and the ambient temperature; and / or, The foaming area is between the target panel and the inner shell of the product to be tested, and the target panel shields the foaming area; and / or, The position relationship acquisition module includes: The identification recognition submodule is used to identify the product identification of the product to be tested in the visible light image of the product to be tested; A size determination submodule, for determining the product size of the product to be tested based on the product identification and the correspondence between the preset product identification and the product size, wherein the product size includes the actual margin between the foaming area and the target panel, the actual size of the target panel where the foaming area of the product to be tested is located, and the actual size of the foaming area; a relationship determination submodule, for calculating the proportional relationship between the actual margin between the foaming area and the target panel and the actual size of the target panel based on the actual margin and the actual size of the target panel; and / or, The result determination module comprises: A temperature difference determination submodule, used to determine whether the temperature difference between the temperature corresponding to the regional position in the infrared image and the ambient temperature is greater than a preset temperature threshold; if the temperature difference is greater than the preset temperature threshold, triggering the first generation submodule; if the temperature difference is not greater than the preset temperature threshold, triggering the second generation submodule; The first generating submodule is used to generate a first type of detection result characterizing the non-uniformity of the foaming area; The second generation submodule is used to generate a second type of detection result that characterizes the uniformity of the foaming area.
16. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-13 when executing a program stored in a memory.
17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.
Citation Information
Patent Citations
Method and device for detecting vacuum loss of low-temperature container
CN107270113A
Spacing measurement method, device and equipment and computer readable medium
CN111161339A
Three-dimensional measurement method based on marker
CN111397532A
Refrigerator detection method and device
CN111830078A
Deicing wind power blade heating system detection device and method
CN112483336A