Method, system and equipment for detecting character defects on surface of lampshade of car lamp and medium thereof

By using morphological processing and template matching combined with custom voting algorithms in the detection of character defects on the surface of the car lamp cover, the problem of low detection accuracy and efficiency in the existing technology is solved, and high-precision and rapid detection are achieved, reducing the The impact of human factors has been improved, and the automation and applicability of detection has been improved.

CN119229457APending Publication Date: 2024-12-31CHANGZHOU XINGYU AUTOMOTIVE LIGHTING SYST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411353934.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The prior art has low applicability in character defect detection on the surface of the car lamp cover, low detection accuracy and efficiency, and is easily affected by human factors, and there are missed and missed detection.

Method used

A method for detecting character defects on the surface of the car lampshade, including collecting the original image for preprocessing, extracting the region of interest through morphological processing and template matching, combining a custom voting algorithm to process the difference image, and calculate the proportion of the highlight blocks to Determine whether the character is a defective product.

Benefits of technology

It realizes high-precision and rapid detection, reduces the influence of human factors, improves the automation and applicability of detection, and ensures the stability and consistency of product quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119229457A_ABST
    Figure CN119229457A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of vehicle accessory detection, in particular to a vehicle lamp shade surface character defect detection method, which comprises the following steps of: preprocessing an original image of a to-be-detected vehicle lamp shade to obtain a character region image, and extracting and processing a region of interest of the character region image through morphological processing based on a set character height-width ratio to obtain a character region image; obtaining a character ROI sub-region and a plurality of character images, and matching the character images with a template character image to obtain a matching result; forming character information based on a matching result, and comparing the character information to determine whether the character information is complete; the pixel value of the character image with the highest matching result is subtracted from the pixel value of the corresponding template character image, the subtracted image is processed through a self-defined voting algorithm mechanism, a key information image is obtained, and the maximum connected domain of the key information image is obtained; the proportion of the pixel value of the highlight block in the maximum connected domain to the pixel value of the corresponding template character image is calculated, character defect detection is carried out, the detection precision is high, the efficiency is high, and the applicability is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of vehicle parts detection, and in particular to a method, system, equipment and medium for detecting character defects on the surface of a lampshade of a vehicle lamp. Background Art

[0002] In the field of automobile manufacturing, headlights are the eyes of the car and are indispensable auto parts. In the process of headlight production, it is necessary to ensure that the characters of the headlights of the same batch remain completely consistent and there are no obvious scratches on the character surface. The existing detection methods are still in the manual stage, which requires continuous training of new personnel and is easily affected by subjective factors, so it is easy to have false detection and missed detection. If machine vision automatic detection technology is used instead of manual work, it is easy to quantify the detection standards and store data.

[0003] On high-speed production lines, the visual system uses a non-contact detection method, which reduces labor costs compared to manual detection, and also reduces the impact of human factors on the detection results, greatly improving the detection speed and efficiency. At the same time, it can achieve high-precision measurement and detection, reduce human errors, and ensure the stability and consistency of product quality. The visual inspection system can be customized and adjusted according to different product lines and production environments, and has strong adaptability. With the continuous development of computer technology and image processing technology, visual inspection technology will play a more important role in the future. In the existing technology, the lampshade character detection technology based on deep learning requires a large number of data sets, and it takes time to annotate samples, which is time-consuming and labor-intensive. When the background changes, the model needs to be retrained, and the applicability is not high; the optical character detection technology developed based on Halcon also uses deep learning technology. The process of training the neural network model also requires a lot of time and data, and the model may have overfitting problems, and the applicability is low. Therefore, it is urgent to develop a method for detecting character defects on the surface of lampshades. Summary of the invention

[0004] The technical problem to be solved by the present invention is: in order to solve the technical problem that the existing technology has low applicability in detecting character defects on the surface of a vehicle lamp shade, the present invention provides a method for detecting character defects on the surface of a vehicle lamp shade, which has high detection accuracy, high efficiency and high applicability.

[0005] The technical solution adopted by the present invention to solve the technical problem is: a method for detecting character defects on the surface of a lampshade of a vehicle lamp, the method comprising:

[0006] S1, collecting an original image of a car lampshade to be inspected, and preprocessing the original image to obtain a character area image;

[0007] S2, extracting a region of interest of the character region image by morphologically processing the character region image based on a set character aspect ratio;

