Methods, apparatus, equipment, and readable storage media for identifying vehicle type and materials.

By monitoring the vehicle identification area at the construction site and using deep neural networks to automatically identify the type and category of material vehicles, the problem of difficulty in manually recording material vehicles in existing technologies has been solved, and efficient automated recording has been achieved.

CN116110004BActive Publication Date: 2026-05-26GLODON CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GLODON CO LTD
Filing Date
2023-02-09
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

In the existing technology, when material vehicles enter and leave the construction site, material records mainly rely on manual recording, which results in high labor costs and difficulty in accurately identifying vehicle types and material types in real time.

Method used

By monitoring target vehicles in the vehicle identification area, a deep neural network is used to identify vehicle type and material type, and vehicle and material information is automatically recorded. This includes acquiring vehicle images, delineating the vehicle identification area, using a CNN model for feature extraction and pooling, and calculating cosine distance to identify vehicle and material type.

Benefits of technology

It achieves automated material recording without human intervention, improving recording efficiency, saving human resources, and adapting to the actual conditions of different construction sites, thus expanding its application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116110004B_ABST
    Figure CN116110004B_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, device, and storage medium for identifying vehicle type and materials. The method includes: acquiring a vehicle image of the target vehicle when a target vehicle is detected in a vehicle identification area; identifying the vehicle type of the target vehicle from the vehicle image; identifying the type of material being transported by the target vehicle from the vehicle image when the vehicle type is a material vehicle; and recording the vehicle type and the type of material. This invention can efficiently and accurately identify vehicle type and materials.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image recognition, and in particular to a method, apparatus, device, and readable storage medium for identifying vehicle type and material. Background Technology

[0002] When material trucks transport materials in and out of the construction site, it is necessary to record the types of materials transported in the trucks. To avoid material theft or leakage due to incomplete records of the materials transported, it is necessary to record the material trucks entering and leaving the construction site and the materials they carry. Current methods for recording material trucks and their materials are mostly manual, but this is costly and difficult to record in real time the vehicle type and the types of materials being transported.

[0003] Therefore, how to identify the type of material cart and the types of materials carried by the material cart and record them has become a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0004] The purpose of this invention is to provide a method, apparatus, device, and readable storage medium for identifying vehicle type and materials, which can efficiently identify the type of material vehicle and the materials carried by the material vehicle.

[0005] According to one aspect of the present invention, a method for identifying vehicle type and material is provided, the method comprising:

[0006] When a target vehicle is detected in the vehicle recognition area, a vehicle image of the target vehicle is acquired;

[0007] Identify the vehicle type of the target vehicle from the vehicle image;

[0008] When the vehicle type is a material truck, the type of material being transported by the target vehicle is identified from the vehicle image;

[0009] The vehicle type of the target vehicle and the type of material are recorded.

[0010] Optionally, acquiring a vehicle image of the target vehicle when it is detected in the vehicle recognition area includes:

[0011] Real-time acquisition of monitoring images of the construction site; wherein, the monitoring images include vehicle identification areas and non-identification areas, and the vehicle identification areas are used to determine whether the target vehicle is a vehicle entering or leaving the construction site;

[0012] When the entire body of the target vehicle is detected from the monitoring image, an original area containing the entire body of the target vehicle is defined from the monitoring image;

[0013] Determine whether the vehicle recognition area contains the original area. If so, determine that the target vehicle is a vehicle entering or leaving the construction site, and use the original area as the vehicle image of the target vehicle.

[0014] Optionally, after acquiring the real-time monitoring images of the construction site, the method further includes:

[0015] Identify reference points from the surveillance images to determine the entry and exit of target vehicles from the construction site;

[0016] Based on the position information of the reference object in the monitoring image, a reference range is delineated from the monitoring image;

[0017] The reference range is used as the vehicle identification area, and the area in the monitoring image other than the reference range is used as the non-identification area.

[0018] Optionally, determining whether the vehicle recognition area includes the original area includes:

[0019] Calculate a first vector value to characterize the outer contour of the vehicle recognition region;

[0020] When any pixel in the original region is within the vehicle recognition region, the union of the original region and the vehicle recognition region is set as the combined region;

[0021] Calculate a second vector value to characterize the outer contour of the combined region;

[0022] Determine whether the first vector value and the second vector value are the same. If they are, then determine that the vehicle recognition area includes the original area.

[0023] Optionally, determining whether the vehicle recognition area includes the original area includes:

[0024] Obtain the first pixel point in the preset original region; wherein, the first pixel point is a point on the outer contour line of the original region;

[0025] Obtain the image center point of the original region, and draw rays from the image center point to each first pixel point, wherein the rays intersect the outer contour line of the vehicle recognition region at a second pixel point;

[0026] Obtain a first length value and a second length value on the ray; wherein, the first length value is the length from the center point of the image to the first pixel, and the second length value is the length from the center point of the image to the second pixel;

[0027] When the first length value on each ray is less than or equal to the second length value, it is determined that the vehicle identification area contains the original area.

[0028] Optionally, identifying the vehicle type of the target vehicle from the vehicle image includes:

[0029] Vehicle feature information is extracted from the vehicle image, and the vehicle feature information is pooled to obtain the feature vector of the vehicle to be identified.

[0030] Calculate the cosine distance between the feature vector of the vehicle to be identified and the preset standard vehicle feature vector; wherein, each standard vehicle feature vector corresponds to a vehicle type;

[0031] The vehicle type corresponding to the standard vehicle feature vector with the largest cosine distance is taken as the vehicle type of the target vehicle.

[0032] Optionally, identifying the type of material being transported by the target vehicle from the vehicle image includes:

[0033] Extract material feature information corresponding to the target material from the vehicle image, and perform pooling processing on the material feature information to obtain the material feature vector to be identified for the target material;

[0034] Calculate the cosine distance between the feature vector of the material to be identified and the preset standard material feature vector; wherein, each standard material feature vector corresponds to a material type;

[0035] The material type corresponding to the standard material feature vector with the largest cosine distance is taken as the material type of the target material.

[0036] To achieve the above objectives, the present invention also provides a vehicle type and material identification device, the device comprising:

[0037] The acquisition module is used to acquire a vehicle image of the target vehicle when the target vehicle is detected in the vehicle recognition area;

[0038] The first identification module is used to identify the vehicle type of the target vehicle from the vehicle image;

[0039] The second identification module is used to identify the type of material being transported by the target vehicle from the vehicle image when the vehicle type is a material vehicle.

[0040] The recording module is used to record the vehicle type of the target vehicle and the type of material.

[0041] To achieve the above objectives, the present invention also provides a computer device, which specifically includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the vehicle type and material identification method described above.

[0042] To achieve the above objectives, the present invention also provides a computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the vehicle type and material identification method described above.

[0043] The present invention provides a method, apparatus, device, and readable storage medium for identifying vehicle types and materials. By defining a vehicle identification area, it determines whether a vehicle enters or exits the construction site by checking if the vehicle is within that area. Vehicles appearing within the identification area are then identified to determine their vehicle type. Vehicles classified as material trucks are then identified by material type. Finally, the vehicle type and material type of each material truck entering or leaving the construction site are recorded. This achieves automatic recording of materials entering and leaving the site, eliminating the need for manual vehicle and material identification. The automatic identification and recording via an algorithm improves recording efficiency and saves manpower. Furthermore, by using reference points at the construction site, the system automatically divides the vehicle identification area, allowing for rapid division of vehicle identification areas for different construction site scenarios, thus expanding its application scenarios. Attached Figure Description

[0044] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0045] Figure 1 This is a schematic diagram of an optional process for identifying vehicle type and materials provided in Embodiment 1;

[0046] Figure 2 A schematic diagram of a monitoring image including a vehicle identification area and a non-identification area is provided for Embodiment 1;

[0047] Figure 3 A schematic diagram of the original area including the entire body of the target vehicle, provided for Embodiment 1;

[0048] Figure 4 This is a schematic diagram of a monitoring image of the target vehicle within the vehicle recognition area, provided in Example 1.

[0049] Figure 5This is a schematic diagram of obtaining the outer contour of the combined region provided in Embodiment 1;

[0050] Figure 6 This is a schematic diagram illustrating how to determine if the original region is within the vehicle recognition region, as provided in Embodiment 1.

[0051] Figure 7 This is a schematic diagram of an optional component structure for identifying vehicle type and materials provided in Embodiment 3;

[0052] Figure 8 This is a schematic diagram of an optional hardware architecture for a computer device provided in Embodiment 4. Detailed Implementation

[0053] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without inventive effort are within the scope of protection of this invention.

[0054] Example 1

[0055] This invention provides a method for identifying vehicle type and materials, such as... Figure 1 As shown, the method specifically includes the following steps:

[0056] Step S101: When a target vehicle is detected in the vehicle recognition area, acquire a vehicle image of the target vehicle.

