Straw defect detection method and system based on visual identification

Through visual recognition technology, infrared detection images are used to identify foreign objects inside the straw, solving the problem of low manual detection efficiency, improving detection accuracy and automated cutting, and reducing ineffective cutting.

CN119269580AActive Publication Date: 2025-01-07NINGBO HOMELINK ECO ITECH CO LTD
View PDF 20 Cites 0 Cited by

Patent Information

Application Number
CN202411828712.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-01-07
Estimated Expiration
2044-12-12

AI Technical Summary

Technical Problem

During the production process of existing straws, manual detection efficiency is low and foreign objects are easily missed, resulting in poor defect detection effect.

Method used

Using a method based on visual recognition, the pixel chromaticity of the straw is obtained through infrared detection images, abnormal pixel points are identified, foreign object features are formed, and foreign objects are compensated according to the brightness of the external environment, and foreign objects inside the straw are automatically detected and cropped positions are marked.

Benefits of technology

It improves the efficiency and accuracy of straw defect detection, reduces the situation of ineffective cutting, and realizes automatic detection of foreign objects inside the straw.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119269580A_ABST
    Figure CN119269580A_ABST
Patent Text Reader

Abstract

The invention relates to a straw defect detection method and system based on visual identification, and relates to the field of straw production technologies, and the method comprises the steps: obtaining an infrared detection image of a straw at a preset shooting point; acquiring the detection pixel chroma of each pixel point in the infrared detection image, defining the pixel points of which the detection pixel chroma is within a preset required chroma range as normal pixel points, and defining the pixel points except the normal pixel points as abnormal pixel points; concluding adjacent abnormal pixel points into the same preset pixel set which is initially empty; counting according to abnormal pixel points in each pixel set to determine the number of set pixels; and defining a pixel set of which the set pixel number is greater than a preset reference pixel number as a foreign matter feature set, and determining an area formed by abnormal pixel points contained in the foreign matter feature set as a foreign matter area. The suction tube defect detection device has the effect of improving the detection effect of suction tube defect detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of straw production technology, and in particular to a straw defect detection method and system based on visual recognition. Background Art

[0002] As people's awareness of environmental protection increases, degradable materials are gradually becoming popular. Among them, degradable straws used for milk tea and coffee are more representative products.

[0003] In related technologies, during the production process of degradable straws, the straws are output in continuous and uninterrupted long strips, which are then cut into products of fixed length by a cutting device at the rear end of the output. The staff then conducts internal contamination inspections on the products to reduce the occurrence of straws with foreign objects inside that are not inspected and packaged for shipment.

[0004] In the above-mentioned related technologies, manual inspection of straws by staff is not only inefficient, but also may cause the human eye to miss the presence of foreign matter, resulting in poor detection of straw defects. There is still room for improvement. Summary of the Invention

[0005] In order to improve the detection effect of straw defect detection, the present application provides a straw defect detection method and system based on visual recognition.

[0006] In a first aspect, the present application provides a straw defect detection method based on visual recognition, which adopts the following technical solutions: A straw defect detection method based on visual recognition, comprising: Acquire infrared detection images of the straw at preset shooting points, wherein the shooting points are located between the output rear end and the cutting device and are arranged at multiple intervals; Obtaining the detection pixel chromaticity of each pixel in the infrared detection image, and defining the pixels whose detection pixel chromaticity is within a preset required chromaticity range as normal pixels, and defining the pixels other than the normal pixels as abnormal pixels; The adjacent abnormal pixels are grouped into the same preset initially empty pixel set; Counting abnormal pixels in each pixel set to determine the number of pixels in the set; A pixel set whose number of set pixels is greater than a preset reference number of pixels is defined as a foreign body feature set, and an area formed by abnormal pixels contained in the foreign body feature set is determined as a foreign body area.

[0007] Optionally, before acquiring the infrared detection image, the straw defect detection method based on visual recognition further includes: Get the external environment brightness value of the shooting point; When the external environment brightness value is not within the preset shooting requirement brightness range, determining whether the external environment brightness value is greater than an upper limit value of the shooting requirement brightness range; If the external environment brightness value is greater than the upper limit of the shooting required brightness range, the output backend is controlled to stop the pipette output; If the external environment brightness value is not greater than the upper limit of the shooting required brightness range, then the required compensation brightness range is determined based on the shooting required brightness range and the external environment brightness value; A unique compensation selection brightness is determined within the required compensation brightness range, and a fill light device preset at a shooting point is controlled to operate according to the compensation selection brightness.