[0008] S3, processing the region of interest in a rectangular coordinate system to obtain a character ROI sub-region, wherein the character ROI sub-region includes a plurality of character images C n , where n = 1, 2, ... n;

[0009] S4, each character image C n Match the template character image with the database to obtain the matching result;

[0010] S5, forming character information based on the matching result, comparing the character information with the target character, and determining whether the character information is complete according to the comparison result, and if it is complete, proceeding to the next step;

[0011] S6, obtaining the character image C with the highest matching result x And the corresponding template character image M x , the character image C with the highest matching result x The pixel value and its corresponding template character image M x Subtract the pixel values ​​of to obtain the difference image;

[0012] S7, processing the difference image through a custom voting algorithm mechanism to obtain a key information image, and obtaining a maximum connected domain Rx of the key information image;

[0013] S8, calculating the pixel value of the highlighted block in the maximum connected domain Rx of the key information image and its corresponding template character image M x The proportion of pixel values;

[0014] If the proportion result is greater than a preset value, the characters on the surface of the automobile lampshade are defective products, otherwise, the characters on the surface of the automobile lampshade are good products.

[0015] Further, specifically, the step S1 of preprocessing the original image includes: rotating and anti-overexposure processing the original image, and segmenting the character area of ​​the original image by local adaptive binarization to obtain the character area image.

[0016] Further, specifically, the step S3 specifically includes:

[0017] S31, sorting the regions of interest according to coordinate information in a rectangular coordinate system, and performing secondary filtering to obtain the character ROI sub-region;

[0018] S32, sorting the character ROI sub-regions according to the coordinate information, and correcting the character ROI sub-regions by affine transformation.

[0019] Further, specifically, the customized voting algorithm mechanism includes:

[0020] A 4-neighborhood is used to vote for each pixel in the difference image. If two or more pixels in the 4-neighborhood are highlight blocks, the value of the pixel is set to 1.

[0021] Further, specifically, the calculation formula of the pixel value of the highlight block in the maximum connected domain Rx of the key information image is:

[0022]

[0023] Among them, m and n are the width and height of the image of Rx, and f(i,j) is the pixel value of the i-th row and j-th column.

[0024] Further, specifically, correcting the character ROI sub-region by affine transformation includes:

[0025] Extract all the character images C in the character ROI sub-region n ;

[0026] Calculate each character image C n The upper left corner coordinates are used to calculate the deflection angle between two adjacent character images.

[0027] Sort all the deflection angles, remove the maximum deflection angle and the minimum deflection angle, and calculate the average value of the remaining deflection angles, where the average value is the deflection angle of the character ROI sub-region;

[0028] The character ROI sub-region is corrected based on the deflection angle of the character ROI sub-region.

[0029] A system for detecting character defects on a lampshade surface of a vehicle lamp, the system comprising:

[0030] Industrial camera, collecting the original image of the car lampshade to be inspected;

[0031] A visual controller is connected to the industrial camera and is used to control the industrial camera.

[0032] A host computer is connected to the industrial camera, and the host computer executes the above-mentioned method for detecting character defects on the surface of a lampshade of a vehicle lamp.

[0033] A computer device comprising:

[0034] processor;

[0035] A memory for storing executable instructions;

[0036] The processor is used to read the executable instructions from the memory and execute the executable instructions to implement the above-mentioned method for detecting character defects on the surface of a lampshade of a vehicle lamp.

[0037] A computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the processor implements the above-mentioned method for detecting character defects on the surface of a lampshade of a vehicle lamp.

[0038] The beneficial effect of the present invention is that the method for detecting character defects on the surface of a car lampshade of the present invention detects character defects on the surface of a car lampshade through template matching and target character comparison, has high detection accuracy, high efficiency, high real-time detection, realizes automated recognition, and has high applicability. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0040] Figure 1 It is a schematic diagram of the method flow of embodiment 1 of the present invention.

[0041] Figure 2 It is a schematic diagram of an original image according to the first embodiment of the present invention.

[0042] Figure 3 It is a schematic diagram of a character area image according to the first embodiment of the present invention.

[0043] Figure 4 It is a schematic diagram of a character ROI sub-region according to the first embodiment of the present invention.