[0057] The vehicle identification area is used to determine whether a target vehicle is entering or leaving the construction site. When a vehicle appears in the vicinity of the construction site, it is necessary to determine whether the vehicle has entered or left the construction site, or whether the vehicle has passed through the weighbridge area. The presence of the entire vehicle body in the vehicle identification area serves as the basis for determining whether the vehicle has entered or left the construction site or passed through the weighbridge area. Then, the vehicle type is identified for vehicles that meet the criteria.

[0058] Specifically, step S101 includes the following steps:

[0059] Step A1: Acquire real-time monitoring images of the construction site; wherein the monitoring images include vehicle identification areas and non-identification areas, and the vehicle identification areas are used to determine whether the target vehicle is a vehicle entering or leaving the construction site.

[0060] Among them, such as Figure 2 As shown, the monitoring image can be divided into a vehicle recognition area and a non-recognition area. The method for defining the vehicle recognition area is shown in steps A101-A103. Figure 2 For illustrative purposes only.

[0061] Furthermore, after acquiring the real-time monitoring images of the construction site, the method further includes:

[0062] Step A101: Identify reference objects from the monitoring images to determine the entry and exit of the target vehicle from the construction site.

[0063] The reference object serves as a reference for whether a vehicle enters or leaves the construction site. When a vehicle appears in the reference area where the reference object is located, it indicates that the vehicle is either entering or leaving the site.

[0064] Preferably, the reference objects are the weighbridge area, the construction site gate, the warehouse gate, etc.

[0065] Step A102: Determine the reference range from the monitoring image based on the position information of the reference object in the monitoring image.

[0066] The reference range is defined based on the size and position information of the reference object, and the size of the reference range is larger than the size of each vehicle.

[0067] Step A103: Use the reference range as the vehicle identification area and the area in the monitoring image other than the reference range as the non-identification area.

[0068] Step A2: When the entire body of the target vehicle is detected from the monitoring image, the original area containing the entire body of the target vehicle is defined from the monitoring image.

[0069] Among them, such as Figure 3 As shown, the original area is defined by using a preset graphic to frame the entire body of the target vehicle. In addition, when the target vehicle is carrying materials, the original area should include the materials carried by the target vehicle.

[0070] Preferably, the preset shape is a rectangle.

[0071] Step A3: Determine whether the vehicle recognition area contains the original area. If so, determine that the target vehicle is a vehicle entering or leaving the construction site, and use the original area as the vehicle image of the target vehicle.

[0072] Among them, such as Figure 4 As shown, the vehicle recognition area contains the entire image of the original area, which is then considered as the vehicle image of the target vehicle.

[0073] Furthermore, determining whether the vehicle recognition area includes the original area specifically includes the following steps:

[0074] Step A301: Calculate a first vector value to characterize the outer contour of the vehicle identification region.

[0075] Since the vehicle recognition area is a closed shape, a coordinate system is established in the monitoring image to obtain the coordinate values ​​of each vertex of the outer contour of the vehicle recognition area. The vector values ​​of each edge of the outer contour of the vehicle recognition area are calculated in turn, and the vector values ​​of each edge constitute the first vector value of the outer contour of the vehicle recognition area.

[0076] Step A302: When any pixel in the original region is within the vehicle recognition region, the union of the original region and the vehicle recognition region is set as the combined region.

[0077] The union region refers to the region formed by performing a union operation on two graphics that partially overlap, resulting in a single graphic. For example... Figure 5 As shown, when the outer border of the original region and the outer border of the vehicle recognition region partially overlap, the original region and the vehicle recognition region are combined to obtain the union region of the original region and the vehicle recognition region, i.e., the combined region.

[0078] Step A303: Calculate a second vector value to characterize the outer contour of the combined region.

[0079] Step A304: Determine whether the first vector value and the second vector value are the same. If so, determine that the vehicle recognition area includes the original area.

[0080] Among them, such as Figure 5 As shown, when the original region intersects with the vehicle recognition region, the Boolean algorithm is used to calculate the union region of the original region and the vehicle recognition region to obtain the combined region. The shapes of the two are obtained through vector values. When the first vector value is the same as the second vector value, it means that the outer contour of the vehicle recognition region and the outer contour of the combined region are the same, that is, the vehicle recognition region contains the entire image of the original region.

[0081] Furthermore, this embodiment also provides a method for determining whether the vehicle recognition area includes the original area, which further includes the following steps:

[0082] Step A311: Obtain the first pixel in the preset original region; wherein the first pixel is a point on the outer contour line of the original region.

[0083] Wherein, when the camera captures the surveillance image at eye level, preferably, the first pixel is the point where the foot of the perpendicular line drawn from the center point of the original area to the bottom edge of the original area is located; when the camera captures the surveillance image at a top-down angle, preferably, as shown in the figure... Figure 6As shown, the first pixel is selected from the vertices of the outer contour of the original region and the points where the feet of the perpendiculars drawn from the image center of the original region to each side of the original region are located. It should be noted that the selection method for the first pixel can also be determined based on the shapes of the original region and the vehicle recognition region.

