CN117576664A - Obstacle area calculation method, device, equipment and storage medium - Google Patents
Obstacle area calculation method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN117576664A CN117576664A CN202410066455.7A CN202410066455A CN117576664A CN 117576664 A CN117576664 A CN 117576664A CN 202410066455 A CN202410066455 A CN 202410066455A CN 117576664 A CN117576664 A CN 117576664A
- Authority
- CN
- China
- Prior art keywords
- obstacle
- pixel
- sample data
- prediction model
- area
- 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.)
- Pending
Links
- 238000004364 calculation method Methods 0.000 title claims description 50
- 238000012549 training Methods 0.000 claims abstract description 52
- 238000000034 method Methods 0.000 claims abstract description 38
- 238000012545 processing Methods 0.000 claims description 11
- 238000009434 installation Methods 0.000 claims description 6
- 238000004519 manufacturing process Methods 0.000 abstract description 8
- 238000013136 deep learning model Methods 0.000 description 6
- 230000004888 barrier function Effects 0.000 description 5
- 238000004891 communication Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 238000001514 detection method Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 239000003086 colorant Substances 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- YOBAEOGBNPPUQV-UHFFFAOYSA-N iron;trihydrate Chemical compound O.O.O.[Fe].[Fe] YOBAEOGBNPPUQV-UHFFFAOYSA-N 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/50—Context or environment of the image
- G06V20/56—Context or environment of the image exterior to a vehicle by using sensors mounted on the vehicle
- G06V20/58—Recognition of moving objects or obstacles, e.g. vehicles or pedestrians; Recognition of traffic objects, e.g. traffic signs, traffic lights or roads
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/22—Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
- G06V10/225—Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition based on a marking or identifier characterising the area
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/764—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
- G06V10/774—Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/82—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Evolutionary Computation (AREA)
- Multimedia (AREA)
- Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- Artificial Intelligence (AREA)
- General Health & Medical Sciences (AREA)
- Software Systems (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Databases & Information Systems (AREA)
- Medical Informatics (AREA)
- Biomedical Technology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Molecular Biology (AREA)
- General Engineering & Computer Science (AREA)
- Mathematical Physics (AREA)
- Image Analysis (AREA)
Abstract
The application discloses a method, a device, equipment and a storage medium for calculating the area of an obstacle, and belongs to the technical field of automation. The pixel data obtained by shooting by the camera is obtained; inputting the pixel data into a preset pixel prediction model, and determining a target obstacle pixel based on the pixel prediction model, wherein the pixel prediction model is obtained by performing iterative training on the preset prediction model to be trained based on obstacle pixel sample data and an obstacle pixel classification label corresponding to the obstacle pixel sample data; based on the association relation between the target obstacle pixels and the preset pixel size and the occupied area of projection of the target obstacle pixels, the occupied area of the obstacle is calculated, and the automatic mower is low in production cost.
Description
Technical Field
The present application relates to the field of automation, and in particular, to a method, apparatus, device, and storage medium for calculating an obstacle area.
Background
With the development of economy and science, the use of mowers has become more and more frequent, but because of the difficulty of mowing work, which is very physical, automatic mowers are gradually becoming the mainstream choice instead of traditional manual mowers.
In the prior art, a robot mower acquires a front route picture by using a monocular camera, and recognizes the occupied area of an obstacle on the front picture through a deep learning model so as to realize the obstacle avoidance operation, but the deep learning model is used for directly detecting the occupied area of the obstacle on the route picture acquired by the monocular camera, so that the robot mower has high production cost because of consuming great calculation force.
The foregoing is merely provided to facilitate an understanding of the principles of the present application and is not admitted to be prior art.
Disclosure of Invention
The main purpose of the application is to provide a method, a device, equipment and a storage medium for calculating the area of an obstacle, and aims to solve the technical problem that the production cost of a robotic mower is too high.
In order to achieve the above object, the present application provides an obstacle area calculation method including the steps of:
acquiring pixel data obtained by shooting by a camera;
inputting the pixel data into a preset pixel prediction model, and determining a target obstacle pixel based on the pixel prediction model, wherein the pixel prediction model is obtained by performing iterative training on the preset prediction model to be trained based on obstacle pixel sample data and an obstacle pixel classification label corresponding to the obstacle pixel sample data;
and calculating the occupied area of the obstacle based on the association relation between the target obstacle pixel and the preset pixel size and the projected occupied area.
Optionally, before the step of acquiring the pixel data obtained by shooting by the camera, the method includes:
based on the performance and the installation position of the camera, the association relation between the size of each pixel and the projected occupied area in the preset area calculation method is adjusted.
Optionally, the step of acquiring pixel data obtained by shooting with a camera includes:
acquiring an image shot by a camera, and acquiring RGB channel data of each pixel in the image;
and recording the RGB channel data of each pixel and outputting the RGB channel data as pixel data.
Optionally, the step of calculating the area of the obstacle based on the association between the target obstacle pixel and the preset pixel size and the projected area thereof includes:
marking all pixels of the target obstacle, and calculating the number of marked pixels;
and calculating the occupied area of the obstacle based on the number of marked pixels and the association relation between the size of each pixel and the projected occupied area of each pixel in a preset area calculation method.
Optionally, before the step of acquiring the pixel data obtained by shooting by the camera, the method includes:
obtaining obstacle pixel sample data of a pixel training set and an obstacle pixel classification label corresponding to the obstacle pixel sample data;
and performing iterative training on a preset prediction model to be trained based on the obstacle pixel sample data and the obstacle pixel classification labels corresponding to the obstacle pixel sample data to obtain a pixel prediction model meeting the accuracy condition.
Optionally, the step of acquiring obstacle pixel sample data in the pixel training set includes:
acquiring initial obstacle pixel sample data of a pixel training set;
and carrying out symmetrical exchange processing on the initial obstacle pixel sample data of each pixel training set to obtain target obstacle pixel sample data so as to realize data expansion of the obstacle pixel sample data.
Optionally, the step of performing iterative training on a preset prediction model to be trained based on the obstacle pixel sample data and the obstacle pixel classification label corresponding to the obstacle pixel sample data to obtain a pixel prediction model meeting the precision condition includes:
inputting the obstacle pixel sample data into the preset prediction model to be trained to obtain predicted obstacle pixel classification information;
performing difference calculation on the predicted obstacle pixel classification information and an obstacle pixel classification label corresponding to the obstacle pixel sample data to obtain a first loss value;
and if the first loss value does not meet the error standard indicated by the preset loss threshold range, returning to the step of inputting the obstacle pixel sample data into the preset prediction model to be trained to obtain predicted obstacle pixel classification information, and stopping training until the first loss value meets the error standard indicated by the preset loss threshold range to obtain the pixel prediction model meeting the accuracy condition.
In addition, to achieve the above object, the present application further provides an obstacle area calculating device, including:
the first acquisition module is used for acquiring pixel data obtained by shooting by the camera;
the input module is used for inputting the pixel data into a preset pixel prediction model, and determining a target obstacle pixel based on the pixel prediction model, wherein the pixel prediction model is obtained by performing iterative training on the preset prediction model to be trained based on obstacle pixel sample data and an obstacle pixel classification label corresponding to the obstacle pixel sample data;
and the calculation module is used for calculating the occupied area of the obstacle by using a preset area calculation method based on the target obstacle pixels.
In addition, to achieve the above object, the present application further provides an obstacle area calculating device, including: a memory, a processor, and an obstacle area calculation program stored on the memory and executable on the processor, the obstacle area calculation program configured to implement the steps of the obstacle area calculation method as described above.
In addition, in order to achieve the above object, the present application also provides a storage medium having stored thereon an obstacle area calculation program which, when executed by a processor, implements the steps of the obstacle area calculation method as described above.
Compared with the problem that in the related art, a deep learning model directly detects the occupied area of an obstacle on a route picture acquired by a monocular camera and consumes very large calculation force, so that the production cost of a automatic mower is too high, the method and the device for calculating the area of the obstacle are characterized in that pixel data acquired by acquiring the camera are acquired; inputting the pixel data into a preset pixel prediction model, and determining a target obstacle pixel based on the pixel prediction model, wherein the pixel prediction model is obtained by performing iterative training on the preset prediction model to be trained based on obstacle pixel sample data and an obstacle pixel classification label corresponding to the obstacle pixel sample data; based on the association relation between the target obstacle pixels and the preset pixel size and the projected occupied area of the target obstacle pixels, the occupied area of the obstacle is calculated, and it can be understood that the calculation force required for identifying one pixel is far smaller than that required for directly identifying the whole picture, so that the calculation force consumed for identifying the occupied area of the obstacle is low, and the problem of overhigh production cost of the automatic mower is solved.
Drawings
FIG. 1 is a schematic diagram of an obstacle area computing device of a hardware operating environment according to an embodiment of the present application;
FIG. 2 is a flowchart of a first embodiment of a method for calculating an obstacle area according to the present disclosure;
FIG. 3 is a schematic view of a scene of the obstacle area calculation method of the present application;
FIG. 4 is a flowchart of a second embodiment of the method for calculating an obstacle area according to the present disclosure;
FIG. 5 is a flowchart of a third embodiment of a method for calculating an obstacle area according to the present disclosure;
fig. 6 is a block diagram of the obstacle area calculation device of the present application.
The realization, functional characteristics and advantages of the present application will be further described with reference to the embodiments, referring to the attached drawings.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an obstacle area computing device of a hardware running environment according to an embodiment of the present application.
As shown in fig. 1, the obstacle area calculating device may include: a processor 1001, such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a high-speed random access Memory (Random Access Memory, RAM) Memory or a stable nonvolatile Memory (NVM), such as a disk Memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Those skilled in the art will appreciate that the structure shown in fig. 1 does not constitute a limitation of the obstacle area computing device, and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
As shown in fig. 1, an operating system, a data storage module, a network communication module, a user interface module, and an obstacle area calculation program may be included in the memory 1005 as one type of storage medium.
In the obstacle area computing device shown in fig. 1, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the obstacle area computing device of the present application may be disposed in an obstacle area computing device, which invokes an obstacle area computing program stored in the memory 1005 through the processor 1001, and executes the obstacle area computing method provided in the embodiment of the present application.
An embodiment of the present application provides a method for calculating an area of an obstacle, and referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of the method for calculating an area of an obstacle.
It should be noted that, the method execution body of the present embodiment is an obstacle area computing device, and the obstacle area computing device may be a device with data processing capability, such as a mobile terminal or a wireless controller, which is not specifically limited in this application.
The following describes a mobile terminal as an obstacle area calculation device in detail.
It can be understood that in the prior art, the automatic mower uses the monocular camera to acquire the front route picture, then uses the deep learning model to identify the occupied area of the obstacle on the front picture so as to realize the obstacle avoidance operation, but because the deep learning model directly detects the occupied area of the obstacle on the route picture acquired by the monocular camera, the extremely large calculation power is required to be consumed, so that the production cost of the automatic mower is too high.
In this embodiment, the method for calculating the area of the obstacle includes:
step S10: and acquiring pixel data obtained by shooting by a camera.
In a specific implementation, the obstacle area computing device acquires pixel data obtained by shooting by a camera.
The step of acquiring pixel data obtained by shooting by a camera specifically comprises the following steps:
step S11: and acquiring an image shot by a camera, and acquiring RGB channel data of each pixel in the image.
In a specific implementation, the obstacle area computing device acquires an image captured by a camera, and acquires RGB channel data of each pixel in the image.
It should be noted that, the RGB channel data is composed of a plurality of color gradation units (RGB units), where "RGB" is the first letter of english Red (Red), green (Green) and Blue (Blue), each of the color gradation units is composed of values of three colors of Red, green and Blue, the color gradation units can correspondingly display one color through the RGB values, the range of values of each color of RGB is 0 to 255, the closer to 0, the closer to 255, the closer to white, and the color gradation units can synthesize any one color by using Red, green and Blue of different values and transmit the record in a numerical manner.
For example, pure yellow consists of red of 255, green of 255, and blue of 0, converted to values (R: 255, G:255, B: 0);
the pink color consists of 255 red, 0 green and 255 blue, and is converted into a numerical value (R: 255, G:0, B: 255);
orange consists of red of 255, green of 127 and blue of 0, and is converted to a value (R: 255, G:127, B: 0).
Step S12: and recording the RGB channel data of each pixel and outputting the RGB channel data as pixel data.
In a specific implementation, the obstacle area computing device records the RGB channel data of each pixel and outputs the RGB channel data as pixel data.
Step S20: inputting the pixel data into a preset pixel prediction model, and determining a target obstacle pixel based on the pixel prediction model, wherein the pixel prediction model is obtained by performing iterative training on the preset prediction model to be trained based on obstacle pixel sample data and an obstacle pixel classification label corresponding to the obstacle pixel sample data.
In a specific implementation, the obstacle area computing device inputs the pixel data into a preset pixel prediction model, and determines a target obstacle pixel based on the pixel prediction model.
For example, the input is original data of 24 pixels (i.e. the number of pixels corresponding to the barrier pixel sample data is 24), the number of output nodes and the number of pixels of the pixel prediction model are unified, the number of output nodes is 24, the label of each node is [0,1], wherein 0 represents that when the pixel is redundant, 1 represents that the current pixel is necessary, so the model output is a vector of 1 x24, each vector is composed of [0,1], the target barrier pixel sample data is the pixel corresponding to the node output of 1, the redundant part of pixels are the pixel corresponding to the node output of 0, i.e. the original 24-channel data is input, the output is a 24-dimensional vector, whether each pixel is a redundant pixel or not is represented, if the redundant pixel is negligible in the subsequent task, the input data quantity of the front end is reduced when the subsequent signal processing is entered, and the purpose of saving the calculation power is achieved through the barrier pixel self-selection.
Step S30: and calculating the occupied area of the obstacle based on the association relation between the target obstacle pixel and the preset pixel size and the projected occupied area.
In a specific implementation, the obstacle area calculation device calculates the area of the obstacle based on the association between the target obstacle pixel and the preset pixel size and the projected area of the obstacle.
The step of calculating the occupied area of the obstacle based on the association relation between the target obstacle pixel and the preset pixel size and the projected occupied area of the target obstacle pixel specifically comprises the following steps:
step S31: all target obstacle pixels are marked and the number of marked pixels is calculated.
In a specific implementation, the obstacle area computing device marks all target obstacle pixels and calculates the number of marked pixels.
Step S32: and calculating the occupied area of the obstacle based on the number of marked pixels and the association relation between the size of each pixel and the projected occupied area of each pixel in a preset area calculation method.
In a specific implementation, the obstacle area calculating device calculates the occupied area of the obstacle based on the number of marked pixels and the association relation between the size of each pixel and the projected occupied area in a preset area calculating method.
It should be noted that, since the camera is fixed relative to the mower, and the area where the mower advances approximates a plane, each pixel can record a real area, and based on the real area of the area, the area of the obstacle can be estimated approximately by comparing the number of pixels of the obstacle.
It will be appreciated that, as shown in fig. 3, the number of pixels in the mower is fixed, the size of the image shot by the mower is also fixed, the occupation area corresponding to a single pixel in the mower can be calculated based on the size of the image shot by the mower, and the pixel prediction model only needs to determine the obstacle pixels in the image shot by the mower camera, and then adds the occupation areas projected by the obstacle pixels to estimate the occupation area size of the obstacle.
For example, if the footprint corresponding to a single pixel of the mower camera is 9cm 2 The pixel prediction model determines that 9 pixels in the image are closely arranged cube obstacle pixels and 3 obstacle pixels are arranged on each side of the obstacle, and the occupation area of the 9 pixels is added to estimate that the occupation area of the obstacle is 81cm 2 。
Compared with the problem that in the related art, a deep learning model directly detects the occupied area of an obstacle on a route picture acquired by a monocular camera and consumes very large calculation force, so that the production cost of a automatic mower is too high, in the embodiment, the method and the device acquire pixel data acquired by shooting by the camera; inputting the pixel data into a preset pixel prediction model, and determining a target obstacle pixel based on the pixel prediction model, wherein the pixel prediction model is obtained by performing iterative training on the preset prediction model to be trained based on obstacle pixel sample data and an obstacle pixel classification label corresponding to the obstacle pixel sample data; based on the association relation between the target obstacle pixels and the preset pixel size and the projected occupied area of the target obstacle pixels, the occupied area of the obstacle is calculated, and it can be understood that the calculation force required for identifying one pixel is far smaller than that required for directly identifying the whole picture, so that the calculation force consumed for identifying the occupied area of the obstacle is low, and the problem of overhigh production cost of the automatic mower is solved.
The second embodiment of the present application provides a method for calculating an area of an obstacle, referring to fig. 4, before step S10, the method for calculating an area of an obstacle specifically includes step a10:
step A10: based on the performance and the installation position of the camera, the association relation between the size of each pixel and the projected occupied area in the preset area calculation method is adjusted.
In a specific implementation, the obstacle area calculation device adjusts the association relation between the size of each pixel and the projected occupation area in the preset area calculation method based on the performance and the installation position of the camera.
In this embodiment, based on the performance and the installation position of the camera, the association relationship between the size of each pixel and the projected occupation area in the preset area calculation method is adjusted, so that the obstacle area calculation device can calculate the occupation area of the obstacle by distinguishing the pixels of the obstacle.
The third embodiment of the present application provides a method for calculating an area of an obstacle, referring to fig. 5, before step S10, the method for calculating an area of an obstacle specifically includes steps B10-B20:
step B10: and obtaining obstacle pixel sample data of the pixel training set and an obstacle pixel classification label corresponding to the obstacle pixel sample data.
In a specific implementation, an obstacle area computing device obtains obstacle pixel sample data of a pixel training set and an obstacle pixel classification tag corresponding to the obstacle pixel sample data.
For example, the pixel training set a is 24 obstacle pixels, the pixel training set a target obstacle pixel sample data includes target obstacle pixel sample data X1-X24 at the historical time X, and target obstacle pixel sample data Y1-Y24 at the historical time Y, the pixel classification labels corresponding to the target obstacle pixel sample data X1-X24 are X1-X15, and the pixel classification labels corresponding to the target obstacle pixel sample data Y1-Y24 are Y1-Y10.
The step of obtaining the obstacle pixel sample data of the pixel training set and the obstacle pixel classification label corresponding to the obstacle pixel sample data specifically includes:
step B11: initial obstacle pixel sample data for a training set of pixels is obtained.
In a specific implementation, an obstacle area computing device obtains initial obstacle pixel sample data for a training set of pixels.
Step B12: and carrying out symmetrical exchange processing on the initial obstacle pixel sample data of each pixel training set to obtain target obstacle pixel sample data so as to realize data expansion of the obstacle pixel sample data.
In a specific implementation, the obstacle area computing device performs symmetrical exchange processing on initial obstacle pixel sample data of each pixel training set to obtain target obstacle pixel sample data so as to realize data expansion of the obstacle pixel sample data.
It can be understood that, because the barrier pixels are sparser in data, and the deep learning network has a larger data requirement, a channel exchange scheme, that is, symmetrical barrier pixels are used for exchange in the training process, so that the training data can be expanded multiple times without additionally increasing the acquisition time, and in particular, the training data can be expanded to 4 times of the original data amount.
Step B20: and performing iterative training on a preset prediction model to be trained based on the obstacle pixel sample data and the obstacle pixel classification labels corresponding to the obstacle pixel sample data to obtain a pixel prediction model meeting the accuracy condition.
In a specific implementation, the obstacle area computing device performs iterative training on a preset prediction model to be trained based on the obstacle pixel sample data and an obstacle pixel classification label corresponding to the obstacle pixel sample data to obtain a pixel prediction model meeting the accuracy condition.
The step of performing iterative training on a preset prediction model to be trained based on the obstacle pixel sample data and the obstacle pixel classification label corresponding to the obstacle pixel sample data to obtain a pixel prediction model meeting the precision condition specifically comprises the following steps:
step B21: and inputting the obstacle pixel sample data into the preset prediction model to be trained to obtain predicted obstacle pixel classification information.
In a specific implementation, the obstacle area computing device inputs the obstacle pixel sample data to the preset prediction model to be trained to obtain prediction obstacle pixel classification information, wherein the prediction obstacle pixel classification information is obtained by predicting a safety detection result of a model in training, the detection model to be trained has only differences with different precision (the detection model to be trained has lower precision) compared with the pixel prediction model, and both have the function of processing the obstacle pixel sample data.
Step B22: and performing difference calculation on the predicted obstacle pixel classification information and an obstacle pixel classification label corresponding to the obstacle pixel sample data to obtain a first loss value.
In a specific implementation, the obstacle area calculating device performs difference calculation on the predicted obstacle pixel classification information and the obstacle pixel classification label corresponding to the obstacle pixel sample data to obtain a first loss value, namely, verifies whether a result obtained by a model in training is consistent with a known result, and performs difference calculation between the results to obtain the first loss value.
Step B23: and if the first loss value does not meet the error standard indicated by the preset loss threshold range, returning to the step of inputting the obstacle pixel sample data into the preset prediction model to be trained to obtain predicted obstacle pixel classification information, and stopping training until the first loss value meets the error standard indicated by the preset loss threshold range to obtain the pixel prediction model meeting the accuracy condition.
Specifically, since the predicted result and the actual result of the model in training have errors, the error result is allowed to be within a preset error threshold range, so as to further judge whether the first loss value meets an error standard indicated by the preset error threshold range.
In a specific implementation, if the first loss value does not meet the error standard indicated by the preset loss threshold range, the obstacle area calculation device returns to the step of inputting the obstacle pixel sample data to the preset prediction model to be trained to obtain predicted obstacle pixel classification information, and stops training until the first loss value meets the error standard indicated by the preset loss threshold range, so as to obtain the pixel prediction model meeting the precision condition.
In this embodiment, the obstacle pixel sample data of the pixel training set and the obstacle pixel classification label corresponding to the obstacle pixel sample data are obtained; based on the obstacle pixel sample data and the obstacle pixel classification labels corresponding to the obstacle pixel sample data, iterative training is carried out on a preset prediction model to be trained to obtain a pixel prediction model meeting the precision condition, and the precision of the trained pixel prediction model meets the standard.
In addition, an embodiment of the present application further provides an obstacle area calculating device, referring to fig. 6, including:
a first obtaining module 10, configured to obtain pixel data obtained by capturing by a camera;
the input module 20 is configured to input the pixel data into a preset pixel prediction model, and determine a target obstacle pixel based on the pixel prediction model, where the pixel prediction model is obtained by performing iterative training on a preset prediction model to be trained based on obstacle pixel sample data and an obstacle pixel classification tag corresponding to the obstacle pixel sample data;
a calculating module 30, configured to calculate a floor area of the obstacle using a preset area calculating method based on the target obstacle pixel.
Optionally, the first acquisition module 10 includes:
the first acquisition unit is used for acquiring an image shot by the camera and acquiring RGB channel data of each pixel in the image;
and a recording unit for recording the RGB channel data of each pixel and outputting the RGB channel data as pixel data.
Optionally, the computing module 30 includes:
a marking unit for marking all the pixels of the target obstacle and calculating the number of marked pixels;
a first calculating unit, configured to calculate a floor area of the obstacle based on the number of marked pixels and an association relationship between a size of each pixel and a floor area projected by the pixel in a preset area calculating method.
Optionally, the obstacle area calculating device further includes:
the adjusting module is used for adjusting the association relation between the size of each pixel and the projected occupied area in the preset area calculation method based on the performance and the installation position of the camera.
Optionally, the obstacle area calculating device further includes:
the second acquisition module is used for acquiring obstacle pixel sample data of the pixel training set and obstacle pixel classification labels corresponding to the obstacle pixel sample data;
the training module is used for carrying out iterative training on a preset prediction model to be trained based on the obstacle pixel sample data and the obstacle pixel classification labels corresponding to the obstacle pixel sample data to obtain a pixel prediction model meeting the precision condition.
Optionally, the second acquisition module further includes:
the second acquisition unit is used for acquiring initial obstacle pixel sample data of the pixel training set;
and the processing unit is used for carrying out symmetrical exchange processing on the initial obstacle pixel sample data of each pixel training set to obtain target obstacle pixel sample data so as to realize data expansion of the obstacle pixel sample data.
Optionally, the training module further comprises:
the input unit is used for inputting the obstacle pixel sample data into the preset prediction model to be trained to obtain predicted obstacle pixel classification information;
the second calculation unit is used for performing difference calculation on the predicted obstacle pixel classification information and an obstacle pixel classification label corresponding to the obstacle pixel sample data to obtain a first loss value;
and the return unit is used for returning to the step of inputting the obstacle pixel sample data to the preset prediction model to be trained to obtain predicted obstacle pixel classification information if the first loss value does not meet the error standard indicated by the preset loss threshold range, and stopping training until the first loss value meets the error standard indicated by the preset loss threshold range, so as to obtain the pixel prediction model meeting the precision condition.
The specific embodiments of the obstacle area calculating device in the present application are basically the same as the embodiments of the obstacle area calculating method described above, and are not described herein again.
Embodiments of the present application provide a storage medium, and the storage medium stores one or more programs, which may be further executed by one or more processors to implement the steps of the obstacle area calculation method described in any one of the above.
The specific implementation manner of the storage medium is basically the same as that of each embodiment of the above method for calculating the area of the obstacle, and will not be repeated here.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system 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 system. 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 system that comprises the element.
The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
From the above description of embodiments, it will be clear to a person skilled in the art that the above embodiment method may be implemented by means of software plus a necessary general hardware platform, but may of course also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) as described above, including several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method described in the embodiments of the present application.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the claims, and all equivalent structures or equivalent processes using the descriptions and drawings of the present application, or direct or indirect application in other related technical fields are included in the scope of the claims of the present application.
Claims (10)
1. A method of calculating an obstacle area, the method comprising:
acquiring pixel data obtained by shooting by a camera;
inputting the pixel data into a preset pixel prediction model, and determining a target obstacle pixel based on the pixel prediction model, wherein the pixel prediction model is obtained by performing iterative training on the preset prediction model to be trained based on obstacle pixel sample data and an obstacle pixel classification label corresponding to the obstacle pixel sample data;
and calculating the occupied area of the obstacle based on the association relation between the target obstacle pixel and the preset pixel size and the projected occupied area.
2. The obstacle area calculation method as claimed in claim 1, wherein before the step of acquiring pixel data captured by the camera, the method includes:
based on the performance and the installation position of the camera, the association relation between the size of each pixel and the projected occupied area in the preset area calculation method is adjusted.
3. The obstacle area calculation method as claimed in claim 1, wherein the step of acquiring pixel data obtained by photographing with a camera includes:
acquiring an image shot by a camera, and acquiring RGB channel data of each pixel in the image;
and recording the RGB channel data of each pixel and outputting the RGB channel data as pixel data.
4. The obstacle area calculation method as claimed in claim 1, wherein the step of calculating the floor area of the obstacle based on the association between the target obstacle pixel and a preset pixel size and the floor area projected thereby, comprises:
marking all pixels of the target obstacle, and calculating the number of marked pixels;
and calculating the occupied area of the obstacle based on the number of marked pixels and the association relation between the size of each pixel and the projected occupied area of each pixel in a preset area calculation method.
5. The obstacle area calculation method as claimed in claim 1, wherein before the step of acquiring pixel data captured by the camera, the method includes:
obtaining obstacle pixel sample data of a pixel training set and an obstacle pixel classification label corresponding to the obstacle pixel sample data;
and performing iterative training on a preset prediction model to be trained based on the obstacle pixel sample data and the obstacle pixel classification labels corresponding to the obstacle pixel sample data to obtain a pixel prediction model meeting the accuracy condition.
6. The obstacle area computing method as claimed in claim 5, wherein the step of acquiring obstacle pixel sample data in a training set of pixels comprises:
acquiring initial obstacle pixel sample data of a pixel training set;
and carrying out symmetrical exchange processing on the initial obstacle pixel sample data of each pixel training set to obtain target obstacle pixel sample data so as to realize data expansion of the obstacle pixel sample data.
7. The method for calculating the area of the obstacle according to claim 5, wherein the step of iteratively training a preset prediction model to be trained based on the obstacle pixel sample data and the obstacle pixel classification label corresponding to the obstacle pixel sample data to obtain a pixel prediction model satisfying the accuracy condition includes:
inputting the obstacle pixel sample data into the preset prediction model to be trained to obtain predicted obstacle pixel classification information;
performing difference calculation on the predicted obstacle pixel classification information and an obstacle pixel classification label corresponding to the obstacle pixel sample data to obtain a first loss value;
and if the first loss value does not meet the error standard indicated by the preset loss threshold range, returning to the step of inputting the obstacle pixel sample data into the preset prediction model to be trained to obtain predicted obstacle pixel classification information, and stopping training until the first loss value meets the error standard indicated by the preset loss threshold range to obtain the pixel prediction model meeting the accuracy condition.
8. An obstacle area computing device, the device comprising:
the first acquisition module is used for acquiring pixel data obtained by shooting by the camera;
the input module is used for inputting the pixel data into a preset pixel prediction model, and determining a target obstacle pixel based on the pixel prediction model, wherein the pixel prediction model is obtained by performing iterative training on the preset prediction model to be trained based on obstacle pixel sample data and an obstacle pixel classification label corresponding to the obstacle pixel sample data;
and the calculation module is used for calculating the occupied area of the obstacle by using a preset area calculation method based on the target obstacle pixels.
9. An obstacle area computing device, the device comprising: a memory, a processor and an obstacle area calculation program stored on the memory and executable on the processor, the obstacle area calculation program being configured to implement the steps of the obstacle area calculation method of any one of claims 1 to 7.
10. A storage medium having stored thereon an obstacle area calculation program which, when executed by a processor, implements the steps of the obstacle area calculation method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410066455.7A CN117576664A (en) | 2024-01-17 | 2024-01-17 | Obstacle area calculation method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410066455.7A CN117576664A (en) | 2024-01-17 | 2024-01-17 | Obstacle area calculation method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117576664A true CN117576664A (en) | 2024-02-20 |
Family
ID=89864838
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410066455.7A Pending CN117576664A (en) | 2024-01-17 | 2024-01-17 | Obstacle area calculation method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117576664A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117784801A (en) * | 2024-02-27 | 2024-03-29 | 锐驰激光(深圳)有限公司 | Tracking obstacle avoidance method, device, equipment and storage medium |
-
2024
- 2024-01-17 CN CN202410066455.7A patent/CN117576664A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117784801A (en) * | 2024-02-27 | 2024-03-29 | 锐驰激光(深圳)有限公司 | Tracking obstacle avoidance method, device, equipment and storage medium |
CN117784801B (en) * | 2024-02-27 | 2024-05-28 | 锐驰激光(深圳)有限公司 | Tracking obstacle avoidance method, device, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111052146B (en) | System and method for active learning | |
US20240092344A1 (en) | Method and apparatus for detecting parking space and direction and angle thereof, device and medium | |
US11341371B2 (en) | Method, device and terminal for generating training data | |
CN117576664A (en) | Obstacle area calculation method, device, equipment and storage medium | |
US20200357111A1 (en) | Recognizing damage through image analysis | |
WO2017219992A1 (en) | Indoor navigation method for handheld terminal, handheld terminal, and storage medium | |
CN111008561A (en) | Livestock quantity determination method, terminal and computer storage medium | |
CN115335872A (en) | Training method of target detection network, target detection method and device | |
CN110910375A (en) | Detection model training method, device, equipment and medium based on semi-supervised learning | |
CN110111341B (en) | Image foreground obtaining method, device and equipment | |
CN110930386A (en) | Image processing method, device, equipment and storage medium | |
CN113822144A (en) | Target detection method and device, computer equipment and storage medium | |
CN110211190B (en) | Method and device for training camera self-motion parameter estimation model and storage medium | |
JP2022513781A (en) | Target attribute detection, neural network training and intelligent driving methods, equipment | |
CN116563604A (en) | End-to-end target detection model training, image target detection method and related equipment | |
CN113807315B (en) | Method, device, equipment and medium for constructing object recognition model to be recognized | |
JP7239002B2 (en) | OBJECT NUMBER ESTIMATING DEVICE, CONTROL METHOD, AND PROGRAM | |
CN117784801B (en) | Tracking obstacle avoidance method, device, equipment and storage medium | |
CN111275183B (en) | Visual task processing method, device and electronic system | |
CN113239922A (en) | Virtual reality space positioning feature point identification system and identification method | |
CN112115976B (en) | Model training method, model training device, storage medium and electronic equipment | |
CN111667539A (en) | Camera calibration and plane measurement method | |
CN112949672A (en) | Commodity identification method, commodity identification device, commodity identification equipment and computer readable storage medium | |
CN116539026B (en) | Map construction method, device, equipment and storage medium | |
TWI803334B (en) | Method for optimizing depth estimation model and detecting object distance, and related equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication |