Universal detection method and device for night vision of camera
By implementing a general night vision detection method of the camera on the upper computer, the number of night vision lights is automatically detected using industrial vision cameras and dot fitting functions, the problems of inaccurate and low efficiency in the prior art are solved, and high accuracy and low cost detection effects are achieved.
Patent Information
- Application Number
- CN202210700464.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-20
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2042-06-20
AI Technical Summary
In the prior art, night vision light detection of cameras relies on manual judgment, resulting in inaccurate detection results, low efficiency and high cost.
By implementing the general night vision detection method of the camera on the upper computer, using an industrial vision camera to receive pictures, and after cropping and processing, the night vision lights are extracted through the dot fitting function, and the number of night vision lights that meet the area standard is compared to determine whether the camera is qualified.
It improves the accuracy and efficiency of testing, ensures the stability of product testing results, and reduces labor costs.
Smart Images

Figure CN115103180B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cameras, and in particular to a universal night vision detection method and device for cameras. Background Art
[0002] The current factory's operating procedure for determining whether camera products are qualified is: connect the camera to the power cord, wait for the camera to be powered on, and then the host computer controls the camera to switch the night vision light. Manually determine whether the number of night vision lights is correct. If correct, the camera is qualified; if incorrect, the camera is unqualified.
[0003] The above method is to manually determine whether the camera is qualified. This manual determination method will lead to inaccurate detection results and low detection efficiency; and when the number of cameras to be detected is large, a large amount of manpower is required and the cost is high. Summary of the invention
[0004] In view of this, an object of the present invention is to provide a universal night vision detection method and device for a camera, which can improve the accuracy and efficiency of detection, ensure the stability of product detection results, and reduce labor costs.
[0005] In a first aspect, an embodiment of the present invention provides a universal night vision detection method for a camera, which is applied to a host computer, and the method includes:
[0006] When the camera to be tested is placed on the detection fixture, a connection is established with the camera to be tested;
[0007] Receive a picture sent by an industrial vision camera, and crop the picture according to the night vision light area of the camera to be tested to obtain a cropped picture;
[0008] Processing the cropped image to obtain a processed image;
[0009] Extracting the processed image through a dot fitting function to obtain a dot set;
[0010] Selecting a night vision light that meets the area standard from the set of dots;
[0011] Compare the number of the night vision lights that meet the area standard with the number of the night vision lights of the camera to be tested to obtain a test result;
[0012] Determine whether the camera to be tested is qualified according to the detection result.
[0013] Further, selecting the night vision light that meets the area standard from the set of dots includes repeatedly performing the following process until each of the dots is traversed:
[0014] Select any point from the point set, and use the selected point as the current point;
[0015] Calculating the area of the current point to obtain the area corresponding to the current point;
[0016] If the area corresponding to the current dot exceeds the preset area threshold, the current dot is the night vision light that meets the area standard.
[0017] Further, the cropped image is processed to obtain a processed image, including:
[0018] The cropped image is subjected to noise reduction processing, grayscale processing, binarization processing, noise corrosion processing and bright spot expansion processing to obtain the processed image.
[0019] Further, determining whether the camera to be tested is qualified according to the test result includes:
[0020] If the number of night vision lights that meet the area standard is consistent with the number of night vision lights of the camera to be tested, the camera to be tested is qualified;
[0021] If the number of night vision lights that meet the area standard is inconsistent with the number of night vision lights of the camera to be tested, the camera to be tested is unqualified.
[0022] Furthermore, after establishing a connection with the camera to be tested, the method further includes:
[0023] Sending a control instruction to the camera to be tested, so that the camera to be tested turns on the night vision light according to the control instruction;
[0024] Receive the reply instruction information sent by the camera to be tested.
[0025] Furthermore, the method further comprises:
[0026] Reading memory information of the camera, wherein the memory information includes production information;
[0027] Binding the production information with the test result to obtain binding information;
[0028] The binding information is uploaded to the cloud.
[0029] In a second aspect, an embodiment of the present invention provides a universal night vision detection device for a camera, which is applied to a host computer, and the device includes:
[0030] A connection unit, used to establish a connection with the camera to be tested when the camera to be tested is placed on the detection fixture;
[0031] A picture information receiving unit, used for receiving a picture sent by an industrial vision camera, and cropping the picture according to the night vision light area of the camera to be tested to obtain a cropped picture;
[0032] A processing unit, used for processing the cropped image to obtain a processed image;
[0033] An extraction unit, used to extract the processed image through a dot fitting function to obtain a dot set;
[0034] A selection unit, used for selecting a night vision light that meets the area standard from the set of dots;
[0035] A comparison unit, used for comparing the number of the night vision lights meeting the area standard with the number of the night vision lights of the camera to be tested, to obtain a test result;
[0036] A determination unit is used to determine whether the camera to be tested is qualified according to the detection result.
[0037] Furthermore, the selection unit is specifically configured to repeatedly perform the following processing until each of the dots is traversed:
[0038] Select any point from the point set, and use the selected point as the current point;
[0039] Calculating the area of the current point to obtain the area corresponding to the current point;
[0040] If the area corresponding to the current dot exceeds the preset area threshold, the current dot is the night vision light that meets the area standard.
[0041] In a third aspect, an embodiment of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor implements the method described above when executing the computer program.
[0042] In a fourth aspect, an embodiment of the present invention provides a computer-readable medium having a non-volatile program code executable by a processor, wherein the program code enables the processor to execute the method as described above.
[0043] The embodiment of the present invention provides a universal night vision detection method and device for a camera, which are applied to a host computer, including: when a camera to be tested is placed on a detection fixture, establishing a connection with the camera to be tested; receiving a picture sent by an industrial vision camera, and cropping the picture according to the night vision light area of the camera to be tested to obtain a cropped picture; processing the cropped picture to obtain a processed picture; extracting the processed picture through a dot fitting function to obtain a dot set; selecting night vision lights that meet the area standard from the dot set; comparing the number of night vision lights that meet the area standard with the number of night vision lights of the camera to be tested to obtain a detection result; determining whether the camera to be tested is qualified according to the detection result; the accuracy and efficiency of the detection can be improved, the stability of the product detection results can be ensured, and the labor cost can be reduced.
[0044] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0045] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 A flow chart of a universal night vision detection method for a camera provided in Embodiment 1 of the present invention;
[0048] Figure 2 This is a flow chart of step S105 in the universal night vision detection method for a camera provided in the first embodiment of the present invention;
[0049] Figure 3 This is a schematic diagram of a universal night vision detection device for a camera provided in Embodiment 1 of the present invention.
[0050] icon:
[0051] 1-connection unit; 2-picture information receiving unit; 3-processing unit; 4-extraction unit; 5-selection unit; 6-comparison unit; 7-determination unit. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0053] To facilitate understanding of this embodiment, the embodiment of the present invention is described in detail below.
[0054] Embodiment 1:
[0055] Figure 1 This is a flow chart of a universal night vision detection method for a camera provided in Embodiment 1 of the present invention.
[0056] Reference Figure 1 , the execution subject is the host computer, and the method includes the following steps:
[0057] Step S101, when the camera to be tested is placed on the testing fixture, a connection is established with the camera to be tested;
[0058] Step S102, receiving a picture sent by the industrial vision camera, and cropping the picture according to the night vision light area of the camera to be tested to obtain a cropped picture;
[0059] Here, the host computer can establish communication with the camera to be tested through a P2P connection method; establish a connection with the industrial vision camera through a USB data cable to transmit video data.
[0060] Step S103, processing the cropped image to obtain a processed image;
[0061] Step S104, extracting the processed image through a dot fitting function to obtain a dot set;
[0062] Step S105, selecting a night vision light that meets the area standard from the dot set;
[0063] Step S106, comparing the number of night vision lights that meet the area standard with the number of night vision lights of the camera to be tested to obtain a test result;
[0064] Step S107, determining whether the camera to be tested is qualified according to the test result.
[0065] Here, it also includes a display connected to the host computer to display the test results. Among them, the industrial vision camera can adjust the height through a precision slide to adapt to a variety of products; the test fixture can also be designed as a quick-change structure, which can be compatible with a variety of products by replacing the test fixture.
[0066] Further, see Figure 2 Step S105 includes repeatedly performing the following processing until each dot is traversed:
[0067] Step S201, selecting any point from the point set, and using the selected point as the current point;
[0068] Step S202, calculating the area of the current dot to obtain the area corresponding to the current dot;
[0069] Step S203: If the area corresponding to the current dot exceeds the preset area threshold, the current dot is a night vision light that meets the area standard.
[0070] Furthermore, step S103 includes:
[0071] The cropped image is subjected to denoising, grayscale processing, binarization processing, noise corrosion processing and bright spot expansion processing to obtain a processed image.
[0072] Further, step S107 includes:
[0073] Step S301, if the number of night vision lights that meet the area standard is the same as that of the camera to be tested, the camera to be tested is qualified;
[0074] Step S302: If the number of night vision lights that meet the area standard is inconsistent with the number of night vision lights of the camera to be tested, the camera to be tested is unqualified.
[0075] Furthermore, after establishing a connection with the camera to be tested, the method further includes the following steps:
[0076] Step S401, sending a control instruction to the camera to be tested, so that the camera to be tested turns on the night vision light according to the control instruction;
[0077] Step S402, receiving reply instruction information sent by the camera to be tested.
[0078] Here, since it is found in practice that there will be a delay in USB transmission of video data, when the host computer receives the reply command information sent by the camera to be tested, it will discard the pictures obtained from the industrial vision camera within 1 second.
[0079] Furthermore, the method further comprises the following steps:
[0080] Step S501, reading the memory information of the camera, the memory information includes production information;
[0081] Step S502, binding the production information with the test result to obtain binding information;
[0082] Step S503, uploading the binding information to the cloud.
[0083] Specifically, the operator first inserts the memory card into the card slot of the camera, then places the camera on the detection fixture, and inserts the USB connector of the camera into the power supply interface, thereby powering on the camera and communicating with the host computer at the same time.
[0084] The host computer identifies the camera and reads the program pre-burned in the memory card. The program records the production information of the product, including the product MAC (Media Access Control Address) and aging test results. The purpose of the host computer reading the production information in the memory information is to bind the test results with the production information, obtain the binding information, and then upload the binding information to the cloud as a basis for controlling product quality.
[0085] In addition, the detection time and equipment operation status can be uploaded to the cloud platform through the host computer, which is convenient for managers to monitor the on-site production status in real time. Data is collected in the cloud to facilitate subsequent product traceability and prevent defective products from being discharged due to workers' misoperation.
[0086] The embodiment of the present invention provides a universal night vision detection method for a camera, which is applied to a host computer and includes: when a camera to be tested is placed on a detection fixture, establishing a connection with the camera to be tested; receiving a picture sent by an industrial vision camera, and cropping the picture according to the night vision light area of the camera to be tested to obtain a cropped picture; processing the cropped picture to obtain a processed picture; extracting the processed picture through a dot fitting function to obtain a dot set; selecting night vision lights that meet the area standard from the dot set; comparing the number of night vision lights that meet the area standard with the number of night vision lights of the camera to be tested to obtain a detection result; determining whether the camera to be tested is qualified according to the detection result; the accuracy and efficiency of the detection can be improved, the stability of the product detection results can be ensured, and the labor cost can be reduced.
[0087] Embodiment 2:
[0088] Figure 3 This is a schematic diagram of a universal night vision detection device for a camera provided in Embodiment 1 of the present invention.
[0089] Reference Figure 3 , applied to the host computer, the device includes:
[0090] A connection unit 1 is used to establish a connection with the camera to be tested when the camera to be tested is placed on the detection fixture;
[0091] The picture information receiving unit 2 is used to receive the picture sent by the industrial vision camera, and to crop the picture according to the night vision light area of the camera to be tested to obtain a cropped picture;
[0092] Processing unit 3, used to process the cropped image to obtain a processed image;
[0093] Extraction unit 4, used to extract the processed image through a dot fitting function to obtain a dot set;
[0094] A selection unit 5, used for selecting a night vision light that meets the area standard from the set of dots;
[0095] A comparison unit 6, used to compare the number of night vision lights that meet the area standard with the number of night vision lights of the camera to be tested to obtain a test result;
[0096] The determination unit 7 is used to determine whether the camera to be tested is qualified according to the detection result.
[0097] Furthermore, the selection unit 5 is specifically configured to repeatedly perform the following processing until each dot is traversed:
[0098] Select any point from the point set and use the selected point as the current point;
[0099] Calculate the area of the current dot to obtain the area corresponding to the current dot;
[0100] If the area corresponding to the current dot exceeds the preset area threshold, the current dot is a night vision light that meets the area standard.
[0101] The embodiment of the present invention provides a universal night vision detection device for a camera, which is applied to a host computer and includes: when a camera to be tested is placed on a detection fixture, a connection is established with the camera to be tested; a picture sent by an industrial vision camera is received, and the picture is cropped according to the night vision light area of the camera to be tested to obtain a cropped picture; the cropped picture is processed to obtain a processed picture; the processed picture is extracted through a dot fitting function to obtain a dot set; a night vision light that meets the area standard is selected from the dot set; the number of night vision lights that meet the area standard is compared with the number of night vision lights of the camera to be tested to obtain a detection result; and whether the camera to be tested is qualified according to the detection result can be determined; the accuracy and efficiency of the detection can be improved, the stability of the product detection results can be ensured, and the labor cost can be reduced.
[0102] An embodiment of the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the universal night vision detection method for the camera provided in the above embodiment are implemented.
[0103] An embodiment of the present invention also provides a computer-readable medium having a non-volatile program code executable by a processor, wherein a computer program is stored on the computer-readable medium, and when the computer program is executed by the processor, the steps of the universal night vision detection method for the camera of the above embodiment are executed.
[0104] The computer program product provided in the embodiment of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method described in the previous method embodiment. The specific implementation can be found in the method embodiment and will not be repeated here.
[0105] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0106] In addition, in the description of the embodiments of the present invention, 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 an indirect connection 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.
[0107] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0108] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the 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 limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0109] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A universal detection method for night vision of a camera, characterized in that: Applied to a host computer, the method includes: When the camera to be tested is placed on the detection fixture, a connection is established with the camera to be tested; Receive a picture sent by an industrial vision camera, and crop the picture according to the night vision light area of the camera to be tested to obtain a cropped picture; Processing the cropped image to obtain a processed image; Extracting the processed image through a dot fitting function to obtain a dot set; Selecting a night vision light that meets the area standard from the set of dots; Compare the number of night vision lights that meet the area standard with the number of night vision lights of the camera to be tested to obtain a test result; Determine whether the camera to be tested is qualified according to the detection result.
2. The universal night vision detection method of a camera according to claim 1, characterized in that: Selecting a night vision light that meets the area standard from the set of dots includes repeatedly performing the following process until each of the dots is traversed: Select any point from the point set, and use the selected point as the current point; Calculating the area of the current point to obtain the area corresponding to the current point; If the area corresponding to the current dot exceeds the preset area threshold, the current dot is the night vision light that meets the area standard.
3. The universal night vision detection method of a camera according to claim 1, characterized in that: Processing the cropped image to obtain a processed image includes: The cropped image is subjected to noise reduction processing, grayscale processing, binarization processing, noise corrosion processing and bright spot expansion processing to obtain the processed image.
4. The universal night vision detection method of a camera according to claim 1, characterized in that: Determining whether the camera to be tested is qualified according to the test result includes: If the number of night vision lights that meet the area standard is consistent with the number of night vision lights of the camera to be tested, the camera to be tested is qualified; If the number of night vision lights that meet the area standard is inconsistent with the number of night vision lights of the camera to be tested, the camera to be tested is unqualified.
5. The universal night vision detection method of a camera according to claim 1, characterized in that: After establishing a connection with the camera to be tested, the method further includes: Sending a control instruction to the camera to be tested, so that the camera to be tested turns on the night vision light according to the control instruction; Receive the reply instruction information sent by the camera to be tested.
6. The universal night vision detection method of a camera according to claim 1, characterized in that: The method further comprises: Reading memory information of the camera, wherein the memory information includes production information; Binding the production information with the test result to obtain binding information; The binding information is uploaded to the cloud.
7. A universal night vision detection device for a camera, characterized in that: Applied to a host computer, the device comprises: A connection unit, used to establish a connection with the camera to be tested when the camera to be tested is placed on the detection fixture; A picture information receiving unit, used for receiving a picture sent by an industrial vision camera, and cropping the picture according to the night vision light area of the camera to be tested to obtain a cropped picture; A processing unit, used for processing the cropped image to obtain a processed image; An extraction unit, used to extract the processed image through a dot fitting function to obtain a dot set; A selection unit, used for selecting a night vision light that meets the area standard from the set of dots; A comparison unit, used for comparing the number of night vision lights that meet the area standard with the number of night vision lights of the camera to be tested to obtain a test result; A determination unit is used to determine whether the camera to be tested is qualified according to the detection result.
8. The universal night vision detection device for a camera according to claim 7, characterized in that: The selection unit is specifically used to repeatedly perform the following processing until each of the dots is traversed: Select any point from the point set, and use the selected point as the current point; Calculating the area of the current point to obtain the area corresponding to the current point; If the area corresponding to the current dot exceeds the preset area threshold, the current dot is the night vision light that meets the area standard.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
10. A computer readable medium having a non-volatile program code executable by a processor, characterized in that: The program code enables the processor to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Vision-based LED chip quality detection method
CN110490847A
Night vision camera test system
KR101062619B1