[0084] Step A312: Obtain the image center point of the original region, and draw rays from the image center point to each first pixel point, and the rays intersect with the outer contour line of the vehicle recognition region at the second pixel point.

[0085] Step A313: Obtain a first length value and a second length value on the ray; wherein the first length value is the length from the center point of the image to the first pixel, and the second length value is the length from the center point of the image to the second pixel.

[0086] Step A314: When the first length value on each ray is less than or equal to the second length value, it is determined that the vehicle identification area contains the original area.

[0087] In this embodiment, when vehicles appear in the monitoring images of the construction site, in the prior art, it is necessary to record the material trucks entering and leaving the construction site and the materials they carry in order to manage material data. However, the recording method is usually manual, which is costly and difficult to quickly and accurately capture vehicle types and material types. Therefore, in this embodiment, a vehicle identification area is first delineated based on reference objects in the monitoring image to determine whether the vehicle appearing in the monitoring image is a vehicle entering or leaving the construction site. The original area of ​​the entire vehicle body captured by the monitoring image is judged to determine whether the original area is contained within the vehicle identification area. If so, the target vehicle is determined to be a vehicle entering or leaving the construction site, so as to perform subsequent vehicle type identification for the target vehicle entering or leaving the construction site. This judgment method can be adapted to local conditions, associating the vehicle identification area delineation method with the actual situation of the construction site, adapting to the actual situation in various occasions. By delineating the vehicle identification area, it is also possible to avoid vehicle type identification for vehicles captured by the monitoring equipment that have not entered or left the construction site, saving computing resources.

[0088] Step S102: Identify the vehicle type of the target vehicle from the vehicle image.

[0089] After acquiring vehicle images from surveillance footage, a trained vehicle recognition model based on a CNN deep neural network is needed to identify the vehicle type from the images.

[0090] Furthermore, before identifying the vehicle type of the target vehicle from the vehicle image, the method further includes:

[0091] Step B1: Obtain an initial vehicle sample image containing vehicles and a labeled vehicle sample image obtained by labeling the vehicles in the initial vehicle sample image with vehicle types.

[0092] Step B2: Input the initial vehicle sample image and the labeled vehicle sample image into the feature extraction layer of the CNN model to be trained, and extract the vehicle feature information of the initial vehicle sample image and the labeled vehicle sample image respectively.

[0093] The vehicle feature information includes front vehicle feature information, rear vehicle feature information, vehicle logo feature information, and cargo bed feature information, with each type of vehicle feature information corresponding to a different weight for its respective vehicle type.

[0094] Step B3: Input the vehicle feature information of the labeled vehicle sample image of each vehicle type, the weight of the vehicle type to which the vehicle feature information of the labeled vehicle sample image belongs, and the vehicle feature information of the initial vehicle sample image into the loss layer of the CNN model to be trained, and calculate the vehicle feature vector of the vehicle feature information through the pooling layer in the loss layer, and obtain the loss value of the loss function in the CNN model to be trained based on the vehicle feature vector.

[0095] The pooling layer is used to calculate the vehicle feature vector of the vehicle feature information of the labeled vehicle sample image and the vehicle feature vector of the vehicle feature information of the initial vehicle sample image. The loss layer is used to calculate the loss value between the vehicle feature vector of the vehicle feature information of the labeled vehicle sample image and the vehicle feature vector of the vehicle feature information of the initial vehicle sample image.

[0096] Step B4: Based on the loss value of the loss function, adjust the parameters in the CNN model to be trained to obtain the trained vehicle recognition model.

[0097] The vehicle recognition model is a recognition model trained based on a CNN neural network, which takes a vehicle image as input and the vehicle type in the vehicle image as output to identify the vehicle type.

[0098] Specifically, the method for vehicle type identification using a vehicle recognition model includes the following steps:

[0099] Step C1: Extract vehicle feature information from the vehicle image and perform pooling processing on the vehicle feature information to obtain the feature vector of the vehicle to be identified.

[0100] The vehicle feature information is obtained by extracting vehicle-related vehicle feature information from vehicle images through the feature extraction layer in the trained vehicle recognition model, and then performing pooling processing on the vehicle feature information through the pooling layer to obtain the vehicle feature vector.

[0101] Step C2: Calculate the cosine distance between the feature vector of the vehicle to be identified and the preset standard vehicle feature vector; wherein each standard vehicle feature vector corresponds to a vehicle type.

