CN113793339A - DOE (design of element) shedding degree detection method, electronic device and storage medium - Google Patents

DOE (design of element) shedding degree detection method, electronic device and storage medium Download PDF

Info

Publication number
CN113793339A
CN113793339A CN202111366674.XA CN202111366674A CN113793339A CN 113793339 A CN113793339 A CN 113793339A CN 202111366674 A CN202111366674 A CN 202111366674A CN 113793339 A CN113793339 A CN 113793339A
Authority
CN
China
Prior art keywords
target
doe
area
speckle pattern
camera
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111366674.XA
Other languages
Chinese (zh)
Other versions
CN113793339B (en
Inventor
刘祺昌
户磊
化雪诚
王海彬
李东洋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hefei Dilusense Technology Co Ltd
Original Assignee
Beijing Dilusense Technology Co Ltd
Hefei Dilusense Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dilusense Technology Co Ltd, Hefei Dilusense Technology Co Ltd filed Critical Beijing Dilusense Technology Co Ltd
Priority to CN202111366674.XA priority Critical patent/CN113793339B/en
Publication of CN113793339A publication Critical patent/CN113793339A/en
Application granted granted Critical
Publication of CN113793339B publication Critical patent/CN113793339B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)
  • Measurement Of Optical Distance (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

The embodiment of the application relates to the technical field of machine vision, and discloses a DOE (DOE shedding degree) detection method, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a speckle pattern obtained by shooting a target plane by a camera to be detected, and filtering the speckle pattern; carrying out local binarization on the filtered speckle pattern according to a preset window size to obtain a binarized speckle pattern; determining a first target area and a second target area in the binarized speckle pattern, and determining the number of the first target areas, the area of each first target area, the number of the second target areas and the area of each second target area; according to the number of the first target regions, the area of each first target region, the number of the second target regions and the area of each second target region, the falling degree of the DOE of the camera to be detected is determined, a basis is provided for factory return and repair of the structured light camera, and the factory return and repair efficiency of the structured light camera is remarkably improved.

Description

DOE (design of element) shedding degree detection method, electronic device and storage medium
Technical Field
The embodiment of the application relates to the technical field of machine vision, in particular to a DOE (DOE shedding degree) detection method, electronic equipment and a storage medium.
Background
The structured light camera is a camera which obtains depth data by emitting an active infrared light source and calculating, wherein a Diffraction Optical Element (DOE) is an important component of a laser projector in the structured light camera, laser emitted by the infrared light source passes through a transmitting cavity surface and is then diffracted by the DOE to be dispersed into various speckles to be projected on an object, the speckles add texture feature points for the object, so that features can be conveniently extracted from a shot image during image processing, the DOE is important for the functionality of the structured light camera, however, the DOE is easily influenced by factors such as external environment change, device aging and daily collision, the DOE has a risk of falling off, and when the DOE falls off, high-intensity infrared laser can damage human eyes, so whether the DOE falls off or not in time is necessary to detect.
For DOE falling detection, laser coding patterns projected by structured light to a human face can be collected, pattern blocks with the same size are extracted from the middle position and the periphery of the laser coding patterns, the pattern blocks are realized by calculating the difference value of the brightness mean values of the middle position pattern blocks and the four adjacent domain pattern blocks, and when the difference value meets a certain threshold value, DOE falling is considered.
However, the DOE shedding detection method can only detect that the DOE is shed or the DOE is not shed, and cannot measure and judge the degree to which the DOE is shed, so that a basis cannot be provided for returning the structured light camera to the factory for rework, the returning efficiency of the structured light camera to the factory is very low, and poor use experience is brought to users.
Disclosure of Invention
An object of the embodiment of the application is to provide a DOE degree of shedding detection method, electronic equipment and storage medium, can accurately, finely determine the concrete degree that DOE drops, provide the basis for returning factory of structured light camera and reprocess, show that the efficiency that structured light camera returned factory and reprocessed is promoted.
In order to solve the above technical problem, an embodiment of the present application provides a DOE shedding degree detection method, including the following steps: acquiring a speckle pattern obtained by shooting a target plane by a camera to be detected, and filtering the speckle pattern; carrying out local binarization on the filtered speckle pattern according to a preset window size to obtain a binarized speckle pattern; determining a first target area and a second target area in the binarized speckle pattern, and determining the number of the first target areas, the area of each first target area, the number of the second target areas and the area of each second target area; the gray value of each point in the first target area is 255, and the gray value of each point in the second target area is 0; and determining the falling degree of the diffractive optical element DOE of the camera to be detected according to the number of the first target regions, the area of each first target region, the number of the second target regions and the area of each second target region.
An embodiment of the present application further provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the DOE release detection method described above.
Embodiments of the present application further provide a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the DOE shedding degree detection method described above is implemented.
The DOE shedding degree detection method, the electronic device, and the computer-readable storage medium provided in the embodiments of the present application, first obtain a speckle pattern obtained by shooting a target plane by a camera to be detected, filter the speckle pattern, perform local binarization on the filtered speckle pattern according to a preset window size to obtain a binarized speckle pattern, determine a first target region and a second target region in the binarized speckle pattern, determine the number of the first target regions, the area of each first target region, the number of the second target regions, and the area of each second target region, and finally determine the shedding degree of the DOE of the camera to be detected according to the number of the first target regions, the area of each first target region, the number of the second target regions, and the area of each second target region, in consideration of whether the current DOE shedding detection technology can only determine the DOE of the camera to be detected to shed or not, the DOE of the camera to be detected can not be accurately judged to what degree the DOE falls off, the DOE is combined with the characteristics that the DOE images differently under the falling condition of different degrees, the falling degree of the DOE of the camera is determined by determining a first target region in a speckle pattern, namely the number and the area of a bright spot region with the pixel gray value of 255, and a second target region, namely the number and the area of a dark spot region with the pixel gray value of 0, the specific falling degree of the DOE can be accurately and finely determined, the basis is provided for the factory returning and repairing of the structured light camera, and the factory returning and repairing efficiency of the structured light camera is remarkably improved.
In addition, the determining the falling-off degree of the diffractive optical element DOE of the camera to be detected according to the number of the first target regions, the area of each of the first target regions, the number of the second target regions and the area of each of the second target regions includes: if the number of the first target regions is equal to 1 and the area of the first target regions is within a first preset range, determining that the DOE of the camera to be detected completely falls off; if the number of the first target areas is not equal to 1 or the area of the first target areas is outside the first preset range, judging whether the number of the second target areas is within a second preset range; if the number of the second target areas is within a second preset range, determining the total area of the second target areas according to the area of each second target area; judging whether the total area is within a third preset range; if the total area is within a third preset range, determining the falling degree of the DOE of the camera to be detected according to each second target area; if the number of the second target areas is outside the second preset range or the total area is outside the third preset range, determining that the DOE of the camera to be detected DOEs not fall off, considering that under normal conditions, no bright "bright spots" exist in the speckle pattern, namely, no dark "dark spots" should exist in the first target area, namely, the second target area, when a bright spot with a large area appears in the speckle pattern, the DOE completely falls off, when the DOE partially falls off, namely, the angle falls off, the "dark spot" area begins to appear in the speckle pattern, at this time, the server determines the falling-off degree of the camera to be detected according to each second target area, and under the conditions except the above conditions, even if the "bright spots" and the dark spots "appear in the speckle pattern, the server can only be caused by the light environment, and can determine that the DOE of the camera to be detected DOEs not fall off, the accuracy of DOE shedding degree detection is further improved.
In addition, the determining the falling-off degree of the DOE of the camera to be detected according to each second target region includes: according to the position of each second target area in the binarized speckle pattern, taking the second target area closest to the center of the binarized speckle pattern as a reference second target area; acquiring the height of the row in which the center of the reference second target area is located as the height of the reference second target area; determining the falling degree of the DOE of the camera to be detected according to the height of the reference second target region and a preset corresponding relation; the preset corresponding relationship is a corresponding relationship between the height of the reference second target region and the falling degree of the DOE of the camera to be detected, the higher the height of the reference second target region is, the greater the falling degree of the DOE of the camera to be detected is, when the DOE partially falls off, i.e., an angle falls off, a 'dark spot' region begins to appear in the speckle pattern, the greater the falling angle is, the higher the height of the 'dark spot' region is, the reference second target region is determined in the embodiment, only the height of the reference second target region is obtained for judgment, the speed of detecting the falling degree of the DOE can be increased, and detection resources are saved.
In addition, the obtaining of the binarized speckle pattern according to the assigned points to be assigned includes: sequentially taking each point to be assigned after assignment as a point to be filled, and searching for a preset length in each neighborhood direction of the point to be filled by taking the point to be filled as a center; determining the number of neighborhood directions of the points which are searched to have the same gray value as the point to be filled; if the number of the neighborhood directions is smaller than a second preset threshold, assigning the gray value of the point to be filled as a contrast value of the gray value of the point to be filled; if the number of the neighborhood directions is greater than or equal to a second preset threshold, keeping the gray value of the point to be filled unchanged; the binarized speckle pattern is obtained according to the assigned gray value of each point to be filled, a plurality of gaps often exist in the locally binarized speckle pattern, and the gaps are filled in the method based on neighborhood search, so that the accuracy of judging the DOE shedding degree of the camera to be detected subsequently can be further improved.
Additionally, the filtering the speckle pattern comprises: obtaining a depth map corresponding to the speckle pattern; the depth map is obtained by shooting the target plane by the camera to be detected; determining the number of the hole points in the depth map; the depth value of the void point is smaller than or equal to a third preset threshold value; judging whether the number of the cavity points is larger than a fourth preset threshold value or not; if the number of the void points is larger than a fourth preset threshold value, filtering the speckle pattern; if the number of the hole points is smaller than or equal to a fourth preset threshold value, it is determined that the DOE of the camera to be detected DOEs not fall off, and it is considered that the speckle pattern changes when the DOE falls off, and the change can cause depth recovery failure, that is, a large number of holes appear in the depth map, and the detection of the hole rate is relatively simple.
In addition, the acquiring of the speckle pattern obtained by shooting the target plane by the camera to be detected includes: the speckle pattern obtained by shooting the target plane at a plurality of distances by the camera to be detected is obtained, namely, comprehensive judgment is carried out according to a plurality of speckle patterns, and the accuracy of DOE (DOE-shedding degree) judgment of the camera to be detected can be further improved.
Drawings
One or more embodiments are illustrated by the corresponding figures in the drawings, which are not meant to be limiting.
FIG. 1 is a first flowchart of a DOE release detection method according to an embodiment of the present application;
fig. 2 is a flowchart for determining the falling-off degree of the DOE of the camera to be detected according to the number of the first target regions, the area of each first target region, the number of the second target regions and the area of each second target region, in an embodiment according to the application;
FIG. 3 is a speckle pattern of a camera shot with a non-shedding DOE provided according to an embodiment of the present application;
FIG. 4 is a speckle pattern of a camera shot with a completely broken-out DOE provided according to an embodiment of the present application;
FIG. 5 is a flow chart for determining a degree of separation of the DOE of the camera to be inspected based on the second target regions, in accordance with embodiments of the present application;
FIG. 6 is a speckle pattern taken with a camera with a 30 ° missing DOE according to one embodiment of the present application;
FIG. 7 is a speckle pattern taken with a camera with a DOE broken away by 50 provided according to an embodiment of the present application;
FIG. 8 is a flowchart illustrating local binarization of a filtered speckle pattern according to a preset window size to obtain a binarized speckle pattern according to an embodiment of the present application;
FIG. 9 is a flowchart illustrating obtaining a binarized speckle pattern according to assigned gray values of points to be assigned according to an embodiment of the present application;
FIG. 10 is a second flowchart of a DOE release detection method according to another embodiment of the present application;
fig. 11 is a schematic structural diagram of an electronic device according to another embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present application clearer, the embodiments of the present application will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that in the examples of the present application, numerous technical details are set forth in order to provide a better understanding of the present application. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments. The following embodiments are divided for convenience of description, and should not constitute any limitation to the specific implementation manner of the present application, and the embodiments may be mutually incorporated and referred to without contradiction.
An embodiment of the present application relates to a DOE shedding degree detection method, which is applied to an electronic device, where the electronic device may be a terminal or a server, and the electronic device in this embodiment and the following embodiments are all described by taking the server as an example.
The specific process of the DOE shedding detection method of this embodiment may be shown in fig. 1, and includes:
step 101, obtaining a speckle pattern obtained by shooting a target plane by a camera to be detected, and filtering the speckle pattern.
Specifically, when the DOE shedding degree is determined to be required to be detected, the server may obtain a speckle pattern obtained by shooting a target plane by a camera to be detected, the target plane may be a plane with good reflection capability, such as a wall surface, a plastic plate, a partition plate, a curtain, and the like, and a distance between the camera to be detected and the target plane is within a preset distance range, where the preset distance range may be set by a person skilled in the art according to actual needs, and the embodiment of the present application is not specifically limited to this.
In the specific implementation, some salt and pepper noises often exist in the speckle pattern obtained by shooting the target plane by the camera to be detected acquired by the server, the salt and pepper noises are also called pulse noises, and are bright spots or dark spots which randomly appear, for example, dark pixel points exist in a bright area or bright pixel points exist in a dark area, and the occurrence of the salt and pepper noises can cause adverse effects on detection of the DOE falling degree.
In one example, the filtering of the speckle pattern by the server may include, but is not limited to, any combination of the following: gaussian filtering, median filtering, mean filtering, bilateral filtering, etc.
And 102, carrying out local binarization on the filtered speckle pattern according to the preset window size to obtain a binarized speckle pattern.
Specifically, after the server filters the speckle pattern to obtain the filtered speckle pattern, local binarization processing can be performed on the filtered speckle pattern according to a preset window size to obtain a binarized speckle pattern, and the characteristics of the speckle pattern can be better analyzed by performing the local binarization processing to more accurately segment bright and dark areas in the speckle pattern.
In one example, the server may traverse the filtered speckle pattern, with a current pixel as a center, calculate a gray value threshold for local binarization according to a gray value of each pixel within a preset window size, and perform binarization assignment on the current pixel according to the calculated gray value threshold, thereby completing binarization assignment on the entire filtered speckle pattern to obtain a binarized speckle pattern, where a gray value of each point in the binarized speckle pattern is 0 or 255.
In one example, the server may calculate the gray value threshold for local binarization according to the gray value of each pixel point within a preset window size by using a bimodal method, a p-parameter method, a large law method, a maximum entropy threshold method, an iterative method, and the like.
In another example, the server may also directly perform global binarization on the filtered speckle pattern to obtain a binarized speckle pattern, which may save time in the binarization process, thereby increasing the speed of DOE shedding degree detection.
And 103, determining a first target area and a second target area in the binarized speckle pattern, and determining the number of the first target areas, the area of each first target area, the number of the second target areas and the area of each second target area.
In a specific implementation, after the server obtains the binarized speckle pattern, the server may perform connected region detection on the binarized speckle pattern by using a preset connected region detection algorithm, determine a first target region and a second target region in the binarized speckle pattern, where the gray values of all points in the first target region are 255 and the gray values of all points in the second target region are 0, and after the server determines the first target region and the second target region in the binarized speckle pattern, the server may count the number of the first target regions and the number of the second target regions, and calculate the areas of all the first target regions and the areas of all the second target regions.
And 104, determining the falling degree of the DOE of the camera to be detected according to the number of the first target regions, the area of each first target region, the number of the second target regions and the area of each second target region.
Specifically, considering that the most obvious characteristic of DOE shedding reflected in the speckle pattern is that a "bright spot" region and a "dark spot" region occur, the "bright spot" region is a region with a gray value of 255, that is, a first target region determined by the present application, the "dark spot" region is a region with a gray value of 0, that is, a second target region determined by the present application, and distribution characteristics such as the number and the area of the "bright spot" region and the "dark spot" region are different in DOE shedding degree, the server may determine the shedding degree of the DOE of the camera to be detected according to the number of the first target regions, the area of each first target region, the number of the second target regions, and the area of each second target region, thereby providing a basis for factory return repair of the structured light camera, and significantly improving the factory return efficiency of the structured light camera.
In one example, the 'bright spot' regions and the 'dark spot' regions where the DOE falls off are regularly and periodically distributed, and the server can compare the number of the first target regions, the area of each first target region, the number of the second target regions, the area of each second target region, and a preset distribution template, so that the falling degree of the DOE of the camera to be detected is determined according to the matched distribution template.
In this embodiment, the server obtains a speckle pattern obtained by shooting a target plane by a camera to be detected, filters the speckle pattern, performs local binarization on the filtered speckle pattern according to a preset window size to obtain a binarized speckle pattern, determines a first target region and a second target region in the binarized speckle pattern, determines the number of the first target regions, the area of each first target region, the number of the second target regions and the area of each second target region, and determines the falling degree of the camera to be detected according to the number of the first target regions, the area of each first target region, the number of the second target regions and the area of each second target region, considering that the existing DOE falling detection technology can only determine whether the DOE of the camera to be detected falls or not, and cannot accurately determine the degree to which the DOE of the camera to be detected falls, the different characteristics of DOE formation of image under the condition of not equidimension drops are combined to this embodiment, through confirming first target area in the speckle pattern, pixel grey scale value is the regional number and the area of "bright spot" of 255 promptly, and the second target area, the mode of the regional number and the area of "dark spot" that pixel grey scale value is 0 promptly, confirm the degree of dropping of the DOE of detecting the camera, can be accurate, confirm the concrete degree that DOE drops meticulously, the basis is provided for the factory return of structured light camera is reprocessed, the efficiency of factory return of structured light camera is obviously promoted.
In an embodiment, when the server obtains the speckle pattern obtained by shooting the target plane by the camera to be detected, the speckle pattern obtained by shooting the target plane by the camera to be detected at a plurality of distances can be obtained, and the DOE shedding degree detection is performed by using the speckle pattern obtained by shooting the target plane at the plurality of distances, so that the probability of erroneous judgment can be further reduced, and the robustness of the detection process can be improved.
In an embodiment, the determining, by the server, the falling-off degree of the DOE of the camera to be detected according to the number of the first target regions, the area of each first target region, the number of the second target regions, and the area of each second target region may be implemented by the steps shown in fig. 2, and specifically includes:
step 201, judging whether the number of the first target areas is equal to 1, if so, executing step 202, otherwise, executing step 204.
Step 202, determining whether the area of the first target region is within a first preset range, if so, executing step 203, otherwise, executing step 204.
And step 203, determining that the DOE of the camera to be detected is completely fallen off.
In a specific implementation, considering that under a normal condition, as shown in fig. 3, a particularly bright "bright spot" region and a particularly dark "dark spot" region should not exist in a speckle pattern, when the "bright spot" region and the "dark spot" region appear in the speckle pattern, the DOE of the camera to be detected is likely to fall off, and in particular, as shown in fig. 4, when only one "bright spot" region exists in the speckle pattern and the area of the "bright spot" region is relatively large, it may be determined that the DOE of the camera to be detected completely falls off, so after determining the number of the first target regions, the area of each first target region, the number of the second target regions and the area of each second target region, the server may first determine whether the number of the first target regions is equal to 1, and whether the area of the first target regions is within a first preset range, if the number of the first target regions is equal to 1, and the area of the first target region is within a first preset range, and the server directly determines that the DOE of the camera to be detected completely falls off, wherein the first preset range can be set by a person skilled in the art according to actual needs, and the embodiment of the application is not specifically limited to this.
In one example, the DOE of the camera to be inspected completely falls off, equivalent to a 90 ° DOE fall off angle of the camera to be inspected.
In a specific implementation, if the server determines that the number of the first target regions is not equal to 1, or the area of the first target regions is outside a first preset range, the DOE of the camera to be detected may partially fall off, or the camera to be detected is only affected by an abnormal light environment and the DOE DOEs not fall off, the server may continue to perform detection according to the number of the second target regions and the area of each second target region.
Step 204, determining whether the number of the second target areas is within a second preset range, if so, executing step 205, otherwise, executing step 208.
Step 205, determining the total area of the second target regions according to the area of each second target region.
In a specific implementation, considering that when the DOE of the camera to be detected partially falls off, that is, when the DOE partially falls off at an angle, the distribution of the "dark spot" regions in the speckle pattern exhibits periodicity and a certain rule, after the server determines that the number of the first target regions is not equal to 1 or the area of the first target regions is outside the first preset range, the server continues to determine whether the number of the second target regions is within the second preset range, if the server determines that the number of the second target regions is within the second preset range, it indicates that the distribution of the "dark spot" regions in the speckle pattern has the certain rule, that is, the DOE of the camera to be detected may partially fall off, the server determines the total area of the second target regions according to the area of each second target region, performs further determination according to the total area, if the server determines that the number of the second target regions is outside the second preset range, it is explained that the "dark spot" region in the speckle pattern is not caused by the DOE of the camera to be detected falling off, and the server directly determines that the DOE of the camera to be detected DOEs not fall off, where the second preset range may be set by a person skilled in the art according to actual needs, and the embodiment of the present application is not specifically limited to this.
Step 206, determining whether the total area of the second target region is within a third preset range, if so, executing step 207, otherwise, executing step 208.
And step 207, determining the falling degree of the DOE of the camera to be detected according to each second target region.
And step 208, determining that the DOE of the camera to be detected DOEs not fall off.
In specific implementation, after the server determines the total area of the second target region, whether the total area of the second target region is within a third preset range or not can be judged, if the server determines that the total area of the second target region is within the third preset range, it is described that a "bright spot" region and a "dark spot" region in a speckle pattern are really caused by the falling of the DOE part of the camera to be detected, and at this time, the server can specifically determine the falling degree, such as the falling angle and the like, of the DOE of the camera to be detected according to each second target region; if the server determines that the total area of the second target region is outside the third preset range, it is described that the "bright spot" region and the "dark spot" region in the speckle pattern are caused by external environment light, and the server directly determines that the DOE of the camera to be detected DOEs not fall off, where the third preset range may be set by a person skilled in the art according to actual needs, and the embodiment of the present application is not specifically limited to this.
In this embodiment, the determining, according to the number of the first target regions, the area of each of the first target regions, the number of the second target regions, and the area of each of the second target regions, a falling-off degree of the diffractive optical element DOE of the camera to be detected includes: if the number of the first target regions is equal to 1 and the area of the first target regions is within a first preset range, determining that the DOE of the camera to be detected completely falls off; if the number of the first target areas is not equal to 1 or the area of the first target areas is outside the first preset range, judging whether the number of the second target areas is within a second preset range; if the number of the second target areas is within a second preset range, determining the total area of the second target areas according to the area of each second target area; judging whether the total area is within a third preset range; if the total area is within a third preset range, determining the falling degree of the DOE of the camera to be detected according to each second target area; if the number of the second target regions is outside a second preset range, or the total area is outside a third preset range, it is determined that the DOE of the camera to be detected DOEs not fall off, so that the DOE falling degree detection accuracy is further improved.
In an embodiment, the determining, by the server, the falling-off degree of the DOE of the camera to be detected according to each second target region may be implemented by the steps shown in fig. 5, which specifically include:
and step 301, according to the position of each second target area in the binarized speckle pattern, using the second target area closest to the center of the binarized speckle pattern as a reference second target area.
Step 302, the height of the row where the center of the reference second target area is located is obtained as the height of the reference second target area.
And step 303, determining the falling degree of the DOE of the camera to be detected according to the height of the reference second target region and a preset corresponding relation.
Specifically, when the DOE is partially peeled off, that is, has a peeling angle, the "dark spot" region in the speckle pattern changes, and as the DOE peeling angle increases, the "dark spot" region gradually becomes higher, as shown in fig. 6 and 7, fig. 6 is the speckle pattern captured by the camera with the DOE peeled off by 30 °, fig. 7 is the speckle pattern captured by the camera with the DOE peeled off by 50 °, and the height of the "dark spot" region in fig. 7 is higher than that of the "dark spot" region in fig. 6, so that the present embodiment can determine the peeling degree of the DOE of the camera to be detected based on the height of each second target region.
In a specific implementation, the server may use, according to the position of each second target region in the binarized speckle pattern, the second target region closest to the center of the binarized speckle pattern as a reference second target region, then obtain the height of the row where the center of the reference second target region is located as the height of the reference second target region, and finally determine the falling degree of the DOE of the camera to be detected according to the height of the reference second target region and a preset corresponding relationship, where the preset corresponding relationship is the corresponding relationship between the height of the reference second target region and the falling degree of the DOE of the camera to be detected, and the higher the height of the reference second target region is, the larger the falling degree of the corresponding DOE of the camera to be detected is, the embodiment determines the reference second target region first, and only obtains the height of the reference second target region to determine the falling degree of the DOE, the DOE falling degree detection speed can be increased, and detection resources are saved.
In an embodiment, the server performs local binarization on the filtered speckle pattern according to a preset window size to obtain a binarized speckle pattern, which can be implemented by the steps shown in fig. 8, and specifically includes:
and step 401, sequentially taking each pixel point of the filtered speckle pattern as a point to be assigned, and calculating a gray average value in a preset window size by taking the point to be assigned as a center.
Step 402, judging whether the difference value between the gray value of the point to be assigned and the average value of the gray value is smaller than a first preset threshold value, if so, executing step 403, otherwise, executing step 404.
In step 403, the gray value of the point to be assigned is assigned to 0.
In step 404, the gray value of the point to be assigned is assigned to 255.
In a specific implementation, when the server performs local binarization on the filtered speckle pattern according to a preset window size, the server may traverse pixel points of the filtered speckle pattern, sequentially use each pixel point of the filtered speckle pattern as a to-be-assigned value point, center on a current to-be-assigned point, calculate a gray level mean value of each pixel point within the preset window size, if a difference value between a gray level value of the current to-be-assigned value point and the gray level mean value is smaller than a first preset threshold, assign a gray level value of the to-be-assigned value point to 0, and if the difference value between the gray level value of the current to-be-assigned value point and the gray level mean value is greater than or equal to the first preset threshold, assign the gray level value of the to-assigned value point to 255, where the first preset threshold may be set by a person skilled in the art according to actual needs, and this embodiment of the present application is not specifically limited thereto.
In one example, the server may perform binarization assignment on the to-be-assigned value points by the following formula:
Figure 816235DEST_PATH_IMAGE001
in the formula, I is the gray value of the point to be assigned,
Figure 998954DEST_PATH_IMAGE002
is the mean value of the gray levels, k1And I' is a first preset threshold value, and is the gray value of the assigned point to be assigned.
And 405, obtaining a binary speckle pattern according to the assigned gray value of each point to be assigned.
Specifically, after the server finishes binary assignment of each point to be assigned, a binary speckle pattern can be obtained according to the assigned gray value of each point to be assigned.
In one example, the server obtains the binarized speckle pattern according to the assigned gray values of the points to be assigned, and the binarized speckle pattern can be realized through the steps shown in fig. 9, and specifically includes:
and step 501, sequentially taking each point to be assigned after assignment as a point to be filled, and searching for a preset length in each neighborhood direction of the point to be filled by taking the point to be filled as a center.
Step 502, determining the number of neighborhood directions of the points searched to have the same gray value as the point to be filled.
In the specific implementation, a lot of "gaps" often exist in the speckle pattern after the local binarization, and the "gaps" cause the originally complete "bright spot" area or "dark spot" area to be cleaved, in this embodiment, the "gaps" may be filled, the server sequentially uses each point to be assigned after the assignment as a point to be filled, and searches for a preset length in each neighborhood direction of the point to be filled with taking the point to be filled as a center, and determines the number of neighborhood directions in which the point having the same gray value as that of the point to be filled is searched.
In one example, the server may perform top, bottom, left, and right four-neighbor domain searches centered on the point to be filled.
In one example, the server may perform eight neighborhood searches, top, bottom, left, right, top left, bottom left, top right, and bottom right, centered on the point to be filled.
Step 503, determining whether the number of the neighborhood directions is smaller than a second preset threshold, if so, executing step 504, otherwise, executing step 505.
Step 504, assigning the gray value of the point to be filled as the opposite value of the gray value of the point to be filled.
And 505, keeping the gray value of the point to be filled unchanged.
Specifically, after determining that the number of neighborhood directions of the points which are the same as the gray value of the point to be filled is searched, the server can judge whether the number of the neighborhood directions is smaller than a second preset threshold, if the number of the neighborhood directions is judged to be smaller than the second preset threshold by the server, the point to be filled is a pixel point located in a gap, the server assigns the gray value of the point to be filled to be an opposite value of the gray value of the point to be filled, namely if the gray value of the point to be filled is 0, the server assigns the gray value of the point to be filled to be 255, and if the gray value of the point to be filled is 0, the server assigns the gray value of the point to be filled to be 255; if the server determines that the number of the neighborhood directions is greater than or equal to a second preset threshold, it indicates that the point to be filled is not located in the "gap", and the server keeps the gray value of the point to be filled unchanged, where the second preset threshold may be set by a person skilled in the art according to actual needs, and the embodiment of the present application is not specifically limited to this.
And step 506, obtaining a binary speckle pattern according to the assigned gray value of each point to be filled.
Specifically, after the server completes filling (assignment) of each point to be filled, a binarized speckle pattern can be obtained according to the assigned gray value of each point to be filled, and in this embodiment, "gaps" in the speckle pattern are filled based on a neighborhood search mode, so that the accuracy of determining the DOE falling degree of a subsequent camera to be detected can be further improved.
Another embodiment of the present application relates to a DOE disengagement degree detection method, and the implementation details of the DOE disengagement degree detection method of the present embodiment are specifically described below, and the following are provided only for facilitating understanding of the implementation details, and are not necessary to implement the present solution, and a specific flow of the DOE disengagement degree detection method of the present embodiment may be as shown in fig. 10, and includes:
step 601, acquiring a speckle pattern and a depth pattern obtained by shooting a target plane by a camera to be detected.
Specifically, the server may obtain a speckle pattern obtained by shooting a target plane by the camera to be detected, and simultaneously obtain a depth map obtained by shooting the target plane by the camera to be detected, where the target plane may be a plane with good reflection capability, such as a wall surface, a plastic plate, a partition plate, a curtain, and the like, and a distance between the camera to be detected and the target plane is within a preset distance range, where the preset distance range may be set by a person skilled in the art according to actual needs, and the embodiment of the present application is not specifically limited to this.
Step 602, determining the number of the hole points in the depth map.
Specifically, after the server obtains a depth map obtained by shooting a target plane by a camera to be detected, the server may traverse the depth value of each pixel point in the depth map, and take the pixel point with the depth value less than or equal to a third preset threshold as a hole point.
In one example, the third preset threshold is 0, that is, the server takes the pixel point with the depth value of 0 as the hole point.
Step 603, determining whether the number of the hole points is greater than a fourth preset threshold, if so, executing step 604, otherwise, executing step 608.
Step 604, filtering the speckle pattern.
In specific implementation, after the server determines the number of the void points in the depth map, it may be determined whether the number of the void points is greater than a fourth preset threshold, if the number of the void points is greater than the fourth preset threshold, that is, the void rate of the depth map is too large, the DOE of the camera to be detected may fall off, the server may filter the speckle pattern, and continue detecting the falling degree of the DOE, where the fourth preset threshold may be set by a person skilled in the art according to actual needs, and the embodiment of the present application is not specifically limited to this.
And 605, performing local binarization on the filtered speckle pattern according to a preset window size to obtain a binarized speckle pattern.
Step 606, determining a first target area and a second target area in the binarized speckle pattern, and determining the number of the first target areas, the area of each first target area, the number of the second target areas and the area of each second target area.
Step 607, determining the falling degree of the DOE of the camera to be detected according to the number of the first target regions, the area of each first target region, the number of the second target regions and the area of each second target region.
Steps 605 to 607 are substantially the same as steps 102 to 104, and are not described herein again.
Step 608, determining that the DOE of the camera to be detected DOEs not fall off.
In specific implementation, after the server determines the number of the hole points in the depth map, whether the number of the hole points is greater than a fourth preset threshold value or not can be judged, and if the number of the hole points is less than or equal to the fourth preset threshold value, the server can directly determine that the DOE of the camera to be detected DOEs not fall off.
This embodiment, carry out the voidage that DOE drops the in-process of detecting and carry out the depth map earlier and detect, when considering that DOE drops, the speckle pattern can change, and this kind of change can lead to the depth to resume failure, appears a large amount of holes in the depth map promptly, and the voidage detects fairly simplely, if the voidage is very low, can directly judge the DOE who treats the detection camera and do not take place to drop, just can continue to detect when the voidage is very high, can practice thrift detection resources to reduce the probability of erroneous judgement.
The steps of the above methods are divided for clarity, and the implementation may be combined into one step or split some steps, and the steps are divided into multiple steps, so long as the same logical relationship is included, which are all within the protection scope of the present patent; it is within the scope of the patent to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.
Another embodiment of the present application relates to an electronic device, as shown in fig. 11, including: at least one processor 701; and a memory 702 communicatively coupled to the at least one processor 701; the memory 702 stores instructions executable by the at least one processor 701, and the instructions are executed by the at least one processor 701, so that the at least one processor 701 can execute the DOE-out degree detection method in the foregoing embodiments.
Where the memory and processor are connected by a bus, the bus may comprise any number of interconnected buses and bridges, the buses connecting together one or more of the various circuits of the processor and the memory. The bus may also connect various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor is transmitted over a wireless medium via an antenna, which further receives the data and transmits the data to the processor.
The processor is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And the memory may be used to store data used by the processor in performing operations.
Another embodiment of the present application relates to a computer-readable storage medium storing a computer program. The computer program realizes the above-described method embodiments when executed by a processor.
That is, as can be understood by those skilled in the art, all or part of the steps in the method for implementing the embodiments described above may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples for carrying out the present application, and that various changes in form and details may be made therein without departing from the spirit and scope of the present application in practice.

Claims (10)

1. A DOE (design object analysis) shedding degree detection method is characterized by comprising the following steps:
acquiring a speckle pattern obtained by shooting a target plane by a camera to be detected, and filtering the speckle pattern;
carrying out local binarization on the filtered speckle pattern according to a preset window size to obtain a binarized speckle pattern;
determining a first target area and a second target area in the binarized speckle pattern, and determining the number of the first target areas, the area of each first target area, the number of the second target areas and the area of each second target area; the gray value of each point in the first target area is 255, and the gray value of each point in the second target area is 0;
and determining the falling degree of the diffractive optical element DOE of the camera to be detected according to the number of the first target regions, the area of each first target region, the number of the second target regions and the area of each second target region.
2. The method for detecting the DOE shedding degree according to claim 1, wherein the determining the shedding degree of the DOE of the diffractive optical element of the camera to be detected according to the number of the first target regions, the area of each first target region, the number of the second target regions and the area of each second target region comprises:
if the number of the first target regions is equal to 1 and the area of the first target regions is within a first preset range, determining that the DOE of the camera to be detected completely falls off;
if the number of the first target areas is not equal to 1 or the area of the first target areas is outside the first preset range, judging whether the number of the second target areas is within a second preset range;
if the number of the second target areas is within a second preset range, determining the total area of the second target areas according to the area of each second target area;
judging whether the total area is within a third preset range;
if the total area is within a third preset range, determining the falling degree of the DOE of the camera to be detected according to each second target area;
and if the number of the second target regions is outside a second preset range, or the total area is outside a third preset range, determining that the DOE of the camera to be detected DOEs not fall off.
3. The DOE release degree detection method according to claim 2, wherein the determining the release degree of the DOE of the camera to be detected according to each of the second target regions includes:
according to the position of each second target area in the binarized speckle pattern, taking the second target area closest to the center of the binarized speckle pattern as a reference second target area;
acquiring the height of the row in which the center of the reference second target area is located as the height of the reference second target area;
determining the falling degree of the DOE of the camera to be detected according to the height of the reference second target region and a preset corresponding relation; the preset corresponding relation is the corresponding relation between the height of the reference second target region and the falling degree of the DOE of the camera to be detected, and the higher the height of the reference second target region is, the larger the falling degree of the DOE of the camera to be detected is.
4. The DOE (DOE shedding degree) detection method according to any one of claims 1 to 3, wherein the obtaining of the binarized speckle pattern by locally binarizing the filtered speckle pattern according to a preset window size comprises:
sequentially taking each pixel point of the filtered speckle pattern as a point to be assigned, and calculating the gray level mean value of each pixel point in the preset window size by taking the point to be assigned as the center;
if the difference value between the gray value of the point to be assigned and the gray average value is smaller than a first preset threshold value, assigning the gray value of the point to be assigned to be 0;
if the difference value between the gray value of the point to be assigned and the gray average value is larger than or equal to a first preset threshold value, assigning the gray value of the point to be assigned to be 255;
and obtaining the binary speckle pattern according to the assigned gray value of each point to be assigned.
5. The DOE (DOE) shedding degree detection method according to claim 4, wherein the obtaining of the binarized speckle pattern according to the assigned gray values of the points to be assigned comprises:
sequentially taking each point to be assigned after assignment as a point to be filled, and searching for a preset length in each neighborhood direction of the point to be filled by taking the point to be filled as a center;
determining the number of neighborhood directions of the points which are searched to have the same gray value as the point to be filled;
if the number of the neighborhood directions is smaller than a second preset threshold, assigning the gray value of the point to be filled as a contrast value of the gray value of the point to be filled;
if the number of the neighborhood directions is greater than or equal to a second preset threshold, keeping the gray value of the point to be filled unchanged;
and obtaining the binarized speckle pattern according to the assigned gray value of each point to be filled.
6. The DOE release degree detection method according to any one of the claims 1 to 3, wherein the filtering the speckle pattern comprises:
obtaining a depth map corresponding to the speckle pattern; the depth map is obtained by shooting the target plane by the camera to be detected;
determining the number of the hole points in the depth map; the depth value of the void point is smaller than or equal to a third preset threshold value;
judging whether the number of the cavity points is larger than a fourth preset threshold value or not;
if the number of the void points is larger than a fourth preset threshold value, filtering the speckle pattern;
and if the number of the cavity points is smaller than or equal to a fourth preset threshold value, determining that the DOE of the camera to be detected DOEs not fall off.
7. The DOE release detection method according to any one of the claims 1 to 3, wherein the filtering of the speckle pattern comprises any combination of the following: gaussian filtering, median filtering, mean filtering, bilateral filtering.
8. The DOE shedding degree detecting method according to any one of claims 1 to 3, wherein the acquiring of the speckle pattern obtained by shooting the target plane by the camera to be detected comprises:
and acquiring a speckle pattern which is obtained by shooting a target plane at a plurality of distances by a camera to be detected.
9. An electronic device, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the DOE out degree detection method of any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the DOE-shedding degree detection method according to any one of claims 1 to 8.
CN202111366674.XA 2021-11-18 2021-11-18 DOE (design of element) falling degree detection method, electronic equipment and storage medium Active CN113793339B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111366674.XA CN113793339B (en) 2021-11-18 2021-11-18 DOE (design of element) falling degree detection method, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111366674.XA CN113793339B (en) 2021-11-18 2021-11-18 DOE (design of element) falling degree detection method, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113793339A true CN113793339A (en) 2021-12-14
CN113793339B CN113793339B (en) 2022-08-26

Family

ID=78955378

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111366674.XA Active CN113793339B (en) 2021-11-18 2021-11-18 DOE (design of element) falling degree detection method, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113793339B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115760750A (en) * 2022-11-15 2023-03-07 北京的卢铭视科技有限公司 DOE quality detection method, system, electronic device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103345635A (en) * 2013-07-31 2013-10-09 哈尔滨工业大学 Online detection method for damages of optical component based on local signal intensity and improved two-dimensional histogram
CN108600740A (en) * 2018-04-28 2018-09-28 Oppo广东移动通信有限公司 Optical element detection method, device, electronic equipment and storage medium
CN109030495A (en) * 2018-06-26 2018-12-18 大连鉴影光学科技有限公司 A kind of optical element defect inspection method based on machine vision technique
WO2019086004A1 (en) * 2017-11-06 2019-05-09 深圳奥比中光科技有限公司 Structured light projection module, depth camera, and method for manufacturing structured light projection module
CN111986154A (en) * 2020-07-20 2020-11-24 深圳奥比中光科技有限公司 Optical information detection method, device and equipment
WO2021218196A1 (en) * 2020-04-29 2021-11-04 奥比中光科技集团股份有限公司 Depth imaging method and apparatus, and computer readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103345635A (en) * 2013-07-31 2013-10-09 哈尔滨工业大学 Online detection method for damages of optical component based on local signal intensity and improved two-dimensional histogram
WO2019086004A1 (en) * 2017-11-06 2019-05-09 深圳奥比中光科技有限公司 Structured light projection module, depth camera, and method for manufacturing structured light projection module
CN108600740A (en) * 2018-04-28 2018-09-28 Oppo广东移动通信有限公司 Optical element detection method, device, electronic equipment and storage medium
CN109030495A (en) * 2018-06-26 2018-12-18 大连鉴影光学科技有限公司 A kind of optical element defect inspection method based on machine vision technique
WO2021218196A1 (en) * 2020-04-29 2021-11-04 奥比中光科技集团股份有限公司 Depth imaging method and apparatus, and computer readable storage medium
CN111986154A (en) * 2020-07-20 2020-11-24 深圳奥比中光科技有限公司 Optical information detection method, device and equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
郭少琴等: "异形光学元件的数控加工技术", 《机电技术》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115760750A (en) * 2022-11-15 2023-03-07 北京的卢铭视科技有限公司 DOE quality detection method, system, electronic device and storage medium
CN115760750B (en) * 2022-11-15 2023-11-21 北京的卢铭视科技有限公司 DOE quality detection method, DOE quality detection system, DOE quality detection electronic device and storage medium

Also Published As

Publication number Publication date
CN113793339B (en) 2022-08-26

Similar Documents

Publication Publication Date Title
EP3499418B1 (en) Information processing apparatus, identification system, setting method, and program
JP6795993B2 (en) Shape measurement system, shape measurement device and shape measurement method
CN111582054B (en) Point cloud data processing method and device and obstacle detection method and device
CN111914665B (en) Face shielding detection method, device, equipment and storage medium
US20190011263A1 (en) Method and apparatus for determining spacecraft attitude by tracking stars
US20100014759A1 (en) Eye detecting device, eye detecting method, and program
CN111553946B (en) Method and device for removing ground point cloud and method and device for detecting obstacle
CN114255233B (en) Speckle pattern quality evaluation method and device, electronic device and storage medium
CN111354038B (en) Anchor detection method and device, electronic equipment and storage medium
CN113793339B (en) DOE (design of element) falling degree detection method, electronic equipment and storage medium
US11074704B2 (en) Error reduction of depth maps
US11016177B2 (en) Method for estimating object distance and electronic device
CN112102288A (en) Water body identification and water body change detection method, device, equipment and medium
CN110599479A (en) Monitoring area change detection method and device and storage medium
KR101927861B1 (en) Method and apparatus for removing noise based on mathematical morphology from geometric data of 3d space
CN113096067A (en) Method and system for determining surface wear of workpiece
CN114283089B (en) Jump acceleration based depth recovery method, electronic device, and storage medium
CN112884697B (en) Wafer map identification method and computer readable recording medium
CN113936316B (en) DOE (DOE-out-of-state) detection method, electronic device and computer-readable storage medium
US11282229B2 (en) Inspection apparatus
CN113936315B (en) DOE (design of optical element) shedding detection method and device, electronic equipment and storage medium
CN114529509B (en) Image noise evaluation method, electronic device, and computer-readable storage medium
CN115661131A (en) Image identification method and device, electronic equipment and storage medium
KR101519966B1 (en) Vision recognitiong method and system based on reference plate
CN116091450A (en) Obstacle detection method, obstacle detection device, obstacle detection equipment, obstacle detection medium and obstacle detection product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20220629

Address after: 230091 room 611-217, R & D center building, China (Hefei) international intelligent voice Industrial Park, 3333 Xiyou Road, high tech Zone, Hefei, Anhui Province

Applicant after: Hefei lushenshi Technology Co.,Ltd.

Address before: 100083 room 3032, North B, bungalow, building 2, A5 Xueyuan Road, Haidian District, Beijing

Applicant before: BEIJING DILUSENSE TECHNOLOGY CO.,LTD.

Applicant before: Hefei lushenshi Technology Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant