Pool stain detection method and system
The background image is generated through point cloud matching and β-spline interpolation, and the pool stains are detected in combination with threshold parameters, which solves the problem of difficulty in detecting transparent liquid stains and poor algorithm versatility in the prior art, and achieves efficient and robust pool stain detection.
Patent Information
- Application Number
- CN202111064094.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-10
- Publication Date
- 2025-04-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art has the problem of difficulty in detecting transparent liquid stains and poor algorithm versatility in pool stain detection, especially under different stain scenarios and lighting conditions.
By matching the real-time detected pool point cloud data with the point cloud data model, calculate the region of interest, and perform noise reduction processing and β-spline interpolation to generate a modeling background map. Based on this background image, detection threshold parameters are set, stains in the pool are detected, and stain position information is converted into spatial three-dimensional coordinates.
It realizes efficient detection of transparent liquid stains that are difficult to detect in the pool, improves the robustness and versatility of the algorithm, can effectively detect under different stain scenarios and lighting conditions, and significantly improves the accuracy and efficiency of the re-checking of the cleaning robot.
Smart Images

Figure CN114119738B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of visual recognition and positioning, and in particular, to a pool stain detection method and system, and more particularly, to a hotel pool stain detection method and system. Background Art
[0002] Data shows that one smart device can currently replace the work hours of 2 to 3 cleaners, with one cleaner cleaning 300m per hour. 2 The intelligent device can complete 700-1000m per hour. 2 Among them, most cleaning equipment can achieve up to 16 hours of battery life after charging for 3 to 4 hours in the corresponding operation mode, which is equivalent to two shifts for cleaning staff for property companies. Intelligent cleaning of hotel rooms is already a trend in the future, because the current room cleaning is a standardized process, which is very suitable for robots to replace many repetitive tasks.
[0003] The workflow of hotel cleaning robots is relatively complicated. As far as the pool is concerned, how to make the robot clean thoroughly or conduct accurate re-inspection after cleaning has always been a challenge.
[0004] Patent document CN103575747A (application number: CN201210281893.2) discloses an aluminum foil surface stain detection device, including: a detection device, the detection device includes a frame, a white film and a transparent plate, the white film and the transparent plate are fixedly installed in the hollow of the frame, the white film is arranged above the transparent plate, and a direct light source is arranged above the detection device. Through the above method, the aluminum foil surface stain detection device described in the present invention utilizes the principle of light reflection and refraction, and can identify black lines, black spots, oil stains and other stains attached to the aluminum foil surface with the naked eye. It has a simple structure, is easy to operate, and improves the efficiency of aluminum foil appearance detection. However, its stain detection scene is not suitable for the scene of pool detection, and it uses the reflective physical properties of aluminum foil. In the actual pool stain detection scene, the effect is not ideal.
[0005] Patent document CN109712123A (application number: CN201811533655.X) discloses a stain detection method, including the following steps: obtaining an image of a cover to be tested; performing circular target calibration on the grayscale image and calculating the center point and radius of the circular target image; dividing the circular target image into a circular ring area and a central circle area, and performing polar coordinate transformation on the circular ring area image with the center point as the origin; performing adaptive binary filtering on the polar coordinate transformed image and the central circle area image, respectively, to obtain stain images of the circular ring area and the central circle area, respectively, and performing coordinate inverse transformation on the stain image in the polar coordinate system to obtain the stain image of the circular ring area in the rectangular coordinate system; merging the stain images of the two areas to obtain the stain image of the cover to be tested. However, the invention cannot effectively detect stains in scenes with different stains or in different lighting scenes, and the algorithm is not universal. Summary of the invention
[0006] In view of the defects in the prior art, an object of the present invention is to provide a pool stain detection method and system.
[0007] A pool stain detection method provided by the present invention comprises:
[0008] Step S1: performing point cloud matching on the point cloud data of the pool detected in real time and the point cloud data model to calculate the region of interest;
[0009] Step S2: performing noise reduction processing on the region of interest;
[0010] Step S3: performing β-spline curve interpolation on the image after noise reduction to obtain a modeling background image;
[0011] Step S4: Based on the modeled background image, the stains in the pool are detected by setting the detection threshold parameters;
[0012] Step S5: Output the detected stain parameters and convert the stain position information into three-dimensional spatial coordinates.
[0013] Preferably, in step S1:
[0014] The real-time detected 3D point cloud data is matched with the 3D point cloud data model built in the database, and the marked pose points are converted into the region of interest during actual detection, including the following steps:
[0015] a. Use template matching to find the four corners of the calibrated pool:
[0016] When deploying the scene, obtain and store the pool point cloud data at a fixed location, and calibrate the four corners of the pool;
[0017] Using template matching, the plane coordinates of the four corners are accurately matched and converted into spatial coordinates;
[0018] b. Use the 3D point cloud data of the actual detected image to match the point cloud data, and calculate the region of interest corresponding to the detected image through the posture conversion relationship:
[0019] Obtain the point cloud data of the pool during actual inspection, match it with the previously collected point cloud, and save the posture conversion relationship between the two sets of data;
[0020] Transform the spatial coordinates to obtain the new coordinate points of the four corners;
[0021] Using the intrinsic and extrinsic parameters of the camera, the obtained transformed coordinates are projected into the image coordinate system, and the required region of interest is generated.
[0022] Preferably, in step S2:
[0023] Preprocess the pool image:
[0024] Convert the color image, i.e. the RGB three channels, into a grayscale image;
[0025] The calculated region of interest is subjected to noise reduction processing, and median filtering and Gaussian filtering are used to filter out the influence of salt and pepper noise and Gaussian noise on background modeling.
[0026] Preferably, in step S3:
[0027] Background image generation based on β-spline interpolation:
[0028] According to the characteristics of piecewise continuity, variation reduction, convex hull and convexity preservation of the β-spline curve, and according to the size of the object to be detected in the actual application scenario, control points with preset value gaps are selected from the preprocessed image to generate a background image and obtain a control point image;
[0029] The pixel values at the coordinate positions of the control points are used to perform horizontal β-spline interpolation to obtain a horizontal line background image. When the segmentation gap involves an outlier, the influence of the outlier on the background image generation is reduced by the influence of the main pixel value, thereby improving the detection efficiency of the outlier.
[0030] Using the generated horizontal line background image, β-spline curve interpolation is performed column by column in the vertical direction to obtain the modeled background image.
[0031] Preferably, in step S4:
[0032] Based on the background image generated by modeling, a diff image is generated. According to the diff image, the stains in the pool are detected by setting the detection threshold parameters:
[0033] Subtract the converted grayscale image from the background image to generate a difference image, and perform histogram equalization on the original image to enhance the image contrast. Subtraction means making a point-to-point difference between the two images.
[0034] Perform threshold segmentation on the image after histogram equalization, improve detection sensitivity by lowering the threshold, and perform morphological opening operation to eliminate detected outlier points;
[0035] According to the obtained binary mask image, the characteristic parameters of the area are screened and the location of the stain is output.
[0036] Preferably, in step S5:
[0037] Output the detected stain position, centroid, and area parameters, and convert the position information into three-dimensional spatial coordinates:
[0038] According to the internal parameters of the depth image and color image camera, the positioning points in the pool stains are converted into the spatial coordinate system to realize the detection and positioning functions of the stains.
[0039] A pool stain detection system provided by the present invention comprises:
[0040] Module M1: Perform point cloud matching between the point cloud data of the real-time detected pool and the point cloud data model to calculate the area of interest;
[0041] Module M2: noise reduction processing of the region of interest;
[0042] Module M3: Perform β-spline curve interpolation on the denoised image to obtain a modeling background image;
[0043] Module M4: Based on the modeled background image, the stains in the pool are detected by setting the detection threshold parameters;
[0044] Module M5: Output the detected stain parameters and convert the stain location information into three-dimensional spatial coordinates.
[0045] Preferably, in the module M1:
[0046] The real-time detected 3D point cloud data is matched with the 3D point cloud data model built in the database, and the marked pose points are converted into the region of interest during actual detection, including the following steps:
[0047] a. Use template matching to find the four corners of the calibrated pool:
[0048] When deploying the scene, obtain and store the pool point cloud data at a fixed location, and calibrate the four corners of the pool;
[0049] Using template matching, the plane coordinates of the four corners are accurately matched and converted into spatial coordinates;
[0050] b. Use the 3D point cloud data of the actual detected image to match the point cloud data, and calculate the region of interest corresponding to the detected image through the posture conversion relationship:
[0051] Obtain the point cloud data of the pool during actual inspection, match it with the previously collected point cloud, and save the posture conversion relationship between the two sets of data;
[0052] Transform the spatial coordinates to obtain the new coordinate points of the four corners;
[0053] Using the intrinsic and extrinsic parameters of the camera, the obtained transformed coordinates are projected into the image coordinate system, and the required region of interest is generated.
[0054] Preferably, in the module M2:
[0055] Preprocess the pool image:
[0056] Convert the color image, i.e. the RGB three channels, into a grayscale image;
[0057] Perform noise reduction on the calculated region of interest, using median filtering and Gaussian filtering to filter out the influence of salt and pepper noise and Gaussian noise on background modeling;
[0058] Preferably, in the module M3:
[0059] Background image generation based on β-spline interpolation:
[0060] According to the characteristics of piecewise continuity, variation reduction, convex hull and convexity preservation of the β-spline curve, and according to the size of the object to be detected in the actual application scenario, control points with preset value gaps are selected from the preprocessed image to generate a background image and obtain a control point image;
[0061] The pixel values at the coordinate positions of the control points are used to perform horizontal β-spline interpolation to obtain a horizontal line background image. When the segmentation gap involves an outlier, the influence of the outlier on the background image generation is reduced by the influence of the main pixel value, thereby improving the detection efficiency of the outlier.
[0062] Using the generated horizontal line background image, β-spline curve interpolation is performed column by column in the vertical direction to obtain the modeled background image.
[0063] Preferably, in the module M4:
[0064] Based on the background image generated by modeling, a diff image is generated, and according to the diff image, the stains in the pool are detected by setting the detection threshold parameters;
[0065] Subtract the converted grayscale image from the background image to generate a difference image, and perform histogram equalization on the original image to enhance the image contrast. Subtraction means making a point-to-point difference between the two images.
[0066] Perform threshold segmentation on the image after histogram equalization, improve detection sensitivity by lowering the threshold, and perform morphological opening operation to eliminate detected outlier points;
[0067] According to the obtained binary mask image, the characteristic parameters of the region are screened and the location of the stain is output;
[0068] Preferably, in the module M5:
[0069] Output the detected stain position, centroid, and area parameters, and convert the position information into three-dimensional spatial coordinates:
[0070] According to the internal parameters of the depth image and color image camera, the positioning points in the pool stains are converted into the spatial coordinate system to realize the detection and positioning functions of the stains.
[0071] Compared with the prior art, the present invention has the following beneficial effects:
[0072] 1. It can efficiently detect transparent liquid stains that are difficult to detect in the pool;
[0073] 2. The background modeling based on the image itself greatly improves the robustness of the algorithm. It can effectively detect different stains or different lighting scenes, and the algorithm has good versatility.
[0074] 3. The pool stain detection algorithm has great application prospects in cleaning robots. It greatly improves the re-inspection accuracy and efficiency of the cleaning robot, and can greatly improve the cleanliness evaluation of the cleaning robot. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0076] Figure 1 A flow chart for pool stain detection;
[0077] Figure 2 The four corners of the pool are marked;
[0078] Figure 3 This is the actual test point cloud map;
[0079] Figure 4 is the control point map for sampling;
[0080] Figure 5 It is the background image of the horizon line;
[0081] Figure 6 Background image modeled for beta-spline interpolation;
[0082] Figure 7 It is the histogram equalization diff graph;
[0083] Figure 8 A binary mask image for detecting stains;
[0084] Fig. 9 is the stain binary mask image;
[0085] Fig.10 Mark the image for stains. DETAILED DESCRIPTION
[0086] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.
[0087] Embodiment 1:
[0088] According to a pool stain detection method provided by the present invention, Figures 1 to 10 ,include:
[0089] Step S1: performing point cloud matching on the point cloud data of the pool detected in real time and the point cloud data model to calculate the region of interest;
[0090] Step S2: performing noise reduction processing on the region of interest;
[0091] Step S3: performing β-spline curve interpolation on the image after noise reduction to obtain a modeling background image;
[0092] Step S4: Based on the modeled background image, the stains in the pool are detected by setting the detection threshold parameters;
[0093] Step S5: Output the detected stain parameters and convert the stain position information into three-dimensional spatial coordinates.
[0094] Preferably, in step S1:
[0095] The real-time detected 3D point cloud data is matched with the 3D point cloud data model built in the database, and the marked pose points are converted into the region of interest during actual detection, including the following steps:
[0096] a. Use template matching to find the four corners of the calibrated pool:
[0097] When deploying the scene, obtain and store the pool point cloud data at a fixed location, and calibrate the four corners of the pool;
[0098] Using template matching, the plane coordinates of the four corners are accurately matched and converted into spatial coordinates;
[0099] b. Use the 3D point cloud data of the actual detected image to match the point cloud data, and calculate the region of interest corresponding to the detected image through the posture conversion relationship:
[0100] Obtain the point cloud data of the pool during actual inspection, match it with the previously collected point cloud, and save the posture conversion relationship between the two sets of data;
[0101] Transform the spatial coordinates to obtain the new coordinate points of the four corners;
[0102] Using the intrinsic and extrinsic parameters of the camera, the obtained transformed coordinates are projected into the image coordinate system, and the required region of interest is generated.
[0103] Preferably, in step S2:
[0104] Preprocess the pool image:
[0105] Convert the color image, i.e. the RGB three channels, into a grayscale image;
[0106] The calculated region of interest is subjected to noise reduction processing, and median filtering and Gaussian filtering are used to filter out the influence of salt and pepper noise and Gaussian noise on background modeling.
[0107] Preferably, in step S3:
[0108] Background image generation based on β-spline interpolation:
[0109] According to the characteristics of piecewise continuity, variation reduction, convex hull and convexity preservation of the β-spline curve, and according to the size of the object to be detected in the actual application scenario, control points with preset value gaps are selected from the preprocessed image to generate a background image and obtain a control point image;
[0110] The pixel values at the coordinate positions of the control points are used to perform horizontal β-spline interpolation to obtain a horizontal line background image. When the segmentation gap involves an outlier, the influence of the outlier on the background image generation is reduced by the influence of the main pixel value, thereby improving the detection efficiency of the outlier.
[0111] Using the generated horizontal line background image, β-spline curve interpolation is performed column by column in the vertical direction to obtain the modeled background image.
[0112] Preferably, in step S4:
[0113] Based on the background image generated by modeling, a diff image is generated. According to the diff image, the stains in the pool are detected by setting the detection threshold parameters:
[0114] Subtract the converted grayscale image from the background image to generate a difference image, and perform histogram equalization on the original image to enhance the image contrast. Subtraction means making a point-to-point difference between the two images.
[0115] Perform threshold segmentation on the image after histogram equalization, improve detection sensitivity by lowering the threshold, and perform morphological opening operation to eliminate detected outlier points;
[0116] According to the obtained binary mask image, the characteristic parameters of the area are screened and the location of the stain is output.
[0117] Preferably, in step S5:
[0118] Output the detected stain position, centroid, and area parameters, and convert the position information into three-dimensional spatial coordinates:
[0119] According to the internal parameters of the depth image and color image camera, the positioning points in the pool stains are converted into the spatial coordinate system to realize the detection and positioning functions of the stains.
[0120] In stereo vision, the image coordinate system, camera coordinate system, and world coordinate system can be converted to each other. The specific conversion relationship is shown in the following formula:
[0121]
[0122] Note: u and v on the left represent the two-dimensional coordinates in the image coordinate system. w ,Y w ,Z w is the coordinate in the world coordinate system, The camera's internal parameters, The external parameters of the camera can be obtained through Zhang Zhengyou calibration method.
[0123] Embodiment 2:
[0124] Embodiment 2 is a preferred example of Embodiment 1, and is used to illustrate the present invention in more detail.
[0125] Those skilled in the art may understand the pool stain detection method provided by the present invention as a specific implementation of the pool stain detection system, that is, the pool stain detection system may be implemented by executing the steps of the pool stain detection method.
[0126] A pool stain detection system provided by the present invention comprises:
[0127] Module M1: Perform point cloud matching between the point cloud data of the real-time detected pool and the point cloud data model to calculate the area of interest;
[0128] Module M2: noise reduction processing of the region of interest;
[0129] Module M3: Perform β-spline curve interpolation on the denoised image to obtain a modeling background image;
[0130] Module M4: Based on the modeled background image, the stains in the pool are detected by setting the detection threshold parameters;
[0131] Module M5: Output the detected stain parameters and convert the stain location information into three-dimensional spatial coordinates.
[0132] Preferably, in the module M1:
[0133] The real-time detected 3D point cloud data is matched with the 3D point cloud data model built in the database, and the marked pose points are converted into the region of interest during actual detection, including the following steps:
[0134] a. Use template matching to find the four corners of the calibrated pool:
[0135] When deploying the scene, obtain and store the pool point cloud data at a fixed location, and calibrate the four corners of the pool;
[0136] Using template matching, the plane coordinates of the four corners are accurately matched and converted into spatial coordinates;
[0137] b. Use the 3D point cloud data of the actual detected image to match the point cloud data, and calculate the region of interest corresponding to the detected image through the posture conversion relationship:
[0138] Obtain the point cloud data of the pool during actual inspection, match it with the previously collected point cloud, and save the posture conversion relationship between the two sets of data;
[0139] Transform the spatial coordinates to obtain the new coordinate points of the four corners;
[0140] Using the intrinsic and extrinsic parameters of the camera, the obtained transformed coordinates are projected into the image coordinate system, and the required region of interest is generated.
[0141] Preferably, in the module M2:
[0142] Preprocess the pool image:
[0143] Convert the color image, i.e. the RGB three channels, into a grayscale image;
[0144] Perform noise reduction on the calculated region of interest, using median filtering and Gaussian filtering to filter out the influence of salt and pepper noise and Gaussian noise on background modeling;
[0145] Preferably, in the module M3:
[0146] Background image generation based on β-spline interpolation:
[0147] According to the characteristics of piecewise continuity, variation reduction, convex hull and convexity preservation of the β-spline curve, and according to the size of the object to be detected in the actual application scenario, control points with preset value gaps are selected from the preprocessed image to generate a background image and obtain a control point image;
[0148] The pixel values at the coordinate positions of the control points are used to perform horizontal β-spline interpolation to obtain a horizontal line background image. When the segmentation gap involves an outlier, the influence of the outlier on the background image generation is reduced by the influence of the main pixel value, thereby improving the detection efficiency of the outlier.
[0149] Using the generated horizontal line background image, β-spline curve interpolation is performed column by column in the vertical direction to obtain the modeled background image.
[0150] Preferably, in the module M4:
[0151] Based on the background image generated by modeling, a diff image is generated, and according to the diff image, the stains in the pool are detected by setting the detection threshold parameters;
[0152] Subtract the converted grayscale image from the background image to generate a difference image, and perform histogram equalization on the original image to enhance the image contrast. Subtraction means making a point-to-point difference between the two images.
[0153] Perform threshold segmentation on the image after histogram equalization, improve detection sensitivity by lowering the threshold, and perform morphological opening operation to eliminate detected outlier points;
[0154] According to the obtained binary mask image, the characteristic parameters of the region are screened and the location of the stain is output;
[0155] Preferably, in the module M5:
[0156] Output the detected stain position, centroid, and area parameters, and convert the position information into three-dimensional spatial coordinates:
[0157] According to the internal parameters of the depth image and color image camera, the positioning points in the pool stains are converted into the spatial coordinate system to realize the detection and positioning functions of the stains.
[0158] Embodiment 3:
[0159] Embodiment 3 is a preferred example of Embodiment 1, and is used to illustrate the present invention in more detail.
[0160] Step 1: According to the 3D point cloud data model built in the database, the real-time detected 3D point cloud data is matched with it, and the marked pose points are converted into the ROI region of interest during actual detection. ROI stands for Region of Interest, which is translated into Region of Interest in Chinese.
[0161] Step 2: Based on the background modeling of β-spline interpolation, stains are detected and located in the selected pool ROI area;
[0162] Step 3: Output the detected stain location, centroid area and other parameters, and convert the location information into three-dimensional spatial coordinates;
[0163] Wherein, step 1 comprises the following steps:
[0164] Step 1.1: Use template matching to find the four corner positions of the calibrated pool:
[0165] When deploying the scene, obtain the pool point cloud data at a fixed location, store it, and calibrate the four corners of the pool, such as Figure 2 As shown;
[0166] Using template matching, the plane coordinates (x, y) of the four corners are accurately matched and converted into spatial coordinates (x, y, z).
[0167] Step 1.2: Use the 3D point cloud data of the actual detected image to perform point cloud data matching, and calculate the ROI area corresponding to the detected image through the posture transformation relationship.
[0168] When obtaining actual detection, the point cloud data of the pool, such as Figure 3 As shown, it is matched with the previously collected point cloud to save the posture conversion relationship between the two sets of data;
[0169] Convert the (x, y, z) coordinates in step 1 to obtain four coordinate points (x1, y1, z1);
[0170] Using the internal and external parameters of the camera, the obtained (x1, y1, z1) can be projected into the image coordinate system and the required ROI area can be generated;
[0171] Step 2 includes the following steps:
[0172] Step 2.1: Preprocess the pool image:
[0173] Convert the color image (RGB three channels) into a grayscale image;
[0174] Perform noise reduction on the ROI area calculated in step 1, mainly using median filtering and Gaussian filtering to filter out the influence of salt and pepper noise and Gaussian noise on background modeling;
[0175] Step 2.2: Generate background image based on β-spline interpolation:
[0176] According to the piecewise continuity, variation reduction, convex hull and convexity preservation characteristics of the β-spline curve, and according to the size of the object to be detected in the actual application scenario, a certain gap of control points is selected from the preprocessed image to generate the background image. For example, the gap is selected as 36 pixels, and the control point image obtained is as follows: Figure 4 As shown;
[0177] By using the pixel values of the control point coordinates to perform horizontal β-spline interpolation, a horizontal line background image can be obtained. If the segmentation gap involves an outlier, it can also be affected by the main pixel value to reduce the impact of the outlier on the background image generation, thereby improving the detection efficiency of the outlier. Figure 5 As shown;
[0178] By using the horizontal line background image generated above, the β-spline curve interpolation in the vertical direction is performed column by column to obtain the final modeling background image, such as Figure 6 As shown;
[0179] Step 2.3: Generate a diff image based on the background image generated by modeling. According to the diff image, the stains in the pool are detected by setting the detection threshold parameters.
[0180] Subtract the original image, i.e. the converted grayscale image, from the background image to generate a difference image, and perform histogram equalization on the original image to enhance the image contrast. Subtraction is the point-to-point difference between the two images, such as Figure 7 As shown;
[0181] The image after histogram equalization is segmented by thresholding. By lowering the threshold, the detection sensitivity can be improved, and morphological opening operation can be performed to exclude the detected outlier points, as follows Figure 8 As shown;
[0182] According to the obtained binary mask image, the characteristic parameters of the region are screened (area, roundness characteristics, etc.) [such as excluding the target area with an area > 5000 pixels], and the final position of the stain is output, such as Fig. 9 , as shown in 10.
[0183] Step 3 includes the following steps:
[0184] According to the internal parameters of the depth image and color image camera, the positioning points in the pool stains are converted into the spatial coordinate system, realizing the detection and positioning functions of the stains.
[0185] Those skilled in the art know that, in addition to implementing the system, device and its various modules provided by the present invention in a purely computer-readable program code, it is entirely possible to implement the same program in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers and embedded microcontrollers by logically programming the method steps. Therefore, the system, device and its various modules provided by the present invention can be considered as a hardware component, and the modules included therein for implementing various programs can also be considered as structures within the hardware component; the modules for implementing various functions can also be considered as both software programs for implementing the method and structures within the hardware component.
[0186] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.
Claims
1. A method for detecting pool stains, characterized in that: include: Step S1: performing point cloud matching on the point cloud data of the pool detected in real time and the point cloud data model to calculate the region of interest; Step S2: performing noise reduction processing on the region of interest; Step S3: performing β-spline curve interpolation on the image after noise reduction to obtain a modeling background image; Step S4: Based on the modeled background image, the stains in the pool are detected by setting the detection threshold parameters; Step S5: outputting the detected stain parameters and converting the stain position information into three-dimensional spatial coordinates; In step S1: The real-time detected 3D point cloud data is matched with the 3D point cloud data model built in the database, and the marked pose points are converted into the region of interest during actual detection, including the following steps: a. Use template matching to find the four corners of the calibrated pool: When deploying the scene, obtain and store the pool point cloud data at a fixed location, and calibrate the four corners of the pool; Using template matching, the plane coordinates of the four corners are accurately matched and converted into spatial coordinates; b. Use the 3D point cloud data of the actual detected image to match the point cloud data, and calculate the region of interest corresponding to the detected image through the posture conversion relationship: Obtain the point cloud data of the pool during actual inspection, match it with the previously collected point cloud, and save the posture conversion relationship between the two sets of data; Transform the spatial coordinates to obtain the new coordinate points of the four corners; Using the intrinsic and extrinsic parameters of the camera, the obtained transformed coordinates are projected into the image coordinate system, and the required region of interest is generated; In step S2: Preprocess the pool image: Convert the color image, i.e. the RGB three channels, into a grayscale image; Perform noise reduction on the calculated region of interest, using median filtering and Gaussian filtering to filter out the influence of salt and pepper noise and Gaussian noise on background modeling; In step S3: Background image generation based on β-spline interpolation: According to the characteristics of piecewise continuity, variation reduction, convex hull and convexity preservation of the β-spline curve, and according to the size of the object to be detected in the actual application scenario, control points with preset value gaps are selected from the preprocessed image to generate a background image and obtain a control point image; The pixel values at the coordinate positions of the control points are used to perform horizontal β-spline interpolation to obtain a horizontal line background image. When the segmentation gap involves an outlier, the influence of the outlier on the background image generation is reduced by the influence of the main pixel value, thereby improving the detection efficiency of the outlier. Using the generated horizontal line background image, the β-spline curve interpolation in the vertical direction is performed column by column to obtain the modeled background image; In step S4: Based on the background image generated by modeling, a diff image is generated. According to the diff image, the stains in the pool are detected by setting the detection threshold parameters: Subtract the converted grayscale image from the background image to generate a difference image, and perform histogram equalization on the original image to enhance the image contrast. Subtraction means making a point-to-point difference between the two images. Perform threshold segmentation on the image after histogram equalization, improve detection sensitivity by lowering the threshold, and perform morphological opening operation to eliminate detected outlier points; According to the obtained binary mask image, the characteristic parameters of the region are screened and the location of the stain is output; In step S5: Output the detected stain position, centroid, and area parameters, and convert the position information into three-dimensional spatial coordinates: According to the internal parameters of the depth image and color image camera, the positioning points in the pool stains are converted into the spatial coordinate system to realize the detection and positioning functions of the stains.
2. A pool stain detection system, characterized in that: include: Module M1: Perform point cloud matching between the point cloud data of the real-time detected pool and the point cloud data model to calculate the area of interest; Module M2: noise reduction processing of the region of interest; Module M3: Perform β-spline curve interpolation on the denoised image to obtain a modeling background image; Module M4: Based on the modeled background image, the stains in the pool are detected by setting the detection threshold parameters; Module M5: outputs the detected stain parameters and converts the stain location information into three-dimensional spatial coordinates; In the module M1: The real-time detected 3D point cloud data is matched with the 3D point cloud data model built in the database, and the marked pose points are converted into the region of interest during actual detection, including the following steps: a. Use template matching to find the four corners of the calibrated pool: When deploying the scene, obtain and store the pool point cloud data at a fixed location, and calibrate the four corners of the pool; Using template matching, the plane coordinates of the four corners are accurately matched and converted into spatial coordinates; b. Use the 3D point cloud data of the actual detected image to match the point cloud data, and calculate the region of interest corresponding to the detected image through the posture conversion relationship: Obtain the point cloud data of the pool during actual inspection, match it with the previously collected point cloud, and save the posture conversion relationship between the two sets of data; Transform the spatial coordinates to obtain the new coordinate points of the four corners; Using the intrinsic and extrinsic parameters of the camera, the obtained transformed coordinates are projected into the image coordinate system, and the required region of interest is generated; In the module M2: Preprocess the pool image: Convert the color image, i.e. the RGB three channels, into a grayscale image; Perform noise reduction on the calculated region of interest, using median filtering and Gaussian filtering to filter out the influence of salt and pepper noise and Gaussian noise on background modeling; In the module M3: Background image generation based on β-spline interpolation: According to the characteristics of piecewise continuity, variation reduction, convex hull and convexity preservation of the β-spline curve, and according to the size of the object to be detected in the actual application scenario, control points with preset value gaps are selected from the preprocessed image to generate a background image and obtain a control point image; The pixel values at the coordinate positions of the control points are used to perform horizontal β-spline interpolation to obtain a horizontal line background image. When the segmentation gap involves an outlier, the influence of the outlier on the background image generation is reduced by the influence of the main pixel value, thereby improving the detection efficiency of the outlier. Using the generated horizontal line background image, the β-spline curve interpolation in the vertical direction is performed column by column to obtain the modeled background image; In the module M4: Based on the background image generated by modeling, a diff image is generated, and according to the diff image, the stains in the pool are detected by setting the detection threshold parameters; Subtract the converted grayscale image from the background image to generate a difference image, and perform histogram equalization on the original image to enhance the image contrast. Subtraction means making a point-to-point difference between the two images. Perform threshold segmentation on the image after histogram equalization, improve detection sensitivity by lowering the threshold, and perform morphological opening operation to eliminate detected outlier points; According to the obtained binary mask image, the characteristic parameters of the region are screened and the location of the stain is output; In the module M5: Output the detected stain position, centroid, and area parameters, and convert the position information into three-dimensional spatial coordinates: According to the internal parameters of the depth image and color image camera, the positioning points in the pool stains are converted into the spatial coordinate system to realize the detection and positioning functions of the stains.
Citation Information
Patent Citations
Surface blot detection equipment for aluminum foil
CN103575747A
Dirt detection method
CN109712123A