[0102] The preset standard vehicle feature vector is the standard vehicle feature vector corresponding to the standard vehicle feature information of each vehicle type, which is learned by the vehicle recognition model after training.

[0103] Step C3: The vehicle type corresponding to the standard vehicle feature vector with the largest cosine distance is taken as the vehicle type of the target vehicle.

[0104] The larger the cosine distance, the more similar the standard vehicle feature vector is to the vehicle feature vector of the vehicle image.

[0105] In this embodiment, when a target vehicle is determined to be a vehicle entering or leaving the construction site, a trained vehicle recognition model is used to perform vehicle recognition on the vehicle image of the target vehicle to obtain the vehicle type of the target vehicle. Since this embodiment only records material vehicles entering and leaving the construction site, after completing vehicle recognition, the identified target vehicles belonging to material vehicles will be further processed for material recognition. For non-material vehicles, such as cars and buses, which are not involved in transporting materials, material recognition and recording will not be performed, thereby improving the efficiency of managing material vehicles and saving computer resources.

[0106] Step S103: When the vehicle type is a material vehicle, the type of material being transported by the target vehicle is identified from the vehicle image.

[0107] After identifying the vehicle type of the target vehicle, it is necessary to determine whether the vehicle type belongs to a material transport vehicle. A material transport vehicle is a vehicle that carries construction materials, such as... Figure 3 As shown, when materials are exposed in the vehicle image, the types of materials carried by the material truck in the vehicle image are identified to obtain the types of materials carried by the material truck.

[0108] Specifically, prior to step S103, the method further includes:

[0109] Step D1: Obtain an initial material sample image containing materials and a labeled material sample image obtained by labeling the materials in the initial material sample image with material types.

[0110] Step D2: Input the initial material sample image and the labeled material sample image into the feature extraction layer of the CNN model to be trained, and extract the material feature information of the initial material sample image and the labeled material sample image respectively.

[0111] The feature extraction layer extracts various material feature information that characterizes different material types based on the differences in material feature information between different material types.

[0112] Step D3: Input the material feature information of the labeled material sample image and the material feature information of the initial material sample image for each material type into the loss layer of the CNN model to be trained, and calculate the material feature vector of the material feature information through the pooling layer in the loss layer. Based on the material feature vector, obtain the loss value of the loss function in the CNN model to be trained.

[0113] The pooling layer is used to calculate the material feature vector of the material feature information of the labeled material sample image and the material feature vector of the material feature information of the initial material sample image. The loss layer is used to calculate the loss value between the material feature vector of the material feature information of the labeled material sample image and the material feature vector of the material feature information of the initial material sample image.

[0114] Step D4: Based on the loss value of the loss function, adjust the parameters in the CNN model to be trained to obtain the trained material recognition model.

[0115] Specifically, step S103 involves material identification using a material identification model, including the following steps:

[0116] Step E1: Extract the material feature information corresponding to the target material from the material image, and perform pooling processing on the material feature information to obtain the material feature vector to be identified for the target material.

[0117] The material feature information is obtained by extracting material-related feature information from the material image through the feature extraction layer in the trained material recognition model, and then performing pooling processing on the material feature information through the pooling layer to obtain the material feature vector.

[0118] Step E2: Calculate the cosine distance between the feature vector of the material to be identified and the preset standard material feature vector; wherein, each standard material feature vector corresponds to a material type.

[0119] The preset standard material feature vector is the standard material feature vector corresponding to the standard material feature information of each material type, which is learned by the material identification model after training.

[0120] Step E3: The material type corresponding to the standard material feature vector with the largest cosine distance is taken as the material type of the target material.

[0121] The larger the cosine distance, the more similar the standard material feature vector is to the material feature vector of the material image.

[0122] Furthermore, the method for identifying the type of material being transported by the target vehicle from the vehicle image also includes:

[0123] Step F1: Determine the entry and exit status of the target vehicle; wherein, the entry and exit status is either an entry status or an exit status;

[0124] Step F2: Determine the truck bed position information of the target vehicle based on the vehicle type and the entry / exit status;

[0125] Step F3: Obtain the truck bed image from the vehicle image based on the truck bed position information.

[0126] Among these methods, pre-obtaining images of the truck bed from vehicle images and then inputting these images into a trained material recognition model to identify the materials being transported by the target vehicle can effectively reduce the difficulty of material recognition model in identifying materials and improve the efficiency and accuracy of material type recognition.

[0127] Step S104: Record the vehicle type of the target vehicle and the type of material.

[0128] In addition to recording the vehicle type and material type of the target vehicle, it is also necessary to record information such as the vehicle's entry and exit status, entry and exit time, and vehicle load weight, so as to achieve the purpose of automatically recording material information at the construction site.

[0129] In this embodiment, the function of automatically dividing vehicle recognition areas is realized by using reference objects at the construction site. This allows different construction sites to quickly divide vehicle recognition areas according to the actual situation to determine whether vehicles have entered or exited the construction site, thus expanding the application scenarios. By defining the vehicle recognition area, it is determined whether a vehicle has entered or exited the construction site. Vehicles appearing in the vehicle recognition area are identified to obtain the vehicle type. Then, vehicles belonging to the material truck type are identified for the material type. Finally, the vehicle type and the type of material transported by the material trucks entering and exiting the construction site are recorded, realizing the function of automatically recording materials entering and leaving the site. There is no need for manual identification of vehicles and materials. The recognition algorithm automatically identifies and records them, improving the efficiency of material recording and saving human resources.

[0130] Example 2

[0131] This invention provides a device for identifying vehicle type and materials, such as... Figure 7 As shown, the device specifically includes the following components:

[0132] The acquisition module 701 is used to acquire a vehicle image of the target vehicle when a target vehicle is detected in the vehicle recognition area;

[0133] The first identification module 702 is used to identify the vehicle type of the target vehicle from the vehicle image;

[0134] The second identification module 703 is used to identify the type of material being transported by the target vehicle from the vehicle image when the vehicle type is a material vehicle.

[0135] The recording module 704 is used to record the vehicle type of the target vehicle and the type of material.

[0136] The acquisition module 701 is used for:

[0137] Real-time acquisition of monitoring images of the construction site; wherein, the monitoring images include vehicle identification areas and non-identification areas, and the vehicle identification areas are used to determine whether the target vehicle is a vehicle entering or leaving the construction site;

[0138] When the entire body of the target vehicle is detected from the monitoring image, an original area containing the entire body of the target vehicle is defined from the monitoring image;

[0139] Determine whether the vehicle recognition area contains the original area. If so, determine that the target vehicle is a vehicle entering or leaving the construction site, and use the original area as the vehicle image of the target vehicle.

[0140] Specifically, the acquisition module 701 is further configured to:

[0141] Identify reference points from the surveillance images to determine the entry and exit of target vehicles from the construction site;

[0142] Based on the position information of the reference object in the monitoring image, a reference range is delineated from the monitoring image;

[0143] The reference range is used as the vehicle identification area, and the area in the monitoring image other than the reference range is used as the non-identification area.

[0144] Furthermore, the acquisition module 701 is also used for:

[0145] Calculate a first vector value to characterize the outer contour of the vehicle recognition region;

[0146] When any pixel in the original region is within the vehicle recognition region, the union of the original region and the vehicle recognition region is set as the combined region;

[0147] Calculate a second vector value to characterize the outer contour of the combined region;

[0148] Determine whether the first vector value and the second vector value are the same. If they are, then determine that the vehicle recognition area includes the original area.

[0149] Furthermore, the acquisition module 701 is also used for:

[0150] Obtain the first pixel point in the preset original region; wherein, the first pixel point is a point on the outer contour line of the original region;

[0151] Obtain the image center point of the original region, and draw rays from the image center point to each first pixel point, wherein the rays intersect the outer contour line of the vehicle recognition region at a second pixel point;

[0152] Obtain a first length value and a second length value on the ray; wherein, the first length value is the length from the center point of the image to the first pixel, and the second length value is the length from the center point of the image to the second pixel;

[0153] When the first length value on each ray is less than or equal to the second length value, it is determined that the vehicle identification area contains the original area.

[0154] The first identification module 702 is used for:

[0155] Vehicle feature information is extracted from the vehicle image, and the vehicle feature information is pooled to obtain the feature vector of the vehicle to be identified.

[0156] Calculate the cosine distance between the feature vector of the vehicle to be identified and the preset standard vehicle feature vector; wherein, each standard vehicle feature vector corresponds to a vehicle type;

[0157] The vehicle type corresponding to the standard vehicle feature vector with the largest cosine distance is taken as the vehicle type of the target vehicle.

[0158] Furthermore, the first identification module 702 is also used for:

[0159] Obtain an initial vehicle sample image containing vehicles and a labeled vehicle sample image obtained by labeling the vehicles in the initial vehicle sample image with vehicle types;

[0160] The initial vehicle sample image and the labeled vehicle sample image are input into the feature extraction layer of the CNN model to be trained, and the vehicle feature information of the initial vehicle sample image and the labeled vehicle sample image are extracted respectively.