[0044] Figure 5 Schematic diagram of a character ROI subregion before and after affine transformation correction according to the first embodiment of the present invention, (a) a schematic diagram of a character ROI subregion before affine transformation correction; (b) a schematic diagram of a character ROI subregion after affine transformation correction;

[0045] Figure 6 Schematic diagram of each character image in a character ROI sub-region according to the first embodiment of the present invention.

[0046] Figure 7 It is a schematic diagram of a template character image according to the first embodiment of the present invention.

[0047] Figure 8 is the character image C with the highest matching result in the first embodiment of the present invention x The pixel value and its corresponding template character image M x .

[0048] Fig. 9 It is a schematic diagram of a difference image according to the first embodiment of the present invention.

[0049] Fig.10 It is a schematic diagram of a key information image corresponding to a difference image according to the first embodiment of the present invention.

[0050] Fig.11 It is a schematic diagram of four neighborhoods in the first embodiment of the present invention.

[0051] Fig.12 It is the maximum connected domain Rx of the key information image in the first embodiment of the present invention.

[0052] Fig.13 It is a schematic diagram of the system structure of the second embodiment of the present invention.

[0053] Fig.14 It is a schematic diagram of the device structure of embodiment 3 of the present invention.

[0054] In the figure, 10 is a computer device; 1002 is a processor; 1004 is a memory; and 1006 is a transmission device. DETAILED DESCRIPTION

[0055] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, which only illustrate the basic structure of the present invention in a schematic manner, and therefore only show the components related to the present invention.

[0056] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. In addition, features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "multiple" means two or more.

[0057] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0058] Example 1

[0059] The present application embodiment provides a method for detecting character defects on the surface of a lampshade of a vehicle. Figure 1-12 As shown, the method includes:

[0060] S1, collecting the original image of the automobile lampshade to be inspected, preprocessing the original image to obtain a character area image; for example, preprocessing the original image includes: rotating the original image and performing anti-overexposure processing, and using local adaptive binarization to segment the character area of ​​the original image to obtain a character area image.

[0061] S2, extracting the region of interest of the character region image by morphologically processing the character region image based on the set character aspect ratio.

[0062] It should be noted that, through morphological processing of the character area image, the individual characters in the character area image are located and extracted. Under morphological processing, the characters and defects in the character area image will form a continuous character area for each character. This area is extracted to form the area of ​​interest of the character area image, and the area where the defect is located is eliminated. Only the area of ​​interest of the character area image is retained to improve the accuracy of detection.

[0063] S3, processing the region of interest in a rectangular coordinate system to obtain a character ROI sub-region, which includes multiple character images C n , where n=1, 2, ...n; such as, specifically including:

[0064] S31, sorting the regions of interest according to coordinate information in a rectangular coordinate system, and performing secondary filtering to obtain character ROI sub-regions;

[0065] S32, sorting the character ROI sub-regions according to the coordinate information, and correcting the character ROI sub-regions through affine transformation.

[0066] S4, each character image C n Match the template character image with the database to obtain the matching result.

[0067] S5, forming character information based on the matching result, comparing the character information with the target character, and determining whether the character information is complete according to the comparison result. If it is complete, proceed to the next step; if it is incomplete, directly determining that the character on the surface of the automobile lampshade is a defective product.

[0068] S6, obtaining the character image C with the highest matching result x And the corresponding template character image M x , the character image C with the highest matching result x The pixel value and its corresponding template character image M x The pixel values ​​of are subtracted to obtain the difference image.

[0069] S7, processing the difference image through a custom voting algorithm mechanism to obtain a key information image and obtain the maximum connected domain Rx of the key information image; for example, the custom voting algorithm mechanism includes:

[0070] Use 4 neighborhoods to vote for each pixel in the difference image. If two or more pixels in the 4 neighborhoods are highlighted blocks, the value of the pixel is set to 1. This can maximize the difference between characters and improve detection accuracy. Fig.11 As shown, if two or more pixels in the 4-neighborhood of the central pixel G4 are highlight blocks, the value of the pixel is set to 1. Conversely, if less than two pixels are low-brightness blocks, the value of the pixel is set to 0. The formula is as follows:

[0071]

[0072] It should be noted that the obtained maximum connected area can remove the unfiltered external noise, strengthen the character features, and further improve the accuracy of detection.

