CN108629795B - Road picture detection method and device - Google Patents

Road picture detection method and device Download PDF

Info

Publication number
CN108629795B
CN108629795B CN201710161730.3A CN201710161730A CN108629795B CN 108629795 B CN108629795 B CN 108629795B CN 201710161730 A CN201710161730 A CN 201710161730A CN 108629795 B CN108629795 B CN 108629795B
Authority
CN
China
Prior art keywords
picture
road
detected
pixel
difference
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.)
Active
Application number
CN201710161730.3A
Other languages
Chinese (zh)
Other versions
CN108629795A (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.)
Alibaba China Co Ltd
Original Assignee
Alibaba China 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 Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN201710161730.3A priority Critical patent/CN108629795B/en
Publication of CN108629795A publication Critical patent/CN108629795A/en
Application granted granted Critical
Publication of CN108629795B publication Critical patent/CN108629795B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Processing Or Creating Images (AREA)
  • Image Analysis (AREA)

Abstract

The application discloses a road picture detection method and a road picture detection device, which can take a picture rendered based on old version electronic map data as a reference picture, take a picture rendered based on new version electronic map data as a picture to be detected, respectively carry out binarization processing on the picture to be detected and the reference picture, and calculate pixel difference values of pixel points at the same position, wherein the pixel points with the pixel difference values not being zero are the pixel points with the difference between the picture to be detected and the reference picture. According to the method, whether the difference exists in the rendered pictures based on the two-version electronic map data is determined through the picture binarization processing and the difference solving of the pixel values of the pixel points at the same position, so that the difference detection efficiency of the electronic map data is greatly improved, and the detection cost is reduced.

Description