[0161] The vehicle feature information of the labeled vehicle sample image for each vehicle type, the weight of the vehicle type to which the vehicle feature information of the labeled vehicle sample image belongs, and the vehicle feature information of the initial vehicle sample image are input into the loss layer of the CNN model to be trained. The vehicle feature vector of the vehicle feature information is calculated through the pooling layer in the loss layer. The loss value of the loss function in the CNN model to be trained is obtained based on the vehicle feature vector.

[0162] Based on the loss value of the loss function, the parameters in the CNN model to be trained are adjusted to obtain the trained vehicle recognition model.

[0163] Furthermore, the first identification module 702 is also used for:

[0164] Determine the entry and exit status of the target vehicle; wherein, the entry and exit status is either an entry status or an exit status;

[0165] The truck bed position information of the target vehicle is determined based on the vehicle type and the entry / exit status of the target vehicle;

[0166] The truck bed image is obtained from the vehicle image based on the truck bed position information.

[0167] Specifically, the second identification module 703 is used for:

[0168] Extract material feature information corresponding to the target material from the vehicle image, and perform pooling processing on the material feature information to obtain the material feature vector to be identified for the target material;

[0169] Calculate the cosine distance between the feature vector of the material to be identified and the preset standard material feature vector; wherein, each standard material feature vector corresponds to a material type;

[0170] The material type corresponding to the standard material feature vector with the largest cosine distance is taken as the material type of the target material.

[0171] Furthermore, the second identification module 703 is also used for:

[0172] Obtain an initial material sample image containing materials and a labeled material sample image obtained by labeling the materials in the initial material sample image with material types;

[0173] The initial material sample image and the labeled material sample image are input into the feature extraction layer of the CNN model to be trained, and the material feature information of the initial material sample image and the labeled material sample image are extracted respectively.

[0174] The material feature information of the labeled material sample image and the material feature information of the initial material sample image for each material type are input into the loss layer of the CNN model to be trained, and the material feature vector of the material feature information is calculated through the pooling layer in the loss layer. The loss value of the loss function in the CNN model to be trained is obtained based on the material feature vector.

[0175] Based on the loss value of the loss function, the parameters in the CNN model to be trained are adjusted to obtain the trained material recognition model.

[0176] Example 3

[0177] This embodiment also provides a computer device, such as a smartphone, tablet computer, laptop computer, desktop computer, rack server, blade server, tower server, or cabinet server (including a standalone server or a server cluster composed of multiple servers), etc., capable of executing programs. Figure 8 As shown, the computer device 80 in this embodiment includes, but is not limited to, a memory 801 and a processor 802 that are communicatively connected to each other via a system bus. It should be noted that... Figure 8 Only a computer device 80 with components 801-802 is shown; however, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0178] In this embodiment, the memory 801 (i.e., storage medium) includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 801 may be an internal storage unit of the computer device 80, such as the hard disk or memory of the computer device 80. In other embodiments, the memory 801 may also be an external storage device of the computer device 80, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. Of course, the memory 801 may include both the internal storage unit and the external storage device of the computer device 80. In this embodiment, the memory 801 is typically used to store the operating system and various application software installed on the computer device 80. Furthermore, the memory 801 can also be used to temporarily store various types of data that have been output or will be output.

[0179] In some embodiments, processor 802 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other chip for identifying vehicle type and material. Processor 802 is typically used to control the overall operation of computer device 80.

[0180] Specifically, in this embodiment, the processor 802 is used to execute a program for identifying vehicle type and material stored in the memory 801. When the program for identifying vehicle type and material is executed, it performs the following steps:

[0181] When a target vehicle is detected in the vehicle recognition area, a vehicle image of the target vehicle is acquired;

[0182] Identify the vehicle type of the target vehicle from the vehicle image;

[0183] When the vehicle type is a material truck, the type of material being transported by the target vehicle is identified from the vehicle image;

[0184] The vehicle type of the target vehicle and the type of material are recorded.

[0185] For a detailed description of the above method steps, please refer to Example 1. This example will not be repeated here.

[0186] Example 4

[0187] This embodiment also provides a computer storage medium, such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, server, app store, etc., which stores a computer program. When the computer program is executed by a processor, it implements the following method steps:

[0188] When a target vehicle is detected in the vehicle recognition area, a vehicle image of the target vehicle is acquired;

[0189] Identify the vehicle type of the target vehicle from the vehicle image;

[0190] When the vehicle type is a material truck, the type of material being transported by the target vehicle is identified from the vehicle image;

[0191] The vehicle type of the target vehicle and the type of material are recorded.