[0073] S8, calculating the pixel value of the highlight block in the maximum connected domain Rx of the key information image and its corresponding template character image M x The proportion of pixel values;

[0074] If the proportion result is greater than the preset value, the characters on the surface of the car lampshade are defective, otherwise, the characters on the surface of the car lampshade are good.

[0075] The calculation formula of the pixel value of the highlight block in the maximum connected domain Rx of the key information image is:

[0076]

[0077] Among them, m and n are the width and height of the image of Rx, and f(i,j) is the pixel value of the i-th row and j-th column.

[0078] In an embodiment, step S32 correcting the character ROI sub-region by affine transformation includes:

[0079] Extract all character images C in the character ROI sub-region n ;

[0080] Calculate each character image C n The coordinate of the upper left corner is used to calculate the deflection angle between two adjacent character images;

[0081] Sort all the deflection angles, remove the maximum deflection angle and the minimum deflection angle, and calculate the average of the remaining deflection angles. The average is the deflection angle of the character ROI sub-region;

[0082] The character ROI sub-region is corrected based on the deflection angle of the character ROI sub-region.

[0083] In the embodiment, in order to improve the detection efficiency, when executing step S4, the character image C is first n If the number does not meet the preset value, the characters on the surface of the car lampshade are directly determined to be defective.

[0084] In summary, the method for detecting character defects on the surface of a car lampshade of the present invention detects character defects on the surface of a car lampshade through template matching and target character comparison, has high detection accuracy, high efficiency, high real-time detection, realizes automated recognition, and has high applicability.

[0085] Example 2

[0086] Based on the same inventive concept as the method for detecting character defects on the surface of a lampshade of a vehicle in the aforementioned embodiment, the embodiment of the present application provides a system for detecting character defects on the surface of a lampshade of a vehicle, the system comprising:

[0087] Industrial camera, collecting the original image of the car lampshade to be inspected;

[0088] A visual controller is connected to the industrial camera and is used to control the industrial camera.

[0089] A host computer is connected to the industrial camera, and the host computer executes the above-mentioned method for detecting character defects on the surface of a lampshade of a vehicle.

[0090] The foregoing Figure 1 The various variations and specific examples of the method for detecting character defects on the surface of a vehicle lamp shade in Example 1 are also applicable to a system for detecting character defects on the surface of a vehicle lamp shade in this embodiment. Through the above detailed description of the method for detecting character defects on the surface of a vehicle lamp shade, those skilled in the art can clearly know the implementation method of the system for detecting character defects on the surface of a vehicle lamp shade in this embodiment. Therefore, for the sake of brevity of the specification, it will not be described in detail here.

[0091] Example 3

[0092] An embodiment of the present application provides a computer device, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement a method for detecting character defects on the surface of a vehicle lamp cover as provided in the above method embodiment.

[0093] Fig.14 The hardware structure diagram of a device for implementing a method for detecting character defects on the surface of a lamp shade provided in an embodiment of the present application is shown. The device may participate in constituting or include the apparatus or system provided in an embodiment of the present application. Fig.14 As shown, the computer device 10 may include one or more processors 1002 (the processor may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 1004 for storing data, and a transmission device 1006 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Fig.14 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig.14 More or fewer components as shown, or with Fig.14 Different configurations are shown.

[0094] It should be noted that the one or more processors and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer device 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0095] The memory 1004 can be used to store software programs and modules of application software, such as a program instruction / data storage device corresponding to a method for detecting character defects on the surface of a headlight shade in an embodiment of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 1004, that is, implementing the above-mentioned method. The memory 1004 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 1004 may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computer device 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0096] The transmission device 1006 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer device 10. In one example, the transmission device 1006 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 1006 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0097] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer device 10 (or mobile device).

[0098] Example 4

[0099] An embodiment of the present application also provides a computer-readable storage medium, which can be set in a server to store at least one instruction or at least one program related to a method for detecting character defects on the surface of a vehicle lamp cover in a method embodiment. The at least one instruction or the at least one program is loaded and executed by the processor to implement a method for detecting character defects on the surface of a vehicle lamp cover provided in the above method embodiment.

[0100] Optionally, in this embodiment, the storage medium may be located in at least one of the multiple network servers of the computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0101] Example 5

[0102] The embodiment of the present invention also provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes a method for detecting character defects on the surface of a lampshade provided in the above-mentioned various optional embodiments.

