Disclosure of Invention
The application provides a method for removing protrusion interference noise in a depth image, which can effectively remove protrusion interference in the depth image in a depth image preprocessing stage aiming at protrusion drying noise which appears in a plurality of noise combination forms in the depth image.
The technical scheme adopted by the application for solving the technical problems is as follows:
a method of removing saliency interference noise in a depth image, comprising the steps of:
obtaining local information of a depth image according to a removal object, wherein the local information is valley point, peak point or gentle point information around a raised data point, and the removal object is a raised or depressed data point between the local information;
determining a removal interval of the local information according to the removal size;
determining a removal benchmark reference point according to the removal size in the removal interval;
calculating the distance from the protrusion data point to a benchmark reference point in the removal interval;
removing the salient data points from the depth image if the distance is greater than a removal threshold.
Optionally, the removal size is the number of the protruding data points in the local information;
the removal threshold is a preset distance between the protrusion data point and a benchmark reference point.
Optionally, the acquiring local information of the depth image includes:
acquiring local information of the depth image in a traversing mode on the depth image in a single direction of a longitudinal axis or a transverse axis;
or, the local information of the depth image is acquired by traversing the depth image in the two directions of the vertical axis and the horizontal axis.
Optionally, the method for removing the protrusion interference noise in the depth image further includes presetting a removal parameter;
the preset removing parameters comprise that the removing object, the removing size and the removing threshold value of the depth image are preset according to actual removing requirements.
Optionally, if the distance is greater than a removal threshold, removing the salient data points from the depth image further includes:
if the removal size is larger than the number of the protruding data points in the removal interval, removing all the protruding data points with the distance larger than a removal threshold value from the depth image;
and if the removal size is smaller than the number of the protruding data points in the removal interval, sequentially removing the protruding data points with the same number as the removal size from the depth image according to descending order of the protruding data points with the distance larger than the removal threshold.
Optionally, the method further includes:
taking the protrusion data points at the removed size position as datum reference points;
calculating the distance from the protrusion interference data point to a benchmark reference point in the removal interval;
if the distance is greater than a removal threshold, removing the salient data points from the depthwise image.
An apparatus for removing salient interference noise in a depth image, the apparatus comprising:
a depth image local information acquisition unit configured to acquire local information of a depth image according to a removal object, the local information being valley point, peak point, or gentle point information around a protrusion data point, the removal object being a protrusion or depression data point between the local information;
a removal interval determination unit configured to determine a removal interval of the local information according to a removal size;
a removal benchmark reference point determining unit, configured to determine a removal benchmark reference point according to the removal size in the removal interval;
and the calculation and protrusion interference removal unit is used for calculating the distance from the protrusion data points to the datum reference point in the removal interval, and removing the protrusion data points from the depth image if the distance is greater than a removal threshold value.
Optionally, the apparatus further comprises: and the removal parameter presetting unit is used for setting the removal object, the removal size and the removal threshold of the depth image according to the actual removal requirement.
A computer readable storage medium having stored thereon computer instructions which, when executed by a processor, carry out the steps of the method of removing salient interference noise in a depth image.
A terminal device, the terminal device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the one processor to cause the at least one processor to perform the method of removing protrusion interference noise in a depth image.
The technical scheme provided by the application comprises the following beneficial technical effects:
according to the method, local information of a depth image is obtained according to a removal object, a removal interval of the local information is determined according to the removal size, a removal reference point is determined in the removal interval according to the removal size, the distance from a protruding data point in the removal interval to the reference point is calculated, and if the distance is larger than a removal threshold value, the protruding data point is removed from the depth image. The method removes the protrusion points of protrusion interference points with different sizes or different forms according to different setting conditions of the removal size, the removal threshold and the removal object, and can ensure that useful data is not removed and the preprocessing effect is achieved while removing protrusion interference data points with different sizes or different forms. The method provided by the application can achieve different removal results by setting different removal parameters, can compatibly remove various noises, has strong pertinence, and solves the problem that the subsequent measurement and detection of the depth image data information and other related operations lose significance due to the fact that the protrusion interference noise cannot be effectively solved in the conventional denoising method.
Detailed Description
In order to make the technical solutions in the present application better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application; it is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, a flow chart of a method for removing protrusion interference noise in a depth image is shown.
The application provides a method for removing protrusion interference noise in a depth image, which comprises the following steps:
local information of the depth image is obtained according to a removal object, the local information is valley point, peak point or gentle point information around the protruding data points, and the removal object is a protruding or sinking data point between the local information.
And determining a removal interval of the local information according to the removal size.
For the concave or convex data points in the depth image, but the concave data points, the convex data points or both the concave data points and the convex data points are removed according to the actual requirement, the corresponding removal objects are removed through setting, and only the requirement is removed, so that the technical method in the application can remove the convex interference noise in the depth image and simultaneously remove the non-planar convex interference data points; in other conventional parlance, raised or depressed data points are also referred to as high and low objects, high objects being raised data points; low object, i.e., depressed data points; high and low objects: i.e., both include, high and low are directions relative to the projected data points; the size is relative to the number of the protruding points.
And determining a removal benchmark reference point according to the removal size in the removal interval.
The concave or convex data points are relative to the direction of the convex data points, where the magnitude of the removal is relative to the number of convex data points.
And calculating the distance from the protruding data point to the benchmark reference point in the removal interval.
And if the distance is greater than the removal threshold, removing the protruding data points from the depth image, otherwise, keeping the normal data points.
The acquiring local information of the depth image comprises:
acquiring local information of the depth image in a traversing mode on the depth image in a single direction of a longitudinal axis or a transverse axis; or, acquiring local information of the depth image in a traversal mode on the depth image in two directions of a longitudinal axis and a transverse axis; if the longitudinal axis or the transverse axis is selected, more protruding interference data points can be removed, and the method can be used for preprocessing the contour data to achieve the purpose of denoising.
The method for removing the protrusion interference noise in the depth image further comprises the steps of presetting removal parameters;
the preset removal parameters comprise the removal object, the removal size and the removal threshold of the depth image according to actual removal requirements;
the removal size is the number of the protruding data points in the local information;
the removal threshold is a preset distance between the protrusion data point and a benchmark reference point.
As described above, the removal object is the direction relative to the protrusion data points, the removal size is the number relative to the protrusion points, and the removal threshold is a value for determining the removal range set according to the removal object and the removal size, and is flexibly set according to actual needs. The technical scheme in the application can reach and get rid of the protruding interference point of different size or different forms through setting up different parameters of getting rid of, if select to get rid of the object and be the height object, then can all get rid of protruding interference point that is higher than and is less than surrounding data information, if there is great protruding interference in the image, then can get rid of through setting up great big parameter of getting rid of, and remove the threshold value and then confirmed the judgement condition whether the protruding point is got rid of.
As another embodiment, the method further includes: a removal interval is determined. Specifically, a removal interval of the protrusion interference data points is obtained according to the set removal size, and as long as the data points higher or lower than the surrounding information are assumed to be protrusion interference noise, the size of the removal interval is the size between the valley point and the valley point or between the peak point and the peak point, and is the number of the surrounding data information. In the removal interval, determining the quantity of the protrusion interference data to be removed according to the removal size, wherein the datum reference points are generally set as two end points of a concave or convex interval, a data point between the datum reference points is a point to be removed, and the interval is also a removal interval; and the datum reference point is set as the data point closest to the removal protrusion interference point, so that the normal data point is protected from being removed, after the datum reference point is determined, the distance from the data point to the datum reference point is calculated, if the distance is larger than a removal threshold value, the interference noise is removed, and otherwise, the normal data point is reserved.
As another embodiment, the method in the present application further includes: taking the protrusion data points at the removed size position as datum reference points; calculating the distance from the protrusion interference data point to a benchmark reference point in the removal interval; if the distance is greater than a removal threshold, removing the salient data points from the depthwise image.
Specifically, the data point of the position with the size removed is taken as a reference point: the position of the datum reference point changes, the datum reference point is not a valley point or a peak point, but the nth data point in a certain specific sequence is used as the datum reference point of the protrusion removal point, whether the data point in the n data points with the removal size needs to be removed or not is judged by taking the point as the datum through a set removal threshold, if the height difference is larger than the removal threshold, the data point is removed, and if not, the data point is kept as an effective data point.
Removing the salient data points from the depth image if the distance is greater than a removal threshold further comprises:
if the removal size is larger than the number of the protruding data points in the removal interval, removing all the protruding data points with the distance larger than a removal threshold value from the depth image;
and if the removal size is smaller than the number of the protruding data points in the removal interval, sequentially removing the protruding data points with the same number as the removal size from the depth image according to descending order of the protruding data points with the distance larger than the removal threshold.
The descending order refers to removing the highest of these data points: if 20 interference data points need to be removed according to actual needs, but 30 data points exist in the removal interval, the 30 data points are arranged from large to small, and the removal height difference is larger than the highest 20 data points in the removal threshold.
The technical solution in the present application is further described below with a specific embodiment.
The steps of obtaining the removal interval, finding the reference point and removing the protrusion interference point according to this embodiment are shown in fig. 2, and taking the protrusion point of the high object as an example, local information of the depth image is obtained by traversing the depth image in a single direction of a longitudinal axis or a transverse axis; or, acquiring local information of the depth image in a traversal mode on the depth image in two directions of a longitudinal axis and a transverse axis; the specific description is as follows:
judging whether the image is traversed and ended, if so, directly outputting a removal result, otherwise, executing the second step;
judging whether the depth data point is a valley point, if not, executing the first step, otherwise, executing the third step;
judging whether the number (removal interval) between the valley points is smaller than the setting of the removal size, if so, executing the fifth step, wherein the reference point is a larger value in the valley points, otherwise, executing the fourth step;
arranging in descending order, taking the data points with the size removed as reference points, and executing the fifth step when the data points are finished;
judging whether the height from the depth data point to the datum point is greater than a removal threshold, if so, executing the sixth step, otherwise, continuously judging and executing the fifth step until the depth data point traverses to the position of the removal size, and stopping;
removing the protruding point;
and outputting a removal result.
Another technical scheme adopted by the application is as follows:
an apparatus for removing salient interference noise in a depth image, the apparatus comprising:
a depth image local information acquisition unit configured to acquire local information of a depth image according to a removal object, the local information being valley point, peak point, or gentle point information around a protrusion data point, the removal object being a protrusion or depression data point between the local information;
a removal interval determination unit configured to determine a removal interval of the local information according to a removal size;
a removal benchmark reference point determining unit, configured to determine a removal benchmark reference point according to the removal size in the removal interval;
and the calculation and protrusion interference removal unit is used for calculating the distance from the protrusion data points to the datum reference point in the removal interval, and removing the protrusion data points from the depth image if the distance is greater than a removal threshold value.
The device further comprises: and the removal parameter presetting unit is used for setting the removal object, the removal size and the removal threshold of the depth image according to the actual removal requirement.
A computer readable storage medium having stored thereon computer instructions which, when executed by a processor, carry out the steps of the method of removing salient interference noise in a depth image.
A terminal device, the terminal device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the one processor to cause the at least one processor to perform the method of removing protrusion interference noise in a depth image.
According to the method, local information of a depth image is obtained according to a removal object, a removal interval of the local information is determined according to the removal size, a removal reference point is determined in the removal interval according to the removal size, the distance from a protruding data point in the removal interval to the reference point is calculated, and if the distance is larger than a removal threshold value, the protruding data point is removed from the depth image. The method removes the protrusion points of protrusion interference points with different sizes or different forms according to different setting conditions of the removal size, the removal threshold and the removal object, and can ensure that useful data is not removed and the preprocessing effect is achieved while removing protrusion interference data points with different sizes or different forms; meanwhile, the method for removing the bump interference points can also remove the bump interference data points of the non-plane. The method provided by the application can achieve different removal results by setting different removal parameters, can compatibly remove various noises, has strong pertinence, and solves the problem that the subsequent measurement and detection of the depth image data information and other related operations lose significance due to the fact that the protrusion interference noise cannot be effectively solved in the conventional denoising method.
It is noted that relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that an article or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is merely exemplary of the present application and is presented to enable those skilled in the art to understand and practice the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
It will be understood that the present application is not limited to what has been described above and shown in the accompanying drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.