[0192] For a detailed description of the above method steps, please refer to Example 1. This example will not be repeated here.

[0193] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0194] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0195] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0196] The above are merely preferred embodiments of the present invention and do not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for identifying vehicle type and materials, characterized in that, The method includes: When a target vehicle is detected in the monitoring image at the construction site, the entire body of the target vehicle is framed to obtain the original area; wherein, the monitoring image includes a vehicle identification area and a non-identification area; Determine whether the vehicle recognition area contains the original area; if so, use the original area as the vehicle image of the target vehicle. Identify the vehicle type of the target vehicle from the vehicle image; When the vehicle type is a material truck, the type of material being transported by the target vehicle is identified from the vehicle image; Record the vehicle type of the target vehicle and the type of material; The step of determining whether the vehicle recognition area contains the original area includes: Obtain the first pixel point in the preset original region; wherein, the first pixel point is a point on the outer contour line of the original region; Obtain the image center point of the original region, and draw rays from the image center point to each first pixel point, wherein the rays intersect the outer contour line of the vehicle recognition region at a second pixel point; Obtain a first length value and a second length value on the ray; wherein, the first length value is the length from the center point of the image to the first pixel, and the second length value is the length from the center point of the image to the second pixel; When the first length value on each ray is less than or equal to the second length value, it is determined that the vehicle identification area contains the original area.

2. The method for identifying vehicle type and materials according to claim 1, characterized in that, The method further includes: Identify reference points from the surveillance images to determine the entry and exit of target vehicles from the construction site; Based on the position information of the reference object in the monitoring image, a reference range is delineated from the monitoring image; The reference range is used as the vehicle identification area, and the area in the monitoring image other than the reference range is used as the non-identification area.

3. The method for identifying vehicle type and materials according to claim 1, characterized in that, The step of determining whether the vehicle recognition area contains the original area further includes: Calculate a first vector value to characterize the outer contour of the vehicle recognition region; When any pixel in the original region is within the vehicle recognition region, the union of the original region and the vehicle recognition region is set as the combined region; Calculate a second vector value to characterize the outer contour of the combined region; Determine whether the first vector value and the second vector value are the same. If they are, then determine that the vehicle recognition area includes the original area.

4. The method for identifying vehicle type and materials according to claim 1, characterized in that, The step of identifying the vehicle type of the target vehicle from the vehicle image includes: Vehicle feature information is extracted from the vehicle image, and the vehicle feature information is pooled to obtain the feature vector of the vehicle to be identified. Calculate the cosine distance between the feature vector of the vehicle to be identified and the preset standard vehicle feature vector; wherein, each standard vehicle feature vector corresponds to a vehicle type; The vehicle type corresponding to the standard vehicle feature vector with the largest cosine distance is taken as the vehicle type of the target vehicle.

5. The method for identifying vehicle type and materials according to claim 1, characterized in that, The process of identifying the type of material being transported by the target vehicle from the vehicle image includes: Extract material feature information corresponding to the target material from the vehicle image, and perform pooling processing on the material feature information to obtain the material feature vector to be identified for the target material; Calculate the cosine distance between the feature vector of the material to be identified and the preset standard material feature vector; wherein, each standard material feature vector corresponds to a material type; The material type corresponding to the standard material feature vector with the largest cosine distance is taken as the material type of the target material.

6. A device for identifying vehicle type and materials, characterized in that, The device includes: The acquisition module is used to frame the entire body of the target vehicle to obtain an original area when a target vehicle is detected in a monitoring image at the construction site; wherein the monitoring image includes a vehicle identification area and a non-identification area; and to determine whether the vehicle identification area contains the original area. If so, the original area is used as the vehicle image of the target vehicle. The first identification module is used to identify the vehicle type of the target vehicle from the vehicle image; The second identification module is used to identify the type of material being transported by the target vehicle from the vehicle image when the vehicle type is a material vehicle. The recording module is used to record the vehicle type of the target vehicle and the type of material. The acquisition module is used for: Obtain the first pixel point in the preset original region; wherein, the first pixel point is a point on the outer contour line of the original region; Obtain the image center point of the original region, and draw rays from the image center point to each first pixel point, wherein the rays intersect the outer contour line of the vehicle recognition region at a second pixel point; Obtain a first length value and a second length value on the ray; wherein, the first length value is the length from the center point of the image to the first pixel, and the second length value is the length from the center point of the image to the second pixel; When the first length value on each ray is less than or equal to the second length value, it is determined that the vehicle identification area contains the original area.

7. A computer device, the computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor, when executing the computer program, implements the steps of the method according to any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.