Forging temperature measuring method based on image processing
By filtering the thermal imaging image of the forging surface, and calculating the filtering degree value using the parameter values of the target pixel point, the problem of noise influence in forging temperature measurement is solved, and more accurate temperature measurement is achieved.
Patent Information
- Application Number
- CN202411652296.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2024-12-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art is difficult to effectively avoid the influence of noise data points in thermal imaging images in the forging temperature measurement, resulting in inaccurate measurement of the forging surface temperature.
By acquiring the thermal imaging image of the forging surface, the first parameter value and the second parameter value of the target pixel point are determined, the filtering degree value is calculated based on these parameter values, the grayscale image is filtered, and the noise pixel points are eliminated, and non-noise pixels are retained. Temperature information of the point.
It realizes more accurate measurement of the surface temperature of the forging, suppresses the influence of noise, retains key temperature information, and improves measurement accuracy.
Smart Images

Figure CN119180761A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of image data processing, and in particular to a forging temperature measurement method based on image processing. Background Art
[0002] In the field of metal forging, temperature control of forgings is a key factor in ensuring product quality and performance. Non-contact temperature measurement technology, especially thermal imaging technology, has been widely used in temperature measurement of forging processes because it can monitor the temperature of forgings without contacting high-temperature forgings. Thermal imaging technology detects the thermal radiation emitted by an object and generates a thermal imaging image representing the surface temperature distribution of the object, thereby realizing non-contact measurement of the forging temperature.
[0003] In order to measure the temperature of the parts to be measured during the production process through thermal imaging images, a temperature intelligent monitoring method is provided in the relevant technology, for example, in the Chinese patent application document with publication number CN113724274A, including: setting an infrared thermal imaging device at a location where temperature monitoring is required; obtaining an image or image sequence of the corresponding area of the infrared thermal imaging device as an original image; performing non-uniformity correction on the original image; performing image detail enhancement processing on the original image after the non-uniformity correction; extracting a feature image in the original image after the detail enhancement processing; generating a multimodal fusion feature image according to the feature image; performing pre-immersion and area filling on the multimodal fusion feature image in sequence; extracting a target area in the multimodal fusion feature image after immersion and area filling; and performing real-time temperature monitoring or temperature warning based on the target area.
[0004] In the related art, the thermal imaging image as a whole is mainly enhanced or corrected. However, in the thermal imaging image of the forging, there may be some noise pixels. After the thermal imaging image is enhanced or corrected as a whole, it is impossible to effectively avoid the influence of the noise data points that may exist in the thermal imaging image on the temperature measurement. Therefore, it is difficult to accurately measure the temperature of the forging surface. Summary of the invention
[0005] In order to overcome the problem that it is difficult to accurately measure the temperature of the forging surface in the related art, the present application provides a forging temperature measurement method based on image processing, including: obtaining a grayscale image of a thermal imaging image of the forging surface to be measured, and taking any pixel point in the grayscale image as a target pixel point; determining a first parameter value of the target pixel point; , exp is an exponential function with a natural constant as base, is the average gradient amplitude of the pixels in the neighborhood of the target pixel whose gradient amplitude is greater than the preset gradient threshold. is the average gradient amplitude of the pixels in the grayscale image whose gradient amplitude is greater than the preset gradient threshold, M is the difference value of the gradient amplitude of the pixels in the neighborhood of the target pixel whose gradient amplitude is greater than the preset gradient threshold, is a preset positive number, J is the shortest distance between the target pixel and the boundary of the grayscale image; according to the inverse of the first parameter value of the target pixel, the target filtering degree value of the target pixel is determined to filter all the target pixels in the grayscale image to obtain the target image; the target image is used to determine the temperature measurement result of the forging to be tested.
[0006] Optionally, determining a target filtering degree value of a target pixel point according to the inverse of a first parameter value of the target pixel point includes: determining a second parameter value of the target pixel point; the second parameter value is used to characterize the degree of difference in grayscale value between the target pixel point and other pixels in a neighborhood; determining the target filtering degree value of the target pixel point according to a ratio of the second parameter value of the target pixel point to the first parameter value.
[0007] Optionally, the second parameter value of the target pixel is determined by: , where P is the second parameter value of the target pixel, K is the number of other pixels in the neighborhood of the target pixel, and D is the gray value of the target pixel. is the grayscale value of the i-th pixel in the neighborhood of the target pixel, and S is the number of other pixels in the grayscale image with the same grayscale value as the target pixel.
[0008] In this way, since the second parameter value of the target pixel is determined based on the grayscale performance of the pixels in the neighborhood of the target pixel and the number of other pixels in the grayscale image with the same grayscale value as the target pixel, the second parameter value of the target pixel can better characterize the probability that the target pixel is a noise pixel.
[0009] Optionally, a target filtering degree value of the target pixel point is determined based on the ratio of the second parameter value to the first parameter value of the target pixel point, including: normalizing the ratio of the second parameter value to the first parameter value of the target pixel point; multiplying the normalized ratio by a preset filtering degree value to obtain the target filtering degree value of the target pixel point.
[0010] In this way, the normalized ratio is multiplied by the preset filtering degree value to obtain the target filtering degree value of the target pixel point. When filtering the pixels in the grayscale image, it can take into account the filtering of the information of the noise pixels and the retention of the information of the non-noise pixels, so as to better realize the measurement of the surface temperature of the forging.
[0011] Optionally, the target filtering degree value of the target pixel point is determined according to the inverse of the first parameter value of the target pixel point, including: normalizing the inverse of the first parameter value of the target pixel point and multiplying it by a preset filtering degree value to obtain the target filtering degree value of the target pixel point.
[0012] Optionally, the difference value of the gradient amplitude of the pixel points whose gradient amplitude is greater than the preset gradient threshold within the neighborhood of the target pixel point is determined by: , where M is the difference degree value, A is the number of pixels in the neighborhood of the target pixel whose gradient amplitude is greater than the preset gradient threshold, is the gradient amplitude of the ath pixel within the neighborhood of the target pixel whose gradient amplitude is greater than the preset gradient threshold. It is the average gradient magnitude of the pixels in the neighborhood of the target pixel whose gradient magnitude is greater than the preset gradient threshold.
[0013] In this way, the gradient amplitudes of the pixels whose gradient amplitudes are greater than the preset gradient threshold in the neighborhood are compared, and the obtained difference degree value can better characterize the degree of difference of the gradient amplitudes of the pixels whose gradient amplitudes are greater than the preset gradient threshold in the neighborhood. Since the temperature changes on the surface of the forging are usually within a certain range, the difference degree value can characterize the probability that the target pixel is located at a non-noise pixel on the surface of the forging, so as to retain the temperature information of the non-noise pixel on the surface of the forging and filter out the temperature information of the noise pixel on the surface of the forging.
[0014] Optionally, the target image is used to determine the temperature measurement result of the forging to be measured, including: determining the temperature value of the position point corresponding to the pixel point in the target grayscale image in the forging to be measured according to the grayscale value of the pixel point in the target image and a preset correspondence relationship; the preset correspondence relationship is used to characterize the relationship between different grayscale values and different temperature values; and outputting the temperature measurement result of the forging to be measured according to the temperature values of different position points in the forging to be measured.
[0015] Optionally, the thermal imaging image of the surface of the forging to be measured is acquired in the following manner: acquiring a first image acquired by an image acquisition device; the first image is a visible light image including the surface area of the forging to be measured and other areas except the surface area of the forging to be measured; inputting the visible light image into a pre-trained image segmentation model to obtain a surface image of the forging area output by the image segmentation model; the image segmentation model is used to set the grayscale values of pixels in other areas of the visible light image except the surface area of the forging to be measured to zero; acquiring a second image acquired by the thermal imaging device for the surface of the forging to be measured, and determining the thermal imaging image of the surface of the forging to be measured from the second image according to the position of the surface image of the forging area in the first image.
[0016] In this way, since the visible light image can more easily locate the position of the forging to be measured in the shooting picture, the surface image of the forging area can be determined from the first image through the pre-trained image segmentation model, and the thermal imaging image of the surface of the forging to be measured can be determined from the second image according to the position of the surface image of the forging area in the first image, so as to avoid the influence of temperature information of other areas outside the forging on the temperature measurement results.
[0017] The technical solution provided by the embodiments of the present application may include the following beneficial effects: determining a target filtering degree value according to the inverse of the first parameter value of the target pixel point; since the first parameter value is determined according to the gradient amplitude difference within the neighborhood range of the target pixel point and the distance between the target pixel point and the boundary of the grayscale image, the temperature of the boundary of the forging is more critical, and the gradient amplitude difference within the neighborhood range can characterize the probability that the pixel point is a noise pixel point; therefore, the target filtering degree value can better realize adaptive filtering of the target pixel point, and adopt different degrees of filtering processing for different target pixels. While suppressing the noise existing in the grayscale image, the key temperature information indicated by the grayscale image can be effectively retained, thereby better realizing the measurement of the surface temperature of the forging.
[0018] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0020] Figure 1 The present invention is a flow chart showing a method for measuring the temperature of a forging based on image processing according to an exemplary embodiment. DETAILED DESCRIPTION
[0021] Here, exemplary embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application.
[0022] First, the application scenario of the embodiment of the present application is briefly introduced. In the application scenario of the present application, in order to measure the surface temperature of the forging, a thermal imaging image of the surface of the forging can be collected by a thermal imaging device. However, there may be some noise data points on the surface of the thermal imaging image, which affects the measurement of the surface temperature of the forging. In the related art, the thermal imaging image is mainly enhanced as a whole. After the overall enhancement, the influence of the noise data points in the thermal imaging image is not eliminated, making it difficult to accurately measure the surface temperature of the forging.
[0023] In view of the above technical problems, the present application provides a forging temperature measurement method based on image processing. Figure 1 is a flow chart of a forging temperature measurement method based on image processing according to an exemplary embodiment. Figure 1 As shown, the method includes the following steps.
[0024] In step S101, a grayscale image of a thermal imaging image of the surface of a forging to be measured is obtained, and any pixel point in the grayscale image is used as a target pixel point.
[0025] Thermal imaging, also known as thermogram or infrared imaging, is a technology that uses infrared radiation from the surface of an object to form an image. Thermal imaging equipment can collect infrared radiation from the surface of an object and convert it into electrical signals, thereby converting these electrical signals into thermal imaging images. In thermal imaging images, different grayscale values of pixels correspond to different temperature values.
[0026] In order to facilitate the user to observe the temperature, a pre-built mapping relationship can be used to map different degrees of infrared radiation to different colors. The mapping relationship is used to characterize the relationship between different degrees of infrared radiation and different colors.
[0027] The grayscale image of the thermal imaging image of the surface of the forging to be measured may refer to a grayscale image directly mapped according to different degrees of infrared radiation, or may refer to a grayscale image obtained after grayscale processing of a color thermal imaging image; thereby mapping the temperature information of different position points on the surface of the forging to be measured into the grayscale values of the pixels in the grayscale image.
[0028] The grayscale image of the thermal imaging image can characterize the temperature information of different positions on the surface of the forging to be measured; the larger the grayscale value of the pixel in the grayscale image of the thermal imaging image, the higher the temperature value of the position corresponding to the pixel in the grayscale image of the thermal imaging image on the surface of the forging to be measured; on the contrary, the smaller the grayscale value of the pixel in the grayscale image of the thermal imaging image, the lower the temperature value of the position corresponding to the pixel in the grayscale image of the thermal imaging image on the surface of the forging to be measured.
[0029] In order to facilitate targeted filtering of pixels in an image, any pixel in the grayscale image can be used as a target pixel to implement filtering of all pixels in the grayscale image.
[0030] In step S102, a first parameter value of a target pixel is determined.
[0031] The first parameter value of the target pixel , exp is an exponential function with a natural constant as base, is the average gradient amplitude of the pixels in the neighborhood of the target pixel whose gradient amplitude is greater than the preset gradient threshold. is the average gradient amplitude of the pixels in the grayscale image whose gradient amplitude is greater than the preset gradient threshold, M is the difference value of the gradient amplitude of the pixels in the neighborhood of the target pixel whose gradient amplitude is greater than the preset gradient threshold, is a preset positive number, and J is the shortest distance between the target pixel and the boundary of the grayscale image.
[0032] The neighborhood range of the target pixel point may be, for example, a range of sizes such as 3×3, 5×5, and 7×7 centered on the target pixel point.
[0033] The first parameter value of the target pixel takes into account the gradient amplitude of the pixels in the neighborhood of the target pixel and the gradient amplitude of the pixels in the entire image; wherein, the average gradient amplitude of the pixels in the neighborhood of the target pixel whose gradient amplitude is greater than the preset gradient threshold can reflect the average level of the gradient amplitude of the pixels in the neighborhood of the target pixel whose gradient changes; the average gradient amplitude of the pixels in the grayscale image whose gradient amplitude is greater than the preset gradient threshold can reflect the average level of the gradient amplitude of the pixels in the grayscale image whose gradient changes. and For comparison, the situation of the pixels around the target pixel and the situation of the pixels of the entire grayscale image can be combined.
[0034] Here, since the grayscale value of the pixel point in the grayscale image of the thermal imaging image can represent the temperature information of the position point on the surface of the forging, the pixel point with a gradient amplitude greater than the preset gradient amplitude in the grayscale image corresponds to the position point where the temperature change of the surface of the forging in a certain direction is greater than the preset temperature. and The comparison can facilitate the analysis of the temperature at the position corresponding to the target pixel point; the preset gradient threshold can be set according to actual needs, for example, the preset gradient threshold can be between 10 and 20.
[0035] Since the grayscale value of the pixel point in the grayscale image of the thermal imaging image can represent the temperature value of the location point of the forging, and the temperature value at the edge of the surface of the forging is more diverse, it is necessary to focus on the temperature information at the edge of the surface of the forging; the smaller the distance between the target pixel point and the boundary of the grayscale image, the more likely the target pixel point is located at the edge of the surface of the forging. Here, the distance from the target pixel point to the boundary of the grayscale image is negatively correlated with the first parameter value. The smaller the distance to the boundary of the grayscale image of the target pixel point, the larger the corresponding first parameter value, so that the first parameter value can facilitate the retention of the temperature information at the edge of the surface of the forging.
[0036] The shortest distance between the target pixel and the boundary of the grayscale image refers to the shortest distance among multiple distances between the target pixel and multiple boundary lines of the grayscale image.
[0037] The difference degree value of the gradient amplitude of the pixel points whose gradient amplitude is greater than the preset gradient threshold within the neighborhood range of the target pixel point can characterize the difference degree in gradient amplitude of the pixel points whose gradient amplitude is greater than the preset gradient threshold within the neighborhood range of the target pixel point.
[0038] Since the object for calculating the difference degree value is the pixel points whose gradient amplitude is greater than the preset gradient threshold within the neighborhood of the target pixel point, the pixel points whose gradient amplitude is less than or equal to the preset gradient threshold within the neighborhood of the target pixel point no longer need to participate in the calculation of the difference degree value, thereby reducing the amount of calculation required for the difference degree value.
[0039] Furthermore, the gradient amplitude of the target pixel can characterize the temperature change at the corresponding position of the target pixel in the forging. The neighborhood range with a higher degree of difference in the gradient amplitude in the grayscale image corresponds to the local area with more diverse temperature changes in the forging.
[0040] The temperature on the surface of the forging usually has a certain consistency. Even if there is a certain temperature change on the surface of the forging, the range of the temperature change will be within a certain range. Due to the existence of noise pixels that may exist in the grayscale image of the thermal imaging image of the surface of the forging, the noise pixels are random and isolated, which increases the degree of change in the grayscale gradient amplitude in the local range of the forging surface. Therefore, the smaller the corresponding difference value of the target pixel, the greater the probability that it belongs to the non-noise pixel on the forging surface. It is necessary to retain the temperature information of the non-noise pixel on the forging surface.
[0041] On the contrary, the larger the corresponding difference degree value of the target pixel point, the greater the probability that it belongs to the noise pixel point on the forging surface, and it is necessary to remove the temperature information of the noise pixel point on the forging surface. The difference degree value of the gradient amplitude of the pixel point whose gradient amplitude is greater than the preset gradient threshold within the neighborhood range of the target pixel point can characterize the probability that the target pixel point belongs to the noise pixel point.
[0042] In order to facilitate the retention of temperature information of the position points corresponding to pixels with a higher probability of being non-noise pixels, a larger first parameter value can be assigned to the corresponding target pixel points with a smaller difference degree value, so that a lower filtering degree value can be used for pixels with a higher probability of being non-noise pixels.
[0043] On the contrary, in order to facilitate the elimination of temperature information of position points corresponding to pixels with a higher probability of belonging to noise pixels, a smaller first parameter value can be assigned to the corresponding target pixels with a larger difference degree value, so that a higher filtering degree value can be used for pixels with a higher probability of belonging to noise pixels.
[0044] In this way, since the first parameter value is determined based on the shortest distance between the target pixel and the boundary of the grayscale image and the difference degree value of the gradient amplitude within the neighborhood of the target pixel, pixels located at different positions in the grayscale image or having different grayscale expressions have different probabilities of being noise pixels in the grayscale image. A matching first parameter value can be assigned according to the actual situation of the pixel so as to perform matching filtering on different pixels.
[0045] In one embodiment, the difference value of the gradient amplitude of the pixel points whose gradient amplitude is greater than the preset gradient threshold within the neighborhood of the target pixel point can be determined in the following manner: , where M is the difference degree value, A is the number of pixels in the neighborhood of the target pixel whose gradient amplitude is greater than the preset gradient threshold, is the gradient amplitude of the ath pixel within the neighborhood of the target pixel whose gradient amplitude is greater than the preset gradient threshold. It is the average gradient magnitude of the pixels in the neighborhood of the target pixel whose gradient magnitude is greater than the preset gradient threshold.
[0046] For the target pixel points existing in the grayscale image of the thermal imaging image of the forging, when the gradient amplitude of the pixel points in the neighborhood of the target pixel points is relatively single, the temperature change of the position point corresponding to the target pixel point on the surface of the forging is relatively single, and the position point corresponding to the target pixel point on the surface of the forging exhibits a relatively flat surface and a relatively consistent temperature.
[0047] By comparing the gradient amplitude of the pixel points whose gradient amplitude is greater than the preset gradient threshold in the neighborhood range with the average gradient amplitude of the pixel points whose gradient amplitude is greater than the preset gradient threshold in the neighborhood range, and by taking the absolute value operation, the degree of difference between the gradient amplitudes of the pixel points whose gradient amplitude is greater than the preset gradient threshold in the neighborhood range can be better reflected.
[0048] In this way, the gradient amplitudes of the pixels whose gradient amplitudes are greater than the preset gradient threshold in the neighborhood are compared, and the obtained difference degree value can better characterize the degree of difference of the gradient amplitudes of the pixels whose gradient amplitudes are greater than the preset gradient threshold in the neighborhood. Since the temperature changes on the surface of the forging are usually within a certain range, the difference degree value can characterize the probability that the target pixel is located at a non-noise pixel on the surface of the forging, so as to retain the temperature information of the non-noise pixel on the surface of the forging and filter out the temperature information of the noise pixel on the surface of the forging.
[0049] When there is no pixel point with a gradient amplitude greater than the preset gradient threshold within the neighborhood of the target pixel point, it means that the degree of change of the temperature information within the neighborhood of the target pixel point is low, and the temperature performance within the neighborhood of the target pixel point is more consistent with the normal temperature change of the forging surface. The difference degree value can be set to 0 to calculate the first parameter value of the target pixel point.
[0050] In step S103, a target filtering degree value of the target pixel is determined according to the inverse of the first parameter value of the target pixel, so as to perform filtering processing on all target pixels in the grayscale image to obtain a target image.
[0051] In one embodiment, the target filtering degree value of the target pixel point is determined according to the inverse of the first parameter value of the target pixel point, including: normalizing the inverse of the first parameter value of the target pixel point and multiplying it by a preset filtering degree value to obtain the target filtering degree value of the target pixel point.
[0052] The target filtering degree value of the target pixel point is determined according to the inverse of the first parameter value of the target pixel point, so that the larger the first parameter value of the target pixel point, the smaller the target filtering degree value of the target pixel point; on the contrary, the smaller the first parameter value of the target pixel point, the larger the target filtering degree value of the target pixel point, and since the first parameter value is determined based on the distance between the pixel point and the boundary of the grayscale image and the gradient characteristics of the pixel point, the first parameter value can represent the necessity of retaining the grayscale value of the target pixel point after filtering.
[0053] By setting the first parameter value and the target filtering degree value to be negatively correlated, since the first parameter value is negatively correlated with the complexity of the gradient amplitude of the target pixel point, the target filtering degree value of the target pixel point is positively correlated with the complexity of the grayscale gradient amplitude within the neighborhood of the target pixel point. The higher the complexity of the grayscale gradient amplitude within the neighborhood of the target pixel point, the higher the probability that the target pixel point is a noise pixel point. Therefore, the noise pixels in the grayscale image can be effectively filtered out, and the temperature information of the noise temperature points on the surface of the forging can be filtered out.
[0054] Since the first parameter value of the target pixel point is determined based on the distance from the target pixel point to the boundary of the grayscale image, by setting the first parameter value to be negatively correlated with the target filtering degree value, the grayscale value of the pixel point near the boundary in the grayscale image can be effectively retained, and the temperature information of the position point on the surface of the forging located at the boundary can also be effectively retained, thereby avoiding the loss of key temperature information when filtering out noise temperature points.
[0055] The inverse of the first parameter value of the target pixel point is normalized and then multiplied by the preset filtering degree value. Since the inverse of the first parameter value is normalized, the normalized value is a positive number less than or equal to 1, which can facilitate the calculation of subsequent processes.
[0056] In this way, the first parameter value is set to be negatively correlated with the target filtering degree value, so that when filtering out noise pixels in the grayscale image, the pixels of non-noise pixels in the grayscale image can be retained. Since the grayscale image is obtained based on the thermal imaging image of the forging, it is possible to retain non-noise temperature points while filtering out noise temperature points, thereby avoiding the loss of temperature information of key temperature points on the surface of the forging.
[0057] In one embodiment, a target filtering degree value of a target pixel point is determined according to the inverse of a first parameter value of the target pixel point, including: determining a second parameter value of the target pixel point; the second parameter value is used to characterize the degree of difference in grayscale value between the target pixel point and other pixels in a neighborhood range; and determining the target filtering degree value of the target pixel point according to the ratio of the second parameter value of the target pixel point to the first parameter value.
[0058] Since the first parameter value can characterize the probability that the target pixel is a non-noise pixel, the second parameter value characterizes the degree of difference in grayscale value between the target pixel and other pixels in the neighborhood, so that the second parameter value can characterize the probability that the target pixel is a noise pixel.
[0059] The target filtering degree value of the target pixel point is determined by the ratio of the second parameter value of the target pixel point to the first parameter value. The grayscale features, gradient features and distance features from the boundary of the grayscale image within the neighborhood of the target pixel point can be combined to determine a target filtering degree value that better matches the target pixel point, so as to better realize the filtering processing of the target pixel point.
[0060] In this way, the filtering degree value for the target pixel points with a higher probability of being non-noise pixels is smaller. Non-noise pixels usually contain more critical information in the grayscale image. For example, the grayscale image can characterize the temperature information of the more critical positions on the surface of the forging. Therefore, when filtering out noise, the loss of temperature information at the critical positions on the surface of the forging can be avoided.
[0061] In one embodiment, the second parameter value of the target pixel is determined by: , where P is the second parameter value of the target pixel, K is the number of other pixels in the neighborhood of the target pixel, and D is the gray value of the target pixel. is the grayscale value of the i-th pixel in the neighborhood of the target pixel, and S is the number of other pixels in the grayscale image with the same grayscale value as the target pixel.
[0062] In the grayscale image of the thermal imaging image of the surface of the forging, the difference in grayscale values of different pixels in the same local range is within a certain range. Due to the introduction of possible noise pixels, the difference in grayscale values of different pixels in the local range increases, which can be manifested as an increase in the difference between the grayscale value of the pixel in the neighborhood of the target pixel and the grayscale mean of the neighborhood. Therefore, by comparing the grayscale values of the pixels in the neighborhood of the target pixel, the second parameter value can effectively characterize the probability that the target pixel belongs to a noise pixel, thereby being able to characterize the probability that the target pixel belongs to a noise temperature point in the thermal imaging image of the surface of the forging.
[0063] Since the noise pixels in the grayscale image are random and isolated, and the temperatures at different positions on the surface of the forging are consistent to a certain extent, the grayscale image of the thermal imaging image can represent the temperature information of the surface positions of the forging. The more other pixels in the grayscale image have the same grayscale value as the target pixel, the higher the probability that the target pixel belongs to the non-noise pixel in the grayscale image. On the contrary, due to the randomness and isolation of the noise pixels in the grayscale image, the number of other pixels in the grayscale image with the same grayscale value as the noise pixels is smaller than that of the non-noise pixels in the grayscale image. Therefore, the fewer the number of other pixels in the grayscale image with the same grayscale value as the target pixel, the higher the probability that the target pixel is noise.
[0064] In this way, since the second parameter value of the target pixel is determined based on the grayscale performance of the pixels in the neighborhood of the target pixel and the number of other pixels in the grayscale image with the same grayscale value as the target pixel, the second parameter value of the target pixel can better characterize the probability that the target pixel is a noise pixel.
[0065] In one embodiment, a target filtering degree value of a target pixel point is determined based on a ratio of a second parameter value to a first parameter value of the target pixel point, including: normalizing the ratio of the second parameter value to the first parameter value of the target pixel point; multiplying the normalized ratio by a preset filtering degree value to obtain the target filtering degree value of the target pixel point.
[0066] After normalizing the ratio of the second parameter value to the first parameter value, the normalized value can be made a positive number less than 1, which is convenient for comparison or calculation in subsequent processes. The target filtering degree value of the target pixel point is obtained by multiplying the normalized ratio with the preset filtering degree value. Since the ratio of the second parameter value to the first parameter value of the target pixel point can characterize the probability that the pixel point belongs to a noise pixel point, the filtering degree value corresponding to the pixel point with a higher probability of belonging to a non-noise pixel point can better retain the information of the non-noise pixel point; the filtering degree value corresponding to the pixel point with a higher probability of belonging to a noise pixel point can filter out the information of the noise pixel point.
[0067] In this way, the normalized ratio is multiplied by the preset filtering degree value to obtain the target filtering degree value of the target pixel point. When filtering the pixels in the grayscale image, it can take into account the filtering of the information of the noise pixels and the retention of the information of the non-noise pixels, so as to better realize the measurement of the surface temperature of the forging.
[0068] When filtering the target pixel points, filtering algorithms such as mean filtering, median filtering, Gaussian filtering and bilateral filtering can be used; for example, when using the bilateral filtering algorithm to filter the target pixel points, the preset filtering degree value can refer to the preset filtering standard deviation, for example, the preset filtering standard deviation can be 5, or the preset filtering degree value can be assigned in advance or in real time according to actual needs.
[0069] In step S104, the temperature measurement result of the forging to be measured is determined using the target image.
[0070] After filtering all the pixels in the grayscale image, the influence of noise in the grayscale image has been avoided. In the target image obtained according to the grayscale image, the temperature information of different positions of the forging to be tested can be represented; wherein, the larger the grayscale value of the pixel in the target image, the higher the temperature of the position corresponding to the pixel in the target image on the surface of the forging; on the contrary, the smaller the grayscale value of the pixel in the target image, the lower the temperature of the position corresponding to the pixel in the target image on the surface of the forging; the target image can be used to determine the temperature of the surface position of the forging to be tested, so as to determine the temperature measurement result of the forging to be tested.
[0071] In one embodiment, a target image is used to determine a temperature measurement result of a forging to be measured, including: determining the temperature value of a position point corresponding to a pixel point in the target grayscale image in the forging to be measured according to the grayscale value of the pixel point in the target image and a preset correspondence relationship; the preset correspondence relationship is used to characterize the relationship between different grayscale values and different temperature values; and outputting the temperature measurement result of the forging to be measured according to the temperature values of different position points in the forging to be measured.
[0072] Since the thermal imaging image of the forging is obtained by mapping the thermal radiation intensity of the surface position points of the forging into image information, and different thermal radiation intensities correspond to different temperature values, the thermal imaging image can represent the temperature information of the surface position points of the forging; therefore, the target image after filtering the pixel points in the grayscale image of the thermal imaging image can also represent the temperature information of the surface position points of the forging; the larger the grayscale value of the pixel point in the target image, the larger the temperature value of the position point corresponding to the pixel point in the target image on the surface of the forging.
[0073] Since the different grayscale values of the pixel points in the target image correspond to different temperature values of the position points on the surface of the forging, the temperature value of the position point corresponding to the pixel point in the target grayscale image in the forging to be measured can be determined based on the grayscale value of the pixel point in the target image and the preset correspondence.
[0074] The preset corresponding relationship can be obtained by pre-calibrating the temperature of the position point on the forging surface and the grayscale image corresponding to the thermal imaging image; the embodiment of the present application does not limit the method for obtaining the preset corresponding relationship.
[0075] For example, the preset correspondence can be determined based on the first sub-correspondence and the second sub-correspondence, the first sub-correspondence is used to characterize the relationship between different temperature values of the position points on the surface of the forging and different thermal radiation intensities; the second sub-correspondence is used to characterize the relationship between different thermal radiation intensities and different grayscale values of pixel points in the target image.
[0076] By converting the first sub-correspondence and the second sub-correspondence, the relationship between different temperature values of the position points representing the surface of the forging and different grayscale values of the pixel points in the target image can be obtained, and the corresponding relationship obtained after the conversion is used as the preset corresponding relationship.
[0077] According to the temperature values of different positions in the forging to be measured, the temperature measurement results of the forging to be measured can be output. For example, according to the temperature values of different positions in the forging to be measured, the temperature distribution diagram of the forging to be measured can be displayed; or, the temperature values of the positions pre-specified by the user can be output; or, at least one of the average temperature, the minimum temperature and the maximum temperature of the surface of the forging to be measured can be output, so that the user can understand the temperature condition of the forging to be measured.
[0078] In this way, since the target image is obtained by adaptively filtering the pixels in the grayscale image, and the grayscale image is obtained based on the thermal imaging image of the surface of the forging, the target image can better characterize the surface temperature of the forging. Therefore, a more accurate temperature measurement result of the forging to be tested can be output based on the target image.
[0079] Through the forging temperature measurement method based on image processing provided in the embodiment of the present application, the target filtering degree value is determined according to the inverse of the first parameter value of the target pixel point. Since the first parameter value is determined according to the gradient amplitude difference within the neighborhood range of the target pixel point and the distance between the target pixel point and the boundary of the grayscale image, the temperature of the boundary of the forging is more critical, and the gradient amplitude difference within the neighborhood range can characterize the probability that the pixel point is a noise pixel point. Therefore, the target filtering degree value can better realize adaptive filtering of the target pixel point, and different degrees of filtering processing are adopted for different target pixels. While suppressing the noise existing in the grayscale image, the key temperature information indicated by the grayscale image can be effectively retained, thereby better realizing the measurement of the surface temperature of the forging.
[0080] In one embodiment, a thermal imaging image of the surface of a forging to be measured is acquired in the following manner: acquiring a first image acquired by an image acquisition device; the first image is a visible light image including a surface area of the forging to be measured and other areas except the surface area of the forging to be measured; inputting the visible light image into a pre-trained image segmentation model to obtain a surface image of the forging area output by the image segmentation model; the image segmentation model is used to set the grayscale values of pixels in other areas of the visible light image except the surface area of the forging to be measured to zero; acquiring a second image acquired by a thermal imaging device for the surface of the forging to be measured, and determining a thermal imaging image of the surface of the forging to be measured from the second image according to the position of the surface image of the forging area in the first image.
[0081] For example, a visible light image of the forging to be measured can be collected by an image acquisition device, and the pixel values of the pixels in other areas of the visible light image except for the forging to be measured are marked as 0 to obtain a mask image corresponding to the visible light image of the forging to be measured. The visible light image of the forging to be measured is used as the input of a pre-constructed network model, and the mask image corresponding to the visible light image of the forging to be measured is used as the output of the network model to complete the training of the network model, and the trained network model is used as the image segmentation model in the embodiment of the present application.
[0082] Through the pre-trained image segmentation model, the grayscale values of pixels in other areas of the visible light image except the surface area of the forging to be measured can be set to zero to avoid the influence of other areas in the visible light image except the surface area of the forging to be measured.
[0083] In order to more accurately obtain the grayscale image of the thermal imaging image of the surface of the forging to be measured, the first image and the second image can be collected respectively at the same image collection angle of view at the same image collection position; since the first image and the second image include different information of the same object, the first image includes the color information of the object in the captured picture, and the second image includes the temperature information of the object in the captured picture, and the forging to be measured in the captured picture can be positioned according to the first image, therefore, according to the position of the surface image of the forging area in the first image, the position of the forging in the second image can be positioned, so as to determine the thermal imaging image that only includes the temperature information of the forging to be measured from the second image.
[0084] In this way, since the visible light image can more easily locate the position of the forging to be measured in the shooting picture, the surface image of the forging area can be determined from the first image through the pre-trained image segmentation model, and the thermal imaging image of the surface of the forging to be measured can be determined from the second image according to the position of the surface image of the forging area in the first image, so as to avoid the influence of temperature information of other areas outside the forging on the temperature measurement results.
[0085] It should be understood that the features of some embodiments of the various applications described herein may be combined with each other, unless specifically stated otherwise.
[0086] Although terms such as "first", "second", and "third" may be used herein to describe various components, parts, regions, layers, or sections, these components, parts, regions, layers, or sections are not limited to these terms. Instead, these terms are only used to distinguish one component, part, region, layer, or section from another component, part, region, layer, or section. Therefore, without departing from the teachings of the examples described herein, the first component, part, region, layer, or section mentioned in the examples may also be referred to as the second component, part, region, layer, or section.
[0087] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description herein, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0088] In addition, the word "exemplary" is used herein to mean serving as an example, instance, or diagram. Any aspect or design described herein as "exemplary" is not necessarily to be understood as being advantageous over other aspects or designs. Instead, the use of the word exemplary is intended to present concepts in a concrete manner. As used herein, the term "or" is intended to mean an inclusive "or" rather than an exclusive "or".
[0089] Likewise, although the present application has been shown and described with respect to one or more implementations, equivalent variations and modifications will occur to those skilled in the art upon reading and understanding this specification and the accompanying drawings. With particular regard to the various functions performed by the components (e.g., elements, resources, etc.) described above, unless otherwise noted, the terms used to describe such components are intended to correspond to any component (functionally equivalent) that performs the specific functions of the described components, even if not structurally equivalent to the disclosed structures.
[0090] Additionally, while particular features of the present application may have been disclosed with respect to only one of several implementations, such features may be combined with one or more other features of other implementations as may be desired and advantageous for any given or particular application.
[0091] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application, and the specification and embodiments are only considered as exemplary.
[0092] It should be understood that the present application is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof.
Claims
1. A forging temperature measurement method based on image processing, characterized in that: include: Obtain a grayscale image of the thermal imaging image of the surface of the forging to be measured, and use any pixel point in the grayscale image as a target pixel point; Determine the first parameter value of the target pixel , exp is an exponential function with a natural constant as base, is the average gradient amplitude of the pixels in the neighborhood of the target pixel whose gradient amplitude is greater than the preset gradient threshold. is the average gradient amplitude of the pixels in the grayscale image whose gradient amplitude is greater than the preset gradient threshold, M is the difference value of the gradient amplitude of the pixels in the neighborhood of the target pixel whose gradient amplitude is greater than the preset gradient threshold, is a preset positive number, J is the shortest distance between the target pixel and the boundary of the grayscale image; Determine the target filtering degree value of the target pixel point according to the inverse of the first parameter value of the target pixel point, so as to perform filtering processing on all the target pixels in the grayscale image to obtain the target image; The target image is used to determine the temperature measurement results of the forging to be tested.
2. The forging temperature measurement method based on image processing according to claim 1 is characterized in that: Determining a target filtering degree value of the target pixel point according to the inverse of the first parameter value of the target pixel point includes: Determine a second parameter value of the target pixel; the second parameter value is used to characterize the difference between the target pixel and other pixels in the neighborhood in terms of grayscale value; A target filtering degree value of the target pixel point is determined according to a ratio of the second parameter value to the first parameter value of the target pixel point.
3. The forging temperature measurement method based on image processing according to claim 2 is characterized in that: The second parameter value of the target pixel is determined in the following way: , where P is the second parameter value of the target pixel, K is the number of other pixels in the neighborhood of the target pixel, and D is the gray value of the target pixel. is the grayscale value of the i-th pixel in the neighborhood of the target pixel, and S is the number of other pixels in the grayscale image with the same grayscale value as the target pixel.
4. The forging temperature measurement method based on image processing according to claim 2 is characterized in that: Determining a target filtering degree value of a target pixel point according to a ratio of a second parameter value to a first parameter value of the target pixel point includes: Normalizing the ratio of the second parameter value to the first parameter value of the target pixel; The normalized ratio is multiplied by the preset filtering degree value to obtain the target filtering degree value of the target pixel.
5. The forging temperature measurement method based on image processing according to claim 1 is characterized in that: Determining a target filtering degree value of the target pixel point according to the inverse of the first parameter value of the target pixel point includes: The inverse of the first parameter value of the target pixel point is normalized and then multiplied by the preset filtering degree value to obtain the target filtering degree value of the target pixel point.
6. The forging temperature measurement method based on image processing according to claim 1 is characterized in that: The difference value of the gradient amplitude of the pixel points whose gradient amplitude is greater than the preset gradient threshold within the neighborhood of the target pixel point is determined by the following method: , where M is the difference degree value, A is the number of pixels in the neighborhood of the target pixel whose gradient amplitude is greater than the preset gradient threshold, is the gradient amplitude of the ath pixel point within the neighborhood of the target pixel point whose gradient amplitude is greater than the preset gradient threshold, It is the average gradient magnitude of the pixels in the neighborhood of the target pixel whose gradient magnitude is greater than the preset gradient threshold.
7. The forging temperature measurement method based on image processing according to claim 1 is characterized in that: The target image is used to determine the temperature measurement results of the forging to be tested, including: Determine the temperature value of the position corresponding to the pixel point in the target grayscale image in the forging to be measured according to the grayscale value of the pixel point in the target image and the preset corresponding relationship; the preset corresponding relationship is used to characterize the relationship between different grayscale values and different temperature values; According to the temperature values of different positions in the forging to be measured, the temperature measurement results of the forging to be measured are output.
8. The forging temperature measurement method based on image processing according to claim 1 is characterized in that: The thermal imaging image of the forging surface to be measured is obtained by: Acquire a first image acquired by an image acquisition device; the first image is a visible light image including a surface area of the forging to be measured and other areas except the surface area of the forging to be measured; The visible light image is input into a pre-trained image segmentation model to obtain a surface image of the forging area output by the image segmentation model; the image segmentation model is used to set the grayscale values of pixels in other areas of the visible light image except for the surface area of the forging to be measured to zero; A second image captured by the thermal imaging device on the surface of the forging to be measured is obtained, and a thermal imaging image of the surface of the forging to be measured is determined from the second image according to the position of the surface image of the forging area in the first image.
Citation Information
Patent Citations
Heat balance management method and system
CN111879410A
Intelligent identification and remote temperature measurement system and method for aviation casing casting sand mold sand core
CN117190904A
Fuse piece fracture detection method based on X-ray image
CN118967666A
Apparatus for detecting defect of strip and method for detecting defect using the same
KR101853770B1
Cited By
Method and system for measuring large hot red part
CN119437044A
