Data processing method and electronic equipment

By converting the target area in the point cloud map into the target image and fitting it in parallel lines, the problem of inaccurate marking of rectangular areas in autonomous driving is solved, and higher recognition accuracy is achieved.

CN119600251APending Publication Date: 2025-03-11BEIJING ZHIXINGZHE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411423977.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-12
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

In the field of autonomous driving, it is difficult for the prior art to accurately mark rectangular areas in laser point cloud maps, resulting in inaccurate identification of robots during autonomous driving operations.

Method used

By converting the target area in the point cloud map into the target image, the minimum external rectangle formed by the pixel points corresponding to the target point cloud in the target image is determined, and the pixel points set is further determined, and the fitted line of four edges is obtained through parallel lines, so that the target area is automatically determined in the point cloud map.

Benefits of technology

This method avoids the error of manual labeling by users, improves the accuracy of labeling rectangular areas in point cloud maps, and ensures that the robot more accurately recognizes the target area during autonomous driving operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119600251A_ABST
    Figure CN119600251A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data processing method and electronic equipment. The method comprises the following steps: converting a target point cloud comprising a target area in a point cloud map into a target image; determining a minimum enclosing rectangle of an area formed by pixel points corresponding to the target point cloud in the target image; pixel point sets corresponding to the four edges of the minimum enclosing rectangle in pixel points corresponding to the target point cloud are determined; according to the pixel point sets respectively corresponding to two groups of opposite sides in the four sides, respectively carrying out parallel line fitting on the two groups of opposite sides to obtain fitting straight lines of the four sides; and determining the target area from the point cloud map based on a quadrangle defined by the fitting straight lines of the four edges.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of autonomous driving technology, and in particular to a data processing method and electronic device. Background Art

[0002] In the field of autonomous driving, many robots (including but not limited to unmanned cleaning vehicles) need to perform autonomous driving operations based on laser point cloud maps. In some actual use scenarios of robots, it is often necessary to drive in a specific rectangular area, which requires marking the location of the area in the laser point cloud map so that the robot can identify the rectangular area when performing autonomous driving operations. Taking unmanned cleaning vehicles as an example, there may be some cross-floor operations that require the vehicle to have the ability to operate across floors. When performing cross-floor cleaning operations, it needs to move to the rectangular elevator area by itself to take the elevator from the current floor to other floors for cleaning.

[0003] At present, it is usually necessary for users to manually mark the rectangular areas that need to be marked in the point cloud map. For some narrower rectangular areas, the robot's posture when entering the rectangular area is required to be higher, so it is necessary to mark the position of the rectangular area in the point cloud map more accurately. However, manual marking by users is prone to errors and is difficult to meet the needs. Therefore, a new technical solution is needed to more accurately mark the rectangular area in the point cloud map so that the robot can more accurately identify it during autonomous driving operations. Summary of the invention

[0004] In view of this, embodiments of the present application provide a data processing method and an electronic device to at least partially solve the above problems.

[0005] According to one aspect of an embodiment of the present application, a data processing method is provided, including: converting a target point cloud including a target area in a point cloud map into a target image; determining a minimum circumscribed rectangle of an area formed by pixel points corresponding to the target point cloud in the target image; determining a set of pixel points corresponding to each of the four sides of the minimum circumscribed rectangle among the pixel points corresponding to the target point cloud; fitting parallel lines to two sets of opposite sides among the four sides according to the sets of pixel points corresponding to the two sets of opposite sides respectively, to obtain fitted straight lines of the four sides; and determining the target area from the point cloud map based on a quadrilateral enclosed by the fitted straight lines of the four sides.

[0006] In some optional embodiments, according to the pixel point sets corresponding to two groups of opposite sides among the four sides, parallel line fitting is performed on the two groups of opposite sides respectively to obtain the fitted straight lines of the four sides, including: for each group of opposite sides among the two groups of opposite sides: according to the pixel point sets corresponding to the group of opposite sides, fitting parameters corresponding to the fitted straight lines of the two sides are determined; according to the fitting parameters and a preset fitting function, parallel line fitting is performed on the group of opposite sides to obtain the fitted straight lines of the group of opposite sides.

[0007] In some optional embodiments, the method of determining fitting parameters corresponding to the fitting straight lines of the two sides according to the set of pixel points corresponding to the group of opposite sides, and performing parallel line fitting on the group of opposite sides according to the fitting parameters and a preset fitting function to obtain the fitting straight lines of the group of opposite sides includes: determining the slope corresponding to the fitting straight lines of the first side and the second side according to the coordinates of each pixel point in the set of pixel points corresponding to the group of opposite sides; determining the first vertical intercept corresponding to the fitting straight line of the first side according to the coordinates of each pixel point in the set of pixel points corresponding to the first side in the group of opposite sides; determining the second vertical intercept corresponding to the fitting straight line of the second side according to the coordinates of each pixel point in the set of pixel points corresponding to the second side in the group of opposite sides; determining the fitting straight line of the first side in the group of opposite sides according to the first vertical intercept, the slope and the preset fitting function; and determining the fitting straight line of the second side in the group of opposite sides according to the second vertical intercept, the slope and the preset fitting function.

[0008] In some optional embodiments, the method further comprises: if the absolute value of the slope k1 calculated for one of the two groups of opposite sides is less than a first predetermined threshold, and the absolute value of the slope k2 calculated for the other of the two groups of opposite sides is greater than a second predetermined threshold, forcibly assigning the slope k2 whose absolute value is greater than the predetermined threshold to

[0009] In some optional embodiments, the step of determining a set of pixel points corresponding to each of the four sides of the minimum circumscribed rectangle among the pixel points corresponding to the target point cloud includes: for each of the four sides of the minimum circumscribed rectangle, determining all pixel points within a circular area with the center of the edge as the center of the circle among the pixel points corresponding to the target point cloud, and determining all the determined pixel points as the set of pixel points corresponding to the edge.

[0010] In some optional embodiments, converting a target point cloud including a target area in a point cloud map into a target image includes: determining a size of the target image, and creating a solid color image having the same size as the target image and a first pixel value as the pixel value; for each point in the target point cloud, correspondingly writing the pixel value of the pixel point of the solid color image to a second pixel value different from the first pixel value according to the position, and determining the result obtained after writing as the target image.

[0011] In some optional embodiments, the size of the target image includes a horizontal size and a vertical size; determining the size of the target image and creating a solid color image with the same size as the target image and a pixel value of the first pixel value includes: determining the minimum horizontal coordinate value, the maximum horizontal coordinate value, the minimum vertical coordinate value, and the maximum vertical coordinate value in the coordinates of each vertex of the polygonal outline in the point cloud map, wherein the polygonal outline surrounds the target point cloud; determining the horizontal size of the target image according to the minimum horizontal coordinate value and the maximum horizontal coordinate value, and determining the vertical size of the target image according to the minimum vertical coordinate value and the maximum vertical coordinate value, and creating a solid color image with the horizontal size and the vertical size and the pixel value of the first pixel value.