Road picture detection method and device
Technical Field
The application relates to the technical field of road picture detection, in particular to a road picture detection method and device.
Background
With the development of economy, new roads are continuously built on, old roads are closed or rebuilt, and electronic map data is expressed in a digital form on roads, buildings and the like in the real world. Since roads, buildings, etc. in the real world may vary, there may be a difference between different versions of electronic map data. Referring to fig. 1a and 1b, which are pictures of the same geographical location area rendered based on different versions of electronic map data, it can be seen that the road shape of the road is changed by comparing the pictures. Referring again to fig. 1c and 1d, which are also pictures of the same geographical location area rendered based on different versions of electronic map data, it can be seen by comparing that a new road appears, i.e. road l1 in fig. 1 d.
The prior art generally adopts a manual detection mode to search the difference of two versions of electronic map data, and the mode has the problems of high cost and low detection efficiency.
Disclosure of Invention
In view of the above, the application provides a road picture detection method and device, which are used for solving the problems of high cost and low efficiency in the prior art that roads in each geographic area need to be checked one by one manually.
In order to achieve the above object, the following solutions have been proposed:
a road picture detection method, comprising:
acquiring a reference picture and a picture to be detected of the same geographic area, wherein roads of the geographic area are rendered in the reference picture and the picture to be detected;
respectively carrying out binarization processing on the reference picture and the picture to be detected;
acquiring a difference value of pixel values of pixel points at the same position of the binarized reference picture and the picture to be detected;
and determining whether the difference exists between the picture to be detected and the road rendered in the reference picture according to the distribution of the pixel points with the difference value of the pixel values not being zero.
Preferably, before the binarization processing is performed on the reference picture and the picture to be detected respectively, the method further includes:
And respectively carrying out smoothing processing on the reference picture and the picture to be detected based on pixel values of a preset number of continuous pixel points in the reference picture and the picture to be detected.
Preferably, if there is a difference between the picture to be detected and the reference picture, the method further comprises:
carrying out connected domain analysis on the binarized reference picture to obtain at least one connected domain, and storing pixel points corresponding to roads in the same connected domain as a piece of road record data;
and carrying out connected domain analysis on the picture to be detected after the binarization processing to obtain at least one connected domain, and storing pixel points corresponding to roads in the same connected domain as a piece of road record data.
Preferably, the method further comprises:
acquiring pixel points corresponding to intersection points of roads on picture boundaries from the road record data as starting points;
traversing continuous pixel points in the road record data from a starting point, and acquiring the slope of a straight line where the traversed pixel points are located according to a straight line fitting algorithm;
and acquiring the slope difference of the straight line where the pixel points are located, if one of the slope differences exceeds a preset first slope difference threshold, determining the pixel points as intersection points, and storing the starting points, the intersection points and continuous pixel points among the starting points and the intersection points as new road record data.
Preferably, the method further comprises:
judging whether the slope difference of the straight line where any pixel point is located in the road record data does not exceed a preset second slope difference threshold value, and determining that the road type corresponding to the road record data is an arc road if the slope difference of the straight line where two adjacent pixel points are located does not exceed the preset difference threshold value.
Preferably, the method further comprises:
and sequentially searching the pixel points corresponding to the road from the pixel points corresponding to the intersection point of the road and the picture boundary in the picture to be detected after the binarization processing until the tail pixel point of the road is found, and taking the tail pixel point as a breakpoint of the road if the pixel points corresponding to the road exist around the tail pixel point.
Preferably, before the pixel points corresponding to the road in the image to be detected after the binarization processing and the pixel points corresponding to the intersection points of the road and the image boundary are sequentially searched, the method further includes:
and cutting the binarized picture to be detected to obtain a cut picture to be detected, wherein the boundary between the road in the cut picture to be detected and the picture has only one intersection point.
A road picture detection apparatus comprising:
the road picture acquisition unit is used for acquiring a reference picture and a picture to be detected of the same geographic area, wherein roads of the geographic area are rendered in the reference picture and the picture to be detected;
the binarization processing unit is used for respectively carrying out binarization processing on the reference picture and the picture to be detected;
the difference value determining unit is used for obtaining the difference value of the pixel point at the same position of the reference picture and the picture to be detected after binarization processing;
and the difference determining unit is used for determining whether the to-be-detected picture and the road rendered in the reference picture have differences according to the distribution of the pixel points with the difference values of the pixel values not being zero.
Preferably, the method further comprises:
and the smoothing processing unit is used for respectively carrying out smoothing processing on the reference picture and the picture to be detected based on pixel values of a preset number of continuous pixel points in the reference picture and the picture to be detected before the binarization processing unit processes the reference picture and the picture to be detected.
Preferably, the method further comprises:
the first connected domain analysis unit is used for carrying out connected domain analysis on the binarized reference picture to obtain at least one connected domain when the difference between the picture to be detected and the reference picture is determined, and storing pixels corresponding to roads in the same connected domain as a piece of road record data;
And the second connected domain analysis unit is used for carrying out connected domain analysis on the picture to be detected after the binarization processing to obtain at least one connected domain when the difference between the picture to be detected and the reference picture is determined, and storing pixels corresponding to roads in the same connected domain as a piece of road record data.
Preferably, the method further comprises:
the starting point determining unit is used for acquiring pixel points corresponding to the intersection points of the roads on the picture boundaries from the road record data as starting points;
the slope determining unit is used for traversing continuous pixel points in the road record data from a starting point and acquiring the slope of a straight line where the traversed pixel points are located according to a straight line fitting algorithm;
and the breaking unit is used for acquiring the slope difference of the straight line where the pixel points are located, if one of the slope differences exceeds a preset first slope difference threshold value, determining the pixel points as intersection points, and storing the starting points, the intersection points and continuous pixel points between the starting points and the intersection points as new road record data.
Preferably, the method further comprises:
the road type determining unit is used for determining whether the slope difference of the straight line where any pixel point is located in the road record data does not exceed a preset second slope difference threshold value, and the difference of the slope differences of the straight lines where two adjacent pixel points are located does not exceed a preset difference threshold value, if yes, determining that the road type corresponding to the road record data is an arc-shaped road.
Preferably, the method further comprises:
and the breakpoint detection unit is used for sequentially searching the pixel points corresponding to the road from the pixel points corresponding to the intersection points of the road and the picture boundary in the picture to be detected after the binarization processing until the end pixel point of the road is found, and taking the end pixel point as the breakpoint of the road if the pixel points corresponding to the road exist around the end pixel point.
Preferably, the method further comprises:
and the clipping unit is used for clipping the binarized picture to be detected before the breakpoint detection unit processes the picture to be detected to obtain a clipped picture to be detected, wherein the boundary between the road in the clipped picture to be detected and the picture has only one intersection point.
According to the technical scheme, the road picture detection method disclosed by the application is used for acquiring the reference picture and the picture to be detected of the same geographic area, wherein roads of the geographic area are rendered in the reference picture and the picture to be detected; respectively carrying out binarization processing on the reference picture and the picture to be detected; acquiring a difference value of pixel values of pixel points at the same position of the binarized reference picture and the picture to be detected; and determining whether the difference exists between the picture to be detected and the road rendered in the reference picture according to the distribution of the pixel points with the difference value of the pixel values not being zero. According to the application, the picture rendered based on the old version electronic map data can be used as a reference picture, the picture rendered based on the new version electronic map data is used as a picture to be detected, binarization processing is respectively carried out on the picture to be detected and the reference picture, the pixel difference value of the pixel point at the same position is obtained, and the pixel point with the pixel difference value not being zero is the pixel point with the difference between the picture to be detected and the reference picture. According to the application, whether the difference exists in the picture rendered based on the two-version electronic map data is determined by the technology which can be realized by the computing terminal and is that the picture binarization processing and the pixel value of the pixel point at the same position are used for solving the difference, compared with the existing manual detection mode, the electronic map data difference detection efficiency is greatly improved, and the detection cost is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIGS. 1a-1b illustrate road schematic diagrams of the same geographic location area in different versions of electronic map data;
FIGS. 1c-1d illustrate road schematic diagrams of the same geographic location area in another different version of electronic map data;
fig. 2 is a flowchart of a road picture detection method according to an embodiment of the present application;
FIG. 3 is a flowchart of another road picture detection method according to an embodiment of the present application;
FIG. 4 is a flowchart of another road picture detection method according to an embodiment of the present application;
FIG. 5 illustrates a road topology diagram;
FIG. 6 is a flowchart of another road picture detection method according to an embodiment of the present application;
FIG. 7a illustrates a schematic diagram of a road break point;
FIG. 7b illustrates a schematic view of a road end;
FIG. 8 is a flowchart of another road picture detection method according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a road picture detecting device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
First, the object processed by the technical scheme of the application comprises: a reference picture and a picture to be detected. For convenience of description, the following operations will be performed on both the reference picture and the picture to be detected, and the term "picture" will be used to refer to the reference picture or the picture to be detected in description, and should not be construed as a third "picture" in addition to the reference picture and the picture to be detected.
The picture is rendered based on the electronic map data, and in general, the electronic map data is divided into a plurality of grid data according to a preset grid size, so that the picture can be rendered based on each grid data.
The reference picture is rendered based on old version electronic map data, the picture to be detected is rendered based on new version electronic map data, the old version electronic map data and the new version electronic map data are preferably divided according to the same grid size, and at least roads in the electronic map data are rendered by the reference picture and the picture to be detected.
The following describes a road picture detection method provided by the application in detail with reference to fig. 2, and the method comprises the following steps:
step S100, obtaining a reference picture and a picture to be detected of the same geographic area;
step S110, respectively performing binarization processing on the reference picture and the picture to be detected;
wherein, if the picture is a color picture, the binarization processing process includes: and graying the picture, and binarizing the grayed picture.
If the picture is a gray scale, the binarization process is to process the pixel values of the picture into two pixel values, 255 (white) or 0 (black). For example, the pixel value of the pixel point corresponding to the road in the picture may be binarized to 255, and the pixel value of the pixel point corresponding to the other objects (such as the background) may be binarized to 0. Or the pixel value of the pixel point corresponding to the road can be binarized to 0, and the pixel values of the pixel points of other objects can be binarized to 255, so that the realization of the embodiment of the application is not influenced.
The following description will take the example that the pixel value of the pixel point corresponding to the road in the picture is binarized to 255, and the pixel value of the pixel point corresponding to the other objects is binarized to 0.
In order to binarize the pixel value of the pixel point corresponding to the road, a pixel value threshold may be set according to the pixel value of the pixel point corresponding to the road in the image, for example, if the pixel value of the pixel point corresponding to the road is greater than a certain value, the value or a value slightly smaller than the value may be set as the pixel value threshold, the pixel value of the pixel point exceeding the pixel value threshold is set as 0, and the pixel value of the pixel point not exceeding the pixel value threshold is set as 255.
Step S120, obtaining a difference value of pixel values of pixel points at the same position of the reference picture and the picture to be detected after binarization processing;
the step is to calculate the difference value of the pixel point at the same position of the reference picture and the picture to be detected after the binarization processing. It will be appreciated that if the pixels at the same position in the reference picture and the picture to be detected correspond to the same object, for example, are both roads or are both backgrounds, then the pixel values corresponding to the pixels at the position should be the same, the difference value should be zero, otherwise, the difference value is not zero.
Optionally, after obtaining the difference value of the pixel values of the pixel points, the pixel points with abnormal difference values may be filtered to remove the interference pixel points.
Step S130, determining whether there is a difference between the to-be-detected picture and the road rendered in the reference picture according to the distribution of the pixels with the difference of the pixel values not being zero.
As described above, if there is a pixel point where the difference between the pixel values of the reference picture and the picture to be detected is not zero, it is indicated that the objects in the picture to be detected and the reference picture are not completely identical, i.e., the pictures are different. Therefore, according to the distribution of the pixel points of which the difference value of the pixel values is not zero, whether the picture to be detected and the reference picture have the difference or not can be determined.
If the number of pixel points with the difference value of the pixel values not being zero exceeds a preset number threshold, the picture to be detected and the reference picture have larger difference.
Otherwise, if the difference value of the pixel values is not zero, the pixel points are few or none, and the picture to be detected and the reference picture have no difference.
According to the application, the picture rendered based on the old version electronic map data can be used as a reference picture, the picture rendered based on the new version electronic map data is used as a picture to be detected, binarization processing is respectively carried out on the picture to be detected and the reference picture, the pixel difference value of the pixel point at the same position is obtained, and the pixel point with the pixel difference value not being zero is the pixel point with the difference between the picture to be detected and the reference picture. According to the application, whether the difference exists in the picture rendered based on the two-version electronic map data is determined by the technology which can be realized by the computing terminal and is that the picture binarization processing and the pixel value of the pixel point at the same position are used for solving the difference, compared with the existing manual detection mode, the difference detection efficiency of the electronic map data is greatly improved, and the detection cost is reduced.
In another embodiment of the present application, another road picture detection method is disclosed, referring to the flowchart illustrated in fig. 3, the process may include:
step S200, obtaining a reference picture and a picture to be detected of the same geographic area;
step S210, respectively performing smoothing processing on the reference picture and the picture to be detected based on pixel values of a preset number of continuous pixel points in the reference picture and the picture to be detected;
specifically, the present application may determine a difference in pixel values that cannot be recognized by the human eye, based on the human eye recognition capability, and set the difference as a pixel difference threshold. And further, carrying out smoothing processing on pixel points of which the difference value of the preset number of continuous pixel values is lower than a preset pixel difference value threshold value in the reference picture and the picture to be detected. The smoothing process sets the pixel values of a preset number of consecutive pixels with pixel value differences below a set pixel difference threshold to the same pixel value. The same pixel value may be a pixel value of any one of the continuous pixel points, or may be an average value or a median value of the pixel values of the continuous pixel points.
Examples are:
the following continuous 6 pixel points exist in the picture, and the pixel values of the continuous 6 pixel points are as follows in sequence: 255. 249, 255, 254, 255. An alternative smoothing method is to set the pixel value of each pixel point in the succession to 255, and the result is: 255. 255, 255.
Assuming that the pixel value threshold value set at the time of the binarization processing is 250, if the smoothing processing is not performed, the binarization processing result is: 255. 0, 255. Obviously, the result of this processing may cause black noise to appear in the road, which is not practical.
If the binarization operation is executed after the smoothing process is performed, the processing result is: 255. 255, 255. The above problems are avoided.
Step S220, respectively carrying out binarization processing on the reference picture and the picture to be detected after the smoothing processing;
specifically, in this step, binarization processing is performed on the reference picture and the picture to be detected, which have undergone the smoothing processing in the previous step.
Step S230, obtaining a difference value of pixel values of pixel points at the same position of the reference picture and the picture to be detected after binarization processing;
step S240, determining whether there is a difference between the to-be-detected picture and the road rendered in the reference picture according to the distribution of the pixels with the difference value of the pixel values not being zero.
It should be noted that, in this embodiment, a process of smoothing the reference picture and the picture to be detected is added, and the implementation manner of the other steps may refer to the previous embodiment, which is not described in detail.
Compared with the previous embodiment, the scheme provided by the embodiment increases the smoothing process before the binarization operation is performed on the road picture, so that abnormal pixel points in the binarization result are avoided, and the problem that the actual situation is not met is solved.
Optionally, after obtaining the binarized reference picture and the picture to be detected in the foregoing embodiment, the method may further determine road record data included in each of the reference picture and the picture to be detected, and the detailed implementation process is shown in fig. 4, and includes:
step S300, obtaining a reference picture and a picture to be detected of the same geographic area;
step S310, respectively performing binarization processing on the reference picture and the picture to be detected;
specifically, in this step, binarization processing may be directly performed on the reference picture and the picture to be detected acquired in step S300. In addition, before the step, a process of smoothing the reference picture and the picture to be detected can be added, and binarization processing is further performed on the smoothed reference picture and the picture to be detected.
Step S320, obtaining a difference value of pixel values of pixel points at the same position of the reference picture and the picture to be detected after binarization processing;
Step S330, determining whether the difference exists between the picture to be detected and the road rendered in the reference picture according to the distribution of the pixel points with the difference value of the pixel values not being zero;
the steps S300-S330 correspond to the steps S100-S130 in the foregoing embodiment one by one, and are not described herein again.
Step S340, carrying out connected domain analysis on the binarized reference picture to obtain at least one connected domain, and storing pixel points corresponding to roads in the same connected domain as a piece of road record data;
and step 350, carrying out connected domain analysis on the picture to be detected after the binarization processing to obtain at least one connected domain, and storing the pixel points corresponding to the roads in the same connected domain as a piece of road record data.
It will be appreciated that steps S340-S350 may be performed at any location after step S310, and that this embodiment illustrates only one alternative implementation.
Step S340 may be implemented with reference to the following manner:
and carrying out connected domain analysis on the binarized reference picture, dividing continuous pixels representing the road with the adjacent distance not exceeding a set distance threshold into a connected domain, and storing the pixels in the same connected domain as road record data.
Specifically, two pixels whose adjacent pitches do not exceed the set distance threshold may be regarded as connected pixels, i.e., pixels belonging to the same road.
After the connected domain analysis, the binarized reference picture can determine a plurality of connected domains, and the number of the connected domains is the number of roads contained in the reference picture. The application can be provided with the first container 1 for storing each piece of road record data contained in the reference picture.
Similarly, step S350 may be implemented with reference to the following manner:
and carrying out connected domain analysis on the picture to be detected after binarization processing, dividing continuous pixels representing roads with adjacent intervals not exceeding a first set distance threshold into a connected domain, and storing the pixels in the same connected domain as road record data.
Similarly, the analysis process of the connected domain of the picture to be detected can refer to the analysis process of the connected domain of the reference picture. The application can be provided with the second container 2 for storing each piece of road record data contained in the picture to be detected.
In this embodiment, a connected domain analysis process is added to the reference picture and the picture to be detected, and each piece of road record data contained in each picture is determined. The difference between the two pieces of road record data can be reflected by the respective pieces of road record data contained in the respective pieces of road record data.
Optionally, the connected domain analysis process may determine the number of roads included in the road picture. However, in the connected domain analysis process, the continuous pixels representing the road with the adjacent distance not exceeding the set distance threshold are divided into one connected domain, so that one road is determined to be recorded data, and if two different road end points with larger slopes are connected or one road is intersected with the other road at a certain point in the middle, the pixels forming the two roads also meet the above condition, and are divided into one connected domain, so that one road is stored as one road record data.
In order to avoid such errors, the application further analyzes the results obtained by the connected domain analysis. It can be understood that the slope of each pixel point in one road should be a smooth transition, and the slope of each pixel point in the intersection point will be abrupt when one road intersects with another road, based on this, the present application further performs the following operations with respect to the analysis result of the connected domain:
s11, acquiring pixel points corresponding to intersection points of roads on the boundaries of the pictures from the road record data as starting points;
specifically, data is recorded for each road in vector1 and vector2 respectively, and a pixel point corresponding to an intersection point of the road on a picture boundary is obtained as a starting point.
S12, traversing continuous pixel points in the road record data from a starting point, and acquiring the slope of a straight line where the traversed pixel points are located according to a straight line fitting algorithm;
the description is given in connection with fig. 5:
fig. 5 illustrates a road topology composed of one piece of road record data, and the road topology contains 5 pixel points of O1-O5, wherein l1 is connected between O1 and O2, l2 is connected between O2 and O3, l3 is connected between O3 and O4, and l4 is connected between O4 and O5.
The traversal starts with the point O1, where O1 is located only on l1, O2 is located on l1 and l2, O3 is located on l2 and l3, O4 is located on l3 and l4, and O5 is located only on l4.
S13, acquiring the slope difference of the straight line where the pixel points are located, if one of the slope differences exceeds a preset first slope difference threshold value, determining the pixel points as intersection points, and storing the starting points, the intersection points and continuous pixel points between the starting points and the intersection points as new road record data.
Still described in connection with fig. 5:
o1 and O5 pointsThere is no slope difference, the slope difference of O2 point is k l1 -k l2 The difference in slope of O3 point is k l2 -k l3 The difference in slope of O4 point is k l3 -k l4
Assume that the preset first slope difference threshold is k x If k l1 -k l2 Less than k x If the O2 point is not the intersection point, if k l2 -k l3 Greater than k x And if the slope changes suddenly at the point O3, the point O3 is an intersection point, and the O1-O3 is saved as new road record data. Meanwhile, O3 is used as a new starting point, and the backward traversal is continued.
If k l3 -k l4 Less than k x It means that O4 is not an intersection point, so O3-O5 is saved as a new piece of road record data.
It is understood that there may be no abrupt slope change pixels or one or more abrupt slope change pixels in a piece of road record data.
According to the above example, it can be determined that, assuming that the number of pixels with abrupt slope changes in one piece of road record data is n, n+1 pieces of new road record data will be obtained after the above processing.
In another embodiment of the present application, still another road picture detection method is further disclosed, as shown in fig. 6, the method may include:
step S400, obtaining a reference picture and a picture to be detected of the same geographic area;
step S410, respectively performing binarization processing on the reference picture and the picture to be detected;
step S420, obtaining a difference value of pixel values of pixel points at the same position of the reference picture and the picture to be detected after binarization processing;
step S430, determining whether the difference exists between the picture to be detected and the road rendered in the reference picture according to the distribution of the pixel points with the difference value of the pixel values not being zero;
specifically, the steps S400 to S430 correspond to the steps S100 to S130 in the foregoing embodiment one by one, and will not be described herein.
Step S440, obtaining pixel points corresponding to the intersection points of the roads on the picture boundaries from the road record data as starting points;
step S450, traversing continuous pixel points in the road record data from a starting point, and acquiring the slope of a straight line where the traversed pixel points are located according to a straight line fitting algorithm;
step S460, obtaining the slope difference of the straight line where the pixel points are located, if one of the slope differences exceeds a preset first slope difference threshold, determining the pixel point as an intersection point, and storing the starting point, the intersection point and continuous pixel points between the starting point and the intersection point as new road record data;
specifically, the steps S440 to S460 correspond to the steps S11 to S13 in the previous embodiment one by one, and will not be described here again.
Step S470, judging whether the slope difference of the straight line where any pixel point in the road record data is located meets the preset condition; if yes, go to step S480;
the process of judging whether the preset condition is met may specifically be to judge whether the slope difference of the straight line where any pixel point is located in the road record data does not exceed a preset second slope difference threshold value, and the difference of the slope differences of the straight lines where two adjacent pixel points are located does not exceed a preset difference threshold value. Since the first slope difference threshold is used to find the slope discontinuity and the second slope difference threshold is used to determine whether the curve transitions smoothly, the second slope difference threshold may be set smaller than the first slope difference threshold.
Step S480, determining that the road type corresponding to the road record data is an arc road.
Specifically, in step 407, the road record data having undergone the breaking process is processed, and in the road record data having undergone the breaking process, the middle pixel point is only on two straight lines except for the first and the last road nodes, so that the slope difference of the straight line where the pixel point is located in step 470 is only one.
Still described in connection with fig. 5:
in fig. 5, the above determination process is illustrated by taking the pixel O2 as an example:
the slope difference of the straight line where the O2 point is located is k l1 -k l2 The slope difference of the straight line where the O3 point is located is k l2 -k l3 . Assuming that the preset second slope difference threshold is k y The preset difference threshold is k z If judge k l1 -k l2 Less than k y And (k) l1 -k l2 )-(k l2 -k l3 ) Less than k y And determining that the O2 point meets the condition.
And similarly, if each pixel point in the road record data meets the condition, the road type corresponding to the road record data can be determined to be an arc road.
The arc-shaped road is a road type which is paid attention to by technicians, and through the scheme of the embodiment, whether the road type corresponding to each road record data is the arc-shaped road can be determined.
It should be noted that, in the road fitting detection process, road breaking points are also a problem that those skilled in the art are concerned with. The road break point is a point where the middle of the road breaks and is not connected, and the end point of the road is not a break point. See fig. 7a and 7b, wherein the arrow in fig. 7a indicates that a break point occurs at the road junction. Whereas the arrow in fig. 7b shows the end point of the road, not the break point.
In order to detect a road breakpoint, the application discloses a road picture detection method, which is shown in fig. 8, and comprises the following steps:
step S500, obtaining a reference picture and a picture to be detected of the same geographic area;
step S510, respectively performing binarization processing on the reference picture and the picture to be detected;
step S520, obtaining a difference value of pixel values of pixel points at the same position of the reference picture and the picture to be detected after binarization processing;
step S530, determining whether the difference exists between the picture to be detected and the road rendered in the reference picture according to the distribution of the pixel points with the difference value of the pixel values not being zero;
the steps S500 to S530 correspond to the steps S100 to S130 in the foregoing embodiment one by one, and are not described herein again.
Step S540, starting from the pixel point corresponding to the intersection point of the road and the picture boundary in the picture to be detected after the binarization processing, sequentially searching the pixel point corresponding to the road until the tail pixel point of the road is found;
specifically, a maze algorithm may be used to find the end pixel point of the road. The process may include: and sequentially searching for the pixel points corresponding to the roads with the next interval distance not exceeding the first set distance threshold value from the pixel points corresponding to the intersection points of the roads and the picture boundaries until the last pixel point is found, and extending the last pixel point forwards until the pixel point corresponding to the roads does not exist in the first set distance threshold value.
And step S550, if the pixel points corresponding to the road exist around the end pixel point, taking the end pixel point as a breakpoint of the road.
Specifically, the peripheral area of the end pixel point may be such that the end pixel point extends forward within the second set distance threshold range. Specifically, it may be determined whether a pixel point corresponding to a road exists in the second set distance threshold value extending forward from the end pixel point, if yes, the end pixel point is used as a breakpoint of the road, and the reason for the breakpoint is that if a pixel point corresponding to a road exists in the second set distance threshold value extending forward from the point, it is indicated that the road where the breakpoint exists and the road corresponding to the pixel point in the second set distance threshold value should be connected, and then correction is required to be performed on the data of the road in the electronic map data, and the two roads are connected.
Wherein the second set distance threshold is greater than the first set distance threshold.
The method provided by the embodiment can further determine the road breakpoint included in the picture to be detected.
Optionally, before the step S540, the method may further perform clipping processing on the binarized picture to be detected, including:
And cutting the binarized picture to be detected to obtain a cut picture to be detected, wherein the boundary between the road in the cut picture to be detected and the picture has only one intersection point.
The specific cutting mode can comprise the following steps:
and reducing the width of the road in the binarized picture to be detected, if the width of the road is reduced to be one pixel width and the like, searching the pixel point corresponding to the road through a maze algorithm.
Further, cutting the edge of the picture to be detected after binarization processing according to the set width. Because the width of the road is compressed, line segments with the length of the width of the road exist in the edge area of the picture to be detected after the binarization processing, and the process of searching the pixel points of the road is interfered, the edge of the picture to be detected after the binarization processing is further cut off according to the set width. The set width may be the width of the original road, which is approximately 5-6 pixels wide.
The road picture detection apparatus provided in the embodiments of the present application will be described below, and the road picture detection apparatus described below and the road picture detection method described above may be referred to correspondingly.
Referring to fig. 9, fig. 9 is a schematic structural diagram of a road picture detecting device according to an embodiment of the present application. As shown in fig. 9, the apparatus includes:
a road picture obtaining unit 11, configured to obtain a reference picture and a picture to be detected of the same geographic area, where roads of the geographic area are rendered in the reference picture and the picture to be detected;
a binarization processing unit 12, configured to perform binarization processing on the reference picture and the picture to be detected, respectively;
a difference value determining unit 13, configured to obtain a difference value of pixel values of pixel points at the same position of the reference picture and the picture to be detected after binarization processing;
and the difference determining unit 14 is used for determining whether the to-be-detected picture and the road rendered in the reference picture have differences according to the distribution of the pixel points with the difference values of the pixel values not being zero.
According to the road picture detection device disclosed by the embodiment of the application, the picture rendered based on the old version electronic map data can be used as the reference picture, the picture rendered based on the new version electronic map data can be used as the picture to be detected, binarization processing is respectively carried out on the picture to be detected and the reference picture, the pixel difference value of the pixel point at the same position is obtained, and the pixel point with the pixel difference value not being zero is the pixel point with the difference between the picture to be detected and the reference picture. According to the application, whether the difference exists in the picture rendered based on the two-version electronic map data is determined by the technology which can be realized by the computing terminal and is that the picture binarization processing and the pixel value of the pixel point at the same position are used for solving the difference, compared with the existing manual detection mode, the difference detection efficiency of the electronic map data is greatly improved, and the detection cost is reduced.
Optionally, the apparatus of the present application may further include:
and the smoothing processing unit is used for respectively carrying out smoothing processing on the reference picture and the picture to be detected based on pixel values of a preset number of continuous pixel points in the reference picture and the picture to be detected before the binarization processing unit processes the reference picture and the picture to be detected.
Optionally, the apparatus of the present application may further include:
the first connected domain analysis unit is used for carrying out connected domain analysis on the binarized reference picture to obtain at least one connected domain when the difference between the picture to be detected and the reference picture is determined, and storing pixels corresponding to roads in the same connected domain as a piece of road record data;
and the second connected domain analysis unit is used for carrying out connected domain analysis on the picture to be detected after the binarization processing to obtain at least one connected domain when the difference between the picture to be detected and the reference picture is determined, and storing pixels corresponding to roads in the same connected domain as a piece of road record data.
Optionally, the apparatus of the present application may further include:
the starting point determining unit is used for acquiring pixel points corresponding to the intersection points of the roads on the picture boundaries from the road record data as starting points;
The slope determining unit is used for traversing continuous pixel points in the road record data from a starting point and acquiring the slope of a straight line where the traversed pixel points are located according to a straight line fitting algorithm;
and the breaking unit is used for acquiring the slope difference of the straight line where the pixel points are located, if one of the slope differences exceeds a preset first slope difference threshold value, determining the pixel points as intersection points, and storing the starting points, the intersection points and continuous pixel points between the starting points and the intersection points as new road record data.
Optionally, the apparatus of the present application may further include:
the road type determining unit is used for determining whether the slope difference of the straight line where any pixel point is located in the road record data does not exceed a preset second slope difference threshold value, and the difference of the slope differences of the straight lines where two adjacent pixel points are located does not exceed a preset difference threshold value, if yes, determining that the road type corresponding to the road record data is an arc-shaped road.
Wherein the second slope difference threshold may be set smaller than the first slope difference threshold.
Optionally, the apparatus of the present application may further include:
and the breakpoint detection unit is used for sequentially searching the pixel points corresponding to the road from the pixel points corresponding to the intersection points of the road and the picture boundary in the picture to be detected after the binarization processing until the end pixel point of the road is found, and taking the end pixel point as the breakpoint of the road if the pixel points corresponding to the road exist around the end pixel point.
Optionally, the apparatus of the present application may further include:
and the clipping unit is used for clipping the binarized picture to be detected before the breakpoint detection unit processes the picture to be detected to obtain a clipped picture to be detected, wherein the boundary between the road in the clipped picture to be detected and the picture has only one intersection point.
Finally, it is further noted that relational terms such as first and second, and the like are 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. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, and identical and similar parts between the embodiments are all enough to refer to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use 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.

Claims (6)

1. A road picture detection method, characterized by comprising:
acquiring a reference picture and a picture to be detected of the same geographic area, wherein roads of the geographic area are rendered in the reference picture and the picture to be detected;
smoothing the reference picture and the picture to be detected respectively based on pixel values of a preset number of continuous pixel points in the reference picture and the picture to be detected;
Respectively carrying out binarization processing on the reference picture and the picture to be detected;
acquiring a difference value of pixel values of pixel points at the same position of the binarized reference picture and the picture to be detected;
determining whether the difference exists between the picture to be detected and the road rendered in the reference picture according to the distribution of the pixel points of which the difference value of the pixel values is not zero;
if the picture to be detected is different from the reference picture, the method further comprises:
carrying out connected domain analysis on the binarized reference picture to obtain at least one connected domain, and storing pixel points corresponding to roads in the same connected domain as a piece of road record data;
carrying out connected domain analysis on the binarized picture to be detected to obtain at least one connected domain, and storing pixel points corresponding to roads in the same connected domain as a piece of road record data;
acquiring pixel points corresponding to intersection points of roads on picture boundaries from the road record data as starting points;
traversing continuous pixel points in the road record data from a starting point, and acquiring the slope of a straight line where the traversed pixel points are located according to a straight line fitting algorithm;
Judging whether the slope difference of the straight line where any pixel point is located in the road record data does not exceed a preset second slope difference threshold value, and determining that the road type corresponding to the road record data is an arc road if the slope difference of the straight line where two adjacent pixel points are located does not exceed the preset difference threshold value;
and sequentially searching the pixel points corresponding to the road from the pixel points corresponding to the intersection point of the road and the picture boundary in the picture to be detected after the binarization processing until the tail pixel point of the road is found, and taking the tail pixel point as a breakpoint of the road if the pixel points corresponding to the road exist around the tail pixel point.
2. The method according to claim 1, wherein the method further comprises:
and acquiring the slope difference of the straight line where the pixel points are located, if one of the slope differences exceeds a preset first slope difference threshold, determining the pixel points as intersection points, and storing the starting points, the intersection points and continuous pixel points among the starting points and the intersection points as new road record data.
3. The method according to claim 1 or 2, wherein, before sequentially searching for a pixel corresponding to a road in the binarized picture to be detected from a pixel corresponding to an intersection point of the road and a picture boundary, the method further comprises:
And cutting the binarized picture to be detected to obtain a cut picture to be detected, wherein the boundary between the road in the cut picture to be detected and the picture has only one intersection point.
4. A road picture detection apparatus, characterized by comprising:
the road picture acquisition unit is used for acquiring a reference picture and a picture to be detected of the same geographic area, wherein roads of the geographic area are rendered in the reference picture and the picture to be detected;
the smoothing processing unit is used for respectively carrying out smoothing processing on the reference picture and the picture to be detected based on pixel values of a preset number of continuous pixel points in the reference picture and the picture to be detected;
the binarization processing unit is used for respectively carrying out binarization processing on the reference picture and the picture to be detected;
the difference value determining unit is used for obtaining the difference value of the pixel point at the same position of the reference picture and the picture to be detected after binarization processing;
the difference determining unit is used for determining whether the difference exists between the picture to be detected and the road rendered in the reference picture according to the distribution of the pixel points with the difference value of the pixel values not being zero;
The apparatus further comprises:
the first connected domain analysis unit is used for carrying out connected domain analysis on the binarized reference picture to obtain at least one connected domain when the difference between the picture to be detected and the reference picture is determined, and storing pixels corresponding to roads in the same connected domain as a piece of road record data;
the second connected domain analysis unit is used for carrying out connected domain analysis on the picture to be detected after the binarization processing to obtain at least one connected domain when the difference between the picture to be detected and the reference picture is determined, and storing pixel points corresponding to roads in the same connected domain as a piece of road record data;
the starting point determining unit is used for acquiring pixel points corresponding to the intersection points of the roads on the picture boundaries from the road record data as starting points;
the slope determining unit is used for traversing continuous pixel points in the road record data from a starting point and acquiring the slope of a straight line where the traversed pixel points are located according to a straight line fitting algorithm;
the road type determining unit is used for determining whether the slope difference of the straight line where any pixel point is located in the road record data does not exceed a preset second slope difference threshold value, and the difference of the slope differences of the straight lines where two adjacent pixel points are located does not exceed a preset difference threshold value, if yes, determining that the road type corresponding to the road record data is an arc-shaped road;
And the breakpoint detection unit is used for sequentially searching the pixel points corresponding to the road from the pixel points corresponding to the intersection points of the road and the picture boundary in the picture to be detected after the binarization processing until the end pixel point of the road is found, and taking the end pixel point as the breakpoint of the road if the pixel points corresponding to the road exist around the end pixel point.
5. The apparatus as recited in claim 4, further comprising:
and the breaking unit is used for acquiring the slope difference of the straight line where the pixel points are located, if one of the slope differences exceeds a preset first slope difference threshold value, determining the pixel points as intersection points, and storing the starting points, the intersection points and continuous pixel points between the starting points and the intersection points as new road record data.
6. The apparatus according to claim 4 or 5, further comprising:
and the clipping unit is used for clipping the binarized picture to be detected before the breakpoint detection unit processes the picture to be detected to obtain a clipped picture to be detected, wherein the boundary between the road in the clipped picture to be detected and the picture has only one intersection point.
CN201710161730.3A 2017-03-17 2017-03-17 Road picture detection method and device Active CN108629795B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710161730.3A CN108629795B (en) 2017-03-17 2017-03-17 Road picture detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710161730.3A CN108629795B (en) 2017-03-17 2017-03-17 Road picture detection method and device

Publications (2)

Publication Number Publication Date
CN108629795A CN108629795A (en) 2018-10-09
CN108629795B true CN108629795B (en) 2023-10-27

Family

ID=63686288

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710161730.3A Active CN108629795B (en) 2017-03-17 2017-03-17 Road picture detection method and device

Country Status (1)

Country Link
CN (1) CN108629795B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109635050A (en) * 2018-10-31 2019-04-16 百度在线网络技术(北京)有限公司 Map accuracy estimating method and apparatus
CN109949376A (en) * 2019-02-25 2019-06-28 平安科技(深圳)有限公司 Discrimination method, device, computer equipment and the storage medium of black and white picture
CN112991725A (en) * 2021-02-07 2021-06-18 深圳市电明科技股份有限公司 Image updating method, system, electronic device and medium
CN112870723B (en) * 2021-03-08 2024-02-23 网易(杭州)网络有限公司 Game map detection method and device, storage medium and electronic equipment
CN113761100B (en) * 2021-09-15 2023-09-12 广州小鹏自动驾驶科技有限公司 New and old map difference detection method and device and readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013068482A (en) * 2011-09-21 2013-04-18 Nec Casio Mobile Communications Ltd Azimuth direction correction system, terminal device, server device, azimuth direction correction method and program
CN103150337A (en) * 2013-02-04 2013-06-12 北京航空航天大学 Lane line reconstruction method based on Bezier curve
CN103646402A (en) * 2013-12-20 2014-03-19 中国科学院遥感与数字地球研究所 Method and device for detecting accuracy of remote sensing road image
CN104050477A (en) * 2014-06-27 2014-09-17 西北工业大学 Infrared image vehicle detection method based on auxiliary road information and significance detection
CN105760812A (en) * 2016-01-15 2016-07-13 北京工业大学 Hough transform-based lane line detection method
CN105809674A (en) * 2016-03-03 2016-07-27 厦门大学 Machine vision based die protection apparatus and its functioning method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013068482A (en) * 2011-09-21 2013-04-18 Nec Casio Mobile Communications Ltd Azimuth direction correction system, terminal device, server device, azimuth direction correction method and program
CN103150337A (en) * 2013-02-04 2013-06-12 北京航空航天大学 Lane line reconstruction method based on Bezier curve
CN103646402A (en) * 2013-12-20 2014-03-19 中国科学院遥感与数字地球研究所 Method and device for detecting accuracy of remote sensing road image
CN104050477A (en) * 2014-06-27 2014-09-17 西北工业大学 Infrared image vehicle detection method based on auxiliary road information and significance detection
CN105760812A (en) * 2016-01-15 2016-07-13 北京工业大学 Hough transform-based lane line detection method
CN105809674A (en) * 2016-03-03 2016-07-27 厦门大学 Machine vision based die protection apparatus and its functioning method