[0008] Optionally, the step of determining a unique compensation selected brightness within the required compensation brightness range includes: A detection interval is established on a preset time axis with the current time point as the end point and a width of a preset detection duration. The external environment brightness value is extracted according to the preset unit duration in the detection interval, and the extracted external environment brightness value is defined as the detection brightness value; Performing a difference calculation based on the detected brightness value at the current time point and the detected brightness value determined at a time point adjacent to the current time point to determine a changed brightness value; Determine whether the changed brightness value is greater than the preset sudden change brightness value; If the changing brightness value is greater than the sudden change brightness value, the center value in the required compensation brightness range is used as the compensation selected brightness; If the changed brightness value is not greater than the sudden change brightness value, a brightness is randomly selected in the required compensation brightness range as the compensation selected brightness.

[0009] Optionally, if the changing brightness value is not greater than the sudden change brightness value, the straw defect detection method based on visual recognition further includes: Combining the detected brightness values ​​in the current detection interval to determine a first brightness combination; Establishing a historical interval on the time axis with the current time point as the end point and a width equal to a preset historical duration, defining a comparison interval with a width equal to the detection duration within the historical interval, and determining a second brightness combination based on the comparison interval; Determine the combination similarity based on the first brightness combination and the second brightness combination, define the comparison interval corresponding to the combination similarity with the largest value as the similar interval, and construct a detection interval with a width of the preset detection time length with the rear end point of the similar interval as the front end point; The subsequent brightness change is determined by performing a difference calculation based on the brightness value detected at the rear end of the similar interval and the brightness value with the minimum value in the detection interval; A subsequent compensation brightness range is determined based on the subsequent change brightness and the required compensation brightness range, and an intersection calculation is performed based on the subsequent compensation brightness range and the required compensation brightness range to determine a feasible compensation brightness range, and a brightness value is randomly selected in the feasible compensation brightness range as the compensation selected brightness.

[0010] Optionally, after the approximate interval is determined, the straw defect detection method based on visual recognition further includes: Determine whether there are at least two similar intervals; If there are not at least two similar intervals, determining a feasible compensation brightness range based on the subsequent compensation brightness range of the only similar interval; If there are at least two similar intervals, randomly select any number of subsequent compensation brightness ranges and the required compensation brightness range from all subsequent compensation brightness ranges to form a brightness range set; A brightness range set in which each range in the brightness range set has an intersection that is not an empty set is defined as a valid range set, and the number of subsequent ranges is determined by counting the selected subsequent compensation brightness ranges in the valid range set; The number of subsequent ranges with the largest values ​​is determined according to a preset sorting rule, and a feasible compensation brightness range is determined according to a brightness range set corresponding to the number of subsequent ranges.

[0011] Optionally, after the number of subsequent ranges is determined, the straw defect detection method based on visual recognition may further include: Determine whether there are at least two subsequent range sets with the same number of maximum brightness ranges; If there are not at least two largest brightness range sets with the same number of subsequent ranges, determining a feasible compensation brightness range according to the brightness range set corresponding to the largest number of subsequent ranges; If there are at least two brightness range sets with the same number of subsequent ranges and the largest number, the brightness range set corresponding to the largest number of subsequent ranges is defined as the candidate range set, and candidate compensation brightness ranges are determined based on the ranges in each candidate range set, and simulated brightness values ​​are randomly determined in the candidate compensation brightness ranges; defining a subsequent compensation brightness range that is not within a single candidate range set as an outer brightness range of the candidate range set; Determining a fitness value based on the simulated brightness value and each external brightness range, and performing an average calculation based on each fitness value determined under the same candidate range set to determine an average fitness value; The average suitable value with the largest value is determined according to the sorting rule, and the feasible compensation brightness range is determined according to the candidate range set corresponding to the average suitable value.

[0012] Optionally, after the foreign matter area is determined, the straw defect detection method based on visual recognition further includes: Mark the foreign body location point on the preset straw length axis according to the foreign body area; After the foreign body location is determined, a simulated cutting interval is constructed on the straw length axis according to a preset fixed length; Determine whether new foreign body locations appear in the simulated cutting interval; If no new foreign object location point appears in the simulated cutting area, the cutting location point is marked according to the foreign object location point and the preset avoidance distance; If a new foreign body position point appears in the simulated cutting interval, the cutting interval will continue to be constructed based on the new foreign body position point.

[0013] In a second aspect, the present application provides a straw defect detection system based on visual recognition, which adopts the following technical solutions: A straw defect detection system based on visual recognition, comprising: An acquisition module is used to acquire infrared detection images of the straw at preset shooting points, wherein the shooting points are located between the output rear end and the cutting device and are arranged at multiple intervals; A processing module, connected to the acquisition module, for storing and processing information; The processing module obtains the detection pixel chromaticity of each pixel in the infrared detection image, and defines the pixels whose detection pixel chromaticity is within a preset required chromaticity range as normal pixels, and defines the pixels other than the normal pixels as abnormal pixels; The processing module summarizes adjacent abnormal pixels into the same preset initially empty pixel set; The processing module counts abnormal pixel points in each pixel set to determine the number of pixels in the set; The processing module defines a pixel set whose number of set pixels is greater than a preset reference number of pixels as a foreign body feature set, and determines an area formed by abnormal pixels contained in the foreign body feature set as a foreign body area.

[0014] In summary, this application includes at least one of the following beneficial technical effects: During the production process of biodegradable straws, foreign matter defects inside the straws can be automatically detected through visual recognition, thereby improving the detection effect of straw defects; During the image acquisition process, the external environment brightness can be analyzed to compensate for the brightness, so that the acquired image is convenient for defect detection; The positions of the foreign objects on the straw are analyzed to mark the positions that can be cut, thereby reducing the occurrence of subsequent invalid cutting. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a flow chart of the straw defect detection method based on visual recognition.

[0016] Figure 2 This is a module flow chart of the straw defect detection method based on visual recognition. DETAILED DESCRIPTION

[0017] In order to make the purpose, technical solutions and advantages of this application more clear, the following Figure 1-Figure 2 It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application.

[0018] The embodiments of the present application are described in further detail below with reference to the accompanying drawings.

[0019] The present application embodiment discloses a straw defect detection method based on visual recognition, referring to Figure 1 The method flow of the straw defect detection method based on visual recognition includes the following steps: Step S100: acquiring infrared detection images of the straw at preset shooting points, wherein the shooting points are located between the output rear end and the cutting device and are arranged at multiple intervals.

[0020] The shooting point is located between the output rear end and the cutting device. An infrared camera is installed at this shooting point, and the camera is facing the straw, so that the long straw output from the output rear end can be imaged during its movement to the cutting device. At the same time, in order to detect the straw 360 degrees, at least three shooting points are generally set up, and the three shooting points are spaced apart along the length of the straw. The camera devices at the shooting points are distributed in different directions of the straw so that the shooting points can fully detect the entire straw. The infrared detection image is a flat image of the straw obtained by point cloud fusion of the images obtained by the devices at multiple shooting points.

[0021] Step S101: acquiring the detection pixel chromaticity of each pixel in the infrared detection image, defining the pixels whose detection pixel chromaticity is within a preset required chromaticity range as normal pixels, and defining the pixels other than the normal pixels as abnormal pixels.

[0022] The detected pixel chromaticity is the chromaticity value of the pixel point. The required chromaticity range is the chromaticity value range of the pixel points determined to belong to the straw itself, which is set by the staff. Normal pixels and abnormal pixels are defined to distinguish different pixels for subsequent analysis.

[0023] Step S102: grouping adjacent abnormal pixels into the same preset initially empty pixel set.

[0024] The pixel set is an empty set used to collect abnormal pixel points, where the method of summarizing abnormal pixel points is as follows: for example, there are three abnormal pixel points A, B, and C, where A is adjacent to B, B is adjacent to C, but A is not adjacent to C. Since B can be summarized into a pixel set with A and C at the same time, A, B, and C can be summarized into the same pixel set.

[0025] Step S103: Counting abnormal pixel points in each pixel set to determine the number of pixels in the set.

[0026] The number of pixels in a set is the total number of abnormal pixels in the pixel set.

[0027] Step S104: defining a pixel set whose pixel number is greater than a preset reference pixel number as a foreign body feature set, and determining an area formed by abnormal pixel points included in the foreign body feature set as a foreign body area.

[0028] The number of reference pixels is the minimum number of collective pixels set by the staff to determine the presence of foreign matter in the straw. When the number of collective pixels is greater than the number of reference pixels, it means that the currently detected abnormal pixel point is caused by external foreign matter. At this time, it is defined as a clothing feature set to distinguish different pixel sets, so that the foreign matter area can be determined according to the foreign matter feature set, so as to effectively determine the foreign matter situation in the straw and realize intelligent detection of straw defects.

[0029] Before acquiring infrared detection images, the straw defect detection method based on visual recognition also includes: Step S200: Acquire the external environment brightness value of the shooting point.

[0030] The external environment brightness value is the brightness value of the external environment at the shooting point, and the data can be acquired by installing a brightness sensor at the shooting point.

[0031] Step S201 : When the external environment brightness value is not within the preset shooting requirement brightness range, determining whether the external environment brightness value is greater than an upper limit of the shooting requirement brightness range.

[0032] The required shooting brightness range is the brightness range required so that the external brightness does not affect the image color difference and thus affect foreign body analysis. If the external environment brightness value is not within the required shooting brightness range, it indicates that there is an external brightness abnormality and further analysis is required. The purpose of this judgment is to determine whether the external environment is too bright, such as when a strong external light source directly illuminates the shooting point.

[0033] Step S2011: If the external environment brightness value is greater than the upper limit of the shooting required brightness range, the output back end is controlled to stop the pipette output.

[0034] When the external environment brightness value is greater than the upper limit of the required shooting brightness range, it indicates that the external environment is too bright. At this time, the image cannot be effectively analyzed. The output of the back-end for long straws is stopped to reduce the occurrence of false straw detection.

[0035] Step S2012: If the external environment brightness value is not greater than the upper limit of the required shooting brightness range, a calculation is performed based on the required shooting brightness range and the external environment brightness value to determine the required compensation brightness range.

[0036] When the external environment brightness value is not greater than the upper limit of the shooting requirement brightness range, it means that the external brightness is too low. At this time, the ambient brightness can be supplemented by a fill light device to ensure that the detection operation can proceed normally; the required compensation brightness range is the range of brightness that needs to be compensated in order to make the ambient brightness meet the image requirements. The upper and lower endpoints of the required compensation brightness range are determined by calculating the upper and lower endpoints of the shooting requirement brightness range with the external environment brightness value.

[0037] Step S202 : determining a unique compensation selection brightness within the required compensation brightness range, and controlling a fill light device preset at the shooting point to operate according to the compensation selection brightness.

[0038] By determining a unique compensation selection brightness from the required compensation brightness range and controlling the fill light device to operate, the external environment can meet the image shooting requirements. At this time, the foreign body defect of the straw can be effectively determined. The method for determining the compensation selection brightness can be randomly determined from the required compensation brightness range, or determined by the method of steps S300-step S404.

[0039] The steps of determining a unique compensation selected brightness within the required compensation brightness range include: Step S300: establishing a detection interval on a preset time axis with the current time point as the end point and a width of a preset detection duration, and extracting the external environment brightness value according to the preset unit duration in the detection interval, and defining the extracted external environment brightness value as the detection brightness value.

[0040] The time axis is a coordinate axis formed by the combination of various time points. The coordinate axis points from the time points that have passed to the time points that have not yet arrived, and the time points that have passed in the coordinate axis are defined as the left side, where the left side is the front end; the detection time is a recent short time set by the staff, such as 1 hour. By constructing a detection interval, it is convenient to obtain and analyze the data within the detection time; the unit time is a fixed time set by the staff that is less than the detection time and is an integer multiple of the detection time. Generally, the detection time is 15 times to 20 times the unit time. The way to extract the external environment brightness value is to pick up the corresponding external environment brightness value from one end point of the detection interval to the other end point at an interval of unit time, and define it as the detection brightness value to achieve the distinction between different external environment brightness values, which is convenient for subsequent analysis.

[0041] Step S301 : performing a difference calculation based on the detected brightness value at the current time point and the detected brightness value determined at a time point adjacent to the current time point to determine a changed brightness value.

[0042] The brightness change value is the brightness change value of the external environment in the most recent unit time, and is determined by performing a difference calculation between two detected brightness values.

[0043] Step S302: Determine whether the changed brightness value is greater than a preset sudden change brightness value.

[0044] The sudden change brightness value is the minimum change brightness value that needs to be reached when the brightness changes in a way that does not conform to natural laws, as set by the staff. The purpose of the judgment is to know whether there is an external object blocking the original light source in the external environment.

[0045] Step S3021: If the changed brightness value is greater than the sudden change brightness value, the center value in the required compensation brightness range is used as the compensation selected brightness.

[0046] When the changing brightness value is greater than the sudden change brightness value, it indicates that an external object is blocking the light source. In this case, the center value of the required compensation brightness range is used as the compensation selection brightness to facilitate subsequent brightness adjustment.

[0047] Step S3022: If the changed brightness value is not greater than the sudden change brightness value, randomly select a brightness in the required compensation brightness range as the compensation selected brightness.

[0048] When the changing brightness value is not greater than the sudden change brightness value, it means that it complies with the natural change law of the external brightness. At this time, a brightness that meets the requirements can be randomly selected as the compensation brightness.

[0049] If the changing brightness value is not greater than the sudden change brightness value, the straw defect detection method based on visual recognition further includes: Step S400: Determine a first brightness combination by combining the detected brightness values ​​in the current detection interval.

[0050] The first brightness combination is a combination obtained by combining the detected brightness values ​​determined in the detection interval according to the order of acquisition time.

[0051] Step S401: establishing a history interval with the current time point as the end point and a width of a preset history duration on the time axis, defining a comparison interval with a width equal to the detection duration in the history interval, and determining a second brightness combination according to the comparison interval.

[0052] The historical duration is the duration set by the staff to obtain data on changes in external environment brightness under historical circumstances. A historical interval is established to facilitate the acquisition and analysis of data within the historical duration; a comparison interval is defined to facilitate the acquisition of brightness changes at each time point in the historical interval, so as to facilitate the determination of the second brightness combination. The method for determining the second brightness combination is the same as that for the first brightness combination, and will not be repeated here.

[0053] Step S402: Determine the combination similarity based on the first brightness combination and the second brightness combination, define the comparison interval corresponding to the combination similarity with the largest value as the similar interval, and construct a detection interval with a width of the preset detection time length with the rear end point of the similar interval as the front end point.

[0054] The combination similarity is a numerical value that reflects the similarity between two combinations. The larger the value, the more similar the two combinations are, that is, the more similar the brightness and changes of the external environment are. It can be obtained by calculating the difference between the data of the same position in the two combinations and then adding them all up to find the reciprocal; by defining a similar interval, the situation with the closest brightness change in the historical time period can be determined. At this time, the subsequent brightness changes in the similar interval can be used to predict the subsequent brightness changes at the current time point; the detection duration is a fixed duration set by the staff. The detection interval is constructed to facilitate the acquisition and analysis of data within the detection duration.

[0055] Step S403: performing a difference calculation based on the detected brightness value of the rear end point in the similar interval and the detected brightness value with the minimum value in the detection interval to determine the subsequent change brightness.

[0056] The subsequent change brightness is the maximum brightness change value that will occur in the detection interval.

[0057] Step S404: Calculate the subsequent compensation brightness range based on the subsequent change brightness and the required compensation brightness range, perform intersection calculation based on the subsequent compensation brightness range and the required compensation brightness range to determine a feasible compensation brightness range, and randomly select a brightness value in the feasible compensation brightness range as the compensation selected brightness.

[0058] The subsequent compensation brightness range is the range obtained by calculating the upper and lower endpoints of the required compensation brightness range and the subsequent change brightness, that is, the brightness range of the external fill light device required when the subsequent minimum detection brightness value is met. The range can be narrowed by determining the feasible compensation brightness range through the intersection calculation of the subsequent compensation brightness range and the required compensation brightness range. At this time, the feasible compensation brightness range obtained can simultaneously meet the subsequent brightness changes. At this time, the compensation brightness is selected from the feasible compensation brightness range to determine so that there is no need to adjust the brightness of the fill light device again in a short period of time.

[0059] After the approximate interval is determined, the straw defect detection method based on visual recognition also includes: Step S500: Determine whether there are at least two similar intervals.

[0060] The purpose of the judgment is to find out whether there are multiple similar intervals that meet the requirements, so as to facilitate the analysis of subsequent intersection situations.

[0061] Step S5001: If there are no at least two similar intervals, a feasible compensation brightness range is determined according to a subsequent compensation brightness range of the only similar interval.

[0062] When there are not at least two similar intervals, it means that there is only one subsequent compensation brightness range and the required compensation brightness range for intersection calculation. At this time, normal analysis can be performed to determine the feasible compensation brightness range.

[0063] Step S5002: If there are at least two similar intervals, randomly select any number of subsequent compensation brightness ranges and the required compensation brightness range from all subsequent compensation brightness ranges to form a brightness range set.

[0064] When there are at least two similar intervals, it means that there are multiple subsequent compensation brightness ranges that can be intersected, and further analysis is required; the brightness range set is a set that includes subsequent compensation brightness ranges and required compensation brightness ranges. For example, there are three subsequent compensation brightness ranges XYZ, and the required compensation brightness range is defined as W, then the total brightness range set is XW, YW, ZW, XYW, XZW, YZW, XYZW.

[0065] Step S501 : defining a brightness range set in which each range in the brightness range set has an intersection that is not an empty set as a valid range set, and counting the selected subsequent compensation brightness ranges in the valid range set to determine the number of subsequent ranges.

[0066] When there is an intersection of non-empty sets among the ranges in the brightness range set, it means that a range that can select the compensation selection brightness can be generated. At this time, it is defined as a valid range set to achieve the distinction between different brightness range sets, which is convenient for subsequent analysis; the number of subsequent ranges is the number of subsequent compensation brightness ranges in the valid range set.

[0067] Step S502 : determining the number of subsequent ranges with the largest values ​​according to a preset sorting rule, and determining a feasible compensation brightness range according to a brightness range set corresponding to the number of subsequent ranges.

[0068] The sorting rule is a method set by the staff to sort the size of the values, such as the bubble method. The sorting rule can be used to determine the number of subsequent ranges with the largest values. That is, the intersection determined at this time can meet the range requirements in most cases. At this time, the brightness range set can be used to determine the feasible compensation brightness range.

[0069] After the number of subsequent ranges is determined, the straw defect detection method based on visual recognition also includes: Step S600: Determine whether there are at least two subsequent brightness range sets with the same number of ranges and the largest brightness range set.

[0070] The purpose of the judgment is to find out whether there are multiple brightness range sets that meet the requirements, so as to determine the feasible compensation brightness range.

[0071] Step S6001: If there are not at least two largest brightness range sets with the same number of subsequent ranges, then determine a feasible compensation brightness range according to the brightness range set corresponding to the largest number of subsequent ranges.

[0072] When there are not at least two subsequent maximum brightness range sets with the same number of ranges, it means that there is only one brightness range set that meets the requirements. In this case, the feasible compensation brightness range can be determined based on the brightness range set.

[0073] Step S6002: If there are at least two brightness range sets with the same and largest number of subsequent ranges, the brightness range set corresponding to the largest number of subsequent ranges is defined as an alternative range set, and alternative compensation brightness ranges are determined based on the ranges in each alternative range set, and the simulated brightness value is randomly determined in the alternative compensation brightness range.

[0074] When there are at least two brightness range sets with the same number of subsequent ranges and the largest number, it means that there are multiple brightness range sets that meet the requirements. At this time, they are defined as alternative range sets to distinguish different brightness range sets, which is convenient for subsequent analysis; the alternative compensation brightness range is the range obtained after intersection processing based on the ranges in the alternative range set, and the simulated brightness value is a random value in the alternative compensation brightness range.

[0075] Step S601: defining a subsequent compensation brightness range that is not within a single candidate range set as an external brightness range of the candidate range set.

[0076] An external brightness range is defined to distinguish different subsequent compensation brightness ranges, which is convenient for subsequent analysis.

[0077] Step S602: determining a fitness value according to the simulated brightness value and each external brightness range, and performing an average calculation on each fitness value determined under the same candidate range set to determine an average fitness value.

[0078] The suitability value is a numerical value that reflects the distance between the selected simulated brightness value and the external brightness range. The larger the value, the more consistent the selected simulated brightness value is with the external brightness range. It is determined by the inverse of the distance value between the simulated brightness value and the external brightness range; the mean suitability value is the average of the suitability values ​​between the selected simulated brightness value and each external brightness range.

[0079] Step S603: determining the largest suitable mean value according to the sorting rule, and determining a feasible compensation brightness range according to the candidate range set corresponding to the suitable mean value.

[0080] The sorting rule can be used to determine the largest average suitable value, that is, the currently determined simulation brightness value is more consistent with the remaining external brightness ranges. At this time, the feasible compensation brightness range can be determined using the alternative range set corresponding to the average suitable value.

[0081] After the foreign body area is determined, the straw defect detection method based on visual recognition also includes: Step S700: Marking the foreign object location point on the preset straw length axis according to the foreign object area.

[0082] The straw length axis is a linear axis in the length direction of the straw, and the foreign object location point is a location point of the determined foreign object area on the straw length axis. The foreign object location point can be determined by the left and right endpoints of the foreign object area on the straw length axis.

[0083] Step S701 : After the foreign object location is determined, a simulated cutting interval is constructed on the straw length axis according to a preset fixed length.

[0084] The fixed length is the required length of a single straw to be processed and produced, and the simulated cutting interval is an interval of fixed length extending from the foreign body position point toward the output rear end.

[0085] Step S702: Determine whether a new foreign object location point appears in the simulated cutting interval.

[0086] The purpose of the judgment is to know whether the subsequent straws can be cut into straws that meet the requirements after the foreign object at the foreign object position is cut.

[0087] Step S7021: If no new foreign object location point appears in the simulated cutting interval, the cutting location point is marked according to the foreign object location point and the preset avoidance distance.

[0088] When no new foreign body position point appears in the simulated cutting interval, it means that the subsequent cutting meets the requirements. At this time, the foreign body position point can be used to move the avoidance distance toward the output rear end to determine the cutting position point. The subsequent cutting device can perform cutting operations when the straw at the cutting position point moves to the corresponding cutting area; the avoidance distance is the distance set by the staff to avoid being affected by foreign objects during the cutting process.

[0089] Step S7022: If a new foreign object location point appears in the simulated cutting interval, the cutting interval is further constructed according to the new foreign object location point.

