Detection Method, Device, System, Equipment, Medium and Product
Through the image processing-based size detection method, the three-dimensional detection image and differential curves are used to identify the position of the gap side wall, which solves the problems of low gap detection efficiency and insufficient accuracy in the prior art, and achieves higher precision gap width measurement.
Patent Information
- Application Number
- CN202510338985.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-03-21
AI Technical Summary
In the prior art, the detection efficiency of product gaps is low and the accuracy is difficult to guarantee. Especially in the case of irregular gaps, the detection accuracy of automation equipment is low and unqualified products cannot be effectively screened.
By using the image processing-based size detection method, by acquiring the three-dimensional detection image, determining the cross-sectional fitting curve and performing differential processing, the gap sidewall position is identified using the characteristics of the depth differential value, and the gap width dimension is determined, including a filtering step to remove noise and outlier interference.
It improves the accuracy and efficiency of gap detection, can more accurately identify the position of the gap side wall, and improves the detection accuracy and reliability of product quality judgment.
Smart Images

Figure CN119860714B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of dimension detection, and particularly to a detection method, device, system, equipment, medium and product. Background Art
[0002] In the production and manufacturing process of various products, the gap size of a product is an important indicator for judging the product quality. If the gap of the product is too large, it may affect the assembly stability and quality reliability. For example, if the gap between the battery case and the battery top cover is too large, it may cause the laser to pass through the gap and irradiate the inside of the battery during the welding process, which may damage the battery and reduce the battery quality.
[0003] Regarding the gap of the product, in some embodiments, manual detection methods are used for measurement, and the detection efficiency of manual detection is low and the accuracy is difficult to guarantee; in some implementations, automated equipment is used for contact detection, and the detection accuracy for irregular gaps in the product is relatively low. Summary of the Invention
[0004] This application aims to solve at least one of the technical problems existing in the background art. For this reason, an object of this application is to provide a detection method, device, system, equipment, medium and product to improve the problem of the dimension detection accuracy of the target gap.
[0005] An embodiment of the first aspect of this application provides a dimension detection method based on image processing. The dimension detection method includes obtaining a three-dimensional detection image, where the three-dimensional detection image includes depth information corresponding to a target gap and a first component and a second component adjacent to the target gap respectively; based on the three-dimensional detection image, determining a cross-sectional fitting curve perpendicular to the extension direction of the target gap and passing through a preset detection point; the cross-sectional fitting curve is used to characterize the cross-sectional shape of the target gap; performing a differential process on the cross-sectional fitting curve to obtain a differential curve for characterizing the depth differential value corresponding to each pixel point; based on the differential curve, determining a first position and a second position respectively characterizing the positions of two opposite sidewalls of the target gap; and determining the width dimension of the target gap according to the position information of the first position and the second position in a preset coordinate system.
[0006] In the technical solution of the embodiment of this application, by performing a differential process on the cross-sectional fitting curve, the change trend of the cross-sectional fitting curve is converted into a differential curve of the depth differential value. The differential curve can clearly show the rate of depth change at each pixel point, which helps to accurately identify the position change of the gap sidewall. The positions of two opposite sidewalls of the target gap are determined by using the characteristics of the depth differential value, so as to determine the width dimension between the two sidewalls and improve the dimension detection accuracy.
[0007] In some embodiments, the differential curve includes adjacent first and second waveforms respectively corresponding to two opposite sidewalls of the target gap; the first position is within the pixel range corresponding to the half-wave of the first waveform adjacent to the second waveform; the second position is within the pixel range corresponding to the half-wave of the second waveform adjacent to the first waveform. By setting the first position and the second position within the pixel ranges corresponding to two adjacent half-waves, the two positions focus on the half-wave regions of the waveform, corresponding to the regions closer to the downstream in the sidewalls of the target gap, which can effectively utilize the depth information of the three-dimensional detection image, obtain a more accurate position positioning, and improve the measurement accuracy of the gap width.
[0008] In some embodiments, determining the first position and the second position respectively characterizing the positions of two opposite sidewalls of the target gap based on the differential curve includes: performing a first filtering step on the differential curve to obtain a first filtered curve, where the first filtering step includes filtering out partial waveforms in the differential curve where the depth differential value exceeds the first preset threshold range; determining the first position and the second position based on the first filtered curve. By performing the first filtering process on the differential curve and filtering out the partial waveforms exceeding the first preset threshold range, the interference caused by the protrusions on the surfaces of the two sidewalls of the target gap can be removed, and the possibility of incorrect judgments when searching for the sidewall positions due to noise and abnormal fluctuations can be minimized, thus improving the accuracy of the detected width dimension of the target gap.
[0009] In some embodiments, the first filtering step includes: obtaining the first preset threshold range; the first preset threshold range includes an upper limit value and a lower limit value; in response to the depth differential value of a pixel point in the differential curve being greater than the upper limit value of the first preset threshold range, replacing the depth differential value of the pixel point with the upper limit value of the first preset threshold range; in response to the depth differential value of a pixel point in the differential curve being less than the lower limit value of the first preset threshold range, replacing the depth differential value of the pixel point with the lower limit value of the first preset threshold range; fitting the depth differential values of each pixel point to obtain the first filtered curve. By setting the first preset threshold range with the upper limit value and the lower limit value and filtering the depth differential values outside the range, the influence of noise and outliers in the differential curve can be further reduced. This helps to better determine the first position and the second position, and further improve the accuracy of the detected width dimension of the target gap.
[0010] In some embodiments, obtaining the first preset threshold range includes: determining a first filtering line that is parallel to the coordinate axis representing the pixel position in the differential curve and intersects with the first waveform or the second waveform; in response to the pixel distance between the two intersection points where the first filtering line intersects with the first waveform or the second waveform being a first preset width and the depth differential value corresponding to the first filtering line being greater than 0, determining the depth differential value corresponding to the first filtering line as the upper limit value of the first preset threshold range; and / or in response to the pixel distance between the two intersection points where the first filtering line intersects with the first waveform or the second waveform being a second preset width and the depth differential value corresponding to the first filtering line being less than 0, determining the depth differential value corresponding to the first filtering line as the lower limit value of the first preset threshold range. For the first waveform and the second waveform in different directions, using the first filtering line to respectively determine the filtering ranges of the first waveform and the second waveform can respectively reduce the interference caused by the protrusions on the two side walls of the target gap, which helps to better determine the first position and the second position, and further improve the accuracy of the detected width dimension of the target gap.
[0011] In some embodiments, obtaining the first preset threshold range includes: performing an absolute value transformation on the depth differential value corresponding to each pixel point in the differential curve to obtain a differential transformation curve; determining a second filtering line that is parallel to the coordinate axis representing the pixel position in the differential transformation curve and intersects with both the first waveform and the second waveform; in response to the smaller of the pixel distances between the two intersection points where the second filtering line intersects with the first waveform and the pixel distances between the two intersection points where the second filtering line intersects with the second waveform being a third preset width, determining the depth differential value corresponding to the second filtering line as the upper limit value of the first preset threshold range; and determining the lower limit value of the first preset threshold range as 0. By performing an absolute value transformation on the depth differential value corresponding to each pixel point in the differential curve, the first waveform and the second waveform are located on the same side, and the first preset threshold range can be determined by setting the upper limit value of the first preset threshold range, which helps to improve the processing efficiency of the differential curve.
[0012] In some embodiments, based on the first filtering curve, determining the first position and the second position includes: determining the pixel points where the depth differential value in the half-wave of the first waveform adjacent to the second waveform is equal to the upper limit value or the lower limit value of the first preset threshold range as the first position; and determining the pixel points where the depth differential value in the half-wave of the second waveform adjacent to the first waveform is equal to the upper limit value or the lower limit value of the first preset threshold range as the second position. Through the first filtering step, the interference of noise and outliers has been removed, so that the first filtering curve can more truly reflect the depth change of the target gap. Determining the first position and the second position as the upper limit value or the lower limit value of the first preset threshold range respectively can shorten the time for determining the first position and the second position on the first filtering curve and improve the detection efficiency.
[0013] In some embodiments, based on the first filter curve, determining the first position and the second position further includes: performing a second filtering step on the first filter curve to obtain a second filter curve, the second filtering step including filtering out a portion of the waveform whose depth differential value falls within a second preset threshold range in the first filter curve; and determining the first position and the second position based on the second filter curve. By performing a second filtering process on the first filter curve and filtering out a portion of the waveform that falls within the second preset threshold range, the bottom area of the first waveform and the second waveform can be removed, and the possibility of taking points at the intersection area between the first component and the second component and the target gap, and the possibility of taking points at the intersection area between the side and bottom of the target gap, can be reduced as much as possible, thereby improving the accuracy of the target gap detection width size.
[0014] In some embodiments, the second filtering step includes: obtaining a second preset threshold range; the upper limit value of the second preset threshold range is greater than 0 and less than the upper limit value of the first preset threshold range, and the lower limit value of the second preset threshold range is less than 0 and greater than the lower limit value of the first preset threshold range; in response to the depth differential value corresponding to the pixel point in the first filtering curve falling into the second preset threshold range, the depth differential value corresponding to the pixel point is replaced with a null value; the curve after filtering the first filtering curve is determined as the second filtering curve. For the first waveform and the second waveform in different directions, the upper limit value and the lower limit value of the second preset threshold range are used, and the falling part is processed, which mainly eliminates the interference caused by structural changes at the junction of the first component and the target gap, the junction of the side and bottom of the target gap, and the junction of the second component and the target gap, so as to improve the accuracy of the target gap detection width size.
[0015] In some embodiments, obtaining the second preset threshold range includes: determining a third filter line, the third filter line is parallel to the coordinate axis representing the pixel position in the differential curve, and the third filter line intersects with the first waveform or the second waveform; in response to the pixel distance between the two intersections where the third filter line intersects with the first waveform or the second waveform being the fourth preset width, and the depth differential value corresponding to the third filter line being greater than 0, determining the depth differential value corresponding to the third filter line as the upper limit value of the second preset threshold range; and / or in response to the pixel distance between the two intersections where the third filter line intersects with the first waveform or the second waveform being the fifth preset width, and the depth differential value corresponding to the third filter line being less than 0, determining the depth differential value corresponding to the third filter line as the lower limit value of the second preset threshold range. For the first waveform and the second waveform in different directions, using the third filter line to respectively determine the filtering range of the first waveform and the second waveform can respectively reduce the interference caused by the structure at the junction of the side of the target gap and the first component and the second component, which helps to better determine the first position and the second position, and further improve the accuracy of the target gap detection width size.
[0016] In some embodiments, the second filtering step further includes: performing an absolute value transformation on the depth differential value corresponding to each pixel point in the differential curve to obtain a differential transformation curve; obtaining a second preset threshold range; the upper limit value of the second preset threshold range is greater than 0 and less than the upper limit value of the first preset threshold range, and the lower limit value of the second preset threshold range is 0; in response to the depth differential value corresponding to the pixel point in the first filtering curve falling within the second preset threshold range, replacing the depth differential value corresponding to the pixel point with a null value; and determining the curve after filtering the first filtering curve as the second filtering curve. By performing an absolute value transformation on the depth differential value corresponding to each pixel point in the differential curve, the first waveform and the second waveform are located on the same side, and then filtering the first filtering curve after the absolute value transformation through the second filtering step helps to improve the detection accuracy and also helps to improve the processing efficiency of the differential curve.
[0017] In some embodiments, obtaining the second preset threshold range includes: determining a fourth filtering line, the fourth filtering line is parallel to the coordinate axis representing the pixel position in the differential transformation curve, and the fourth filtering line intersects both the first waveform and the second waveform at the same time; in response to the larger of the pixel distances between the two intersection points where the fourth filtering line intersects the first waveform and the pixel distances between the two intersection points where the fourth filtering line intersects the second waveform being a sixth preset width, determining the depth differential value corresponding to the fourth filtering line as the upper limit value of the second preset threshold range; and determining the lower limit value of the second preset threshold range as 0. After performing an absolute value transformation on the depth differential value corresponding to each pixel point in the differential curve to make the first waveform and the second waveform located on the same side, the second preset threshold range can be determined by setting the upper limit value of the second preset threshold range, which helps to improve the processing efficiency of the differential curve.
[0018] In some embodiments, based on the second filtering curve, determining the first position and the second position includes: determining the middle position of the pixel points in the region where the depth differential value is greater than 0 and less than or equal to the upper limit value of the first preset threshold range in the half-wave of the first waveform in the second filtering curve that is adjacent to the second waveform as the first position; the depth differential value corresponding to the pixel points in the first waveform is greater than or equal to 0; determining the middle position of the pixel points in the region where the depth differential value is less than 0 and greater than or equal to the lower limit value of the first preset threshold range in the half-wave of the second waveform in the second filtering curve that is adjacent to the first waveform as the second position. By determining the first position as the middle position of the pixel points corresponding to the half-wave of the first waveform in the second filtering curve that is close to the second waveform, and determining the second position as the middle position of the pixel points corresponding to the half-wave of the second waveform in the second filtering curve that is close to the first waveform, the value-taking error during filtering can be further reduced, and the detection accuracy of the target gap can be improved.
[0019] In some embodiments, the dimension detection method further includes: determining the top surface position of the first component and the top surface position of the second component based on the cross-section fitting curve; determining the height difference between the first component and the second component based on the top surface position of the first component and the top surface position of the second component. By detecting the height difference between the first component and the second component, it is possible to more comprehensively obtain whether the positioning of the first component and the second component is qualified, improve the detection effect, and save time.
[0020] In some embodiments, the dimension detection method further includes: obtaining a data set composed of the widths of the target gap corresponding to a plurality of preset detection points sequentially arranged at intervals along the extension direction of the target gap; in response to N consecutive values in the data set being greater than a preset width threshold, determining that the width of the target gap is unqualified. By using consecutive preset detection points to detect the gap situation for the target gap to judge the width qualification of the target gap, compared with using the average value algorithm for each preset detection point, it can more truly reflect the specific gap situation in the target gap and improve the accuracy of the target gap detection.
[0021] An embodiment of the second aspect of the present application provides a battery pre-welding detection method, where the first component is a battery case, the second component is a battery top cover, and the target gap is the gap between the battery case and the battery top cover; the battery pre-welding detection method includes: using the above-mentioned dimension detection method to determine the width of the gap between the battery case and the battery top cover. By detecting the gap width of the battery before welding the battery top cover and the battery case, the accuracy of dimension detection can be improved, which is beneficial to improving the quality of subsequent welding, and further improving the battery quality and production efficiency.
[0022] An embodiment of the third aspect of the present application provides a dimension detection device based on image processing. The dimension detection device includes: a first acquisition module for acquiring a three-dimensional detection image, the three-dimensional detection image including depth information corresponding to the target gap and the first component and the second component adjacent to the target gap respectively; a first processing module for determining a cross-section fitting curve perpendicular to the extension direction of the target gap and passing through a preset detection point based on the three-dimensional detection image; the cross-section fitting curve is used to characterize the cross-sectional shape of the target gap; a second processing module for performing a differential process on the cross-section fitting curve to obtain a differential curve for characterizing the depth differential value corresponding to each pixel point; a third processing module for determining a first position and a second position respectively characterizing the positions of two opposite side walls of the target gap based on the differential curve; and a fourth processing module for determining the width dimension of the target gap according to the position information of the first position and the second position in a preset coordinate system.
[0023] An embodiment of the fourth aspect of the present application provides a pre-welding dimension detection system. The dimension detection system includes a clamping device, an image acquisition device, and a control device. The clamping device is used to clamp a first component and a second component to be welded to a set position, so that a target gap is formed between the first component and the second component. The image acquisition device is configured to obtain a three-dimensional detection image of the position where the target gap is located. The control device is configured to receive the three-dimensional detection image and execute the above-mentioned dimension detection method. Through the mutual cooperation of the control device with the clamping device and the image acquisition device, the detection of the target gap is realized. On the one hand, compared with manual detection, the efficiency is higher, there are more detection points, and the detection result is more accurate. On the other hand, according to the detection result, it is helpful for the preparation of the next process flow.
[0024] An embodiment of the fifth aspect of the present application provides a computing device, which includes at least one processor; and at least one memory communicatively connected to the at least one processor. The at least one memory stores instructions that, when executed alone or jointly by the at least one processor, cause the computing device to execute the above-mentioned dimension detection method.
[0025] An embodiment of the sixth aspect of the present application provides a computer-readable storage medium, which stores instructions that, when executed alone or jointly by one or more processors of a computing device, cause the computing device to execute the above-mentioned dimension detection method.
[0026] An embodiment of the seventh aspect of the present application provides a computer program product, including instructions that, when executed alone or jointly by one or more processors of a computing device, cause the computing device to execute the above-mentioned dimension detection method.
[0027] The above description is only an overview of the technical solution of the present application. In order to be able to understand the technical means of the present application more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features and advantages of the present application more obvious and understandable, the following specifically illustrates the specific implementation manners of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In the drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings denote the same or similar components or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments disclosed in the present application and should not be regarded as limiting the scope of the present application.
[0029] Figure 1 It is a schematic flowchart of a dimension detection method provided for some embodiments of the present application;
[0030] Figure 2 It is a schematic diagram of a cross-section fitting curve and a differential curve provided for some embodiments of the present application;
[0031] Figure 3 Schematic diagram of a cross-section fitting curve provided by some embodiments of the present application;
[0032] Figure 4 Schematic diagram of a first filtering curve provided by some embodiments of the present application;
[0033] Figure 5 Schematic diagram of the first filtering curve after absolute value transformation provided by some embodiments of the present application;
[0034] Figure 6 Schematic diagram of a second filtering curve provided by some embodiments of the present application;
[0035] Figure 7 Schematic diagram of the second filtering curve after absolute value transformation provided by some embodiments of the present application;
[0036] Figure 8 Structural block diagram of a dimension detection device provided by some embodiments of the present application;
[0037] Figure 9 Control logic block diagram of a dimension detection system provided by some embodiments of the present application;
[0038] Figure 10 Structural schematic diagram of a dimension detection system provided by some embodiments of the present application;
[0039] Figure 11 Schematic diagram of the algorithm flow in a dimension detection system provided by some embodiments of the present application.
[0040] Description of reference numerals:
[0041] 100, dimension detection method; 200, dimension detection system; 210, clamping device; 220, image acquisition device; 221, image acquisition unit; 222, driving unit; 230, control device; 300, dimension detection device; 310, first acquisition module; 320, first processing module; 330, second processing module; 340, third processing module; 350, fourth processing module. Detailed implementation manners
[0042] Hereinafter, embodiments of the technical solution of the present application will be described in detail with reference to the accompanying drawings. The following embodiments are only used to illustrate the technical solution of the present application more clearly, and thus are only examples and should not be used to limit the protection scope of the present application.
[0043] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field to which this application belongs; the terms used herein are for the purpose of describing specific embodiments only and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above drawings are intended to cover non-exclusive inclusion.
[0044] In the description of the embodiments of this application, technical terms such as "first" and "second" are only used to distinguish different objects and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity, specific order or primary-secondary relationship of the indicated technical features. In the description of the embodiments of this application, the meaning of "a plurality of" is more than two, unless otherwise specifically defined.
[0045] Reference to "an embodiment" herein means that a particular feature, structure or characteristic described in connection with the embodiment can be included in at least one embodiment of this application. The phrase does not necessarily refer to the same embodiment at various places in the specification, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.
[0046] In the description of the embodiments of this application, the term "and / or" is only a description of the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " herein generally represents an "or" relationship between the associated objects before and after.
[0047] In the description of the embodiments of this application, the term "a plurality of" means more than two (including two). Similarly, "a plurality of groups" means more than two groups (including two groups), and "a plurality of pieces" means more than two pieces (including two pieces).
[0048] In the description of the embodiments of this application, the orientation or positional relationship indicated by technical terms such as "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the embodiments of this application and simplifying the description, rather than indicating or implying that the indicated device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the embodiments of this application.
[0049] In the description of the embodiments of the present application, unless otherwise clearly defined and limited, technical terms such as "installation", "connection", "connection", "fixation", etc. should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or integrated; it can also be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the communication inside two components or the interaction relationship between two components. For those of ordinary skill in the art, the specific meanings of the above terms in the embodiments of the present application can be understood according to specific circumstances.
[0050] Currently, from the perspective of the development of the market situation, rechargeable batteries are more and more widely used. Rechargeable batteries are not only applied to energy storage power systems such as hydropower, thermal power, wind power, and solar power stations, but also widely used in various electronic devices, such as electric vehicles, electric motorcycles, electric cars and other electric transportation vehicles, as well as military equipment, aerospace and other fields. With the continuous expansion of the application fields of rechargeable batteries, the market demand is also increasing continuously.
[0051] The battery cell includes a battery top cover and a battery case. The battery top cover is located at the top of the battery cell, and key components such as a liquid injection hole, a safety valve, and electrode terminals are provided thereon. The battery case is used to accommodate the internal components of the battery cell. The sealing performance and stability between the battery top cover and the battery case play a key role in the battery performance and safety. For example, laser welding is used between the battery top cover and the battery case, and the high-energy density laser beam is used to locally melt the connection part of the battery top cover and the battery case to achieve a firm connection, so as to improve the sealing performance.
[0052] Therefore, when welding the gap between the battery top cover and the battery case, it is necessary to detect the size of the gap to avoid laser passing through the gap and irradiating the inside of the battery during the welding process, which may cause damage to the battery and increase the production cost of the battery.
[0053] In some embodiments, after the battery top cover and the battery case are assembled, manual detection is used to detect the gap between the battery top cover and the battery case. The detection efficiency of manual detection is low and the accuracy is difficult to guarantee, resulting in a reduction in production efficiency; in some embodiments, automated equipment is used for contact detection. The automated equipment can only measure the size of the gap edge, and the detection accuracy for irregular gaps is relatively low. It cannot effectively screen out the batteries with unqualified gaps, which may cause damage during battery welding.
[0054] To solve the above problems, the present application provides a size detection method based on image processing. The size detection method includes: obtaining a three-dimensional detection image, based on the three-dimensional detection image, determining a cross-sectional fitting curve that is perpendicular to the extending direction of the target gap and passes through a preset detection point, performing differential processing on the cross-sectional fitting curve to obtain a differential curve for characterizing the depth differential value corresponding to each pixel point, based on the differential curve, determining a first position and a second position that respectively characterize the positions of two opposite sidewalls of the target gap, and determining the width size of the target gap according to the position information of the first position and the second position in a preset coordinate system. By performing differential processing on the cross-sectional fitting curve, the change trend of the cross-sectional fitting curve is converted into a differential curve of the depth differential value. The differential curve can clearly show the rate of depth change at each pixel point, which helps to accurately identify the position change of the gap sidewall. Using the characteristics of the depth differential value to determine the positions of two opposite sidewalls of the target gap, and thus determine the width size between the two sidewalls, improving the accuracy of size detection.
[0055] The size detection method based on image processing disclosed in the embodiments of the present application can be applied to any component that needs to detect gaps, including but not limited to the detection of gap sizes between components in industrial production processes such as mechanical part manufacturing and electronic product assembly in the industrial manufacturing field; the detection of gap sizes between aerospace components in the aerospace field; the detection of gap sizes between automotive components in the automotive manufacturing field; and the detection of gap sizes before welding of the battery top cover and the battery case in the new energy field.
[0056] An electrical device powered by a battery cell detected by using the size detection method of the present application. The electrical device can be but not limited to mobile phones, tablets, laptop computers, electric toys, electric tools, battery cars, electric vehicles, ships, spacecraft, etc. Among them, the electric toy can include fixed or mobile electric toys, such as game consoles, electric vehicle toys, electric ship toys, and electric aircraft toys, etc. The spacecraft can include airplanes, rockets, space shuttles, and spaceships, etc. A energy storage device using the battery cell as a power source can also be used. The energy storage device can be but not limited to energy storage containers, energy storage cabinets, energy storage power stations, energy storage battery packs, or portable energy storage systems, etc.
[0057] Combined Figures 1 to 3 As shown, the embodiments of the present application provide a size detection method based on image processing. The size detection method 100 includes:
[0058] Step S110, obtaining a three-dimensional detection image, where the three-dimensional detection image includes depth information corresponding to the target gap and the first component and the second component adjacent to the target gap respectively;
[0059] Step S120: Based on the three-dimensional detection image, determine a cross-sectional fitting curve that is perpendicular to the extension direction of the target gap and passes through a preset detection point; the cross-sectional fitting curve is used to characterize the cross-sectional shape of the target gap.
[0060] Step S130: Perform a differential process on the cross-sectional fitting curve to obtain a differential curve that is used to characterize the depth differential value corresponding to each pixel point.
[0061] Step S140: Based on the differential curve, determine a first position and a second position that respectively characterize the positions of two opposite side walls of the target gap.
[0062] Step S150: Determine the width dimension of the target gap according to the position information of the first position and the second position in a preset coordinate system.
[0063] This application is applicable to the detection of gaps between any components. For example, after the first component and the second component are assembled, there is a gap between the first component and the second component, and this gap is the target gap. The length and depth of the target gap are related to the structural shapes of the first component and the second component, and specific parameters are not limited.
[0064] For the detection of the target gap, it is necessary to determine a preset detection point. The preset detection point is a detection point on the surface of the first component or the second component of the target gap. The preset detection point can be a point evenly set along the extension direction of the target gap, or a single point with a specific mark. The preset detection point is used to characterize the width dimension of the target gap passing through this preset detection point.
[0065] In some embodiments, the preset detection point can be determined first, and a three-dimensional detection image including this preset detection point can be obtained according to the preset detection point; in some embodiments, multiple three-dimensional detection images can also be obtained along the extension direction of the target gap, and the preset detection point to be detected can be determined according to the obtained three-dimensional detection images. For example, multiple preset detection points can be stored in the dimension detection system. The specific step sequence can be determined according to the actual situation.
[0066] In step S110, a three-dimensional detection image including the target gap is obtained. Any three-dimensional detection device capable of obtaining a three-dimensional detection image meets the requirements of this application. For example, three-dimensional cameras such as CCD (Charge Coupled Device, semiconductor photosensitive element) three-dimensional cameras, laser triangulation three-dimensional cameras, structured light three-dimensional cameras, and binocular stereo vision three-dimensional cameras, etc. For ease of understanding, a three-dimensional coordinate system is established for auxiliary explanation. In the three-dimensional coordinate system, the X-axis is the horizontal axis and is parallel to the extension direction of the target gap; the Y-axis is the horizontal axis and is perpendicular to the extension direction of the target gap; the Z-axis is the vertical axis, indicating the depth of the target gap.
[0067] In some embodiments, the three-dimensional detection image obtained by using a three-dimensional detection device may include a planar view, for example, an XY plane. The plane where the planar view is located is parallel to the extending direction of the target gap. The planar view includes the gray-scale information of the first component, the second component, and the target gap. The gray-scale information refers to the gray-scale value of each pixel point in the image and is used to represent the brightness and darkness of the pixel. For example, when obtaining the three-dimensional detection image, the gray-scale information can help identify the target gap and the outlines and boundaries of the adjacent components. Due to the different surface characteristics of the first component, the second component, and the target gap, and the different distances from the detection device, different gray-scale values will be presented on the gray-scale image. Thus, the approximate position and range of the target gap can be initially determined by analyzing the gray-scale information.
[0068] In some embodiments, the three-dimensional detection image obtained by using a three-dimensional detection device may further include a depth map, for example, a depth map of the YZ plane. The plane where the depth map is located is perpendicular to the extending direction of the target gap. The depth map includes the depth information corresponding to the first component and the second component respectively. The depth information is the gray-scale information of different depths including the first component, the second component, and the target gap, and this depth information can be used to determine the width and depth of the target gap.
[0069] It should be noted that there may be multiple preset detection points set in the target gap in the planar view, and each preset detection point has a corresponding depth map. The multiple preset points to be detected in the planar view are set as the target detection area. To facilitate quickly determining the target detection area, a caliper and a locator can be used to determine the target detection area. The position of the locator can be used as the center point of the target detection area or the position of the caliper. In practical applications, multiple locators can be set. Optionally, the position of the locator moves with the movement of the position of the caliper.
[0070] The interval and the number of calipers can be determined according to the preset detection interval and detection number. The detection interval can be determined according to the conversion rate and the line interval. Optionally, calipers in the X, Y, and Z directions are set, and the conversion rate can include the X conversion rate, the Y conversion rate, and the Z conversion rate. The caliper in the X direction determines the dimension of the target gap in the extending direction, the caliper in the Y direction determines the dimension of the target gap in the width direction, and the caliper in the Z direction determines the dimension of the target gap in the depth direction.
[0071] In step S120, according to the obtained three-dimensional image, a depth map including the preset detection points is selected. The width of the depth map covers at least the target gap and the contact areas of the adjacent first component and second component with the target gap.
[0072] In some embodiments, the process of obtaining a preset detection point through the user interface in the dimension detection system may include: setting a drop-down menu in the user interface, and determining the preset detection point according to the user's selection operation on the drop-down menu. For example, when receiving the operation of the user selecting the preset detection point A in the drop-down menu, the preset detection point obtained is A; when receiving the operation of the user selecting the preset detection point B in the drop-down menu, the preset detection point obtained is B. The obtaining method of the preset detection point is not limited to the above description and can be set according to the actual situation.
[0073] By processing the depth information in the depth map, a cross-section fitting curve C is obtained. The cross-section fitting curve C includes curves of multiple surfaces such as the top surface of the first component, the side surface and the bottom surface of the target gap, and the top surface of the second component, reflecting the cross-sectional shape of the target gap.
[0074] In some embodiments, the process of determining the cross-section fitting curve C according to the depth information may include: obtaining a detection mode through the user interface, and processing the depth information in the target detection area by using the obtained detection mode. Among them, the detection mode may include the all-line mode and the average-line mode. The above process of obtaining the detection mode through the user interface may refer to the method of obtaining the preset detection point.
[0075] In the all-line mode, part of the depth information is removed, and the remaining depth information is processed to obtain the cross-section fitting curve C; among them, the removed part of the depth information may be to remove special information, such as the gap width being 0, the maximum value, the minimum value, etc., or to remove it according to a ratio.
[0076] The average-line mode is to divide the target gap into multiple small regions along the extension direction. For example, taking pixel blocks as units, the depth values in each small region are averaged, and the obtained average value is used to represent the depth information of the small region.
[0077] The specific fitting tool and fitting method are not limited and can be determined according to the tools and methods preset in the dimension detection system. The fitting tools are, for example, Python, Matlab, etc., and the fitting methods are, for example, polynomial fitting method or spline interpolation method, etc.
[0078] In step S130, in the coordinate system of the YZ plane, the obtained cross-section fitting curve C can be scattered into a series of discrete points. Each point corresponds to a depth value and a coordinate value. Using numerical differentiation methods, such as the central difference method, the forward difference, etc., the depth differential value of each discrete point is calculated. The depth differential values of each pixel point are plotted. The abscissa of the differential curve is the position of the pixel point, and the ordinate is the depth differential value. The differential curve can reflect the rate of depth change at each pixel point of the cross-section fitting curve C. Compared with the original cross-section fitting curve C, the differential curve can more intuitively and prominently present the characteristics of depth change.
[0079] In some embodiments, the differential curve can be smoothed, such as using Gaussian filtering or moving average filtering, to eliminate the mutation points caused by noise.
[0080] In step S140, analyze the differential curve of the depth differential value corresponding to each pixel point. For the two waveforms respectively corresponding to the two opposite side walls of the target gap, the depth changes are relatively drastic at the two opposite side walls of the target gap, which are manifested as relatively large differential values on the differential curve.
[0081] In some embodiments, the extreme points of the two waveforms respectively corresponding to the two opposite side walls of the target gap can be selected. The extreme points of the two waveforms represent the parts with the largest changes of the two opposite side walls of the target gap, and the extreme points of the two waveforms are the first position and the second position of the positions of the opposite side walls.
[0082] In some embodiments, a threshold can be set, and the mutation points caused by noise are filtered using the threshold. The threshold points on the two waveforms respectively corresponding to the two opposite side walls of the target gap are the first position and the second position of the positions of the opposite side walls.
[0083] In step S150, the first position and the second position on the differential curve are respectively corresponding to the corresponding positions on the sectional fitting curve C. It should be noted that the horizontal distance between the first position and the second position on the differential curve is the width dimension of the target gap on the sectional fitting curve C.
[0084] Obtain the distance between the first position and the second position on the differential curve in the preset coordinate system. Since both the first position and the second position belong to the YZ plane, the X-axis coordinates of the first position and the second position are the same. For example, the first position coordinate is (x, y1, z1), and the second position coordinate is (x, y2, z2).
[0085] In some embodiments, the coordinates of the first position and the second position are obtained through the dimension detection system, and the horizontal interval between the first position and the second position is obtained through the coordinate difference. In some embodiments, the number of pixel points between the first position and the second position is obtained through the dimension detection system, so as to obtain the horizontal interval distance between the first position and the second position.
[0086] By differentiating the sectional fitting curve C, the change trend of the sectional fitting curve C is transformed into the differential curve of the depth differential value. The differential curve can clearly show the rate of depth change at each pixel point, which helps to accurately identify the position change of the gap side wall. Utilize the characteristics of the depth differential value to determine the positions of the two opposite side walls of the target gap, so as to determine the width dimension between the two side walls and improve the accuracy of dimension detection.
[0087] According to some embodiments of the present application, the differential curve includes adjacent first and second waveforms respectively corresponding to two opposite sidewalls of the target gap; the first position is within the pixel range corresponding to the half-wave of the first waveform adjacent to the second waveform; the second position is within the pixel range corresponding to the half-wave of the second waveform adjacent to the first waveform.
[0088] The differential curve is obtained by differentiating the cross-section fitting curve C. Since the depth changes are relatively drastic at the two opposite sidewalls of the target gap, the sharp depth changes cause the differential values to fluctuate significantly, forming obvious waveforms. Therefore, the adjacent first and second waveforms in the differential curve respectively correspond to the two opposite sidewalls of the target gap.
[0089] For example, when entering the target gap from the top surface of the first component, the depth value changes rapidly, and the differential value increases to form the rising edge of the waveform; after continuing to penetrate into the target gap to a certain extent, the depth change tends to be stable, and the differential value decreases to form the falling edge of the waveform, thus constituting a complete waveform corresponding to one sidewall of the target gap. Similarly, from the bottom of the target gap to the top surface of the second component, the depth value will also change rapidly, forming another complete waveform corresponding to the other sidewall of the target gap.
[0090] Both the first waveform and the second waveform are complete waveforms composed of a rising edge and a falling edge, respectively corresponding to the two sidewalls of the target gap. The half-wave of the first waveform adjacent to the second waveform and the half-wave of the second waveform adjacent to the first waveform both refer to the half waveform close to the junction of the two waveforms, and the adjacent two half-waves are both close to the stable area between the two waveforms.
[0091] By setting the first position and the second position within the pixel ranges corresponding to two adjacent half-waves, the two positions focus on the half-wave regions of the waveforms, corresponding to the regions closer to the downstream in the sidewalls of the target gap, which can effectively utilize the depth information of the three-dimensional detection image, obtain more accurate position positioning, and improve the measurement accuracy of the gap width.
[0092] Combined Figure 3 and Figure 4 As shown, according to some embodiments of the present application, step S140 includes:
[0093] Step S141, perform a first filtering step on the differential curve to obtain a first filtered curve, and the first filtering step includes filtering out the partial waveforms in the differential curve where the depth differential values exceed the first preset threshold range;
[0094] Step S142, based on the first filtered curve, determine the first position and the second position.
[0095] The adjacent first waveform and second waveform in the differential curve respectively correspond to the change rates of two opposite side walls of the target gap in the depth direction. Due to reasons such as noise interference, errors of the image acquisition device, or uneven surfaces of the side walls of the target gap, there may be some abnormal fluctuations in the differential curve, and the depth differential values corresponding to the fluctuations may exceed the normal range. By setting the first preset threshold range, these abnormal partial waveforms can be filtered out.
[0096] In step S141, a first filtering process is performed on the obtained differential curve. By setting the first preset threshold range L1 in the dimension detection system, the partial waveforms exceeding the first preset threshold range L1 are filtered out, and the differential curve after filtering is the first filtered curve Y1.
[0097] Exemplarily, a filtering threshold is set in the dimension detection system, and the parts of the waveforms in the differential curve higher than the filtering threshold are directly filtered out by the system. Exemplarily, a filtering ratio is set according to the waveform height in the dimension detection system, and the top of the waveform is filtered according to the ratio. The filtering ratio can be, for example, 10%, 20%, etc.
[0098] In step S142, the first position and the second position are determined according to the first filtered curve Y1 obtained after filtering. Exemplarily, the first position is within the pixel range corresponding to the half-wave of the first waveform adjacent to the second waveform after filtering; Exemplarily, the second position is within the pixel range corresponding to the half-wave of the second waveform adjacent to the first waveform after filtering.
[0099] By performing the first filtering process on the differential curve and filtering out the partial waveforms exceeding the first preset threshold range L1, the interference caused by the protrusions on the surfaces of the two side walls of the target gap can be removed, and the wrong judgment caused by noise and abnormal fluctuations in finding the side wall positions can be reduced as much as possible, thereby improving the accuracy of the detected width dimension of the target gap.
[0100] Combined Figure 3 and Figure 4 As shown, according to some embodiments of the present application, the first filtering step includes:
[0101] Step S210, obtaining the first preset threshold range L1; the first preset threshold range L1 includes an upper limit value and a lower limit value;
[0102] Step S220, in response to the depth differential value of the pixel point in the differential curve being greater than the upper limit value of the first preset threshold range, replacing the depth differential value of the pixel point with the upper limit value of the first preset threshold range L1;
[0103] Step S230, in response to the depth differential value of the pixel point in the differential curve being less than the lower limit value of the first preset threshold range L1, replacing the depth differential value of the pixel point with the lower limit value of the first preset threshold range L1;
[0104] Step S240: Fit the depth differential values of each pixel point to obtain the first filtering curve Y1.
[0105] In step S141, by performing the first filtering step on the differential curve, the part of the waveform with depth differential values exceeding L1 in the differential curve is filtered out using the first filtering step. What can also be included in performing the first filtering step is:
[0106] In step S210, set the upper limit value and the lower limit value of the first preset threshold range L1, and filter out the part of the differential curve where the depth differential value exceeds the upper limit value and the part below the lower limit value.
[0107] In some embodiments, if the upper limit value is set in the first waveform or the second waveform, then the lower limit value is correspondingly set in the other waveform. The determination of the upper limit value and the lower limit value can be based on requirements. For example, determine the upper limit value and the lower limit value according to a preset depth differential threshold; for example, determine the upper limit value and the lower limit value according to the filtering ratio of the waveform height, and so on.
[0108] In step S220, when the depth differential value of a pixel point in the differential curve is greater than the upper limit value of the set first preset threshold range L1, replace the depth differential value of this pixel point with the upper limit value. For pixel points with overly high depth differential values caused by noise, interference, or other abnormal factors, adjust their values to the maximum acceptable value within the threshold range.
[0109] In step S230, when the depth differential value of a pixel point in the differential curve is less than the lower limit value of the first preset threshold range L1, replace it with the lower limit value. Similarly, for pixel points with overly low depth differential values caused by abnormal factors, adjust them to the minimum acceptable range.
[0110] In step S240, after processing the depth differential values of all pixel points according to the upper limit value and the lower limit value, the curve that originally exceeded the upper limit value is fitted into a horizontal line, and the curve that originally was below the lower limit value is fitted into a horizontal line, obtaining the first filtering curve Y1.
[0111] By setting the first preset threshold range L1 of the upper limit value and the lower limit value, and filtering the depth differential values outside the range, the influence of noise and outliers in the differential curve can be further reduced. It helps to better determine the first position and the second position, and further improve the accuracy of the target gap detection width dimension.
[0112] Combined Figure 3 and Figure 4 As shown, according to some embodiments of the present application, step S210 includes:
[0113] Step S211A: Determine a first filtering line. The first filtering line is parallel to the coordinate axis representing the pixel position in the differential curve, and the first filtering line intersects the first waveform and the second waveform;
[0114] Step S212A: In response to the pixel distance between two intersection points where the first filtering line intersects the first waveform or the second waveform being a first preset width a1, and the depth differential value corresponding to the first filtering line being greater than 0, determine the depth differential value corresponding to the first filtering line as the upper limit value of a first preset threshold range L1; and / or
[0115] Step S213A: In response to the pixel distance between two intersection points where the first filtering line intersects the first waveform or the second waveform being a second preset width a2, and the depth differential value corresponding to the first filtering line being less than 0, determine the depth differential value corresponding to the first filtering line as the lower limit value of the first preset threshold range L1.
[0116] In step S210, it is necessary to determine the upper limit value and the lower limit value of the first preset threshold range L1.
[0117] It should be noted that the cross-section fitting curve C includes curves of multiple surfaces such as the top surface of the first component, the side surfaces and the bottom surface of the target gap, and the top surface of the second component, reflecting the cross-sectional shape of the target gap. In the cross-section fitting curve C, the curve from the top surface of the first component to the bottom surface of the target gap is a descending curve, and the curve from the bottom surface of the target gap to the top surface of the second component is an ascending curve. Therefore, when the cross-section fitting curve C is differentially processed from one end to the other end, the first waveform and the second waveform corresponding to the two side walls of the target gap should be distributed on both sides of the coordinate axis representing the pixel position, which can be understood as the wave peaks of the first waveform and the second waveform facing different directions.
[0118] In step S211A, determine the first filtering line. The purpose of the first filtering line is to select a suitable position on the differential curve to obtain the depth differential value for determining the first preset threshold range L1.
[0119] In some embodiments, the first filtering line is parallel to the coordinate axis representing the pixel position in the differential curve. The position where the first filtering line intersects the first waveform is set as the upper limit value. In some embodiments, the position where the first filtering line intersects the second waveform is set as the upper limit value; for the sake of easy explanation, an example is given where the wave peak of the first waveform faces upward and the wave peak of the second waveform faces downward. That is, the position where the first filtering line intersects the first waveform is set as the upper limit value.
[0120] In step S212A, the pixel distance between two intersection points where the first filtering line intersects the first waveform is the first preset width a1. The first preset width a1 represents the dimensional width occupied by the sidewall corresponding to the first waveform in the Y-axis direction. The larger the first preset width, the worse the perpendicularity of the corresponding sidewall. The first filtering line can be determined according to the first preset width a1. The depth differential value corresponding to the first filtering line on the first waveform is greater than 0, and the depth differential value corresponding to the first filtering line is determined as the upper limit value of the first preset threshold range L1. The determination method of the first preset width a1 is not limited. For example, it can be a width threshold, a waveform width ratio, etc.
[0121] In step S213A, the pixel distance between two intersection points where the first filtering line intersects the second waveform is the second preset width. The second preset width represents the dimensional width occupied by the sidewall corresponding to the second waveform in the Y-axis direction. The larger the second preset width, the worse the perpendicularity of the corresponding sidewall. The first filtering line can be determined according to the second preset width a2. The depth differential value corresponding to the first filtering line on the second waveform is less than 0, and the depth differential value corresponding to the first filtering line is determined as the lower limit value of the first preset threshold range L1. The determination method of the second preset width a2 is not limited. For example, it can be a width threshold, a waveform width ratio, etc.
[0122] For the first waveform and the second waveform in different directions, using the first filtering line to respectively determine the filtering ranges of the first waveform and the second waveform can respectively reduce the interference caused by the surface protrusions on both sidewalls of the target gap, which helps to better determine the first position and the second position, and further improve the accuracy of the detected width dimension of the target gap.
[0123] Combined Figure 3 and Figure 5 As shown in, according to some embodiments of the present application, step S210 includes:
[0124] Step S211B: Perform an absolute value transformation on the depth differential value corresponding to each pixel point in the differential curve to obtain a differential transformation curve;
[0125] Step S212B: Determine a second filtering line. The second filtering line is parallel to the coordinate axis representing the pixel point position in the differential transformation curve, and the second filtering line intersects both the first waveform and the second waveform at the same time;
[0126] Step S213B: In response to the smaller of the pixel distance between two intersection points where the second filtering line intersects the first waveform and the pixel distance between two intersection points where the second filtering line intersects the second waveform being the third preset width a3, determine the depth differential value corresponding to the second filtering line as the upper limit value of the first preset threshold range L1; and
[0127] Step S214B: Determine the lower limit value of the first preset threshold range L1 as 0.
[0128] In step S210, it is necessary to determine the upper limit value and the lower limit value of the first preset threshold range L1.
[0129] It should be noted that the cross-section fitting curve C is subjected to differential processing from one end to the other end. The first waveform and the second waveform corresponding to the two side walls of the target gap should be distributed on both sides of the coordinate axis representing the pixel positions. It can be understood that the wave peaks of the first waveform and the second waveform face different directions. For the convenience of waveform analysis, the waveform can be subjected to absolute value transformation.
[0130] In step S211B, perform absolute value transformation on the depth differential values corresponding to each pixel point in the differential curve, so that the wave peaks of the first waveform and the second waveform both face upward, and obtain the differential transformation curve.
[0131] In step S212B, determine the second filtering line. The purpose of the second filtering line is to select a suitable position on the differential curve to obtain the depth differential value for determining the first preset threshold range L1. The first waveform and the second waveform are on the same side. The second filtering line intersects both the first waveform and the second waveform at the same time. The second filtering line is parallel to the coordinate axis representing the pixel positions in the differential transformation curve.
[0132] In step S213B, the pixel distance between the two intersection points where the second filtering line intersects the first waveform is a width, and the pixel distance between the two intersection points where the second filtering line intersects the second waveform is a width. Thus, according to the third preset width a3, the second filtering line can be determined. Exemplarily, if the pixel distance between the two intersection points where the second filtering line intersects the first waveform is equal to the third preset width a3, then the pixel distance between the two intersection points where the second filtering line intersects the second waveform should be greater than or equal to the third preset width a3; Exemplarily, if the pixel distance between the two intersection points where the second filtering line intersects the second waveform is equal to the third preset width a3; then the pixel distance between the two intersection points where the second filtering line intersects the first waveform should be greater than or equal to the third preset width a3. Setting the smaller one as the third preset width a3 can improve the filtering accuracy, and determine the depth differential value corresponding to the second filtering line as the upper limit value of the first preset threshold range L1.
[0133] In step S214B, determine the lower limit value of the first preset threshold range L1 as 0. That is, the first preset threshold range L1 should be between 0 and the depth differential value corresponding to the second filtering line.
[0134] By performing an absolute value transformation on the depth differential values corresponding to each pixel point in the differential curve, the first waveform and the second waveform are located on the same side. By setting the upper limit value of the first preset threshold range L1, the first preset threshold range L1 can be determined, which helps improve the processing efficiency of the differential curve.
[0135] As Figure 4 shown, according to some embodiments of the present application, step S412 includes:
[0136] Step S310: Determine the first position as the pixel points in the half-wave of the first waveform adjacent to the second waveform where the depth differential value is equal to the upper limit value or the lower limit value of the first preset threshold range L1;
[0137] Step S320: Determine the second position as the pixel points in the half-wave of the second waveform adjacent to the first waveform where the depth differential value is equal to the upper limit value or the lower limit value of the first preset threshold range L1.
[0138] After performing the first filtering step on the differential curve to obtain the first filtered curve Y1, it is necessary to determine the first position on the first waveform and the second position on the second waveform based on the first filtered curve Y1. The specific implementation steps are as follows:
[0139] In some embodiments, the first waveform and the second waveform should be distributed on both sides of the coordinate axis representing the pixel point position, that is, the wave peaks of the first waveform and the second waveform face different directions. For the convenience of description, an example is given where the wave peak of the first waveform faces upward and the wave peak of the second waveform faces downward.
[0140] In step S310, the pixel points in the half-wave of the first waveform adjacent to the second waveform where the depth differential value is equal to the upper limit value of the first preset threshold range L1 are taken as the first position; it should be noted that after filtering by the first filtering step, the depth differential values of the pixel points in the original differential curve that are greater than the upper limit value of the first preset threshold range L1 are replaced with the upper limit value of the first preset threshold range L1. Therefore, the differential curve corresponding to the upper limit value of the first preset threshold range L1 should be a straight line parallel to the coordinate axis of the pixel point position. The first position can be any point on this straight line or the end point B1 of this straight line close to the second waveform.
[0141] In step S320, the pixel points in the half-wave of the second waveform adjacent to the first waveform where the depth differential value is equal to the lower limit value of the first preset threshold range L1 are taken as the second position; similarly, after filtering by the first filtering step, the depth differential values of the pixel points in the original differential curve that are greater than the lower limit value of the first preset threshold range L1 are replaced with the lower limit value of the first preset threshold range L1. Therefore, the differential curve corresponding to the lower limit value of the first preset threshold range L1 should be a straight line parallel to the coordinate axis of the pixel point position. The first position can be any point on this straight line or the end point B2 of this straight line close to the first waveform.
[0142] In some embodiments, by performing an absolute value transformation on the depth differential values corresponding to each pixel point in the differential curve, a differential transformation curve is obtained, such that the first waveform and the second waveform are on the same side.
[0143] In step S310, the upper limit value of the depth differential value equal to the first preset threshold range L1 in the half-wave of the first waveform adjacent to the second waveform is taken as the first position. The specific manner of determining the first position has been given in the foregoing embodiments and will not be elaborated herein.
[0144] In step S320, the upper limit value of the depth differential value equal to the first preset threshold range L1 in the half-wave of the second waveform adjacent to the first waveform is taken as the second position. The specific manner of determining the second position has been given in the foregoing embodiments and will not be elaborated herein.
[0145] Through the first filtering step, the interference of noise and outliers has been removed, such that the first filtered curve Y1 can more truly reflect the depth change of the target gap. Determining the first position and the second position as the upper limit value or the lower limit value of the first preset threshold range L1 respectively can shorten the time for determining the first position and the second position on the first filtered curve Y1 and improve the detection efficiency.
[0146] Combined Figure 3 and Figure 6 As shown, according to some embodiments of the present application, step S412 further includes:
[0147] S410. Perform a second filtering step on the first filtered curve Y1 to obtain a second filtered curve Y2. The second filtering step includes filtering out the partial waveforms of the depth differential values in the first filtered curve Y1 that fall within the second preset threshold range L2;
[0148] S420. Based on the second filtered curve Y2, determine the first position and the second position.
[0149] After being processed by the first filtering step, the partial peak curves of the first waveform and the partial peak curves of the second waveform are mainly removed, mainly removing the interference caused by the unevenness of the two side wall surfaces corresponding to the target gap or the protrusion of foreign objects. Further considering that the junction region may affect the detection accuracy, such as the junction regions between the first component and the second component and the target gap, and the junction regions between the side surface and the bottom surface of the target gap, etc., the bottom inflection points of the first waveform and the second waveform correspond to the junction region of the target gap. In order to further improve the detection accuracy of the target gap, after being processed by the first filtering step, it is further processed by the second filtering step.
[0150] In step S410, after obtaining the first filter curve Y1, the first filter curve Y1 is subjected to a second filter process. By setting a second preset threshold range L2 in the size detection system, part of the waveform whose depth differential value in the first filter curve Y1 falls within the second preset threshold range L2 is filtered, and the differential curve after filtering is the second filter curve Y2.
[0151] Exemplarily, in the size detection system, a filtering threshold is set according to the height of the waveform, and the part of the waveform of the first filter curve Y1 that is lower than the filtering threshold is directly filtered out. Exemplarily, in the size detection system, a filtering ratio is set according to the height of the waveform, and the bottom of the waveform is filtered according to the ratio, such as 10%, 20%, etc.
[0152] In step S420, the first position and the second position are determined based on the first filtering curve Y1 obtained after filtering. Exemplarily, the first position is located within the pixel range corresponding to the half-wave of the first waveform adjacent to the second waveform after filtering; exemplary, the second position is located within the pixel range corresponding to the half-wave of the second waveform adjacent to the first waveform after filtering.
[0153] By performing a second filtering process on the first filtering curve Y1 and filtering out part of the waveform that falls within the second preset threshold range L2, the bottom area of the first waveform and the second waveform can be removed, thereby minimizing the possibility of taking points in the intersection area between the first component and the second component and the target gap, and the possibility of taking points in the intersection area between the side and bottom of the target gap, thereby improving the accuracy of the target gap detection width size.
[0154] Combination Figure 3 and Figure 6 As shown, according to some embodiments of the present application, the second filtering step includes:
[0155] S510, obtaining a second preset threshold range L2; the upper limit value of the second preset threshold range L2 is greater than 0 and less than the upper limit value of the first preset threshold range L1, and the lower limit value of the second preset threshold range L2 is less than 0 and greater than the lower limit value of the first preset threshold range L1;
[0156] S520, in response to the depth differential value corresponding to the pixel point in the first filtering curve Y1 falling into the second preset threshold range L2, the depth differential value corresponding to the pixel point is replaced with a null value;
[0157] S530 , determining the curve obtained by filtering out the first filtering curve Y1 as the second filtering curve Y2 .
[0158] It should be noted that the first waveform and the second waveform corresponding to the two side walls of the target gap should be distributed on both sides of the coordinate axis representing the pixel position, which can be understood as the wave peaks of the first waveform and the second waveform facing different directions. In step S140, by performing a second filtering step on the first filtering curve Y1, the partial waveform of the depth differential value in the first filtering curve Y1 that falls within the second preset threshold range L2 is filtered out by the second filtering step. The execution of the second filtering step may further include:
[0159] In step S510, the upper limit value and the lower limit value of the second preset threshold range L2 are set, and the part of the first filtering curve Y1 where the depth differential value falls within the upper limit value and the lower limit value of the second preset threshold range L2 is filtered out.
[0160] In some embodiments, the wave peak of the first waveform faces upward, the wave peak of the second waveform faces downward, the upper limit value of the second preset threshold range L2 is set in the first waveform, the upper limit value of the second preset threshold range L2 is greater than 0 and less than the upper limit value of the first preset threshold range L1. The lower limit value of the second preset threshold range L2 is set in the second waveform, the lower limit value of the second preset threshold range L2 is less than 0 and greater than the lower limit value of the first preset threshold range L1. The determination of the upper limit value and the lower limit value of the second preset threshold range L2 can be determined according to requirements. For example, the upper limit value and the lower limit value are determined according to a preset depth differential threshold; for example, the upper limit value and the lower limit value are determined according to the filtering ratio of the waveform height, and so on.
[0161] In step S520, when the depth differential value of the pixel in the first filtering curve Y1 is less than the upper limit value of the set second preset threshold range L2, the depth differential value corresponding to the pixel is replaced with a null value. When the depth differential value of the pixel in the first filtering curve Y1 is greater than the lower limit value of the set second preset threshold range L2, the depth differential value corresponding to the pixel is replaced with a null value.
[0162] In step S530, after processing the depth differential values of all pixels in the first filtering curve Y1 according to the upper limit value and the lower limit value of the second preset threshold range L2, a second filtering curve Y2 is obtained.
[0163] For the first waveform and the second waveform in different directions, using the upper limit value and the lower limit value of the second preset threshold range L2 and processing the falling part, it is mainly to exclude the interference caused by the structural changes at the junction of the first component and the target gap, the junction of the side surface and the bottom surface of the target gap, and the junction of the second component and the target gap, and improve the accuracy of the detection width dimension of the target gap.
[0164] Combined Figure 3 and Figure 6 As shown, according to some embodiments of the present application, step S510 includes:
[0165] Step S511: Determine the third filtering line. The third filtering line is parallel to the coordinate axis representing the pixel position in the differential curve, and the third filtering line intersects with the first waveform or the second waveform.
[0166] Step S512: In response to the pixel distance between the two intersection points where the third filtering line intersects with the first waveform or the second waveform being the fourth preset width a4, and the depth differential value corresponding to the third filtering line being greater than 0, determine the depth differential value corresponding to the third filtering line as the upper limit value of the second preset threshold range L2; and / or
[0167] Step S513: In response to the pixel distance between the two intersection points where the third filtering line intersects with the first waveform or the second waveform being the fifth preset width a5, and the depth differential value corresponding to the third filtering line being less than 0, determine the depth differential value corresponding to the third filtering line as the lower limit value of the second preset threshold range L2.
[0168] In step S510, it is necessary to determine the upper limit value and the lower limit value of the second preset threshold range L2.
[0169] In step S511, determine the third filtering line. The purpose of the third filtering line is to select a suitable position on the first filtering curve Y1 to obtain the depth differential value for determining the second preset threshold range L2. The third filtering line is parallel to the coordinate axis representing the pixel position in the differential curve.
[0170] In some embodiments, the position where the third filtering line intersects with the first waveform is set as the upper limit value. In some embodiments, the position where the third filtering line intersects with the second waveform is set as the upper limit value. For the convenience of description, take the example where the peak of the first waveform faces upward and the peak of the second waveform faces downward. That is, the position where the third filtering line intersects with the first waveform is set as the upper limit value of the second preset threshold range L2.
[0171] In step S512, the pixel distance between the two intersection points where the third filtering line intersects with the first waveform is the fourth preset width a4. The fourth preset width a4 represents the size width occupied by the side wall corresponding to the first waveform in the Y-axis direction. The larger the fourth preset width a4, the worse the perpendicularity of the corresponding side wall. According to the fourth preset width a4, the third filtering line can be determined. The depth differential value corresponding to the third filtering line on the first waveform is greater than 0. Determine the depth differential value corresponding to the third filtering line as the upper limit value of the second preset threshold range L2. The determination method of the fourth preset width a4 is not limited. For example, width threshold, waveform width ratio, etc.
[0172] In step S513, the pixel distance between two intersection points where the third filtering line intersects the second waveform is the fifth preset width a5. The fifth preset width a5 represents the dimensional width occupied by the side wall corresponding to the second waveform in the Y-axis direction. The larger the fifth preset width a5, the worse the perpendicularity of the corresponding side wall. The third filtering line can be determined according to the fifth preset width a5. The depth differential value corresponding to the third filtering line on the second waveform is less than 0, and the depth differential value corresponding to the third filtering line is determined as the lower limit value of the second preset threshold range L2. The determination method of the fifth preset width a5 is not limited. For example, it can be a width threshold, a waveform width ratio, etc.
[0173] For the first waveform and the second waveform in different directions, the filtering ranges of the first waveform and the second waveform are respectively determined by using the third filtering line, which can respectively reduce the interference caused by the structure at the junction of the side of the target gap and the first component and the second component, contribute to better determination of the first position and the second position, and further improve the accuracy of the detected width dimension of the target gap.
[0174] Combined Figure 3 and Figure 7 As shown, according to some embodiments of the present application, the second filtering step further includes:
[0175] S610. Perform an absolute value transformation on the depth differential value corresponding to each pixel point in the differential curve to obtain a differential transformation curve;
[0176] S620. Obtain the second preset threshold range L2; the upper limit value of the second preset threshold range L2 is greater than 0 and less than the upper limit value of the first preset threshold range L1, and the lower limit value of the second preset threshold range L2 is 0;
[0177] S630. In response to the depth differential value corresponding to the pixel point in the first filtering curve Y1 falling into the second preset threshold range L2, replace the depth differential value corresponding to the pixel point with a null value;
[0178] S640. Determine the curve obtained by filtering the first filtering curve Y1 as the second filtering curve Y2.
[0179] It should be noted that the two side walls of the target gap corresponding to the first waveform and the second waveform should be distributed on both sides of the coordinate axis representing the pixel point position, which can be understood as the wave peaks of the first waveform and the second waveform facing different directions. For the convenience of waveform analysis, an absolute value transformation can be performed on the waveform. The second filtering step may further include:
[0180] In step S610, perform an absolute value transformation on the depth differential value corresponding to each pixel point in the differential curve so that the wave peaks of the first waveform and the second waveform both face upward to obtain a differential transformation curve.
[0181] In step S620, the upper limit value and the lower limit value of the second preset threshold range L2 are set, and the part of the first filtering curve Y1 where the depth differential value falls within the upper limit value and the lower limit value of the second preset threshold range L2 is filtered out. The determination of the upper limit value of the second preset threshold range L2 can be based on requirements. For example, the upper limit value and the lower limit value are determined according to a preset depth differential threshold; for example, the upper limit value and the lower limit value are determined according to the filtering ratio of the waveform height, etc. It should be noted that the upper limit value of the second preset threshold range L2 should be greater than 0 and less than the upper limit value of the first preset threshold range L1. The lower limit value of the second preset threshold range L2 can be set to 0.
[0182] In step S630, when the depth differential value of a pixel point in the first filtering curve Y1 is less than the upper limit value of the set second preset threshold range L2, the depth differential value corresponding to the pixel point is replaced with a null value.
[0183] In step S640, after processing the depth differential values of all pixel points in the first filtering curve Y1 according to the upper limit value and the lower limit value of the second preset threshold range L2, a second filtering curve Y2 is obtained.
[0184] By performing an absolute value transformation on the depth differential value corresponding to each pixel point in the differential curve, the first waveform and the second waveform are located on the same side, and then filtering the first filtering curve Y1 after the absolute value transformation through the second filtering step helps to improve the detection accuracy and also helps to improve the processing efficiency of the differential curve.
[0185] Combined Figure 3 and Figure 7 As shown, according to some embodiments of the present application, step 620 further includes:
[0186] Step 621, determining a fourth filtering line, the fourth filtering line is parallel to the coordinate axis representing the pixel point position in the differential transformation curve, and the fourth filtering line intersects the first waveform and the second waveform at the same time;
[0187] Step 622, in response to the pixel distance between the two intersection points where the fourth filtering line intersects the first waveform, and the larger of the pixel distances between the two intersection points where the fourth filtering line intersects the second waveform being the sixth preset width a6, determining the depth differential value corresponding to the fourth filtering line as the upper limit value of the second preset threshold range L2; and
[0188] Step 623, determining the lower limit value of the second preset threshold range L2 as 0.
[0189] In step S620, it is necessary to determine the upper limit value and the lower limit value of the second preset threshold range L2. The specific determination operations of the upper limit value and the lower limit value are as follows:
[0190] In step S621, a fourth filtering line is determined. The purpose of the fourth filtering line is to select a suitable position on the differential curve to obtain the depth differential value for determining the second preset threshold range L2. The first waveform and the second waveform are on the same side. The fourth filtering line intersects both the first waveform and the second waveform simultaneously. The fourth filtering line is parallel to the coordinate axis representing the pixel point position in the differential transformation curve.
[0191] In step S622, the pixel distance between the two intersection points where the fourth filtering line intersects the first waveform is a width, and the pixel distance between the two intersection points where the fourth filtering line intersects the second waveform is a width. Thus, the fourth filtering line can be determined according to the sixth preset width a6.
[0192] Exemplarily, if the pixel distance between the two intersection points where the fourth filtering line intersects the first waveform is equal to the sixth preset width, then the pixel distance between the two intersection points where the fourth filtering line intersects the second waveform should be less than or equal to the sixth preset width; Exemplarily, if the pixel distance between the two intersection points where the fourth filtering line intersects the second waveform is equal to the sixth preset width, then the pixel distance between the two intersection points where the fourth filtering line intersects the first waveform should be less than or equal to the sixth preset width. Determining the depth differential value corresponding to the fourth filtering line as the upper limit value of the second preset threshold range L2 can improve the filtering accuracy.
[0193] In step S623, the lower limit value of the second preset threshold range L2 is determined to be 0. That is, the first preset threshold range L1 should be between 0 and the depth differential value corresponding to the fourth filtering line.
[0194] After performing an absolute value transformation on the depth differential value corresponding to each pixel point in the differential curve so that the first waveform and the second waveform are on the same side, the second preset threshold range L2 can be determined by setting the upper limit value of the second preset threshold range L2, which helps to improve the processing efficiency of the differential curve.
[0195] According to some embodiments of the present application, step S420 includes:
[0196] Step S710: Determine the middle position of the pixel points in the region where the depth differential value in the half-wave of the first waveform adjacent to the second waveform in the second filtering curve Y2 is greater than 0 and less than or equal to the upper limit value of the first preset threshold range L1 as the first position; the depth differential value corresponding to the pixel points in the first waveform is greater than or equal to 0;
[0197] Step S720: Determine the middle position of the pixel points in the region where the depth differential value in the half-wave of the second waveform adjacent to the first waveform in the second filtering curve Y2 is less than 0 and greater than or equal to the lower limit value of the first preset threshold range L1 as the second position.
[0198] After performing a second filtering step on the first filtering curve Y1 to obtain the second filtering curve Y2, it is necessary to determine the first position on the first waveform and the second position on the second waveform based on the second filtering curve Y2. The specific implementation steps are as follows:
[0199] In step S710, the depth differential value corresponding to the pixel points in the first waveform is greater than or equal to 0. The top of the first waveform in the second filtering curve Y2 is the upper limit value of the first preset threshold range L1, and the bottom of the first waveform in the second filtering curve Y2 is the upper limit value of the second preset threshold range L2. The middle position of the pixel points in the area between the upper limit value of the first preset threshold range L1 and the upper limit value of the second preset threshold range L2 is determined as the first position. For example, if there are 100 pixel points in the area between the upper limit value of the first preset threshold range L1 and the upper limit value of the second preset threshold range L2, find the corresponding point on the first waveform for the value of the abscissa corresponding to the middle position of the 100 pixel points, and this point is the first position.
[0200] In step S720, the depth differential value corresponding to the pixel points in the second waveform is less than or equal to 0. Similarly, the middle position of the pixel points in the area between the lower limit value of the first preset threshold range L1 and the lower limit value of the second preset threshold range L2 is determined as the second position.
[0201] By determining the first position as the middle position of the pixel points corresponding to the half-wave of the first waveform on the second filtering curve Y2 that is close to the second waveform, and determining the second position as the middle position of the pixel points corresponding to the half-wave of the second waveform on the second filtering curve Y2 that is close to the first waveform, the value-taking error during filtering can be further reduced, and the detection accuracy of the target gap can be improved.
[0202] According to some embodiments of the present application, the dimension detection method 100 further includes:
[0203] Step S160, determining the top surface position of the first component and the top surface position of the second component based on the cross-section fitting curve C;
[0204] Step S170, determining the height difference between the first component and the second component based on the top surface position of the first component and the top surface position of the second component.
[0205] In some embodiments, the dimension detection method can also be used to detect the height difference between the first component and the second component after the first component and the second component are assembled, so as to determine whether the external dimensions of the first component and the second component are qualified. For example, the first component can be a battery case, and the second component can be a battery top cover.
[0206] After determining the cross-section fitting curve C in step S120, the cross-section fitting curve C includes curves of multiple surfaces such as the top surface of the first component, the side and bottom surfaces of the target gap, and the top surface of the second component, reflecting the cross-sectional shape of the target gap.
[0207] While performing the differential processing on the cross-section fitting curve C in step S130, step S160 can also be executed.
[0208] In step S160, the top surface position of the first component and the top surface position of the second component are determined according to the cross-section fitting curve C.
[0209] Subsequently, step S170 is executed. The height difference between the first component and the second component can be determined according to the elevation difference between the top surface position of the first component and the top surface position of the second component on the plane, and it can be directly measured by using a locator and a caliper in dimensional inspection. Whether the shape and size of the first component and the second component are qualified is judged by the height difference.
[0210] In some embodiments, the dimensional inspection method 100 for the battery case and the battery top cover before welding can also be used to detect the height difference between the first component, the second component and the battery welding strip, and judge whether the installation and fixing position of the battery strip is appropriate.
[0211] By detecting the height difference between the first component and the second component, it is possible to more comprehensively obtain whether the positioning of the first component and the second component is qualified, improve the detection effect, and save time.
[0212] According to some embodiments of the present application, the dimensional inspection method 100 further includes:
[0213] Step S180: Obtain a data set composed of the widths of the target gap corresponding to a plurality of preset detection points sequentially arranged at intervals along the extension direction of the target gap;
[0214] Step S190: In response to N consecutive values in the data set being greater than a preset width threshold, determine that the width of the target gap is unqualified.
[0215] A single preset detection point can only detect the gap width at the current position, and its detection result is accidental. In order to further improve the accuracy of the target gap, multiple positions can be continuously detected. The specific steps are as follows:
[0216] In step S180, a plurality of preset detection points are sequentially arranged at intervals along the extension direction of the target gap. For example, if the extension length of the target gap is 200 mm and the interval between adjacent preset detection points is 0.1 mm, then 2000 preset detection points can be correspondingly set in the extension direction of the target gap, and the width data of the target gap corresponding to the plurality of preset detection points are respectively obtained to obtain a data set of the target gap.
[0217] In step S190, the results of detecting multiple preset detection points are processed. A preset width threshold and a maximum continuous number N of unqualified preset detection points are set in the dimension detection system. If the gap width detected at a single preset detection point exceeds the set preset width threshold, it is determined that the gap dimension passing through the position of this preset detection point is unqualified. Exemplarily, the extension length of the target gap is 200 mm, which is divided into 20 small regions, each with a length of 10 mm. The interval between two adjacent multiple preset detection points is 0.1 mm. Then the number of preset detection points in each small region is 100. The maximum continuous number of unqualified preset detection points is set to 5. If the gap widths detected at 5 consecutive adjacent preset detection points in a small region exceed the width threshold of the set qualified gap, it is determined that the gap width in this small region is unqualified. If only 4 consecutive adjacent preset detection points in a small region have gap widths exceeding the width threshold of the set qualified gap, it is determined that the gap width in this small region is qualified. It can be determined that the width of the target gap is unqualified.
[0218] In some embodiments, according to the situation of each small region, the situation of the entire target gap is judged. For example, if the number of small regions exceeding the preset quantity is unqualified, it is determined that the width dimension of the target gap is unqualified. The determination process of the target gap width is not limited to the above description and can be selected according to the actual situation. The unqualified target gap width here means that the dimensional requirements for specific installation or welding are not met. For example, if the detection of the target gap width is carried out before welding, the determination of unqualified here means that the welding dimensional requirements are not met, and the positions of the first component or the second component need to be adjusted or repositioned to meet the requirements of subsequent welding processes.
[0219] It should be noted that after obtaining the width of the target gap corresponding to each preset detection point, the next preset detection point is processed. Alternatively, multiple preset detection points can be sequentially arranged at intervals along the extension direction of the target gap, and then the multiple preset detection points are processed simultaneously. The specific processing method is not limited.
[0220] By using continuous preset detection points to detect the situation of the target gap to judge the width qualification of the target gap, compared with using the average value algorithm for each preset detection point, it can more truly reflect the specific gap situation in the target gap and improve the accuracy of target gap detection.
[0221] According to some embodiments of the present application, a battery pre-welding detection method is provided. The first component is a battery case, the second component is a battery top cover, and the target gap is the gap between the battery case and the battery top cover. The battery pre-welding detection method includes: using the above-mentioned dimension detection method to determine the width of the gap between the battery case and the battery top cover.
[0222] In step S110, a three-dimensional detection image including the gap between the battery housing and the battery top cover is acquired using a three-dimensional camera.
[0223] In some embodiments, the three-dimensional detection image obtained using the three-dimensional detection device may include a plan view. The plane where the plan view is located is parallel to the extension direction of the target gap. The plan view includes the battery housing, the battery top cover, and the gray-scale information of the target gap. The gray-scale information refers to the gray-scale value of each pixel point in the image. Due to the different surface characteristics of the battery housing, the battery top cover, and the target gap, and the different distances from the detection device, different gray-scale values will be presented on the plan view. Thus, the approximate position and range of the target gap can be preliminarily determined by analyzing the gray-scale information.
[0224] In some embodiments, the three-dimensional detection image obtained using the three-dimensional detection device may further include a depth map. The plane where the depth map is located is perpendicular to the extension direction of the target gap. The depth map includes the depth information corresponding to the battery housing and the battery top cover respectively. The depth information is the gray-scale information of different depths including the battery housing, the battery top cover, and the target gap. This depth information can be used to determine the width and depth of the target gap.
[0225] It should be noted that the depth map can be a single image of a single detection point in the target gap, or multiple images acquired at intervals along the extension direction of the target gap. Exemplarily, an image acquisition position is set every 0.1 mm for each gap between the battery housing and the battery top cover. Each image acquisition position corresponds to a preset detection point. If the extension direction of the battery gap is 200 mm, then 2000 image acquisition positions can be set accordingly, which can correspond to 2000 preset detection points.
[0226] In step S120, according to the acquired three-dimensional image, a depth map including a preset detection point is selected. The width of the depth map covers at least the target gap and the adjacent contact areas of the battery housing, the battery top cover, and the target gap. By processing the depth information in the depth map, a cross-section fitting curve C is obtained. The cross-section fitting curve C includes the curves of multiple surfaces such as the upper surface of the battery housing, the side surface and the bottom surface of the target gap, and the upper surface of the battery top cover, reflecting the cross-sectional shape of the target gap.
[0227] In step S130, the cross-section fitting curve C is differentiated to obtain a differential curve for characterizing the depth differential value corresponding to each pixel point.
[0228] In step S140, the differential curve of the depth differential value corresponding to each pixel point is analyzed. There are two waveforms corresponding to the two opposite side walls of the target gap. The depth change at the two opposite side walls of the target gap is relatively drastic, which is manifested as a relatively large differential value on the differential curve.
[0229] In step S150, the first position and the second position on the differential curve respectively correspond to the corresponding positions on the cross-section fitting curve C. It should be noted that the horizontal distance between the first position and the second position on the differential curve is the width dimension of the target gap on the cross-section fitting curve C.
[0230] By detecting the gap width of the battery before welding the battery top cover and the battery case, the accuracy of dimension detection can be improved, which is beneficial to improving the quality of subsequent welding, thereby improving the battery quality, reducing production costs and production efficiency.
[0231] As Figure 8 shown, according to some embodiments of the present application, a dimension detection device 300 based on image processing includes: a first acquisition module 310, a first processing module 320, a second processing module 330, a third processing module 340, and a fourth processing module 350. The first acquisition module 310 is configured to acquire a three-dimensional detection image, and the three-dimensional detection image includes depth information corresponding to a target gap and a first component and a second component adjacent to the target gap respectively; the first processing module 320 is configured to determine, based on the three-dimensional detection image, a cross-section fitting curve perpendicular to the extension direction of the target gap and passing through a preset detection point; the cross-section fitting curve is used to characterize the cross-sectional shape of the target gap; the second processing module 330 is configured to perform a differential process on the cross-section fitting curve to obtain a differential curve for characterizing the depth differential value corresponding to each pixel point; the third processing module 340 is configured to determine, based on the differential curve, a first position and a second position respectively characterizing the positions of two opposite side walls of the target gap; and the fourth processing module 350 is configured to determine the width dimension of the target gap according to the position information of the first position and the second position in a preset coordinate system.
[0232] Combined with Figure 9 and Figure 10 shown, according to some embodiments of the present application, a pre-welding dimension detection system 200 includes a clamping device 210, an image acquisition device 220, and a control device 230. The clamping device 210 is configured to clamp a first component and a second component to be welded to a set position so that a target gap is formed between the first component and the second component; the image acquisition device 220 is configured to acquire a three-dimensional detection image of the position where the target gap is located; the control device 230 is configured to receive the three-dimensional detection image and execute the above-mentioned dimension detection method.
[0233] The clamping device 210 is used to clamp and fix the first component and the second component and transfer the first component and the second component to a set position, and the set position can be a gap acquisition position or a weld position.
[0234] In some embodiments, the control device 230 is communicatively connected to the image acquisition device 220 and the clamping device 210 respectively.
[0235] The control device 230 controls the clamping device 210 to clamp the first component and the second component to be welded to a set position, so as to form a target gap between the first component and the second component, and then controls the image acquisition device 220 to acquire a three-dimensional detection image of the position where the target gap is located.
[0236] In some embodiments, the image acquisition device 220 includes an image acquisition unit 221 and a driving unit 222. The image acquisition unit 221 and the driving unit 222 are communicatively connected to the control device 230 respectively. The driving unit 222 is configured to drive the image acquisition unit 221 to move along the extending direction of the target gap under the control of the control device 230. The image acquisition unit 221 is configured to perform image acquisition under the control of the control device 230.
[0237] In some embodiments, the image acquisition device 220 includes two image acquisition units 221. The two image acquisition units 221 are arranged oppositely. The driving unit 222 drives the two image acquisition units 221 to move simultaneously, and the image acquisition device 220 can realize simultaneous image acquisition of two gaps. In practical applications, the control device 230 may include a PLC (Programmable Logic Controller) and a host computer. Among them, the PLC can send control instructions to the clamping device 210 and the image acquisition device 220 respectively, control the clamping device 210 to adjust the position of the first component or the second component, and control the image acquisition device 220 to perform image acquisition. The host computer can obtain the three-dimensional detection image from the image acquisition device 220, then obtain the sectional fitting curve C according to the three-dimensional detection image, and perform differential processing on the sectional fitting curve C to obtain a differential curve for characterizing the depth differential value corresponding to each pixel point. Based on the differential curve, the first position and the second position respectively characterizing the positions of the two opposite side walls of the target gap are determined, so as to determine the width dimension of the target gap. Moreover, the host computer can display a user interface and obtain various detection parameters through the user interface. For example, the detection interval, the detection quantity, the detection mode, etc. can be obtained. The PLC and the host computer can cache the relevant data during the image acquisition process, and delete the cached data after the image acquisition is completed.
[0238] As Figure 11 shown, when the image acquisition device 220 performs image acquisition, the following process can be followed. For the sake of convenience of description, taking the size detection system 200 for detecting the width of the battery gap as an example, the battery gap has a first long side, a second long side, a first short side and a second short side.
[0239] Monitor the instructions of the PLC at preset time intervals. The instructions can indicate the target gap to be collected. After the image acquisition device 220 monitors the instructions, it replies to the PLC that it has received the trigger process, reads the instructions, and determines whether they are long-side signals. If they are long-side signals, the long-side image acquisition parameters are called for image acquisition. If they are short-side signals, the short-side image acquisition parameters are called for image acquisition. Wait for the encoder to trigger the camera to return the image. After the camera acquires the corresponding image, the image is imported into the algorithm. According to the pre-set algorithm logic and point position requirements, the data of each point position is obtained and cached in the code, and the image is saved. Then, the acquisition of the other side is carried out. Determine whether it is the second short-side process. If so, all four sides have been photographed. Integrate all the data, obtain the algorithm result and save it in the data table. At the same time, the PLC triggers the result sending process, sends the required data to the PLC, and deletes the data cache of this barcode. If not, cache the single-side data and wait for all sides to be acquired for data summary to end this process.
[0240] Through the mutual cooperation of the control device 230 with the clamping device 210 and the image acquisition device 220, the detection of the target gap is realized. On the one hand, compared with manual detection, it has higher efficiency, more detection points, and more accurate detection results. On the other hand, according to the detection results, it is helpful for the preparation of the next process.
[0241] According to some embodiments of the present application, the embodiments of the present application further provide a computing device, which includes at least one processor; and at least one memory communicatively connected to the at least one processor. The at least one memory stores instructions that, when executed by the at least one processor alone or in combination, cause the computing device to execute the above-mentioned dimension detection method.
[0242] In one embodiment, the processor may be an integrated circuit chip with the ability to process signals. During implementation, the steps of the above method embodiments may be completed by the integrated logic circuit in the hardware of the processor or by instructions in the form of software. The above-mentioned processor may be a general-purpose processor, 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. It can implement or execute the various methods and steps disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present application may be directly embodied as being executed and completed by the hardware decoding processor, or by a combination of the hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the steps of the above method.
[0243] In one embodiment, the memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable Programmable ROM (EPROM), an Electrically Erasable Programmable ROM (EEPROM), or a flash memory. The volatile memory may be a Random Access Memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0244] According to some embodiments of the present application, embodiments of the present application provide a computer-readable storage medium storing instructions that, when executed alone or jointly by one or more processors of a computing device, cause the computing device to execute the above-mentioned dimension detection method.
[0245] According to some embodiments of the present application, embodiments of the present application provide a computer program product including instructions that, when executed alone or jointly by one or more processors of a computing device, cause the computing device to execute the above-mentioned dimension detection method.
[0246] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are sequentially shown according to the indications of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0247] In some embodiments, another pre-welding detection method for batteries is provided, which specifically includes the following steps:
[0248] Step S810: Obtain a three-dimensional detection image, which includes depth information corresponding to the target gap and the battery housing and the battery top cover adjacent to the target gap respectively.
[0249] Step S820: Based on the three-dimensional detection image, determine a cross-sectional fitting curve that is perpendicular to the extension direction of the target gap and passes through a preset detection point; the cross-sectional fitting curve is used to characterize the cross-sectional shape of the target gap.
[0250] Step S830: Perform a differential process on the cross-sectional fitting curve to obtain a differential curve for characterizing the depth differential value corresponding to each pixel point; the differential curve includes adjacent first and second waveforms respectively corresponding to two opposite sidewalls of the target gap.
[0251] Step S840: Perform a first filtering step on the differential curve to obtain a first filtered curve. The first filtering step includes filtering out partial waveforms in the differential curve where the depth differential value exceeds the first preset threshold range.
[0252] Step S850: Perform a second filtering step on the first filtered curve to obtain a second filtered curve. The second filtering step includes filtering out partial waveforms in the first filtered curve where the depth differential value falls within the second preset threshold range.
[0253] Step S860: Based on the second filtered curve, determine a first position and a second position.
[0254] Step S870: Determine the width dimension of the target gap according to the position information of the first position and the second position in the preset coordinate system.
[0255] Step S880: Obtain a data set composed of the widths of the target gap corresponding to a plurality of preset detection points sequentially arranged at intervals along the extension direction of the target gap.
[0256] Step S890: In response to N consecutive values in the data set being greater than a preset width threshold, determine that the width of the target gap is unqualified.
[0257] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, rather than limiting them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application, and they should all be covered within the scope of the claims and the description of the present application. In particular, as long as there is no structural conflict, the technical features mentioned in each embodiment can be combined in any way. The present application is not limited to the specific embodiments disclosed in the text, but includes all technical solutions falling within the scope of the claims.
Claims
1. A size detection method based on image processing, characterized in that The dimension detection method includes: Obtaining a three-dimensional detection image, where the three-dimensional detection image includes depth information corresponding to a target gap and first and second components adjacent to the target gap respectively; Based on the three-dimensional detection image, determining a cross-section fitting curve perpendicular to the extending direction of the target gap and passing through a preset detection point; the cross-section fitting curve is used to characterize the cross-sectional shape of the target gap; Performing differential processing on the cross-section fitting curve to obtain a differential curve for characterizing the depth differential value corresponding to each pixel point; the differential curve includes adjacent first and second waveforms corresponding to two opposite sidewalls of the target gap respectively; Based on the differential curve, determining a first position and a second position respectively characterizing the positions of two opposite sidewalls of the target gap; the first position is within the pixel range corresponding to the half-wave of the first waveform adjacent to the second waveform; the second position is within the pixel range corresponding to the half-wave of the second waveform adjacent to the first waveform; and Determining the width dimension of the target gap according to the position information of the first position and the second position in a preset coordinate system.
2. The dimensional inspection method according to claim 1, wherein The determining the first position and the second position respectively characterizing the positions of two opposite sidewalls of the target gap based on the differential curve includes: Performing a first filtering step on the differential curve to obtain a first filtered curve, where the first filtering step includes filtering out partial waveforms in the differential curve where the depth differential value exceeds a first preset threshold range; Based on the first filtered curve, determining the first position and the second position.
3. The dimensional inspection method according to claim 2, characterized in that The first filtering step includes: Obtaining the first preset threshold range; the first preset threshold range includes an upper limit value and a lower limit value; In response to the depth differential value of a pixel point in the differential curve being greater than the upper limit value of the first preset threshold range, replacing the depth differential value of the pixel point with the upper limit value of the first preset threshold range; In response to the depth differential value of a pixel point in the differential curve being less than the lower limit value of the first preset threshold range, replacing the depth differential value of the pixel point with the lower limit value of the first preset threshold range; Fitting the depth differential values of each pixel point to obtain the first filtered curve.
4. The dimensional inspection method according to claim 3, wherein The obtaining the first preset threshold range includes: Determining a first filtering line, where the first filtering line is parallel to the coordinate axis representing the pixel position in the differential curve, and the first filtering line intersects with the first waveform or the second waveform; In response to the pixel distance between two intersection points where the first filtering line intersects with the first waveform or the second waveform being a first preset width, and the depth differential value corresponding to the first filtering line being greater than 0, determining the depth differential value corresponding to the first filtering line as the upper limit value of the first preset threshold range; and / or In response to the pixel distance between two intersection points where the first filtering line intersects with the first waveform or the second waveform being a second preset width, and the depth differential value corresponding to the first filtering line being less than 0, determining the depth differential value corresponding to the first filtering line as the lower limit value of the first preset threshold range.
5. The dimensional inspection method according to claim 3, characterized in that, The obtaining of the first preset threshold range includes: Performing an absolute value transformation on the depth differential values corresponding to each pixel point in the differential curve to obtain a differential transformation curve; Determining a second filtering line, where the second filtering line is parallel to the coordinate axis representing the pixel positions in the differential transformation curve, and the second filtering line intersects both the first waveform and the second waveform simultaneously; In response to the smaller of the pixel distances between the two intersection points where the second filtering line intersects the first waveform and the pixel distances between the two intersection points where the second filtering line intersects the second waveform being a third preset width, determining the depth differential value corresponding to the second filtering line as the upper limit value of the first preset threshold range; and Determining the lower limit value of the first preset threshold range as 0.
6. The dimensional inspection method according to any one of claims 2-5, characterized in that, Based on the first filtering curve, determining the first position and the second position includes: Determining, as the first position, the pixel points in the half-wave of the first waveform adjacent to the second waveform where the depth differential value is equal to the upper limit value or the lower limit value of the first preset threshold range; Determining, as the second position, the pixel points in the half-wave of the second waveform adjacent to the first waveform where the depth differential value is equal to the upper limit value or the lower limit value of the first preset threshold range.
7. The dimension detection method according to any one of claims 2 to 4, characterized in that Based on the first filtering curve, determining the first position and the second position further includes: Performing a second filtering step on the first filtering curve to obtain a second filtering curve, where the second filtering step includes filtering out the partial waveform of the depth differential values in the first filtering curve that fall within a second preset threshold range; Based on the second filtering curve, determining the first position and the second position.
8. The dimensional inspection method according to claim 7, wherein The second filtering step includes: Obtaining a second preset threshold range; the upper limit value of the second preset threshold range is greater than 0 and less than the upper limit value of the first preset threshold range, and the lower limit value of the second preset threshold range is less than 0 and greater than the lower limit value of the first preset threshold range; In response to the depth differential value corresponding to a pixel point in the first filtering curve falling within the second preset threshold range, replacing the depth differential value corresponding to the pixel point with a null value; Determining the curve after filtering the first filtering curve as the second filtering curve.
9. The dimensional inspection method according to claim 8, wherein The obtaining of the second preset threshold range includes: Determining a third filtering line, where the third filtering line is parallel to the coordinate axis representing the pixel positions in the differential curve, and the third filtering line intersects the first waveform or the second waveform; In response to the pixel distance between the two intersection points where the third filtering line intersects the first waveform or the second waveform being a fourth preset width, and the depth differential value corresponding to the third filtering line being greater than 0, determining the depth differential value corresponding to the third filtering line as the upper limit value of the second preset threshold range; and / or In response to the pixel distance between the two intersection points where the third filtering line intersects the first waveform or the second waveform being a fifth preset width, and the depth differential value corresponding to the third filtering line being less than 0, determining the depth differential value corresponding to the third filtering line as the lower limit value of the second preset threshold range.
10. The dimension detection method according to claim 7, characterized in that The second filtering step further includes: Perform an absolute value transformation on the depth differential value corresponding to each pixel point in the differential curve to obtain a differential transformation curve; Obtain a second preset threshold range; the upper limit value of the second preset threshold range is greater than 0 and less than the upper limit value of the first preset threshold range, and the lower limit value of the second preset threshold range is 0; In response to the depth differential value corresponding to the pixel point in the first filtering curve falling within the second preset threshold range, replace the depth differential value corresponding to the pixel point with a null value; Determine the curve after filtering the first filtering curve as the second filtering curve.
11. The dimension detection method according to claim 10, characterized in that, The obtaining of the second preset threshold range includes: Determine a fourth filtering line, the fourth filtering line is parallel to the coordinate axis representing the pixel position in the differential transformation curve, and the fourth filtering line intersects both the first waveform and the second waveform at the same time; In response to the larger of the pixel distances between the two intersection points where the fourth filtering line intersects the first waveform and the pixel distances between the two intersection points where the fourth filtering line intersects the second waveform being a sixth preset width, determine the depth differential value corresponding to the fourth filtering line as the upper limit value of the second preset threshold range; and Determine the lower limit value of the second preset threshold range as 0.
12. The dimensional inspection method according to claim 7, wherein Based on the second filtering curve, determining the first position and the second position includes: Determine the middle position of the pixel points in the region where the depth differential value in the half-wave of the first waveform adjacent to the second waveform in the second filtering curve is greater than 0 and less than or equal to the upper limit value of the first preset threshold range as the first position; the depth differential value corresponding to the pixel points in the first waveform is greater than or equal to 0; Determine the middle position of the pixel points in the region where the depth differential value in the half-wave of the second waveform adjacent to the first waveform in the second filtering curve is less than 0 and greater than or equal to the lower limit value of the first preset threshold range as the second position.
13. The dimensional inspection method according to any one of claims 1-5, characterized in that, The dimension detection method further includes: Determine the top surface position of the first component and the top surface position of the second component based on the cross-section fitting curve; Determine the height difference between the first component and the second component based on the top surface position of the first component and the top surface position of the second component.
14. The dimensional inspection method according to any one of claims 1-5, characterized in that, The dimension detection method further includes: Obtain a data set composed of the widths of the target gap corresponding to a plurality of preset detection points sequentially arranged at intervals along the extension direction of the target gap; In response to N consecutive values in the data set being greater than a preset width threshold, determine that the width of the target gap is unqualified.
15. A pre-welding detection method for a battery, characterized in that, The first component is a battery case, the second component is a battery top cover, and the target gap is the gap between the battery case and the battery top cover; The battery pre-welding detection method includes: Use the dimension detection method according to any one of claims 1-14 to determine the width of the gap between the battery case and the battery top cover.
16. A size detection device based on image processing, characterized in that, The dimension detection device includes: A first acquisition module for acquiring a three-dimensional detection image, the three-dimensional detection image including depth information corresponding to a target gap and first and second components adjacent to the target gap respectively; A first processing module, configured to determine a cross-sectional fitting curve that is perpendicular to the extending direction of the target gap and passes through a preset detection point based on the three-dimensional detection image; the cross-sectional fitting curve is used to characterize the cross-sectional shape of the target gap; A second processing module, configured to perform a differential processing on the cross-sectional fitting curve to obtain a differential curve for characterizing the depth differential value corresponding to each pixel point; the differential curve includes adjacent first and second waveforms respectively corresponding to two opposite sidewalls of the target gap; A third processing module, configured to determine a first position and a second position respectively characterizing the positions of two opposite sidewalls of the target gap based on the differential curve; the first position is within the pixel range corresponding to the half-wave of the first waveform adjacent to the second waveform; the second position is within the pixel range corresponding to the half-wave of the second waveform adjacent to the first waveform; and A fourth processing module, configured to determine the width dimension of the target gap according to the position information of the first position and the second position in a preset coordinate system.
17. A pre-welding dimensional inspection system, characterized in that, Comprising: A clamping device, configured to clamp a first component and a second component to be welded to a set position, so that a target gap is formed between the first component and the second component; An image acquisition device, configured to acquire a three-dimensional detection image of the position where the target gap is located; A control device, configured to receive the three-dimensional detection image and execute the dimension detection method according to any one of claims 1-14.
18. A computing device, characterized in that, Comprising: At least one processor; And At least one memory communicatively connected to the at least one processor, the at least one memory storing instructions that, when executed alone or jointly by the at least one processor, cause the computing device to execute the dimension detection method according to any one of claims 1 to 14.
19. A computer-readable storage medium, characterized in that, Storing instructions that, when executed alone or jointly by one or more processors of a computing device, cause the computing device to execute the dimension detection method according to any one of claims 1 to 14.
20. A computer program product, characterized in that, Including instructions that, when executed alone or jointly by one or more processors of a computing device, cause the computing device to execute the dimension detection method according to any one of claims 1 to 14.
Citation Information
Patent Citations
Weld appearance shape based on line laser scanning and surface defect detection method
CN104697467A
Battery pre-welding detection method, device and system
CN118067624A