Also Published As

Publication number Publication date
CN108629795A (en) 2018-10-09

Similar Documents

Publication Publication Date Title
CN108629795B (en) Road picture detection method and device
CN110084095B (en) Lane line detection method, lane line detection apparatus, and computer storage medium
CN108335302B (en) Region segmentation method and device
US8498449B2 (en) Eye detecting device, eye detecting method, and program
CN108280450B (en) Expressway pavement detection method based on lane lines
US20090202172A1 (en) Image Inspection Apparatus, Image Inspection Method and Computer Program
CN110866926B (en) Infrared remote sensing image rapid and fine sea-land segmentation method
JP2012123626A (en) Object detector and program
WO2004079660A1 (en) Image processing device
CN108256508B (en) News main and auxiliary title detection method and device
CN113052816A (en) Furnace mouth image identification method, device, equipment and storage medium
JP2021051381A (en) Attached matter detection device and attached matter detection method
JP5732217B2 (en) Image binarization method and image binarization apparatus
CN114187368B (en) Dark stripe detection method and device for building board, electronic equipment and storage medium
CN113744200B (en) Camera dirt detection method, device and equipment
CN111768426B (en) Method, device, equipment and storage medium for detecting moving object
CN114022856A (en) Unstructured road travelable area identification method, electronic device and medium
JP2005346222A (en) Sweat gland pore removing device, sweat gland pore removing method and sweat gland pore removing program
CN112465835A (en) Method for jadeite image segmentation and model training method
JP4071336B2 (en) Image processing device for monitoring
JP2010250387A (en) Image recognition device and program
JP2021051377A (en) Attached matter detection device and attached matter detection method
CN115082871B (en) Positioning and deviation rectifying method and system for traffic signal lamp
TW201312477A (en) Method for recognizing camera lens
JP3092871B2 (en) Edge detection method

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: 20200508

Address after: 310052 room 508, floor 5, building 4, No. 699, Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: Alibaba (China) Co.,Ltd.

Address before: 102200, No. 8, No., Changsheng Road, Changping District science and Technology Park, Beijing, China. 1-5

Applicant before: AUTONAVI SOFTWARE Co.,Ltd.

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