[0090] When a new foreign body position point appears in the simulated cutting interval, it means that even if the current foreign body position point is cut, the subsequent straws still cannot meet the usage requirements. Therefore, there is no need to determine the cutting position point to reduce the occurrence of invalid cutting by the subsequent cutting device, reduce the number of times the cutting device is used, and increase its service life.

[0091] Reference Figure 2 Based on the same inventive concept, an embodiment of the present invention provides a straw defect detection system based on visual recognition, comprising: An acquisition module is used to acquire infrared detection images of the straw at preset shooting points, wherein the shooting points are located between the output rear end and the cutting device and are arranged at multiple intervals; A processing module, connected to the acquisition module, for storing and processing information; The processing module obtains the detection pixel chromaticity of each pixel in the infrared detection image, and defines the pixels whose detection pixel chromaticity is within a preset required chromaticity range as normal pixels, and defines the pixels other than the normal pixels as abnormal pixels; The processing module summarizes adjacent abnormal pixels into the same preset initially empty pixel set; The processing module counts abnormal pixel points in each pixel set to determine the number of pixels in the set; The processing module defines a pixel set having a number of pixels greater than a preset reference number of pixels as a foreign body feature set, and determines an area formed by abnormal pixels contained in the foreign body feature set as a foreign body area; Brightness analysis module, used to analyze and process the brightness of the external environment; A compensation selection brightness determination module, configured to determine a unique compensation selection brightness within a required compensation brightness range; A range reduction and precision module is used to reduce the range of the compensation selected brightness; The similar interval analysis module is used to analyze and process the situation where there are multiple similar intervals; A brightness range set screening module is used to perform unique value screening on multiple brightness range sets that meet the requirements; The cutting situation marking module marks the cutting position on the straw according to the position of foreign matter.

[0092] Those skilled in the art will clearly understand that for the sake of convenience and brevity, the division of the above-mentioned functional modules is only used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working processes of the above-mentioned systems, devices, and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

Claims

1. A straw defect detection method based on visual recognition, characterized in that: include: Acquire an infrared detection image of the straw at a preset shooting point, wherein the shooting point is located between the output rear end and the cutting device and is arranged at a plurality of intervals; The detection pixel chromaticity of each pixel point is obtained in the infrared detection image, and the pixel points whose detection pixel chromaticity is within the preset required chromaticity range are defined as normal pixel points, and the pixel points other than the normal pixel points are defined as abnormal pixel points; The adjacent abnormal pixels are grouped into the same preset initially empty pixel set; Counting abnormal pixel points in each pixel set to determine the number of pixels in the set; A pixel set whose pixel number is greater than a preset reference pixel number is defined as a foreign body feature set, and an area formed by abnormal pixel points included in the foreign body feature set is determined as a foreign body area.

2. The straw defect detection method based on visual recognition according to claim 1 is characterized in that: Before the infrared detection image is acquired, the straw defect detection method based on visual recognition also includes: Get the external environment brightness value of the shooting point; When the external environment brightness value is not within the preset shooting requirement brightness range, determining whether the external environment brightness value is greater than an upper limit value of the shooting requirement brightness range; If the external environment brightness value is greater than the upper limit of the required brightness range for shooting, the output backend is controlled to stop the output of the pipette; If the external environment brightness value is not greater than the upper limit of the shooting required brightness range, then the required compensation brightness range is determined based on the shooting required brightness range and the external environment brightness value; A unique compensation selection brightness is determined within the required compensation brightness range, and a fill light device preset at a shooting point is controlled to operate according to the compensation selection brightness.

3. The straw defect detection method based on visual recognition according to claim 2 is characterized in that: The steps of determining a unique compensation selected brightness within the required compensation brightness range include: A detection interval with the current time point as the end point and a width of the preset detection duration is established on the preset time axis, and the external environment brightness value is extracted according to the preset unit duration in the detection interval, and the extracted external environment brightness value is defined as the detection brightness value; Performing a difference calculation based on the detected brightness value at the current time point and the detected brightness value determined at a time point adjacent to the current time point to determine a changed brightness value; Determine whether the changed brightness value is greater than the preset sudden change brightness value; If the change brightness value is greater than the sudden change brightness value, the center value in the required compensation brightness range is used as the compensation selection brightness; If the change brightness value is not greater than the sudden change brightness value, a brightness is randomly selected in the required compensation brightness range as the compensation selected brightness.

