A method and system for detecting defects in hydraulic cylinders based on industrial vision.
By using multi-angle light source illumination, grayscale normalization, pixel-level fusion, and edge smoothing, combined with comparison of local grayscale jump areas with standard features, the problem of incomplete image acquisition in hydraulic cylinder inspection was solved, achieving high-precision defect detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XUZHOU SHANGMING MASCH CO LTD
- Filing Date
- 2026-02-28
- Publication Date
- 2026-05-26
AI Technical Summary
Existing technologies for detecting defects in hydraulic cylinders suffer from incomplete image acquisition, poor preprocessing, and low accuracy in defect feature extraction and judgment, making it difficult to meet the needs of refined industrial inspection.
Image sets are acquired by illuminating from multiple angles, and grayscale normalization and pixel-level fusion are performed. Edge smoothing is also performed to extract local grayscale abrupt change areas. The results are then compared with a standard hydraulic cylinder surface feature library to generate defect detection results.
By optimizing and enhancing multi-dimensional images, a high-quality data foundation is laid for the detection of defects in hydraulic cylinders, significantly improving the accuracy and efficiency of detection and meeting the needs of refined detection in industrial scenarios.
Smart Images

Figure CN122089698A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and in particular to a method and system for detecting defects in hydraulic cylinders based on industrial vision. Background Technology
[0002] Currently, there are significant shortcomings in the image acquisition and preprocessing stages of hydraulic cylinder defect detection. Images are not acquired using multi-angle light sources; instead, images are acquired from a single angle, making it difficult to fully cover the complex structure and blind spots on the cylinder surface, resulting in some defect areas not being effectively captured. Furthermore, the acquired images are not normalized in grayscale or fused at the pixel level; instead, the raw images are used directly for analysis, leading to significant issues such as inconsistent grayscale levels and noise interference, failing to provide high-quality data support for subsequent defect identification.
[0003] Existing technologies have significant shortcomings in the feature extraction and defect determination stages of hydraulic cylinder defect detection. They fail to perform edge-preserving smoothing on images, relying solely on conventional smoothing algorithms, which easily leads to the loss or blurring of defect edge information, affecting the accurate localization of defect areas. Furthermore, they do not comprehensively generate candidate defect sets based on the shape, size, and distribution density of local gray-level abrupt change regions, judging solely by single gray-level differences, which easily misclassifies non-defect areas as candidate defects. Finally, they lack a precise comparison mechanism with non-defect features on the standard cylinder surface, relying only on simple threshold judgments, resulting in low defect detection accuracy and failing to meet the refined requirements of hydraulic cylinder defect detection in industrial scenarios. Summary of the Invention
[0004] To address the aforementioned technical shortcomings, the purpose of this invention is to propose a hydraulic cylinder defect detection method based on industrial vision. This method aims to solve the technical problems in existing technologies, such as incomplete image acquisition, poor preprocessing effects, and low accuracy in defect feature extraction and judgment, which make it difficult to meet the needs of refined industrial inspection.
[0005] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: The present invention provides a method for detecting defects in hydraulic cylinders based on industrial vision.
[0006] The industrial vision-based hydraulic cylinder defect detection method includes: S1. Illuminate the target cylinder with different light source angles to obtain a multi-angle illumination image set of the target cylinder; S2. Perform grayscale normalization processing on the multi-angle illumination image set to obtain a grayscale uniform image set of the target oil cylinder; S3. Perform pixel-level fusion on the grayscale uniform image set corresponding to the same area of the target cylinder to obtain the fused enhanced image of the target cylinder; S4. Perform edge smoothing processing on the fused and enhanced image to obtain a structurally preserved image of the target hydraulic cylinder; S5. Extract the local gray-level jump regions in the structure-preserving image, and generate a set of candidate defect regions for the target cylinder based on the shape, size and distribution density of the local gray-level jump regions; S6. Compare the geometric features of the candidate defect region set with the non-defect features in the preset standard cylinder surface feature library to obtain the defect detection result of the target cylinder.
[0007] Preferably, the target cylinder is illuminated by light sources at different angles to obtain a multi-angle illumination image set of the target cylinder, specifically including: The light sources in the control light source array are lit sequentially according to a time sequence, illuminating the target oil cylinder at different illumination angles; When the light source is lit, a single-angle illumination image of the target cylinder at the current illumination angle is simultaneously acquired; By summarizing the single-angle illumination images, a multi-angle illumination image set for the target hydraulic cylinder is obtained.
[0008] Preferably, the multi-angle illumination image set is subjected to grayscale normalization processing to obtain a grayscale-uniform image set of the target cylinder, specifically including: Traverse the single-angle lighting images in the multi-angle lighting image set to extract the original grayscale values of all pixels in the single-angle lighting image; Based on the original grayscale value, determine the grayscale transformation parameters corresponding to the single-angle illumination image; Based on the grayscale transformation parameters, the original grayscale values of the pixels in the single-angle illumination image are mapped and transformed to obtain a grayscale uniform image set of the target cylinder.
[0009] Preferably, the same region images corresponding to the target cylinder in the grayscale uniform image set are fused at the pixel level to obtain the fused enhanced image of the target cylinder, specifically including: Spatial position registration is performed on all images in the grayscale uniform image set to establish the position mapping relationship of the target hydraulic cylinder; Based on the position mapping relationship, grayscale features of multiple sets of pixels at the same surface position of the target oil cylinder are merged to obtain the fused grayscale value of the target oil cylinder. The fused grayscale values are topologically reconstructed to obtain the fused and enhanced image of the target hydraulic cylinder.
[0010] Preferably, the fused and enhanced image is subjected to edge smoothing processing to obtain a structurally preserved image of the target hydraulic cylinder, specifically including: Traverse the pixels in the fused and enhanced image to identify the gray-level distribution features within the neighborhood of each pixel; Based on the grayscale distribution characteristics, it is determined that the pixel is located in the edge region of the fused and enhanced image; When the pixel is located in a non-edge region, the original gray value of the pixel is smoothed and replaced with the gray value features of adjacent pixels within the neighborhood. When the pixel is located in the edge region, the original gray value of the pixel is retained unchanged; After the pixel has undergone the above processing, a structural image of the target hydraulic cylinder is generated.
[0011] Preferably, local gray-level abrupt change regions are extracted from the structure-preserving image, and a candidate defect region set for the target hydraulic cylinder is generated based on the shape, size, and distribution density of the local gray-level abrupt change regions, specifically including: The structure-preserving image is scanned pixel by pixel to obtain the abrupt pixel points of the structure-preserving image; By connecting and combining the abruptly changed pixels, the local grayscale jump region of the target oil cylinder is obtained; Extract the contour features of the local gray-level abrupt change region, and determine the geometry of the local gray-level abrupt change region based on the contour features; The number of pixels in the local grayscale transition region is counted, and the size of the local grayscale transition region is determined based on the number of pixels. The distribution density of the local gray-level abrupt change regions is determined by summing the number of such regions appearing per unit area. The set of candidate defect regions for the target hydraulic cylinder is obtained by comprehensively evaluating the geometry, size, and distribution density.
[0012] Preferably, the geometric features of the candidate defect region set are compared with non-defect features in a preset standard cylinder surface feature library to obtain the defect detection result of the target cylinder, specifically including: Extract the region contour shape and region size parameters of the candidate defect regions from the candidate defect region set; Retrieve a preset standard cylinder surface feature library, which stores non-defect area feature data of the cylinder surface; The region's outline shape and size parameters are compared with the feature data of the non-defect region. Based on the similarity comparison results, real candidate defect regions that do not match the feature data of the non-defect regions are selected from the candidate defect region set; The actual candidate defect area is determined as the defect detection result of the target hydraulic cylinder.
[0013] This invention also provides a hydraulic cylinder defect detection system based on industrial vision, comprising: The image acquisition module is used to illuminate the target cylinder with different light source angles to obtain a multi-angle illumination image set of the target cylinder; The grayscale processing module is used to perform grayscale normalization processing on the multi-angle illumination image set to obtain a grayscale-uniform image set of the target oil cylinder; The pixel fusion module is used to perform pixel-level fusion of the same area images corresponding to the target cylinder in the grayscale uniform image set to obtain the fused enhanced image of the target cylinder; A smoothing module is used to perform edge smoothing on the fused and enhanced image to obtain a structurally preserved image of the target cylinder. The defect identification module is used to extract local gray-level abrupt change regions in the structure-preserved image, and generate a set of candidate defect regions for the target cylinder based on the shape, size and distribution density of the local gray-level abrupt change regions; The target detection module is used to compare the geometric features of the candidate defect region set with the non-defect features in the preset standard cylinder surface feature library to obtain the defect detection result of the target cylinder.
[0014] The present invention also provides a hydraulic cylinder defect detection device based on industrial vision, comprising: a memory, a processor, and a hydraulic cylinder defect detection program based on industrial vision stored in the memory and executable on the processor. When the hydraulic cylinder defect detection program based on industrial vision is executed by the processor, it implements a hydraulic cylinder defect detection method based on industrial vision.
[0015] The present invention also provides a computer program product, including an industrial vision-based hydraulic cylinder defect detection program, which, when executed by a processor, implements the industrial vision-based hydraulic cylinder defect detection method.
[0016] The beneficial effects of this invention are as follows: This invention lays a high-quality data foundation for hydraulic cylinder defect detection through multi-dimensional image optimization and enhancement. Multi-angle illumination image sets of the target cylinder are acquired from different light source angles. Gray-scale normalization is then performed to eliminate the influence of illumination differences. Pixel-level fusion is then performed on images of the same area to generate a detailed fused and enhanced image. Edge-preserving smoothing processing completely preserves the defect edge structure while removing noise interference, resulting in a structure-preserving image, providing clear and reliable image support for accurate defect identification.
[0017] This invention significantly improves the accuracy and efficiency of hydraulic cylinder defect detection by leveraging a precise feature extraction and comparison mechanism. It extracts local grayscale transition regions from structure-preserving images and generates a candidate defect region set by combining shape, size, and distribution density, comprehensively capturing potential defect features. The geometric features of the candidate regions are then compared with a standard hydraulic cylinder surface non-defect feature library to accurately screen for real defect regions, ensuring the accuracy of the detection results and meeting the refined and efficient requirements of hydraulic cylinder defect detection in industrial scenarios. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart illustrating the first embodiment of a hydraulic cylinder defect detection method based on industrial vision according to the present invention.
[0020] Figure 2 This is a schematic diagram of the equipment for a hydraulic cylinder defect detection method based on industrial vision according to the present invention. Detailed Implementation
[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] Example 1: As Figure 1 The diagram shown is a flowchart of the first embodiment of the hydraulic cylinder defect detection method based on industrial vision of the present invention, which presents the first embodiment of the hydraulic cylinder defect detection method based on industrial vision of the present invention.
[0023] In the first embodiment, the industrial vision-based hydraulic cylinder defect detection method includes: S1. Illuminate the target cylinder with different light source angles to obtain a multi-angle illumination image set of the target cylinder; In this embodiment of the invention, the target hydraulic cylinder is illuminated with different light source angles to obtain a multi-angle illumination image set of the target hydraulic cylinder, specifically including: The light sources in the control light source array are lit sequentially according to a time sequence, illuminating the target oil cylinder at different illumination angles; When the light source is lit, a single-angle illumination image of the target cylinder at the current illumination angle is simultaneously acquired; By summarizing the single-angle illumination images, a multi-angle illumination image set for the target hydraulic cylinder is obtained.
[0024] A fixed-time lighting control command is sent to the light source array, so that the light sources inside the light source array are turned on one by one in a pre-set time sequence. When each light source is lit, it will project light onto the target oil cylinder from an independent spatial position, forming different illumination angles to illuminate the target oil cylinder.
[0025] The moment any light source is detected to have completed its illumination action, the image acquisition device is immediately activated to capture an image of the target cylinder, ensuring complete synchronization between light illumination and image acquisition in time. This allows for the direct acquisition of a complete and clear image of the target cylinder at the current illumination angle, which is the single-angle illumination image of the target cylinder.
[0026] All single-angle illumination images acquired by sequentially lighting all light sources and simultaneously collecting them are centrally integrated and systematically categorized according to the corresponding illumination angles at the time of acquisition. The resulting integrated image set is the multi-angle illumination image set of the target hydraulic cylinder.
[0027] The beneficial effect is that by controlling the light source array to illuminate from multiple angles in a time sequence, the surface of the target cylinder can be fully covered, eliminating blind spots in light and shadow, and completely capturing the feature information of each area on the cylinder surface.
[0028] Illumination and image acquisition are performed simultaneously to ensure the accuracy of single-angle illumination image acquisition and avoid image blurring or feature loss due to timing deviations.
[0029] By compiling images from multiple angles to form an image set, rich and comprehensive raw data is provided for subsequent processing such as grayscale normalization and pixel fusion, effectively improving the accuracy of subsequent defect detection.
[0030] S2. Perform grayscale normalization processing on the multi-angle illumination image set to obtain a grayscale uniform image set of the target oil cylinder; In this embodiment of the invention, grayscale normalization processing is performed on the multi-angle illumination image set to obtain a grayscale-uniform image set of the target hydraulic cylinder, specifically including: Traverse the single-angle lighting images in the multi-angle lighting image set to extract the original grayscale values of all pixels in the single-angle lighting image; Based on the original grayscale value, determine the grayscale transformation parameters corresponding to the single-angle illumination image; Based on the grayscale transformation parameters, the original grayscale values of the pixels in the single-angle illumination image are mapped and transformed to obtain a grayscale uniform image set of the target cylinder.
[0031] Each single-angle lighting image in the multi-angle lighting image set is selected sequentially, and the image of each single-angle lighting image is fully scanned one by one to completely extract the original grayscale value of each pixel in each single-angle lighting image, ensuring that no grayscale information of any pixel is missed.
[0032] All original grayscale values of the extracted single-angle illumination image are statistically analyzed and sorted to clarify the distribution range of all original grayscale values. Based on this distribution range, grayscale transformation parameters that can uniformly adjust the original grayscale values are determined. These parameters are used to achieve standardized adjustment of the grayscale of the single-angle illumination image.
[0033] The determined grayscale transformation parameters are applied to all pixels of the corresponding single-angle lighting image. The original grayscale value of each pixel is uniformly mapped and transformed to ensure that the grayscale distribution of each single-angle lighting image is consistent. All the transformed single-angle lighting images are then summarized to form the grayscale consistent image set of the target cylinder.
[0034] The beneficial effects are that it eliminates the grayscale differences caused by multi-angle illumination, keeps the grayscale distribution of each single-angle illumination image consistent, and effectively avoids the interference of uneven illumination on subsequent detection.
[0035] Unifying image grayscale features improves the standardization of image data, providing a high-quality and consistent image foundation for subsequent pixel-level fusion and ensuring the accuracy of subsequent defect identification.
[0036] S3. Perform pixel-level fusion on the grayscale uniform image set corresponding to the same area of the target cylinder to obtain the fused enhanced image of the target cylinder; In this embodiment of the invention, the same region images corresponding to the target cylinder in the grayscale uniform image set are fused at the pixel level to obtain the fused enhanced image of the target cylinder, specifically including: Spatial position registration is performed on all images in the grayscale uniform image set to establish the position mapping relationship of the target hydraulic cylinder; Based on the position mapping relationship, grayscale features of multiple sets of pixels at the same surface position of the target oil cylinder are merged to obtain the fused grayscale value of the target oil cylinder. The fused grayscale values are topologically reconstructed to obtain the fused and enhanced image of the target hydraulic cylinder.
[0037] Each image in the grayscale uniform image set is selected sequentially. Based on the contour features of the target cylinder, spatial alignment adjustment is performed on all images one by one to eliminate positional shifts caused by differences in shooting angles between different images. The corresponding relationship between the positions of each surface of the target cylinder in all images is accurately established, forming the positional mapping relationship of the target cylinder.
[0038] Based on the established position mapping relationship, all pixels corresponding to the same surface position of the target oil cylinder in all images are accurately located. The grayscale features of these multiple sets of pixels at the same surface position are integrated and merged, abnormal grayscale information is removed, and effective grayscale features are retained. Finally, a unified grayscale value corresponding to the surface position is obtained, which is the fused grayscale value of the target oil cylinder.
[0039] All the fused gray values corresponding to the surface positions are arranged in an orderly manner according to the actual contour shape of the target cylinder. The overall topological structure of these fused gray values is reconstructed to restore the complete surface shape of the target cylinder, enhance the image detail features, make the image contour clearer and the gray distribution more uniform. The complete image obtained after reconstruction is the fused enhanced image of the target cylinder.
[0040] The beneficial effects include eliminating positional offsets in multi-angle images, achieving precise pixel matching within the same area of the hydraulic cylinder, and laying a precise positional foundation for pixel-level fusion. It also integrates grayscale features from multiple pixel groups at the same location, removing abnormal information and retaining effective features, making the image grayscale information more reliable.
[0041] By reconstructing the topology, the complete surface morphology of the crude oil cylinder is restored, enhancing image detail features, improving image clarity and grayscale uniformity, and providing high-quality fusion-enhanced images for subsequent defect detection.
[0042] S4. Perform edge smoothing processing on the fused and enhanced image to obtain a structurally preserved image of the target hydraulic cylinder; In this embodiment of the invention, edge smoothing processing is performed on the fused and enhanced image to obtain a structurally preserved image of the target hydraulic cylinder, specifically including: Traverse the pixels in the fused and enhanced image to identify the gray-level distribution features within the neighborhood of each pixel; Based on the grayscale distribution characteristics, it is determined that the pixel is located in the edge region of the fused and enhanced image; When the pixel is located in a non-edge region, the original gray value of the pixel is smoothed and replaced with the gray value features of adjacent pixels within the neighborhood. When the pixel is located in the edge region, the original gray value of the pixel is retained unchanged; After the pixel has undergone the above processing, a structural image of the target hydraulic cylinder is generated.
[0043] Each pixel in the fused and enhanced image is selected one by one to determine the range of neighboring pixels around each pixel. The grayscale information of all neighboring pixels within this range is comprehensively collected and organized to clearly identify the grayscale distribution characteristics within the neighborhood of the pixel, ensuring complete acquisition of the grayscale changes within the neighborhood.
[0044] Based on the grayscale distribution characteristics within the neighborhood of the identified pixel, the grayscale difference between the pixel and its neighboring pixels is compared. If the grayscale difference reaches a fixed judgment standard, the pixel is determined to be located in the edge region of the fused and enhanced image, thus clearly distinguishing pixels in the edge region from those in the non-edge region.
[0045] When a pixel is determined to be located in a non-edge region, the original gray value of the pixel is smoothed, the gray features of all neighboring pixels in its neighborhood are collected and integrated, and the integrated neighborhood gray features are used to directly replace the original gray value of the pixel to eliminate gray noise in non-edge regions.
[0046] When a pixel is determined to be located in an edge region, its original grayscale value is not changed, and its original grayscale information is fully preserved to avoid damage to the detailed features of the edge region and ensure that the contour structure of the target cylinder is not distorted.
[0047] According to the above processing rules, all pixels in the fused and enhanced image are processed one by one. After all pixels have been processed, all processed pixels are combined in order according to their original positions to form a complete image, which is the structural preservation image of the target oil cylinder.
[0048] The beneficial effects are that it can accurately distinguish between image edges and non-edge areas, eliminate grayscale noise in non-edge areas, and fully preserve the original grayscale information of defective edges, thus avoiding the loss of edge details.
[0049] The processed structure-preserving image not only ensures image cleanliness but also accurately reproduces the outline of the original cylinder and the structural features of defects, providing a clear and reliable image basis for subsequent defect area extraction and improving the accuracy of defect localization.
[0050] S5. Extract the local gray-level jump regions in the structure-preserving image, and generate a set of candidate defect regions for the target cylinder based on the shape, size and distribution density of the local gray-level jump regions; In this embodiment of the invention, local gray-level abrupt change regions are extracted from the structure-preserving image, and a candidate defect region set for the target hydraulic cylinder is generated based on the shape, size, and distribution density of the local gray-level abrupt change regions. Specifically, this includes: The structure-preserving image is scanned pixel by pixel to obtain the abrupt pixel points of the structure-preserving image; By connecting and combining the abruptly changed pixels, the local grayscale jump region of the target oil cylinder is obtained; Extract the contour features of the local gray-level abrupt change region, and determine the geometry of the local gray-level abrupt change region based on the contour features; The number of pixels in the local grayscale transition region is counted, and the size of the local grayscale transition region is determined based on the number of pixels. The distribution density of the local gray-level abrupt change regions is determined by summing the number of such regions appearing per unit area. The set of candidate defect regions for the target hydraulic cylinder is obtained by comprehensively evaluating the geometry, size, and distribution density.
[0051] A comprehensive scan is performed on each pixel of the structure-preserving image, and the difference in grayscale value between each pixel and its neighboring pixels is compared. Pixels with sudden changes in grayscale value are selected, and these pixels with sudden grayscale changes are the abrupt change pixels in the structure-preserving image.
[0052] All identified mutation pixels are screened and integrated. Mutation pixels that are adjacent in position and have the same gray-level mutation characteristics are connected and combined to form continuous regions. These continuous regions are the local gray-level jump regions of the target oil cylinder.
[0053] For each local grayscale transition region, the contour is extracted, and the edge of the local grayscale transition region is scanned point by point to outline the complete contour of the region. Based on the outline shape, the geometry of each local grayscale transition region is clearly determined.
[0054] Count all pixels in each local grayscale transition region one by one, and calculate the total number of pixels contained in each local grayscale transition region. Based on the total number of pixels, determine the size of each local grayscale transition region.
[0055] Select a fixed unit area range in the structure-preserving image, count the total number of local gray-level jump regions appearing within this unit area range, and determine the distribution density of local gray-level jump regions by summarizing the results.
[0056] The geometry, size, and distribution density of each local gray-scale jump region are comprehensively analyzed and evaluated to screen out local gray-scale jump regions that meet the characteristics of defect regions. All regions that meet the conditions are then integrated to form the set of candidate defect regions for the target cylinder.
[0057] The beneficial effects are that it accurately captures the gray-level abrupt change features in the structure-preserving image, forms local gray-level jump areas, and comprehensively explores the location of potential defects.
[0058] By extracting and comprehensively evaluating the geometric features of transition regions from multiple dimensions, misjudgments caused by single gray-level differences are avoided, effectively filtering out regions that meet defect characteristics. The generated candidate defect region set has clear and targeted features, providing a reliable basis for the accurate determination of real defects in the subsequent process, and improving the accuracy and efficiency of defect identification.
[0059] S6. Compare the geometric features of the candidate defect region set with the non-defect features in the preset standard cylinder surface feature library to obtain the defect detection result of the target cylinder.
[0060] In this embodiment of the invention, the geometric features of the candidate defect region set are compared with non-defect features in a preset standard cylinder surface feature library to obtain the defect detection result of the target cylinder, specifically including: Extract the region contour shape and region size parameters of the candidate defect regions from the candidate defect region set; Retrieve a preset standard cylinder surface feature library, which stores non-defect area feature data of the cylinder surface; The region's outline shape and size parameters are compared with the feature data of the non-defect region. Based on the similarity comparison results, real candidate defect regions that do not match the feature data of the non-defect regions are selected from the candidate defect region set; The actual candidate defect area is determined as the defect detection result of the target hydraulic cylinder.
[0061] Each candidate defect region in the candidate defect region set is processed one by one. A complete scan is performed along the edge of each candidate defect region to outline the complete contour of the region and clarify its shape. At the same time, the pixel distribution of each candidate defect region is statistically analyzed to extract the region size parameter that can characterize the region size.
[0062] The command to retrieve the preset standard cylinder surface feature library is initiated. This preset standard cylinder surface feature library is a feature set established after pre-collecting a large number of surface features of defect-free standard cylinders, organizing and calibrating them. The library specifically stores feature data of various non-defect areas on the cylinder surface, covering key information such as the contour shape and size parameters of the non-defect areas.
[0063] The region contour shape and region size parameters of each extracted candidate defect region are compared one by one with the non-defect region feature data in the preset standard cylinder surface feature library. The similarity between the two in terms of contour shape and size is compared to obtain the similarity comparison results between each candidate defect region and the non-defect feature data.
[0064] Based on the obtained similarity comparison results, candidate defect areas that meet the matching criteria with any non-defect area feature data in the preset standard cylinder surface feature library are removed. Only candidate defect areas that do not match any non-defect area feature data are retained. These retained areas are the real candidate defect areas of the target cylinder.
[0065] All the selected real candidate defect areas are centrally organized, and the location, outline and size information of each real candidate defect area are clarified. These real candidate defect areas are used as the specific basis for the existence of defects in the target hydraulic cylinder and are directly determined as the defect detection results of the target hydraulic cylinder.
[0066] The beneficial effect is that by accurately comparing the geometric features of candidate regions with a standard feature library, misjudgments of non-defect regions can be effectively eliminated, significantly improving the accuracy of defect detection.
[0067] It accurately identifies actual defect areas, clearly defines the location and characteristics of defects in the target hydraulic cylinder, and provides highly reliable test results that meet the needs of refined testing in industrial scenarios. It establishes standardized defect judgment criteria, making the testing process more standardized and improving overall testing efficiency and the verifiability of results.
[0068] Example 2: Furthermore, the present invention provides a hydraulic cylinder defect detection system based on industrial vision, employing a hydraulic cylinder defect detection method based on industrial vision from the above embodiments, which can solve the technical problem of hydraulic cylinder defect detection based on industrial vision. The beneficial effects of the hydraulic cylinder defect detection system based on industrial vision provided by the present invention are the same as those of the hydraulic cylinder defect detection method based on industrial vision provided in the above embodiments, and other technical features of the hydraulic cylinder defect detection system based on industrial vision are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0069] Example 3: This invention provides a hydraulic cylinder defect detection device based on industrial vision. Please refer to... Figure 2An industrial vision-based hydraulic cylinder defect detection device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to perform the industrial vision-based hydraulic cylinder defect detection method described in Embodiment 1 above. The industrial vision-based hydraulic cylinder defect detection device in this embodiment of the invention may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), and vehicle terminals (e.g., vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. This industrial vision-based hydraulic cylinder defect detection device is merely an example and should not limit the functionality or scope of the embodiments of the invention. An industrial vision-based hydraulic cylinder defect detection device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.) that can perform various appropriate actions and processes according to a program stored in a read-only memory 1002 or a program loaded from a storage device 1003 into a random access memory 1004. The random access memory 1004 also stores various programs and data required for the operation of the industrial vision-based hydraulic cylinder defect detection device. The processing unit 1001, the read-only memory 1002, and the random access memory 1004 are interconnected via a bus 1005. An I / O interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication device 1009 allows an industrial vision-based hydraulic cylinder defect detection device to communicate wirelessly or wiredly with other devices to exchange data. While the figure shows an industrial vision-based hydraulic cylinder defect detection device with various systems, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.
[0070] Example 4: This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described hydraulic cylinder defect detection method based on industrial vision. The computer program product provided by this invention can solve the technical problem of hydraulic cylinder defect detection based on industrial vision. Compared with the prior art, the beneficial effects of the computer program product provided by this invention are the same as those of the hydraulic cylinder defect detection method based on industrial vision provided in the above embodiments, and will not be repeated here.
[0071] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this invention.
[0072] It should be understood that the various parts disclosed in this invention can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics may be combined in any suitable manner in one or more embodiments or examples.
[0073] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for detecting defects in hydraulic cylinders based on industrial vision, characterized in that the method... include: S1. Illuminate the target cylinder with different light source angles to obtain a multi-angle illumination image set of the target cylinder; S2. Perform grayscale normalization processing on the multi-angle illumination image set to obtain a grayscale uniform image set of the target oil cylinder; S3. Perform pixel-level fusion on the grayscale uniform image set corresponding to the same area of the target cylinder to obtain the fused enhanced image of the target cylinder; S4. Perform edge smoothing processing on the fused and enhanced image to obtain a structurally preserved image of the target hydraulic cylinder; S5. Extract the local gray-level jump regions in the structure-preserving image, and generate a set of candidate defect regions for the target cylinder based on the shape, size and distribution density of the local gray-level jump regions; S6. Compare the geometric features of the candidate defect region set with the non-defect features in the preset standard cylinder surface feature library to obtain the defect detection result of the target cylinder.
2. The method for detecting defects in hydraulic cylinders based on industrial vision according to claim 1, characterized in that, Illuminating the target hydraulic cylinder with different light source angles to obtain a multi-angle illumination image set of the target hydraulic cylinder, specifically including: The light sources in the control light source array are lit sequentially according to a time sequence, illuminating the target oil cylinder at different illumination angles; When the light source is lit, a single-angle illumination image of the target cylinder at the current illumination angle is simultaneously acquired; By summarizing the single-angle illumination images, a multi-angle illumination image set for the target hydraulic cylinder is obtained.
3. The method for detecting defects in hydraulic cylinder based on industrial vision as claimed in claim 1 wherein, The multi-angle illumination image set is subjected to grayscale normalization processing to obtain a grayscale-uniform image set of the target hydraulic cylinder, specifically including: Traverse the single-angle lighting images in the multi-angle lighting image set to extract the original grayscale values of all pixels in the single-angle lighting image; Based on the original grayscale value, determine the grayscale transformation parameters corresponding to the single-angle illumination image; Based on the grayscale transformation parameters, the original grayscale values of the pixels in the single-angle illumination image are mapped and transformed to obtain a grayscale uniform image set of the target cylinder.
4. The method for detecting defects in hydraulic cylinder based on industrial vision as claimed in claim 1 wherein, The same region of the target hydraulic cylinder in the grayscale uniform image set is fused pixel-level to obtain the fused enhanced image of the target hydraulic cylinder, specifically including: Spatial position registration is performed on all images in the grayscale uniform image set to establish the position mapping relationship of the target hydraulic cylinder; Based on the position mapping relationship, grayscale features of multiple sets of pixels at the same surface position of the target oil cylinder are merged to obtain the fused grayscale value of the target oil cylinder. The fused grayscale values are topologically reconstructed to obtain the fused and enhanced image of the target hydraulic cylinder.
5. The method for defect detection of hydraulic cylinder based on industrial vision as claimed in claim 1 wherein, The fused and enhanced image is subjected to edge smoothing processing to obtain a structurally preserved image of the target hydraulic cylinder, specifically including: Traverse the pixels in the fused and enhanced image to identify the gray-level distribution features within the neighborhood of each pixel; Based on the grayscale distribution characteristics, it is determined that the pixel is located in the edge region of the fused and enhanced image; When the pixel is located in a non-edge region, the original gray value of the pixel is smoothed and replaced with the gray value features of adjacent pixels within the neighborhood. When the pixel is located in the edge region, the original gray value of the pixel is retained unchanged; After the pixel has undergone the above processing, a structural image of the target hydraulic cylinder is generated.
6. The method for defect detection of hydraulic cylinder based on industrial vision according to claim 1, characterized in that, Extracting local gray-level abrupt change regions from the structure-preserving image, and generating a candidate defect region set for the target hydraulic cylinder based on the shape, size, and distribution density of these local gray-level abrupt change regions, specifically including: The structure-preserving image is scanned pixel by pixel to obtain the abrupt pixel points of the structure-preserving image; By connecting and combining the abruptly changed pixels, the local grayscale jump region of the target oil cylinder is obtained; Extract the contour features of the local gray-level abrupt change region, and determine the geometry of the local gray-level abrupt change region based on the contour features; The number of pixels in the local grayscale transition region is counted, and the size of the local grayscale transition region is determined based on the number of pixels. The distribution density of the local gray-level abrupt change regions is determined by summing the number of such regions appearing per unit area. The set of candidate defect regions for the target hydraulic cylinder is obtained by comprehensively evaluating the geometry, size, and distribution density.
7. The hydraulic cylinder defect detection method based on industrial vision as described in claim 1, characterized in that, The geometric features of the candidate defect region set are compared with the non-defect features in a preset standard cylinder surface feature library to obtain the defect detection result of the target cylinder, specifically including: Extract the region contour shape and region size parameters of the candidate defect regions from the candidate defect region set; Retrieve a preset standard cylinder surface feature library, which stores non-defect area feature data of the cylinder surface; The region's outline shape and size parameters are compared with the feature data of the non-defect region. Based on the similarity comparison results, real candidate defect regions that do not match the feature data of the non-defect regions are selected from the candidate defect region set; The actual candidate defect area is determined as the defect detection result of the target hydraulic cylinder.
8. A hydraulic cylinder defect detection system based on industrial vision, applied to the hydraulic cylinder defect detection method based on industrial vision as described in any one of claims 1 to 7, characterized in that, The industrial vision-based hydraulic cylinder defect detection system includes: The image acquisition module is used to illuminate the target cylinder with different light source angles to obtain a multi-angle illumination image set of the target cylinder; The grayscale processing module is used to perform grayscale normalization processing on the multi-angle illumination image set to obtain a grayscale-uniform image set of the target oil cylinder; The pixel fusion module is used to perform pixel-level fusion of the same area images corresponding to the target cylinder in the grayscale uniform image set to obtain the fused enhanced image of the target cylinder; A smoothing module is used to perform edge smoothing on the fused and enhanced image to obtain a structurally preserved image of the target cylinder. The defect identification module is used to extract local gray-level abrupt change regions in the structure-preserved image, and generate a set of candidate defect regions for the target cylinder based on the shape, size and distribution density of the local gray-level abrupt change regions; The target detection module is used to compare the geometric features of the candidate defect region set with the non-defect features in the preset standard cylinder surface feature library to obtain the defect detection result of the target cylinder.
9. A hydraulic cylinder defect detection device based on industrial vision, characterized in that, The industrial vision-based hydraulic cylinder defect detection device includes: a memory, a processor, and an industrial vision-based hydraulic cylinder defect detection program stored in the memory and executable on the processor. When the industrial vision-based hydraulic cylinder defect detection program is executed by the processor, it implements the industrial vision-based hydraulic cylinder defect detection method according to any one of claims 1 to 7.
10. A computer program product, characterized in that, The computer program product includes an industrial vision-based hydraulic cylinder defect detection program, which, when executed by a processor, implements a hydraulic cylinder defect detection method based on industrial vision as described in any one of claims 1 to 7.