[0012] In some optional embodiments, the target point cloud including the target area in the point cloud map is converted into a target image, and the method also includes: obtaining a polygon outline pre-input in the point cloud map, and removing outliers from the original point cloud according to the distance between each point of the original point cloud within the polygon outline to obtain the target point cloud.

[0013] In some optional embodiments, the method further includes: using a quadrilateral enclosed by the fitting straight lines of the four sides as the four sides of the minimum circumscribed rectangle, and returning the sets of pixel points corresponding to two groups of opposite sides among the four sides, respectively fitting parallel lines to the two groups of opposite sides, and continuing to execute the operation of obtaining the fitting straight lines of the four sides.

[0014] According to another aspect of an embodiment of the present application, an electronic device is provided, characterized in that it includes: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; the memory is used to store a computer program; and the processor is used to execute the method described in the first aspect above by running the computer program stored in the memory.

[0015] The data processing scheme provided in the embodiment of the present application can convert the target point cloud including the target area in the point cloud map into a target image, and then determine the minimum circumscribed rectangle of the area formed by the pixel points corresponding to the target point cloud in the target image, and then determine the pixel point sets corresponding to the four sides of the minimum circumscribed rectangle in the pixel points corresponding to the target point cloud, and according to the pixel point sets corresponding to the two groups of opposite sides of the four sides, respectively perform parallel line fitting on the two groups of opposite sides to obtain the fitted straight lines of the four sides, and then determine the target area from the point cloud map based on the quadrilateral surrounded by the fitted straight lines of the four sides. Therefore, this scheme can avoid the user from manually marking the target area in the point cloud map, thereby avoiding the errors caused by manual marking, and determining the quadrilateral by parallel line fitting can effectively improve the accuracy of the target area (rectangular area) determined in the point cloud map, so that the rectangular area can be more accurately marked in the point cloud map, so that the robot can more accurately identify it during the autonomous driving operation to meet the needs of the autonomous driving operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0017] Figure 1 The following is a flowchart of an exemplary data processing method in the present application.

[0018] Figure 2 The following is a flowchart of another exemplary data processing method in the present application.

[0019] Figure 3 Schematic diagram of the original point cloud and the target point cloud before and after outlier removal in this application.

[0020] Figure 4 This is an optional sub-step flowchart of step S101 in the present application.

[0021] Figure 5 This is an optional sub-step flowchart of sub-step S1011 in the present application.

[0022] Figure 6 A schematic diagram of the minimum bounding rectangle in this application.

[0023] Figure 7 A schematic diagram for defining the circular area in this application.

[0024] Figure 8This is a flow chart of an optional sub-step for parallel line fitting in this application.

[0025] Fig. 9 This is a schematic diagram of the fitted straight lines of the four sides of the maximum circumscribed rectangle in the present application in the coordinate system.

[0026] Fig.10 This is a schematic diagram of a quadrilateral enclosed by the fitted straight lines of the four sides after the parallel lines are fitted in this application.

[0027] Fig.11 This is a structural block diagram of an exemplary data processing device in this application.

[0028] Fig.12 This is a structural block diagram of an exemplary electronic device in this application. DETAILED DESCRIPTION

[0029] In order to make those skilled in the art better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the embodiments of the present application, all other embodiments obtained by ordinary technicians in this field should belong to the scope of protection of the embodiments of the present application. It should be understood that the various steps recorded in the method implementation mode of the present disclosure can be performed in different orders and / or performed in parallel. In addition, the method implementation mode may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0030] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc. mentioned in this application are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units. It should be noted that the modifications of "one" and "multiple" mentioned in this application are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0031] The specific implementation of the embodiment of the present application is further explained below in conjunction with the accompanying drawings of the embodiment of the present application.

[0032] According to a first aspect of the present application, a data processing method is provided. Figure 1 This is a flowchart of an exemplary data processing method in this application. Figure 1 As shown, the data processing method includes steps S101, S102, S103, S104 and S105, specifically:

[0033] S101: Convert a target point cloud including a target area in a point cloud map into a target image.

[0034] In the present application, the point cloud map can be an overall laser point cloud map of the robot's working environment, and the target area can be a specific area in the robot's working environment, and the target area is generally approximately rectangular. The robot can be any robot that can realize the automatic driving function, for example, it can be a cleaning robot (including but not limited to unmanned cleaning vehicles, etc.), an indoor mobile robot (including but not limited to sweeping robots, etc.), a lawn mowing robot, a swimming pool robot, etc. Taking the robot as an unmanned cleaning vehicle as an example, the target area can be the elevator area in its working environment, and the elevator area is generally approximately rectangular. The unmanned cleaning vehicle can determine the target area (elevator area) through the point cloud map to easily move to the elevator, thereby realizing cross-floor cleaning operations. For the convenience of illustrating the technical solution of the embodiment of the present application, the following example can be taken as an unmanned cleaning vehicle and the target area as an elevator area.

[0035] In this application, the point cloud map can be a pre-built laser point cloud map, which can be composed of multiple points. When the robot is working, the point cloud map can be directly used for autonomous driving operations. The point cloud map can be created by a conventional point cloud map creation algorithm, and the created point cloud map can be a point cloud map of a PCD file, which can be completed by the robot's positioning module and / or SLAM (Simultaneous Localization and Mapping) module.

[0036] When step S101 is executed, the point cloud map may be loaded first, and then the target point cloud including the target area in the point cloud map may be converted into a target image. Compared with directly processing the point cloud data, processing the image data is more convenient for subsequent steps.

[0037] Optionally, the point cloud map can be loaded using the point cloud map reading method pcl::io::loadPCDFile provided in the PCL (Point Cloud Library) library (or other point cloud reading methods can also be used) to load the point cloud data in the point cloud map file with pcl::PointCloud <pcl::pointxyz>The data structure is loaded into memory. Each point cloud of the pcl::PointXYZ structure contains the global horizontal and vertical coordinates of the point cloud.

[0038] The specific implementation of step S101 is not limited in this application. Figure 2 As shown, before executing step S101, the following step S100 may be executed first:

[0039] S100: Obtain a polygonal outline pre-input in the point cloud map, and remove outliers from the original point cloud according to the distances between the points of the original point cloud within the polygonal outline to obtain a target point cloud.

[0040] Optionally, the user may input a polygon outline in the point cloud map from the front end, specifically, the user may select a polygon outline in the point cloud map to enclose the point cloud corresponding to the target area. Figure 3 In the example shown, the vertices of each side of the polygon outline can be used to generate a point set Ele_Points={Pe_1, Pe_2, . . . , Pe_n} in clockwise or counterclockwise order. Figure 3 In the example, the polygonal outline is a quadrilateral outline, and there are 4 vertices in the point set Ele_Points, namely Pe_1, Pe_2, Pe_3, and Pe_4. The point cloud in the polygonal outline is the original point cloud. It should be understood that Figure 3 The quadrilateral outline in the figure is only an example for ease of understanding, and the frame may also be selected into other shapes, and this application does not impose any limitation on this.

[0041] Since there may be relatively sparse and scattered point clouds in the original point cloud in the polygonal contour, this type of point cloud may be affected by the surface material of the target obstacle, causing noise in the point cloud; it may also be caused by obstacles such as smoke and fog in the environment. In this application, by removing outliers from the original point cloud to obtain the target point cloud, the effect of subsequent parallel line fitting can be effectively improved, thereby improving the accuracy of determining the target area.

[0042] Optionally, the above step S100 can be implemented by the outlier filtering algorithm provided by the PCL library. The outlier filtering algorithm can be, for example, the pcl::StatisticalOutlierRemoval algorithm. Taking this method as an example, the method can analyze and count the neighborhood of each point in the original point cloud, calculate the distance distribution from the point to the neighboring points, and obtain the average distance of all neighboring points. Based on the mean and standard deviation of all distances, the point cloud dataset cloud (that is, the original point cloud) loaded into the memory is screened for outliers to obtain the filtered point cloud set filterd_cloud (that is, the target point cloud). The example program code is as follows: "

[0043] pcl::StatisticalOutlierRemoval <pcl::pointxyz>sor;

[0044] sor.setInputCloud(cloud);

[0045] sor.setMeanK(M);

[0046] sor.setStddevMulThresh(N);

[0047] sor.filter(*filterd_cloud);

[0048] ”

[0049] In the above program code, M is the number of adjacent points analyzed for each point, and N is the standard deviation multiple. M and N can be adjusted to appropriate values ​​according to actual conditions when used. For example, in an optional example, M is set to 30 and N is set to 0.3.

[0050] Based on this, the above method can effectively remove outliers from the original point cloud to obtain the target point cloud. Figure 3 As shown, examples of the original point cloud and the target point cloud before and after outlier removal are shown, and it can be seen that some outliers in the original point cloud are effectively removed.

[0051] In some optional embodiments, referring to Figure 4 In the flowchart shown, step S101 includes the following sub-steps S1011 and S1012:

[0052] S1011: Determine the size of the target image, and create a pure color image with the same size as the target image and a pixel value of the first pixel value.

[0053] The pure color image may be any pure color image, and the first pixel value may be any pixel value. For example, in an optional embodiment, the first pixel value of the pure color image may be a pixel value 0 corresponding to black, or may be a pixel value 255 corresponding to white.

[0054] It should be understood that the size of the target image includes horizontal and vertical dimensions, which are the same as the sizes of the pure color image and the target image, that is, the horizontal dimension of the pure color image is the same as the horizontal dimension of the target image, and the vertical dimension of the pure color image is the same as the vertical dimension of the target image.

[0055] In some optional embodiments, referring to Figure 5 In the flowchart shown, sub-step S1011 includes the following sub-steps S1011A and S1011B:

[0056] S1011A: Determine the minimum horizontal coordinate value, the maximum horizontal coordinate value, the minimum vertical coordinate value, and the maximum vertical coordinate value in the coordinates of each vertex of the polygonal outline in the point cloud map, wherein the polygonal outline surrounds the target point cloud.

[0057] Optionally, Figure 3 For example, the vertices of the polygon outline are: Pe_1, Pe_2, Pe_3, Pe_4, and each of the four vertices has a corresponding coordinate. Then the minimum horizontal coordinate value X_min, the maximum horizontal coordinate value X_max, the minimum vertical coordinate value Y_min, and the maximum vertical coordinate value Y_max of the coordinates of each vertex of the polygon outline can be determined:

[0058] X_min=min[x(Pe_1),x(Pe_2),...,x(Pe_n)]

[0059] X_max=max[x(Pe_1),x(Pe_2),...,x(Pe_n)]

[0060] Y_min=min[y(Pe_1),y(Pe_2),...,y(Pe_n)]

[0061] Y_max=max[y(Pe_1),y(Pe_2),...,y(Pe_n)]

[0062] Among them, x(Pe_1), x(Pe_2), ..., x(Pe_n) represent the horizontal coordinates of vertices Pe_1, Pe_2, ..., Pe_n respectively. For example, y(Pe_1), y(Pe_2), ..., y(Pe_n) represent the vertical coordinates of vertices Pe_1, Pe_2, ..., Pe_n respectively, and the rest can be deduced by analogy. Corresponding to Figure 3 For example, n=4.

[0063] S1011B: Determine the horizontal size of the target image according to the minimum horizontal coordinate value and the maximum horizontal coordinate value, and determine the vertical size of the target image according to the minimum vertical coordinate value and the maximum vertical coordinate value, and create a pure color image with the horizontal size and the vertical size and the pixel value being the first pixel value.

[0064] A pure color image whose horizontal dimension is the maximum horizontal coordinate value X_max minus the minimum horizontal coordinate value X_min and whose vertical dimension is the maximum vertical coordinate value Y_max minus the minimum vertical coordinate value Y_min may be determined. Optionally, the first pixel value of the pure color image is 0 as an example.

[0065] For the generated solid color image, its image height and image width can be calculated as follows:

[0066] height=(Y_max-Y_min) / resolution

[0067] width=(X_max-X_min) / resolution

[0068] Among them, height is the image height of the pure color image, width is the image width of the pure color image, and resolution is the accuracy of the image, which can be set as small as possible and can be adjusted according to actual needs.

[0069] In the above manner, a pure color image (referred to as image) with a horizontal size of X_max-X_min, a vertical size of Y_max-Y_min, an image width of width, an image height of height, and a pixel value of the first pixel value can be obtained. Optionally, the pure color image can be created based on OpenCV.

[0070] Based on this, by including the optional implementation of the above-mentioned sub-steps S1011A to S1011B, the size of the target image can be conveniently and quickly determined, and a pure color image with the same size as the target image and a pixel value of the first pixel value can be conveniently and quickly created to facilitate data processing in subsequent steps.

[0071] S1012: For each point in the target point cloud, the pixel value of the pixel point of the pure color image is flushed to a second pixel value different from the first pixel value according to the position correspondence, and the result obtained after flushing is determined as the target image.

[0072] Optionally, each point in the target point cloud can be traversed, that is, all points in the range of X_min to X_max and the range of Y_min to Y_max can be obtained, and the pixel points corresponding to their positions in the pure color image can be brushed, and the pixel value of the pixel point can be brushed to a second pixel value different from the first pixel value. The first pixel value and the second pixel value can have a certain degree of distinction, so as to facilitate the subsequent processing of the obtained target image. Optionally, taking the first pixel value of the pure color image as 0 as an example, the second pixel value can be set to 255, so that the obtained target image is a binary image.

