Search

CN-121414743-B - Shell detection method, device, computer equipment and readable storage medium

CN121414743BCN 121414743 BCN121414743 BCN 121414743BCN-121414743-B

Abstract

The invention discloses a shell detection method, a device, computer equipment and a readable storage medium, wherein the method comprises the steps of obtaining a detection image of a shell to be detected, wherein the shell to be detected corresponds to a detection standard; detecting abnormal points on the surface of the shell to be detected based on the detection image, carrying out region division processing in the detection image based on the abnormal points to obtain an abnormal region and a defect area of the abnormal region, extracting refraction characteristics in the abnormal region, determining defect depth of the abnormal region based on the refraction characteristics, and determining a detection result of the shell to be detected based on the defect area, the defect depth and a detection standard. The detection image is obtained, abnormal points are identified from the pixel layer, the abnormal area is obtained through division, the defect area is calculated, meanwhile, the refraction characteristics are extracted in the abnormal area and mapped to the defect depth, and finally, the detection image is judged according to the detection standard, so that the synchronous quantification of the two-dimensional range and the three-dimensional morphology is formed, the manual subjectivity can be remarkably reduced, and the detection accuracy is effectively improved.

Inventors

  • LIN MIN
  • ZHENG XIAOJIE

Assignees

  • 深圳市富泰鑫科技有限公司

Dates

Publication Date
20260512
Application Date
20251226