4. The straw defect detection method based on visual recognition according to claim 3 is characterized in that: If the change brightness value is not greater than the sudden change brightness value, the straw defect detection method based on visual recognition also includes: Combining the detected brightness values ​​in the current detection interval to determine a first brightness combination; Establishing a historical interval with the current time point as the rear end point and a width of a preset historical duration on the time axis, defining a comparison interval with a width equal to the detection duration in the historical interval, and determining a second brightness combination according to the comparison interval; Determine the combination similarity according to the first brightness combination and the second brightness combination, define the comparison interval corresponding to the combination similarity with the largest value as the similar interval, and construct a detection interval with a width of the preset detection time length with the rear end point of the similar interval as the front end point; The difference calculation is performed based on the detected brightness value of the rear end point in the similar interval and the detected brightness value with the smallest value in the detection interval to determine the subsequent change brightness; A subsequent compensation brightness range is determined based on the subsequent change brightness and the required compensation brightness range, and an intersection calculation is performed based on the subsequent compensation brightness range and the required compensation brightness range to determine a feasible compensation brightness range, and a brightness value is randomly selected in the feasible compensation brightness range as the compensation selected brightness.

5. The straw defect detection method based on visual recognition according to claim 4 is characterized in that: After the approximate interval is determined, the straw defect detection method based on visual recognition also includes: Determine whether there are at least two similar intervals; If there are not at least two similar intervals, then determining a feasible compensation brightness range according to a subsequent compensation brightness range of the only similar interval; If there are at least two similar intervals, randomly select any number of subsequent compensation brightness ranges and the required compensation brightness range from all subsequent compensation brightness ranges to form a brightness range set; A brightness range set when each range in the brightness range set has an intersection that is not an empty set is defined as a valid range set, and the number of subsequent ranges is determined by counting the selected subsequent compensation brightness ranges in the valid range set; The number of subsequent ranges with the largest values ​​is determined according to a preset sorting rule, and a feasible compensation brightness range is determined according to a brightness range set corresponding to the number of subsequent ranges.

6. The straw defect detection method based on visual recognition according to claim 5 is characterized in that: After the number of subsequent ranges is determined, the straw defect detection method based on visual recognition also includes: Determine whether there are at least two subsequent range sets with the same number of maximum brightness ranges; If there are not at least two largest brightness range sets with the same number of subsequent ranges, determining a feasible compensation brightness range according to the brightness range set corresponding to the largest number of subsequent ranges; If there are at least two brightness range sets with the same number of subsequent ranges and the largest number, the brightness range set corresponding to the largest number of subsequent ranges is defined as the candidate range set, and the candidate compensation brightness range is determined according to the ranges in each candidate range set, and the simulation brightness value is randomly determined in the candidate compensation brightness range; defining a subsequent compensation brightness range that is not within a single candidate range set as an outer brightness range of the candidate range set; Determine a suitable value according to the simulated brightness value and each external brightness range, and perform mean calculation according to each suitable value determined under the same candidate range set to determine a mean suitable value; The appropriate mean value with the largest value is determined according to the sorting rule, and the feasible compensation brightness range is determined according to the candidate range set corresponding to the appropriate mean value.

7. The straw defect detection method based on visual recognition according to claim 1, characterized in that: After the foreign body area is determined, the straw defect detection method based on visual recognition also includes: Mark the foreign body location point on the preset straw length axis according to the foreign body area; After the location of the foreign body is determined, a simulated cutting interval is constructed on the straw length axis according to a preset fixed length; Determine whether a new foreign body position point appears in the simulated cutting interval; If no new foreign object position point appears in the simulated cutting interval, the cutting position point is marked according to the foreign object position point and the preset avoidance distance; If a new foreign body position point appears in the simulated cutting interval, the cutting interval is further constructed according to the new foreign body position point.

8. A straw defect detection system based on visual recognition, characterized in that: include: An acquisition module, used to acquire infrared detection images of the straw at a preset shooting point, wherein the shooting point is located between the output rear end and the cutting device and is arranged at multiple intervals; A processing module, connected to the acquisition module, for storing and processing information; The processing module obtains the detection pixel chromaticity of each pixel in the infrared detection image, and defines the pixel whose detection pixel chromaticity is within the preset required chromaticity range as a normal pixel, and defines the pixel other than the normal pixel as an abnormal pixel; The processing module summarizes the adjacent abnormal pixel points into the same preset initially empty pixel set; The processing module counts abnormal pixel points in each pixel set to determine the number of pixels in the set; The processing module defines a pixel set whose pixel number is greater than a preset reference pixel number as a foreign body feature set, and determines an area formed by abnormal pixel points included in the foreign body feature set as a foreign body area.

Citation Information

Patent Citations

  • Machine vision detection device and method for steel rail surface discrete defects

    CN107618533A

  • Real-time product defect positioning method

    CN110186929A

  • Image shooting method, shooting equipment, mobile terminal and medium

    CN112262564A

  • Infrared camera weak light environment compensation method and device and electronic equipment

    CN112861645A

  • Textile fabric defect detection system

    CN118429347A