[0073] Optionally, the position correspondence between each point in the target point cloud and the pixel point of the pure color image image can be expressed by the following formula:

[0074] Image_Xn=round(x-X_min) / resolution

[0075] Image_Yn=round(y-Y_min) / resolution

[0076] Among them, Image_Xn represents the horizontal coordinate of the pixel point, and Image_Yn represents the vertical coordinate of the pixel point. The function of round() is to round the floating point number and return the nearest integer. x is the horizontal coordinate of the point in the target point cloud, and y is the vertical coordinate of the point in the target point cloud. X_min represents the minimum horizontal coordinate value, and Y_min represents the minimum vertical coordinate value (refer to the previous text for understanding). Resolution is the accuracy of the image, which can be set as small as possible and can be adjusted according to actual needs to meet the needs of point cloud screening.

[0077] Based on this, by including the optional implementation of the above sub-steps S1011 to S1012, the target point cloud including the target area in the point cloud map can be effectively converted into a target image, and the target image can represent the point cloud obstacle information, thereby facilitating subsequent data processing of the target image.

[0078] Optionally, in order to reduce the influence of the point cloud of the non-target area in the target image on the minimum bounding rectangle calculation in the following step S102, the target image obtained based on the pure color image may be closed, that is, dilated and eroded, and the closed target image may be used for data processing in the subsequent step S102. Optionally, the closed target image may be closed based on OpenCV.

[0079] S102: Determine the minimum bounding rectangle of the area formed by the pixel points corresponding to the target point cloud in the target image.

[0080] The implementation of step S102 is not specifically limited in the present application. In some optional implementations, step S102 includes: performing contour detection on each pixel point in the target image corresponding to the target point cloud and having a pixel value of the second pixel value, determining at least one circumscribed rectangular contour, and determining the circumscribed rectangular contour with the smallest area among the at least one circumscribed rectangular contour as the minimum circumscribed rectangle.

[0081] Based on this, the minimum bounding rectangle of the area formed by the pixels corresponding to the target point cloud in the target image can be determined quickly and effectively to facilitate subsequent data processing.

[0082] For example, refer to Figure 6 An example of the style after the minimum enclosing rectangle is determined is shown, and it can be seen that the pixels corresponding to the target point cloud are all within the minimum enclosing rectangle. Optionally, the above-mentioned contour detection can be implemented on the target image based on OpenCV in the present application. For example, the contour detection mode of OpenCV can be set to cv::RETR_EXTERNAL mode to perform contour detection on each pixel point in the target image corresponding to the target point cloud and having a pixel value of the second pixel value through the cv::RETR_EXTERNAL contour detection algorithm to obtain at least one circumscribed rectangle contour.

[0083] For example, the above contour detection can be understood by referring to the following example program code:

[0084] std::vector <std::vector <cv::point>>contours;

[0085] std::vector <cv::vec4i>hierarchy;

[0086] findContours(src_image,contours,hierarchy,cv::RETR_EXTERNAL,cv::CHAIN_APPRO X_SIMPLE);

[0087] ”

[0088] In the program code of the above example, contours is the obtained circumscribed rectangle contour, which may be more than one. Then, the area of ​​each circumscribed rectangle contour can be calculated to obtain the circumscribed rectangle contour with the smallest area, which is used as the minimum circumscribed rectangle.

[0089] Of course, other contour detection algorithms may also be used in the present application to implement the contour detection in the above step S102, as long as they can meet the requirements, and this application does not impose any limitation on this.

[0090] S103: Determine, among the pixel points corresponding to the target point cloud, a set of pixel points corresponding to each of the four sides of the minimum circumscribed rectangle.

[0091] After the minimum circumscribed rectangle is determined, pixel point sets corresponding to the four sides of the minimum circumscribed rectangle can be screened out from the pixel points corresponding to the target point cloud, and each pixel point set includes a plurality of pixel points.

[0092] The specific implementation of step S103 is not limited in the present application. For example, in some optional embodiments, step S103 includes: for each of the four sides of the minimum circumscribed rectangle, determining all pixel points in a circular area with the center of the side as the center of the circle among the pixel points corresponding to the target point cloud, and determining all the determined pixel points as the pixel point set corresponding to the side.

[0093] Based on this, in the present application, for each of the four sides of the minimum circumscribed rectangle, by determining all the pixel points in the circular area with the center of the edge as the center among the pixel points corresponding to the target point cloud, all the determined pixel points can be conveniently and quickly determined as the pixel point set corresponding to the edge, so as to facilitate subsequent data processing.

[0094] Optionally, after obtaining the minimum circumscribed rectangle, the present application may obtain the coordinates of the two endpoints of any one of the edges in a clockwise or counterclockwise direction, and then the coordinates of the midpoint of the edge may be calculated through the two endpoints.

[0095] Reference Figure 7 , taking a circular area as an example, the determination process of the above step S103 is exemplarily described. Figure 7 Take the left side of the minimum circumscribed rectangle in as an example. The coordinates of the two endpoints P1 and P2 of the left side are (x1, y1) and (x2, y2) respectively. Then, according to the coordinates of the two endpoints P1 and P2, the coordinates of the midpoint P_middle can be calculated as: ((x1+x2) / 2, (y1+y2) / 2); then, a circle can be drawn with the midpoint P_middle as the center and (sqrt((x1-x2)^2+(y1-y2)^2)) / 2 as the radius. The radius of the circle is denoted as R, where sqrt is the square root operator. In order to ensure that the pixel points corresponding to the left side of the strip are screened out more accurately, the pixel points corresponding to the screened left side of the strip can be all within the minimum circumscribed rectangular area, and also within the range of the circular area with a radius of θ*R (0<θ≤1); after selecting a suitable θ value, the circular area can be determined with a suitable radius θ*R, so that all the pixel points within the circular area with a radius of θ*R are determined as the pixel point set corresponding to the strip. Similarly, the other three sides of the minimum circumscribed rectangle can be understood with reference to the example of the left side, and the pixel point sets corresponding to the other three sides can be obtained, which will not be repeated here.

[0096] As can be seen from the above, in the embodiment of the present application, the radius of the circular area can range from (0, R], where R is 1 / 2 of the length of the side. By selecting values ​​within this range, it is possible to ensure that the set of pixel points corresponding to each side of the minimum circumscribed rectangle is determined. In addition, since each adjacent side in the minimum circumscribed rectangle has an intersection, if the radius of the circular area is too large, the circular area of ​​a certain side in the minimum circumscribed rectangle can enclose more pixel points corresponding to the adjacent sides. Therefore, in the present application, through the value range of the circular area, a suitable radius value θ*R (0<θ≤1) can be selected from the value range to avoid the circular area of ​​a certain side of the minimum circumscribed rectangle enclosing too many pixel points corresponding to the adjacent sides (which can be combined with Figure 7 It is understood that the selected circular area with a radius of θ*R surrounds fewer pixel points corresponding to adjacent edges), and more accurately screens out the pixel points corresponding to each edge, thereby reducing the amount of subsequent processing operations and improving the calculation accuracy.