Claims (9)

  1. 1. A method of housing detection, the method comprising: acquiring a detection image of a shell to be detected, wherein the shell to be detected corresponds to a detection standard; detecting abnormal points on the surface of the shell to be detected based on the detection image; Performing region division processing in the detection image based on the abnormal points to obtain an abnormal region and a defect area of the abnormal region; extracting a refraction feature in the abnormal region, and determining a defect depth of the abnormal region based on the refraction feature; determining a detection result of the shell to be detected based on the defect area, the defect depth and the detection standard; the detecting, based on the detection image, an abnormal point on the surface of the housing to be detected includes: Extracting color information and brightness information of each pixel point from the detection image; based on the color information and the brightness information, obtaining an optical response value of each pixel point according to a preset weight combination; calculating the difference between the optical response value of each pixel point and the average optical response value of the neighborhood; Comparing the difference value with a preset response threshold value, and determining the abnormal point in all pixel points; The optical response value of each pixel point is obtained by combining the color information and the brightness information according to preset weights, and the method comprises the following steps: calculating an optical response value through a formula r=αl+βΔe, wherein α is a luminance weight coefficient, β is a color weight coefficient, L is a luminance value, and Δe is a color difference value of a pixel; the ratio of the brightness weight coefficient to the color weight coefficient is set according to the material type of the shell to be detected; For materials with strong metal wiredrawing and anodic oxidation light reflection, the brightness weight coefficient is improved to enhance the detection capability of scratch and indentation morphology defects; for materials with high requirements on color consistency of spray-painted plastics and coating parts, the color weight coefficient is improved so as to more accurately identify chromatic aberration, pollution or local fading abnormality; Wherein the sum of the brightness weight coefficient and the color weight coefficient is one, when the brightness weight coefficient is increased, the color weight coefficient is correspondingly reduced, and when the color weight coefficient is increased, the brightness weight coefficient is correspondingly reduced.
  2. 2. The housing inspection method of claim 1, wherein the acquiring an inspection image of the housing to be inspected comprises: Under a preset illumination condition, acquiring a plurality of initial detection images of the shell to be detected, wherein the shooting angles of each initial detection image are different; carrying out coordinate normalization processing based on the initial detection images to obtain normalized initial detection images; and carrying out fusion processing on a plurality of normalized initial detection images to obtain the detection images.
  3. 3. The housing detection method according to claim 1, wherein the performing region division processing in the detection image based on the abnormal point to obtain an abnormal region and a defective area of the abnormal region includes: Clustering the abnormal points based on the spatial position relation among the abnormal points to obtain at least one abnormal region; counting the number of abnormal points in each abnormal region, and calculating the defect area of the abnormal region based on the number of abnormal points and a preset mapping relation between pixels of the detection image and physical dimensions.
  4. 4. The housing detection method according to claim 1, wherein the extracting the refractive feature in the abnormal region and determining the defect depth of the abnormal region based on the refractive feature comprises: based on the brightness information of each pixel point in the abnormal region, calculating to obtain the brightness information distribution of the abnormal region; determining a refractive characteristic of the abnormal region based on the luminance information distribution; inputting the refraction characteristics into a preset mapping table, and matching to obtain the defect depth of the abnormal region, wherein the preset mapping table comprises depth values corresponding to different refraction characteristics.
  5. 5. The hull inspection method of claim 1 in which said inspection criteria includes a critical surface inspection criteria and a non-critical surface inspection criteria, said critical surface inspection criteria including a first defect area threshold and a first defect depth threshold, said non-critical surface inspection criteria including a second defect area threshold and a second defect depth threshold, and said first defect area threshold being less than said second defect area threshold, said first defect depth threshold being less than said second defect depth threshold, said determining inspection results of said hull to be inspected based on said defect area, said defect depth, and said inspection criteria including: Judging whether a detection surface to which the abnormal region belongs is a key surface or not; if the first defect area threshold is the key surface, determining the first defect area threshold as a target defect area threshold, and determining the first defect depth threshold as a target defect depth threshold; If the defect depth threshold is a non-key surface, determining the second defect area threshold as a target defect area threshold, and determining the second defect depth threshold as a target defect depth threshold; When the defect area is not smaller than the target defect area threshold value and/or the defect depth is not smaller than the target defect depth threshold value, judging that the detection result of the shell to be detected is defective; and when the defect area is smaller than the target defect area threshold and the defect depth is smaller than the target defect depth threshold, judging that the detection result of the shell to be detected is qualified.
  6. 6. The housing inspection method according to claim 5, wherein after the determination of the inspection result of the housing to be inspected based on the defect area, the defect depth, and the inspection standard, the method further comprises: When the detection result is defective, outputting an alarm signal and outputting a control signal to a preset marking device so that the marking device marks the defective shell to be detected; And when the detection result is a qualified product, storing the detection result in a preset detection database.
  7. 7. A housing detection device, the device comprising: the acquisition module is used for acquiring a detection image of a shell to be detected, and the shell to be detected corresponds to a detection standard; The detection module is used for detecting abnormal points on the surface of the shell to be detected based on the detection image; The dividing module is used for carrying out region dividing processing in the detection image based on the abnormal points to obtain an abnormal region and a defect area of the abnormal region; the extraction module is used for extracting refraction characteristics in the abnormal region and determining the defect depth of the abnormal region based on the refraction characteristics; The determining module is used for determining a detection result of the shell to be detected based on the defect area, the defect depth and the detection standard; The detection module is further used for: Extracting color information and brightness information of each pixel point from the detection image; based on the color information and the brightness information, obtaining an optical response value of each pixel point according to a preset weight combination; calculating the difference between the optical response value of each pixel point and the average optical response value of the neighborhood; Comparing the difference value with a preset response threshold value, and determining the abnormal point in all pixel points; The optical response value of each pixel point is obtained by combining the color information and the brightness information according to preset weights, and the method comprises the following steps: calculating an optical response value through a formula r=αl+βΔe, wherein α is a luminance weight coefficient, β is a color weight coefficient, L is a luminance value, and Δe is a color difference value of a pixel; the ratio of the brightness weight coefficient to the color weight coefficient is set according to the material type of the shell to be detected; For materials with strong metal wiredrawing and anodic oxidation light reflection, the brightness weight coefficient is improved to enhance the detection capability of scratch and indentation morphology defects; for materials with high requirements on color consistency of spray-painted plastics and coating parts, the color weight coefficient is improved so as to more accurately identify chromatic aberration, pollution or local fading abnormality; Wherein the sum of the brightness weight coefficient and the color weight coefficient is one, when the brightness weight coefficient is increased, the color weight coefficient is correspondingly reduced, and when the color weight coefficient is increased, the brightness weight coefficient is correspondingly reduced.
  8. 8. A computer device comprising a memory, a processor, and computer readable instructions stored on the memory and running on the processor, wherein the processor, when executing the computer readable instructions, implements the housing detection method of any one of claims 1 to 6.
  9. 9. A readable storage medium having stored thereon computer readable instructions, which when executed by a processor, implement the housing detection method according to any of claims 1 to 6.

Description

Shell detection method, device, computer equipment and readable storage medium Technical Field The present invention relates to the field of image recognition, and in particular, to a method and apparatus for detecting a shell, and a computer device. Background The existing shell appearance defect detection is mainly performed by manual view in a large number of enterprises, and spot inspection by a spot inspection type contact coarseness meter or a microscope is performed. The manual detection depends on experience and subjective threshold values of inspectors, and is easy to miss detection and misjudgment when facing to shells with batch, high-beat and complex surface reflection (such as spraying, anodic oxidation, electroplating, plastic paint spraying and the like), and defects such as micro scratches, tiny pits, scratches, orange peel, pinholes and the like have obvious differences under different incident angles and different background lights, so that the consistency of multiple visual inspection results of the same part is difficult to guarantee. In addition, the traditional point type contact measurement can only locally sample, can not form whole-surface quantitative evaluation, and the contact measuring head can introduce deformation errors and secondary damages on a soft coating or a curved surface, so that the method is not suitable for full detection of a production line. Therefore, how to provide a shell detection method capable of effectively improving the accuracy of shell detection is a technical problem to be solved in the art. Disclosure of Invention Based on the foregoing, it is necessary to provide a housing detection method, a device, a computer device and a readable storage medium for solving the problem of low accuracy of the conventional housing detection method. A method of housing detection, the method comprising: acquiring a detection image of a shell to be detected, wherein the shell to be detected corresponds to a detection standard; detecting abnormal points on the surface of the shell to be detected based on the detection image; Performing region division processing in the detection image based on the abnormal points to obtain an abnormal region and a defect area of the abnormal region; extracting a refraction feature in the abnormal region, and determining a defect depth of the abnormal region based on the refraction feature; and determining a detection result of the shell to be detected based on the defect area, the defect depth and the detection standard. Optionally, the acquiring a detection image of the shell to be detected includes: Under a preset illumination condition, acquiring a plurality of initial detection images of the shell to be detected, wherein the shooting angles of each initial detection image are different; carrying out coordinate normalization processing based on the initial detection images to obtain normalized initial detection images; and carrying out fusion processing on a plurality of normalized initial detection images to obtain the detection images. Optionally, the detecting, based on the detection image, an abnormal point of the surface of the housing to be detected includes: Extracting color information and brightness information of each pixel point from the detection image; based on the color information and the brightness information, obtaining an optical response value of each pixel point according to a preset weight combination; calculating the difference between the optical response value of each pixel point and the average optical response value of the neighborhood; and comparing the difference value with a preset response threshold value, and determining the abnormal point in all pixel points. Optionally, the performing area division processing in the detected image based on the abnormal point to obtain an abnormal area and a defect area of the abnormal area includes: Clustering the abnormal points based on the spatial position relation among the abnormal points to obtain at least one abnormal region; counting the number of abnormal points in each abnormal region, and calculating the defect area of the abnormal region based on the number of abnormal points and a preset mapping relation between pixels of the detection image and physical dimensions. Optionally, the extracting the refraction feature in the abnormal region and determining the defect depth of the abnormal region based on the refraction feature includes: based on the brightness information of each pixel point in the abnormal region, calculating to obtain the brightness information distribution of the abnormal region; determining a refractive characteristic of the abnormal region based on the luminance information distribution; inputting the refraction characteristics into a preset mapping table, and matching to obtain the defect depth of the abnormal region, wherein the preset mapping table comprises depth values corresponding to different refraction characteristics. Optionall