[0103] It should be noted that the above-mentioned sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of the present application are described. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0104] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment and storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0105] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0106] Based on the above ideal embodiments of the present invention, the relevant staff can make various changes and modifications without departing from the technical concept of the present invention through the above description. The technical scope of the present invention is not limited to the contents of the specification, and its technical scope must be determined according to the scope of the claims.

Claims

1. A method for detecting character defects on the surface of a lampshade, characterized in that: The method comprises: S1, collecting an original image of a car lampshade to be inspected, and preprocessing the original image to obtain a character area image; S2, extracting a region of interest of the character region image by morphologically processing the character region image based on a set character aspect ratio; S3, processing the region of interest in a rectangular coordinate system to obtain a character ROI sub-region, wherein the character ROI sub-region includes a plurality of character images C n , where n = 1, 2, ... n; S4, each character image C n Match the template character image with the database to obtain the matching result; S5, forming character information based on the matching result, comparing the character information with the target character, and determining whether the character information is complete according to the comparison result, and if it is complete, proceeding to the next step; S6, obtaining the character image C with the highest matching result x And the corresponding template character image M x , the character image C with the highest matching result x The pixel value and its corresponding template character image M x Subtract the pixel values ​​of to obtain the difference image; S7, processing the difference image through a custom voting algorithm mechanism to obtain a key information image, and obtaining a maximum connected domain Rx of the key information image; S8, calculating the pixel value of the highlighted block in the maximum connected domain Rx of the key information image and its corresponding template character image M x The proportion of pixel values; If the proportion result is greater than a preset value, the characters on the surface of the automobile lampshade are defective products, otherwise, the characters on the surface of the automobile lampshade are good products.

2. The method for detecting character defects on the surface of a lampshade of a vehicle as claimed in claim 1, characterized in that: The step S1 of preprocessing the original image includes: rotating and anti-overexposure processing the original image, and segmenting the character area of ​​the original image by local adaptive binarization to obtain the character area image.

3. The method for detecting character defects on the surface of a lampshade of a vehicle as claimed in claim 1, characterized in that: The step S3 specifically includes: S31, sorting the regions of interest according to coordinate information in a rectangular coordinate system, and performing secondary filtering to obtain the character ROI sub-region; S32, sorting the character ROI sub-regions according to the coordinate information, and correcting the character ROI sub-regions by affine transformation.

4. The method for detecting character defects on the surface of a lampshade of a vehicle as claimed in claim 1, characterized in that: The custom voting algorithm mechanism includes: A 4-neighborhood is used to vote for each pixel in the difference image. If two or more pixels in the 4-neighborhood are highlight blocks, the value of the pixel is set to 1.

5. The method for detecting character defects on the surface of a lampshade of a vehicle as claimed in claim 1, characterized in that: The calculation formula of the pixel value of the highlight block in the maximum connected domain Rx of the key information image is: Among them, m and n are the width and height of the image of Rx, and f(i,j) is the pixel value of the i-th row and j-th column.

6. The method for detecting character defects on the surface of a lampshade of a vehicle as claimed in claim 1, characterized in that: Correcting the character ROI sub-region by affine transformation includes: Extract all the character images C in the character ROI sub-region n ; Calculate each character image C n The upper left corner coordinates are used to calculate the deflection angles of two adjacent character images; Sort all the deflection angles, remove the maximum deflection angle and the minimum deflection angle, and calculate the average value of the remaining deflection angles, where the average value is the deflection angle of the character ROI sub-region; The character ROI sub-region is corrected based on the deflection angle of the character ROI sub-region.

7. A system for detecting character defects on the surface of a lampshade, the system comprising: Industrial camera, collecting the original image of the car lampshade to be inspected; A visual controller connected to the industrial camera to control the industrial camera; A host computer is connected to the industrial camera, and the host computer executes the method for detecting character defects on the surface of a lampshade of a vehicle lamp as described in any one of claims 1 to 6.

8. A computer device, characterized in that: include: processor; A memory for storing executable instructions; The processor is used to read the executable instructions from the memory and execute the executable instructions to implement the method for detecting character defects on the surface of a lampshade of a vehicle lamp as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the method for detecting character defects on the surface of a lampshade of a vehicle lamp as claimed in any one of claims 1 to 6.