[0097] S104: performing parallel line fitting on two groups of opposite sides among the four sides according to sets of pixel points corresponding to the two groups of opposite sides respectively, to obtain fitting straight lines of the four sides.

[0098] In step S103, the pixel point sets corresponding to the four sides of the minimum circumscribed rectangle are obtained. The pixel point sets corresponding to the two sets of opposite sides of the minimum circumscribed rectangle can be taken as a group to obtain two sets of pixel point sets. Based on the two sets of pixel point sets, parallel lines are fitted to the two sets of opposite sides respectively to obtain fitted straight lines of the four sides.

[0099] It should be understood that, since parallel line fitting is performed on two sets of opposite sides, the slopes of the two sides in each set of opposite sides fitted are the same, but the longitudinal intercepts are different.

[0100] The specific implementation of step S104 is not limited in the present application. For example, in some optional embodiments, step S104 includes: for each of the two groups of opposite sides: according to the set of pixel points corresponding to the group of opposite sides, determining the fitting parameters corresponding to the fitting straight lines of the two sides, and performing parallel line fitting on the group of opposite sides according to the fitting parameters and a preset fitting function to obtain the fitting straight lines of the group of opposite sides.

[0101] Based on this, in the present application, for each set of opposite sides of the minimum circumscribed rectangle, the fitting parameters corresponding to the fitting straight lines of the two sides are determined according to the set of pixel points corresponding to the set of opposite sides, so that the set of opposite sides can be effectively fitted with parallel lines through the fitting parameters and the preset fitting function, thereby quickly and conveniently obtaining the fitting straight lines of the set of opposite sides.

[0102] Optionally, the parallel line fitting of each set of opposite sides can be implemented based on the least squares method in the present application. The slope and the vertical intercept corresponding to the fitting straight line of the two sides can be determined based on the set of pixel points corresponding to each set of opposite sides, and then the fitting straight line of the two sides can be determined based on a preset linear fitting function.

[0103] In some optional embodiments, referring to Figure 8 As shown in the flowchart, the above-mentioned "determining the fitting parameters corresponding to the fitting straight lines of the two edges according to the pixel point set corresponding to the group of opposite edges, and performing parallel line fitting on the group of opposite edges according to the fitting parameters and the preset fitting function to obtain the fitting straight lines of the group of opposite edges" includes the following sub-steps S1041, S1042, S1043 and S1044:

[0104] S1041: Determine the slopes corresponding to the fitted straight lines of the first edge and the second edge according to the coordinates of each pixel point in the set of pixel points corresponding to the group of opposite edges.

[0105] Fig. 9 The schematic diagram of the fitted straight lines of the four sides of the maximum circumscribed rectangle in the coordinate system is shown. Set the fitting function to y=kx+b, refer to Fig. 9 As shown, the slopes of each pair of opposite sides in the fitted straight lines of the four sides are the same, but the vertical intercepts are different. Fig. 9 For example, the first set of opposite sides, the upper side and the lower side, can be used to illustrate the embodiment of the present application. The upper side is the first side of the set of opposite sides, and its fitting line can be y=k1x+b1, and the lower side is the second side of the set of opposite sides, and its fitting line can be y=k1x+b2.

[0106] Assume that the first edge in the first set of opposite edges (refer to Fig. 9 The coordinates of each pixel point in the corresponding pixel point set are recorded as (x1, y1), (x2, y2), ..., (x i ,y i ),...,(x n ,y n ), where there are N pixels in total; assuming that the second edge of the first set of opposite edges (refer to Fig. 9 The coordinates of each pixel point in the corresponding pixel point set are recorded as (x1, y1), (x2, y2), ..., (x j ,y j ),...,(x m ,y m ), where there are M pixels in total; the slope k1 corresponding to the fitting straight line of the first edge and the second edge can be calculated by substituting the coordinates of each pixel in the pixel set corresponding to the pair of opposite edges into the following formula 1:

[0107]

[0108] Next, the expression of k1 is derived as follows:

[0109] Based on the above pixel point set corresponding to the first edge, the pixel point set corresponding to the second edge, and the premise that the fitted lines are parallel lines, the following optimization formula is designed in this application:

[0110]

[0111] After that, the partial derivatives of the first vertical intercept b1 and the second vertical intercept b2 in the optimization formula are calculated respectively:

[0112]

[0113] When the minimum deviation is calculated by the optimization formula, the above two partial derivatives are both 0, that is:

[0114]

[0115] After simplifying the above two equations, we can get:

[0116] The relationship between the first vertical intercept b1 and the slope k1 (recorded as formula 2):

[0117]

[0118] The relationship between the second longitudinal intercept b2 and the slope k1 (recorded as Formula 3):

[0119]

[0120] After that, the partial derivative of the slope k1 in the optimization formula is calculated:

[0121]

[0122] Similarly, when the minimum deviation is calculated by the optimization formula, the partial derivative of k1 is 0, that is:

[0123]

[0124] After simplifying the above formula, we can get:

[0125]

[0126] Substitute the relationship between the first vertical intercept b1 and the slope k1 (Formula 2) and the relationship between the second vertical intercept b2 and the slope k1 (Formula 3) into the above formula and simplify to obtain the above formula 1.

[0127] Therefore, by substituting the coordinates of each pixel point in the pixel point set corresponding to the pair of opposite sides into Formula 1, the slope k1 corresponding to the fitting straight line of the first side and the second side can be calculated.

[0128] S1042: Determine a first longitudinal intercept corresponding to the fitting straight line of a first side in the set of opposite sides according to the coordinates of each pixel point in the set of pixel points corresponding to the first side.

[0129] Optionally, after the slope k1 is calculated in the above sub-step S1041, the coordinates (x1, y1), (x2, y2), ..., (x i ,y i ),...,(x n ,y n ), and the slope k1, are substituted into the above formula 2 to obtain the first longitudinal intercept b1 corresponding to the fitting straight line of the first side.

[0130] S1043: Determine a second longitudinal intercept corresponding to the fitting straight line of a second side in the set of opposite sides according to the coordinates of each pixel point in the set of pixel points corresponding to the second side.

[0131] Optionally, after the slope k1 is calculated in the above sub-step S1041, the coordinates (x1, y1), (x2, y2), ..., (x j ,y j ),...,(x m ,y m ), and the slope k1, are substituted into the above formula 3 to obtain the second longitudinal intercept b2 corresponding to the fitting straight line of the second side.

[0132] S1044: Determine a fitting straight line for the first side in the set of opposite sides according to the first vertical intercept and the slope and a preset fitting function, and determine a fitting straight line for the second side in the set of opposite sides according to the second vertical intercept and the slope and a preset fitting function.

[0133] As mentioned above, the fitting function is y=kx+b. After obtaining the slope k1, the first vertical intercept b1 corresponding to the fitting straight line of the first side, and the second vertical intercept b2 corresponding to the fitting straight line of the second side, the expression of the fitting straight line of the first side can be uniquely determined according to k1 and b1: y=k1x+b1, and the expression of the fitting straight line of the second side can be uniquely determined according to k1 and b2: y=k1x+b2.

[0134] It should be understood that the above has been a set of opposite sides (can be Fig. 9 The parallel line fitting process of the upper and lower sides in the figure is explained in detail. Since the principle is the same, the other pair of opposite sides (can be Fig. 9 The parallel line fitting process of the other set of opposite sides (the left side and the right side in the figure) can be understood by referring to the above text. The slope k2 of the other set of opposite sides, the first vertical intercept b3 corresponding to the fitting straight line of the first side of the other set of opposite sides, and the second vertical intercept b4 corresponding to the fitting straight line of the second side of the other set of opposite sides can be calculated to obtain the corresponding fitting straight lines y=k2x+b3 and y=k2x+b4, which will not be repeated here.

[0135] Based on this, in the present application, through the optional implementation of the above sub-steps S1041 to S1044, parallel line fitting can be accurately and conveniently implemented for the group of opposite sides to obtain the fitting straight lines of the group of opposite sides. The quadrilateral is subsequently determined through the optional method of parallel line fitting, which is beneficial to improve the accuracy of the target area (rectangular area) determined in the point cloud map, so that the rectangular area can be more accurately marked in the point cloud map, so that the robot can identify it more accurately during autonomous driving operations to meet the needs of autonomous driving operations.

[0136] Optionally, the intersection points of the fitted straight lines of the four sides can be solved, and a total of four intersection points can be calculated and connected clockwise or counterclockwise to obtain a quadrilateral surrounded by the fitted straight lines of the four sides. These four intersection points are also the four endpoints of the quadrilateral, which can be used in the subsequent step S105.

[0137] For example, refer to Fig.10 , which shows an example of a quadrilateral enclosed by the fitted straight lines of the four sides.

[0138] In some optional embodiments, the data processing method of the present application further includes: if the absolute value of the slope k1 calculated for one of the two groups of opposite sides is less than a first predetermined threshold, and the absolute value of the slope k2 calculated for the other of the two groups of opposite sides is greater than a second predetermined threshold, then forcibly assigning the slope k2 whose absolute value is greater than the predetermined threshold to

[0139] When the least squares method is used to fit parallel lines, the fitting effect is not as good as that of the small slope (i.e., the small absolute value) for the case of a large slope. Therefore, in this application, the slopes of the fitted parallel lines are selectively discarded, and the slopes of the parallel lines with large slopes are forcibly assigned. Taking the example in the above text as an example, if the absolute value of the slope k1 of a group of opposite sides is less than the first preset threshold, it can be considered that the fitting effect of this group of opposite sides is better, and the absolute value of the slope k2 of another group of opposite sides is too large (i.e., the absolute value of k2 is greater than the second preset threshold), then it is considered that the fitting effect of the other group of opposite sides is poor, and the originally calculated value of k2 is discarded, and forcibly assigned.

[0140] Therefore, in the present application, through the optional implementation method of forced assignment mentioned above, the slope parameter can be optimized, and the fitting effect of parallel line fitting can be effectively improved.

[0141] It should be understood that the first predetermined threshold and the second predetermined threshold can be set according to actual needs, and the second predetermined threshold can be greater than the first predetermined threshold, and the present application does not impose any limitation on this.

[0142] In some optional embodiments, the data processing method in the present application also includes: using a quadrilateral enclosed by the fitting straight lines of the four sides as the four sides of the minimum circumscribed rectangle, and returning a set of pixel points corresponding to two groups of opposite sides of the four sides, respectively fitting parallel lines for the two groups of opposite sides, and continuing to execute the operation of obtaining the fitting straight lines of the four sides (i.e., step S104).

[0143] Based on this, in an embodiment of the present application, a quadrilateral surrounded by fitting straight lines of four sides can be used as the four sides of the minimum circumscribed rectangle to iteratively optimize the quadrilateral, and the aforementioned step S104 is iteratively executed to perform parallel line fitting so that the final quadrilateral has better effect, so that the subsequent step S105 determines the target area from the point cloud map with better effect and higher accuracy.

[0144] It should be understood that the number of iterative optimizations can be determined as needed, and this application does not impose any limitation thereon. After the above iterative optimization is completed, a quadrilateral with better effect can be obtained.

[0145] S105: Determine a target area from the point cloud map based on a quadrilateral enclosed by the fitted straight lines of the four sides.

[0146] For example, refer to Fig.10 As shown, it shows an example of a quadrilateral surrounded by fitted straight lines on four sides. The quadrilateral can be mapped from the image to the corresponding area in the point cloud map, and the target area can be effectively determined from the point cloud map to facilitate the labeling of the target area (rectangular area).

[0147] Based on this, the present application adopts the optional data processing scheme of the above steps S101 to S105, because it can convert the target point cloud including the target area in the point cloud map into a target image, and then determine the minimum circumscribed rectangle of the area formed by the pixel points corresponding to the target point cloud in the target image, and then determine the pixel point sets corresponding to the four sides of the minimum circumscribed rectangle in the pixel points corresponding to the target point cloud, and according to the pixel point sets corresponding to the two groups of opposite sides of the four sides, respectively perform parallel line fitting on the two groups of opposite sides to obtain the fitted straight lines of the four sides, and then determine the target area from the point cloud map based on the quadrilateral surrounded by the fitted straight lines of the four sides. Therefore, this scheme can avoid the user from manually marking the target area in the point cloud map, thereby avoiding the errors caused by manual marking, and determining the quadrilateral by parallel line fitting can effectively improve the accuracy of the target area (rectangular area) determined in the point cloud map, so that the rectangular area can be more accurately marked in the point cloud map, so that the robot can more accurately identify it during the autonomous driving operation to meet the needs of the autonomous driving operation.

[0148] It should be understood that the above description of the data processing method is merely an exemplary description of the present application and does not constitute any limitation to the present application.

[0149] According to a second aspect of an embodiment of the present application, a data processing device is provided. Fig.11 FIG. 1 is a block diagram showing an exemplary data processing device 100 of the present application. The data processing device 100 of this embodiment includes:

[0150] A conversion module 101, used to convert a target point cloud including a target area in a point cloud map into a target image;

[0151] A first determination module 102 is used to determine the minimum circumscribed rectangle of an area formed by pixel points corresponding to the target point cloud in the target image;

[0152] A second determination module 103 is used to determine a set of pixel points corresponding to four sides of the minimum circumscribed rectangle among the pixel points corresponding to the target point cloud;

[0153] A fitting module 104 is used to perform parallel line fitting on two groups of opposite sides of the four sides according to sets of pixel points corresponding to the two groups of opposite sides respectively, so as to obtain fitting straight lines of the four sides;

[0154] The third determination module 105 is used to determine the target area from the point cloud map based on the quadrilateral surrounded by the fitted straight lines of the four sides.

[0155] In the data processing scheme provided by the embodiment of the present application, since the conversion module 101 can convert the target point cloud including the target area in the point cloud map into the target image, the first determination module 102 then determines the minimum circumscribed rectangle of the area formed by the pixel points corresponding to the target point cloud in the target image, and then the second determination module 103 can determine the pixel point sets corresponding to the four sides of the minimum circumscribed rectangle in the pixel points corresponding to the target point cloud, and the fitting module 104 can perform parallel line fitting on the two groups of opposite sides according to the pixel point sets corresponding to the two groups of opposite sides in the four sides, respectively, to obtain the fitted straight lines of the four sides, and then the third determination module 105 can determine the target area from the point cloud map based on the quadrilateral surrounded by the fitted straight lines of the four sides. Therefore, this scheme can avoid the user from manually marking the target area in the point cloud map, thereby avoiding the error caused by manual marking, and determining the quadrilateral by parallel line fitting can effectively improve the accuracy of the target area (rectangular area) determined in the point cloud map, so that the rectangular area can be more accurately marked in the point cloud map, so that the robot can more accurately identify it during the autonomous driving operation to meet the needs of the autonomous driving operation.

[0156] In some optional embodiments, the fitting module 104 is specifically used to: for each group of opposite sides in the two groups of opposite sides: determine the fitting parameters corresponding to the fitting straight lines of the two sides according to the set of pixel points corresponding to the group of opposite sides; and perform parallel line fitting for the group of opposite sides according to the fitting parameters and a preset fitting function to obtain the fitting straight lines of the group of opposite sides.

[0157] In some optional embodiments, the fitting module 104 is specifically used to: determine the slope corresponding to the fitted straight line of the first side and the second side according to the coordinates of each pixel point in the pixel point set corresponding to the group of opposite sides; determine the first vertical intercept corresponding to the fitted straight line of the first side according to the coordinates of each pixel point in the pixel point set corresponding to the first side in the group of opposite sides; determine the second vertical intercept corresponding to the fitted straight line of the second side according to the coordinates of each pixel point in the pixel point set corresponding to the second side in the group of opposite sides; determine the fitted straight line of the first side in the group of opposite sides according to the first vertical intercept, the slope and the preset fitting function; and determine the fitted straight line of the second side in the group of opposite sides according to the second vertical intercept, the slope and the preset fitting function.

[0158] In some optional embodiments, the data processing device 100 is further configured to: if the absolute value of the slope k1 calculated for one of the two groups of opposite sides is less than a first predetermined threshold, and the absolute value of the slope k2 calculated for the other of the two groups of opposite sides is greater than a second predetermined threshold, forcibly assigning the slope k2 whose absolute value is greater than the predetermined threshold to

[0159] In some optional embodiments, the second determination module 103 is specifically used to: for each of the four sides of the minimum circumscribed rectangle, determine all pixel points within a circular area with the center of the edge as the center of the circle, among the pixel points corresponding to the target point cloud, and determine all the determined pixel points as the pixel point set corresponding to the edge.

[0160] In some optional embodiments, the conversion module 101 is specifically used to: determine the size of the target image, and create a pure color image with the same size as the target image and a first pixel value; for each point in the target point cloud, correspondingly change the pixel value of the pixel point of the pure color image to a second pixel value different from the first pixel value according to the position, and determine the result obtained after the change as the target image.

[0161] In some optional embodiments, the size of the target image includes a horizontal size and a vertical size; the conversion module 101 is specifically used to: determine the minimum horizontal coordinate value, the maximum horizontal coordinate value, the minimum vertical coordinate value, and the maximum vertical coordinate value in the coordinates of each vertex of the polygonal outline in the point cloud map, wherein the polygonal outline surrounds the target point cloud; determine the horizontal size of the target image according to the minimum horizontal coordinate value and the maximum horizontal coordinate value, and determine the vertical size of the target image according to the minimum vertical coordinate value and the maximum vertical coordinate value, and create a solid color image with the size of the horizontal size and the vertical size and the pixel value of the first pixel value.

[0162] In some optional embodiments, the data processing device 100 is also used to: obtain a polygon outline pre-input in the point cloud map, and remove outliers from the original point cloud according to the distance between each point of the original point cloud within the polygon outline to obtain the target point cloud.

[0163] In some optional embodiments, the data processing device 100 is also used to: use the quadrilateral enclosed by the fitting straight lines of the four sides as the four sides of the minimum circumscribed rectangle, and return the sets of pixel points corresponding to two groups of opposite sides among the four sides, respectively perform parallel line fitting on the two groups of opposite sides, and continue to execute the operation of obtaining the fitting straight lines of the four sides.

[0164] The data processing device 100 of the embodiment of the present application and the data processing method provided in the first aspect are based on the same inventive concept, and are used to implement the corresponding data processing methods in the aforementioned multiple method embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be described in detail here. In addition, the functional implementation of each module in the data processing device 100 of this embodiment can refer to the description of the corresponding parts in the aforementioned method embodiments, which will not be described in detail here.

[0165] According to a third aspect of an embodiment of the present application, there is provided an electronic device, comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; the memory is used to store a computer program; and the processor is used to execute the data processing method described in the first aspect above by running the computer program stored in the memory.

[0166] Fig.12 The embodiment of the present application does not limit the specific implementation of the electronic device 1200. As an example, refer to Fig.12 The electronic device 1200 provided in the embodiment of the present application includes: a processor 1202, a communication interface 1204, a memory 1206, and a communication bus 1208. Among them:

[0167] The processor 1202 , the communication interface 1204 , and the memory 1206 communicate with each other via a communication bus 1208 .

[0168] The communication interface 1204 is used to communicate with other electronic devices or servers.

[0169] The processor 1202 is used to execute the computer program 1210, and specifically can execute the relevant steps in any of the aforementioned data processing method embodiments.

[0170] Specifically, the computer program 1210 may include program codes including computer operation instructions.

[0171] The processor 1202 may be a central processing unit (CPU), a graphics processing unit (GPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; or may be processors of different types, such as one or more CPUs and one or more ASICs.

[0172] The memory 1206 is used to store the computer program 1210. The memory 1206 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0173] The computer program 1210 may be specifically configured to enable the processor 1202 to execute the data processing method in any of the foregoing embodiments.

[0174] The specific implementation of each step in the computer program 1210 can refer to the corresponding description of the corresponding steps and units in any of the aforementioned data processing method embodiments, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the aforementioned method embodiments, which will not be repeated here.

[0175] The electronic device 1200 in the embodiment of the present application has been described in detail in the aforementioned data processing method embodiment, so its related contents and beneficial effects can be understood with reference to the aforementioned method embodiment and will not be described again here.

[0176] According to a fourth aspect of an embodiment of the present application, a computer storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the data processing method described in the first aspect is implemented.

[0177] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the data processing method as described in the first aspect is implemented.

[0178] The electronic device 1200 / computer storage medium / computer program product embodiment in the embodiment of the present application has been described in detail in the aforementioned data processing method embodiment, so its related content and beneficial effects can be understood with reference to the above-mentioned method embodiment and will not be repeated here.

[0179] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present application can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present application.

[0180] The above-mentioned method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as software or computer code that can be stored in a recording medium (such as a CD ROM, RAM, floppy disk, hard disk or magneto-optical disk), or implemented as a computer code originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a special-purpose processor or programmable or special-purpose hardware (such as an ASIC or FPGA). It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, a processor or hardware, the method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the method shown here, the execution of the code converts the general-purpose computer into a special-purpose computer for executing the method shown here.

[0181] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present application.

[0182] The above implementation methods are only used to illustrate the embodiments of the present application, and are not limitations on the embodiments of the present application. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present application. The scope of patent protection of the embodiments of the present application should be limited by the claims. < / cv::point> < / pcl::pointxyz> < / pcl::pointxyz>

Claims

1. A data processing method, comprising: Converting a target point cloud including a target area in the point cloud map into a target image; Determine a minimum circumscribed rectangle of an area formed by pixel points corresponding to the target point cloud in the target image; Determine, among the pixel points corresponding to the target point cloud, a set of pixel points corresponding to each of the four sides of the minimum circumscribed rectangle; According to the pixel point sets corresponding to two groups of opposite sides of the four sides, respectively, parallel line fitting is performed on the two groups of opposite sides to obtain fitting straight lines of the four sides; The target area is determined from the point cloud map based on a quadrilateral enclosed by the fitted straight lines of the four sides.

2. The method according to claim 1, wherein: The performing parallel line fitting on the two groups of opposite sides respectively according to the pixel point sets corresponding to the two groups of opposite sides among the four sides to obtain the fitting straight lines of the four sides comprises: For each of the two sets of opposite sides: According to the pixel point set corresponding to the group of opposite sides, the fitting parameters corresponding to the fitting straight lines of the two sides are determined, and according to the fitting parameters and a preset fitting function, parallel line fitting is performed on the group of opposite sides to obtain the fitting straight lines of the group of opposite sides.

3. The method according to claim 2, wherein: The step of determining fitting parameters corresponding to the fitting straight lines of the two edges according to the pixel point set corresponding to the set of opposite edges, and performing parallel line fitting on the set of opposite edges according to the fitting parameters and a preset fitting function to obtain the fitting straight lines of the set of opposite edges comprises: Determine the slope of the fitted straight line between the first side and the second side according to the coordinates of each pixel point in the set of pixel points corresponding to the group of opposite sides; Determine, according to the coordinates of each pixel point in the pixel point set corresponding to the first side in the set of opposite sides, a first longitudinal intercept corresponding to the fitting straight line of the first side; Determine, according to the coordinates of each pixel point in the pixel point set corresponding to the second side in the set of opposite sides, a second longitudinal intercept corresponding to the fitted straight line of the second side; According to the first vertical intercept, the slope and the preset fitting function, the fitting straight line of the first side in the group of opposite sides is determined, and according to the second vertical intercept, the slope and the preset fitting function, the fitting straight line of the second side in the group of opposite sides is determined.

4. The method according to claim 3, wherein: The method further comprises: If the absolute value of the slope k1 calculated for one of the two sets of opposite sides is less than a first predetermined threshold, and the absolute value of the slope k2 calculated for the other set of opposite sides is greater than a second predetermined threshold, the slope k2 whose absolute value is greater than the predetermined threshold is forcibly assigned 5. The method according to claim 1, wherein: The pixel points corresponding to the target point cloud, which are respectively corresponding to the four sides of the minimum circumscribed rectangle, include: For each of the four sides of the minimum circumscribed rectangle, all pixel points within a circular area with the center of the edge as the center of the circle among the pixel points corresponding to the target point cloud are determined, and all the determined pixel points are determined as the pixel point set corresponding to the edge.

6. The method according to claim 1, wherein: The step of converting a target point cloud including a target area in the point cloud map into a target image comprises: Determine the size of the target image, and create a pure color image with the same size as the target image and a pixel value being a first pixel value; For each point in the target point cloud, the pixel value of the pixel point of the pure color image is flushed to a second pixel value different from the first pixel value according to the position correspondence, and the result obtained after flushing is determined as the target image.

7. The method according to claim 6, wherein: The size of the target image includes a horizontal size and a vertical size; The step of determining the size of the target image and creating a pure color image with the same size as the target image and a pixel value being a first pixel value comprises: Determine the minimum abscissa value, the maximum abscissa value, the minimum ordinate value, and the maximum ordinate value of the coordinates of each vertex of a polygonal outline in the point cloud map, wherein the polygonal outline surrounds the target point cloud; The horizontal size of the target image is determined according to the minimum horizontal coordinate value and the maximum horizontal coordinate value, and the vertical size of the target image is determined according to the minimum vertical coordinate value and the maximum vertical coordinate value, and a pure color image with a size of the horizontal size and the vertical size and a pixel value of the first pixel value is created.

8. The method according to any one of claims 1 to 7, wherein: The method of converting the target point cloud including the target area in the point cloud map into the target image also includes: A polygonal outline pre-input in the point cloud map is obtained, and outlier points are removed from the original point cloud according to the distances between the points of the original point cloud within the polygonal outline to obtain the target point cloud.

9. The method according to any one of claims 1 to 7, wherein: The method further comprises: The quadrilateral enclosed by the fitting straight lines of the four sides is used as the four sides of the minimum circumscribed rectangle, and the sets of pixel points corresponding to the two groups of opposite sides among the four sides are returned, and parallel lines are fitted to the two groups of opposite sides respectively, and the operation of obtaining the fitting straight lines of the four sides is continued.

10. An electronic device, comprising: A processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; The memory is used to store computer programs; The processor is configured to execute the method according to any one of claims 1 to 9 by running the computer program stored in the memory.