Image processing method, device, equipment and medium
By obtaining the attribute information of the target video data and performing image cutting and scaling processing, the problem of inaccurate detection of small target objects in the image is solved, the accuracy of image recognition is improved, and the missed detection rate is reduced.
Patent Information
- Application Number
- CN202010602123.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-28
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2040-06-28
AI Technical Summary
When the image contains multiple small targets, it is difficult for the existing technology to accurately identify the target object, resulting in a high missed detection rate. Especially in pedestrian and vehicle detection, the area of the target object is small and unclear, resulting in inaccurate detection results.
By obtaining the attribute information of the target video data, including the size and position of the target object, image shearing and scaling are performed, the size of the target object is unified for easy identification, and computer vision technology and target detection models are used for type identification processing to reduce missed detections. Rate.
It improves the accuracy of image recognition, reduces the missed detection rate of target objects, and makes the image recognition results more accurate.
Smart Images

Figure CN111753766B
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing, and in particular to an image processing method, device, equipment and medium. Background Art
[0002] The current image processing technology is relatively mature and widely used in various fields. However, when the image contains multiple small targets, there will be many missed detections. For example, in the scenario of recommending advertising pictures to pedestrians in a shopping mall, the captured images containing pedestrians' clothing can be detected to determine the pedestrians' clothing preferences, and then the corresponding advertising pictures can be recommended. However, due to the large number of pedestrians and their movement, the clothing in the captured images has a small area in the image and is not clear enough, resulting in the inability to accurately determine the pedestrians' clothing preferences.
[0003] For another example, in the field of transportation, as the number of vehicles on the road increases, road vehicle detection becomes increasingly difficult. The more vehicles there are on the road, the more vehicles there are in the road traffic images captured by the camera. Due to the long distance between the vehicle and the camera, the area of the vehicle in the captured vehicle image is small, resulting in the vehicle in the image not being clear enough. Therefore, when the image is subsequently detected and identified, it is easy to cause inaccurate vehicle detection results, resulting in more missed vehicle detections. Summary of the invention
[0004] The embodiments of the present application provide an image processing method, apparatus, device and medium, which can reduce the missed detection rate of vehicles in image recognition, thereby improving the accuracy of image recognition.
[0005] An embodiment of the present application provides an image processing method, including:
[0006] Acquire target video data, where an image in the target video data includes a target object;
[0007] Performing attribute recognition processing on the image in the target video data to obtain first attribute information of the target object, the first attribute information including first size information of the target object in a two-dimensional coordinate system and position information of the target object in the image included in the target video data;
[0008] Cutting the image included in the target video data according to the first size information and the position information of the target object in the image included in the target video data to obtain at least one first image area, each of which includes the target object;
[0009] Determine a reference image region from the at least one first image region, and perform scaling processing on the at least one first image region according to the reference image region to obtain a second image region corresponding to each first image region;
[0010] Type recognition processing is performed on the second image area corresponding to each first image area to obtain the object type of the target object.
[0011] An embodiment of the present application provides an image processing device, including:
[0012] A video acquisition module, used for acquiring target video data, wherein the image in the target video data includes a target object;
[0013] an attribute acquisition module, configured to perform attribute recognition processing on the image in the target video data to obtain first attribute information of the target object, wherein the first attribute information includes first size information of the target object in a two-dimensional coordinate system and position information of the target object in the image included in the target video data;
[0014] An image cutting module, configured to cut the image included in the target video data according to the first size information and the position information of the target object in the image included in the target video data, to obtain at least one first image area, each of which includes the target object;
[0015] An image scaling module, configured to determine a reference image region from the at least one first image region, and to perform scaling processing on the at least one first image region according to the reference image region to obtain a second image region corresponding to each first image region;
[0016] The type acquisition module is used to perform type recognition processing on the second image area corresponding to each first image area to obtain the object type of the target object.
[0017] On one hand, the present application provides a computer device, including: a processor, a memory, and a network interface;
[0018] The above-mentioned processor is connected to the memory and the network interface, wherein the network interface is used to provide data communication function, the above-mentioned memory is used to store computer programs, and the above-mentioned processor is used to call the above-mentioned computer program to execute the method in the above-mentioned aspect in the embodiment of the present application.
[0019] On the one hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program includes program instructions, which, when executed by a processor, enable the processor to execute the blockchain-based data processing method of the first aspect above.
[0020] In the embodiment of the present application, since the first attribute information includes the first size information of the target object in the two-dimensional coordinate system and the position information of the target object in the image included in the target video data, the target object is included in the first image area obtained after the image is cut according to the first attribute information. The size of the reference image area can be, for example, a size that facilitates the identification of the object in the image, so the first image area is scaled to a second image area of the same size as the reference image area, and the image is unified to the same scale for identification again, which can improve the accuracy of image recognition; it can reduce the missed detection rate of the target object in image recognition, thereby making the image recognition result more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1 It is a flowchart of an image processing method provided in an embodiment of the present application;
[0023] Figure 2 is a schematic diagram of first attribute information of a target object in an image provided by an embodiment of the present application;
[0024] Figure 3 It is a schematic diagram of a perspective relationship diagram provided in an embodiment of the present application;
[0025] Figure 4 is a schematic diagram of cutting an image according to reference size information provided in an embodiment of the present application;
[0026] Figure 5 It is a flowchart of an image processing method provided in an embodiment of the present application;
[0027] Figure 6 A schematic diagram of the structure of a detection model provided in an embodiment of the present application;
[0028] Figure 7 is a schematic diagram of the composition structure of an image processing device provided in an embodiment of the present application;
[0029] Figure 8 It is a schematic diagram of the composition structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0031] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0032] Among them, Computer Vision (CV) is a science that studies how to make machines "see". To put it more specifically, it refers to the use of cameras and computers to replace human eyes to identify, track and measure targets, and further perform graphic processing to make computer processing into images that are more suitable for human eye observation or transmission to instruments for detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to establish an artificial intelligence system that can obtain information from images or multi-dimensional data. Computer vision technology usually includes image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous positioning and map construction, and other technologies, as well as common biometric recognition technologies such as face recognition and fingerprint recognition.
[0033] The present application relates to image recognition technology in artificial intelligence. Image recognition technology can be used to reduce the missed detection rate of target objects in image recognition, thereby making the image recognition results more accurate. The present application can be applied to smart government affairs, smart education and other fields, and is conducive to promoting the construction of smart cities.
[0034] The embodiment of the present application is applicable to the scene where an image in target video data is recognized, and the image is cropped and scaled according to the first recognition result, and the processed image is recognized for a second time, so as to determine the type of object in the image. In the embodiment of the present application, the image is cropped and scaled according to the first recognition result, and the processed image is recognized for a second time, which can reduce the missed detection rate of the target object in the image recognition, thereby making the image recognition result more accurate.
[0035] See also Figure 1 , Figure 1is a flowchart of an image processing method provided by an embodiment of the present application. The embodiment of the present application can be executed by a computer device, such as Figure 1 As shown, the method includes:
[0036] S101, obtaining target video data.
[0037] Here, the image in the target video data includes the target object. The target video data may be video data captured by a camera device, which may be, for example, a traffic monitoring camera installed on each road section, or other devices capable of capturing video data, such as a mobile phone, a tablet computer, a laptop computer, a PDA, etc. The target video data includes at least one frame of image, and the target object may be any object in the image, such as a vehicle, a tree, a pedestrian, an obstacle, or other objects that may appear in the image.
[0038] S102: Perform attribute recognition processing on the image in the target video data to obtain first attribute information of the target object.
[0039] The first attribute information includes first size information of the target object in the two-dimensional coordinate system and position information of the target object in the image included in the target video data. Here, the first size information of the target object in the two-dimensional coordinate system is the width of the target object in the image. For example, if the width of the target object in the image is 3 centimeters (cm, unit of length), then the first size information of the target object in the two-dimensional coordinate system is 3 cm. Optionally, the first size information of the target object in the two-dimensional coordinate system may also include the length of the target object.
[0040] A two-dimensional coordinate system is a two-dimensional coordinate system established with any position of the image as the coordinate origin. For example, it can be a two-dimensional coordinate system established with the upper left corner of the image as the coordinate origin, or a two-dimensional coordinate system established with the lower left corner of the image, the midpoint of the image, or other positions of the image as the coordinate origin. The position information of the target object in the image included in the target video data is the position coordinates of the target object in the image. Here, the position information of the target object in the image included in the target video data can include 4 coordinates, that is, the position of the target object in the image is represented by the 4 coordinates. Figure 2 As shown, Figure 2 This is a schematic diagram of the first attribute information of a target object in an image provided by an embodiment of the present application, wherein a is the target object, the first size information of the target object in the two-dimensional coordinate system is 3 cm, and the position information of the target object in the image included in the target video data is (0,0), (0,3), (3,3), (3,0), that is, the position of the target object in the image can be represented by four coordinates (0,0), (0,3), (3,3), (3,0). In this application, the first attribute information can be stored in the blockchain.
[0041] S103: Cut the image included in the target video data according to the first size information and the position information of the target object in the image included in the target video data to obtain at least one first image region.
[0042] Each first image region includes a target object. Cutting the image included in the target video data means cutting each frame image included in the target video data. In the embodiment of the present application, taking any frame image in the target video data as an example, the image is cut to obtain at least one first image region. The method for cutting other frame images in the target video data can refer to this method.
[0043] In the embodiment of the present application, a specific method for cutting an image to obtain at least one first image region is as follows:
[0044] First, a perspective relationship diagram is constructed according to position information of the camera device in the three-dimensional coordinate system, position information of the target object in the three-dimensional coordinate system, first size information, and position information of the target object in an image included in the target video data.
[0045] The position information of the camera device in the three-dimensional coordinate system is used to indicate the position of the camera device when shooting the target video data, such as the position information of the road section where the camera device is installed. For ease of understanding, it is called the actual position of the camera device. The position information of the target object in the three-dimensional coordinate system is the position information of the target object on the road. For ease of understanding, it is called the actual position of the target object. For example, if the target object is a vehicle, the position information of the target object in the three-dimensional coordinate system is the position information of the vehicle on the road when the camera device shoots.
[0046] In a specific implementation, the distance between the position of the camera device and the position of the target object in the constructed perspective relationship diagram and the distance between the actual position of the camera device and the actual position of the target object have a proportional relationship, that is, the perspective relationship diagram and the actual position have a proportional relationship, for example, it can be 1:1, 1:10, 1:50, 1:100, etc. For example, the ratio between the perspective relationship diagram and the actual position is 1:50, that is, the distance between the camera device and the vehicle in the perspective relationship diagram is 1 cm, and the distance between the actual position of the camera device and the actual position of the target object is 50 cm.
[0047] like Figure 3 As shown, Figure 3 is a schematic diagram of a perspective relationship diagram provided by an embodiment of the present application, including a camera device 101, a target object 102, Figure 3In the perspective relationship diagram, the camera device is a camera, the target object is a vehicle, BD represents the position of the image in the target video data in the perspective relationship diagram, the width of the image in the target video data is the length of BD, and the size of the target object 102 in the perspective relationship diagram is h (first size information), that is, the length of CD, y h is the length of BC, y0 is the starting position of the y-axis in the perspective relationship diagram, the height of the camera device 101 is c, that is, the height of EG, and the actual vehicle size of the target object is H, that is, the length of FG.
[0048] Secondly, the perspective relationship diagram is used to determine the linear relationship between the first size information and the position information of the image included in the target video data in the perspective relationship diagram.
[0049] like Figure 3 As shown, Figure 3 There are three pairs of similar triangles, namely: triangle ACD and triangle AFG, triangle ABC and triangle AEF, triangle ABD ~ triangle AEG. Based on the three pairs of similar triangles, we can get formula (1-1):
[0050]
[0051] By converting formula (1-1), we can get formula (1-2):
[0052] h=ky+b (1-2)
[0053] in, b=-ky0,
[0054] H is the actual vehicle size of the target object. H can be set according to the actual situation. The height of the camera device c can also be obtained by measuring the horizontal distance between the camera device and the road. h0 is the minimum detectable size of the target object in the image. That is, when the size of the target object in the image is smaller than h0, the target object in the image cannot be detected. The value of h0 can be set according to the pixels of the camera device and the distance between the actual position of the camera device and the actual position of the target object. y can be obtained by formula (1-2). h The linear relationship between y0 and the first size information is obtained, that is, the linear relationship between the first size information and the position information of the image included in the target video data in the perspective relationship diagram is obtained.
[0055] Next, the first size information and the linear relationship are calculated to obtain at least one reference size information.
[0056] Here, the first size information and the linear relationship can be calculated according to formula (1-3):
[0057]
[0058] Where y is equal to y h , A is the traffic capacity, and the value of the traffic capacity A can be set according to the specific situation. For example, A can be 8, or other values.
[0059] Finally, the image included in the target video data is cut according to at least one reference size information to obtain at least one first image region, where one first image region corresponds to one reference size information.
[0060] The value of y1 can be calculated by formula (1-3), and y1 can be substituted into formula (1-3), that is, the formula after substitution is (1-4):
[0061]
[0062] The value of y2 can be calculated by formula (1-4). Substituting y2 into formula (1-4) can calculate the value of y3. Then, y n The value of y1, y2, y3~y n The reference size information is calculated by using the value of y1-y0, y2-y1, y3-y2, y n -Y n-1 The value of and so on.
[0063] Here, the number of reference size information is equal to the number of first image regions, and the reference size information is the width of the first image region. Optionally, the first image region 1 is the region with the largest reference size information, the size of the first image region 2 is smaller than the first image region 1, the size of the first image region 3 is smaller than the first image region 2, and so on. Figure 4 As shown, Figure 4 is a schematic diagram of cutting an image according to reference size information provided by an embodiment of the present application, wherein a1, a2, and a3 are three target objects, for example, the reference sizes are 10, 5, and 2.5, respectively, and the image included in the target video data is cut according to the reference size to obtain three first image regions, namely Figure 4 Region 1, region 2, and region 3 in the image, wherein the reference size information of region 1 is 10, the reference size information of region 2 is 5, and the reference size information of region 3 is 2.5, thereby all first image regions in the image can be obtained.
[0064] S104, determining a reference image region from at least one first image region, and performing scaling processing on at least one first image region according to the reference image region to obtain a second image region corresponding to each first image region.
[0065] Here, the scaling process refers to reducing or enlarging the first image area so that the size of the first image area after the scaling process is equal to the size of the reference image area. The specific processing method can be determined according to the ratio between the first image area and the reference image area. If the first image area is larger than the reference image area, the first image area is reduced so that the size of the first image area after the reduction process is equal to the size of the reference image area; if the first image area is smaller than the reference image area, the first image area is enlarged so that the size of the first image area after the enlargement process is equal to the size of the reference image area; if the first image area is equal to the reference image area, the first image area may not be scaled. Here, the size of the first image area mainly refers to the width of the first image area. Optionally, the size of the first image area may also refer to the length of the first image area.
[0066] In the embodiment of the present application, a specific method of performing scaling processing on at least one first image region to obtain a second image region corresponding to each first image region is as follows:
[0067] First, an image region with the largest region size in at least one first image region is used as a reference image region.
[0068] For example, there are three first image regions, namely region 1 to region 3, with corresponding sizes of 10, 5, and 2.5, respectively. Then, the image region with the largest region size is region 1, and region 1 is used as the reference image region.
[0069] Secondly, a ratio between each first image region in at least one first image region and a reference image region is obtained.
[0070] Here, for example, after the above steps determine that area 1 is the reference image area, the ratio between the reference image area and area 1 is 1:1, the ratio between the reference image area and area 2 is 2:1 (that is, the ratio between area 1 and area 2 is 2:1), and the ratio between the reference image area and area 3 is 4:1 (that is, the ratio between area 1 and area 3 is 4:1).
[0071] Finally, each first image region is scaled according to the ratio to obtain a second image region corresponding to each first image region.
[0072] As shown in the above steps, the ratio between the reference image area and area 1 is 1:1, the ratio between the reference image area and area 2 is 2:1, and the ratio between the reference image area and area 3 is 4:1. Since the reference image area is equal to area 1, area 1 is not scaled; area 2 is enlarged so that the size of area 2 is equal to the size of the reference area; area 3 is enlarged so that the size of area 3 is equal to the size of the reference area. It can be seen that the second image area includes area 1, enlarged area 2, and enlarged area 3. It can be seen that the sizes of each second image area are equal. Since some target objects may be small and difficult to identify during the first recognition, by enlarging the target object and then identifying it, the size of the target object in the image that needs to be recognized twice can be made as equal as possible, thereby reducing the missed detection rate of the target object.
[0073] In one embodiment, an image region with the largest area size among at least one first image region corresponding to the first frame image in the target video data may be used as a reference image region.
[0074] Here, each frame image in the target video data corresponds to a time, for example, the time when the frame image is captured, and the first frame image in the target video data, that is, the time when the frame image is captured, is earlier than the time when other frames of the target video data are captured. Taking the first frame image as an example, the image area with the largest area size among at least one first image area corresponding to the first frame image is used as the reference image area.
[0075] Optionally, an average size of at least one first image region corresponding to the first frame image may be calculated, and scaling processing may be performed on at least one first image region according to the average size to obtain a second image region corresponding to each first image region.
[0076] For example, the first frame image corresponds to three first image areas, namely area 1, area 2, and area 3, and the corresponding sizes are 12, 9, and 3, respectively. The average size is (12+9+3) / 3=8, so area 1 is reduced by 2 / 3 times to obtain the second image area, area 2 is reduced by 8 / 9 times to obtain the second image area, and area 3 is reduced by 8 / 3 times to obtain the second image area. The sizes of the second image areas obtained after scaling are all 8.
[0077] Optionally, the average size of the image area with the largest area size in at least one first image area corresponding to the first z frames of image in the target video data may be obtained, and at least one first image area may be scaled according to the average size to obtain a second image area corresponding to each first image area.
[0078] For example, z is 3, the size of the image area with the largest area size in at least one first image area corresponding to the first frame image is 10, the size of the image area with the largest area size in at least one first image area corresponding to the second frame image is 9, and the size of the image area with the largest area size in at least one first image area corresponding to the third frame image is 8, then the average size is 9, and at least one first image area corresponding to each frame image is scaled according to the average size, so that the size of the obtained second image areas is 9.
[0079] S105: Perform type recognition processing on the second image area corresponding to each first image area to obtain the object type of the target object.
[0080] Here, a target detection model can be used to perform type recognition processing on the second image area, and the target detection model can include a residual neural network (such as a ResNet50 network) and a deep and cross neural network (such as a DCN network).
[0081] In a specific implementation, the second image area corresponding to each first image area can be input into the target detection model for type recognition processing to obtain multiple first candidate object types of the target object in the second image area and the matching probability corresponding to each first candidate object type; the object type with the highest matching probability among the multiple first candidate object types is used as the object type of the target object in the second image area.
[0082] Among them, the first candidate object type may include, for example, a vehicle type, a tree type, a pedestrian type, or an obstacle type, etc. By inputting the second image area into the target detection model for type recognition processing, the matching probability of the target object in the second image area with each of the multiple first candidate object types can be obtained. For example, if the matching probability of the target object in the second image area with the vehicle type is 0.8, the matching probability of the target object in the second image area with the tree type is 0.3, and the matching probability of the target object in the second image area with the obstacle type is 0.1, the vehicle type is used as the object type of the target object in the second image area. In this application, the object type of the target object can be stored in the blockchain.
[0083] Optionally, the computer device in this application may refer to any node device in the blockchain. The so-called blockchain is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission (P2P transmission), consensus mechanism, encryption algorithm, etc. It is essentially a decentralized database; the blockchain can be composed of multiple serial transaction records (also known as blocks) that are connected and protected by cryptography. The distributed ledger connected by the blockchain allows multiple parties to effectively record transactions and can permanently check the transaction (not tamperable). Among them, the consensus mechanism refers to the mathematical algorithm that realizes the establishment of trust and the acquisition of rights and interests between different nodes in the blockchain network; that is, the consensus mechanism is a mathematical algorithm recognized by all network nodes of the blockchain. This application can use the consensus mechanism of the blockchain to realize the unification of images to the same scale for re-recognition, which can improve the accuracy of image recognition and reduce the missed detection rate of target objects in image recognition.
[0084] For example, each node device in the blockchain performs consensus verification on the execution results of the above steps S101 to S105. If the execution results of each step are verified by consensus, it can be determined that the accuracy of image recognition is relatively high; if the execution results of a step are not verified by consensus, it can be determined that the accuracy of image recognition is relatively low, and the node device can execute the above steps S101 to S105 again to re-recognize the image. Alternatively, each node device in the blockchain can perform consensus verification on the image (i.e., only the execution result of step S105). If the consensus verification is passed, it is determined that the accuracy of image recognition is relatively high; if the consensus verification is not passed, it is determined that the accuracy of image recognition is relatively low, and the node device can execute the above steps S101 to S105 again to re-recognize the image.
[0085] In the embodiment of the present application, since the first attribute information includes the first size information of the target object in the two-dimensional coordinate system and the position information of the target object in the image included in the target video data, the target object is included in the first image area obtained after the image is cut according to the first attribute information. The size of the reference image area can be, for example, a size that facilitates the identification of the object in the image, so the first image area is scaled to a second image area of the same size as the reference image area, and the image is unified to the same scale for identification again, which can improve the accuracy of image recognition; it can reduce the missed detection rate of the target object in image recognition, thereby making the image recognition result more accurate.
[0086] Optional, see Figure 5 , Figure 5 is a flowchart of an image processing method provided by an embodiment of the present application. The embodiment of the present application can be executed by a computer device, such as Figure 5 As shown, the method includes:
[0087] S201, obtaining target video data.
[0088] S202: Perform attribute recognition processing on the image in the target video data to obtain first attribute information of the target object.
[0089] Here, a target detection model may be used to perform attribute recognition processing on images in the target video data, and the target detection model may include a ResNet50 network and a DCN network.
[0090] Optionally, before using the target detection model to perform attribute recognition processing on the image in the target video data, the detection model may be trained first, so that the detection model is used only when the accuracy of the detection model reaches a certain condition. The specific detection model training method is as follows:
[0091] 1. Obtain a sample image and the object type of the annotated object in the sample image.
[0092] Here, when training the model, the object type of the annotated object in the sample image is known, so the object type of the annotated object in the sample image can be obtained.
[0093] 2. Perform attribute recognition processing on the sample image to obtain the first attribute information of the sample object.
[0094] Among them, the first attribute information includes the first sample size information of the sample object in the two-dimensional coordinate system and the position information of the sample object in the sample image. The first size information of the sample object in the two-dimensional coordinate system is the width of the sample object in the sample image. For example, if the width of the sample object in the sample image is 3cm, then the first sample size information of the sample object in the two-dimensional coordinate system is 3cm. Optionally, the first sample size information of the sample object in the two-dimensional coordinate system may also include the length of the sample object. The position information of the sample object in the sample image is the position coordinates of the sample object in the sample image. Here, the position information of the sample object in the sample image may include 4 coordinates, that is, the 4 coordinates are used to represent the position of the sample object in the sample image.
[0095] 3. Cut the sample image according to the first sample size information and the position information of the sample object in the sample image to obtain at least one first sample image area.
[0096] Here, each first sample image area includes a sample object, and the linear relationship between the first sample size information and the position information of the sample object in the sample image can be determined according to the perspective relationship diagram, and at least one sample reference size information can be calculated according to the first sample size information and the linear relationship. The sample image is cut according to the at least one sample reference size information to obtain at least one first sample image area.
[0097] Fourth, determine a sample reference image region from at least one first sample image region, and perform scaling processing on at least one first sample image region according to the sample reference image region to obtain a second sample image region corresponding to each first sample image region.
[0098] Here, the scaling process refers to reducing or enlarging the first sample image area so that the size of the first sample image area after the scaling process is equal to the size of the sample reference image area. The specific processing method can be determined according to the ratio between the first sample image area and the sample reference image area. If the first sample image area is larger than the sample reference image area, the first sample image area is scaled down so that the size of the first sample image area after the scaling process is equal to the size of the sample reference image area; if the first sample image area is smaller than the sample reference image area, the first sample image area is enlarged so that the size of the first sample image area after the enlargement process is equal to the size of the sample reference image area; if the first sample image area is equal to the sample reference image area, the first sample image area may not be scaled. Here, the size of the first sample image area mainly refers to the width of the first sample image area. Optionally, the size of the first sample image area may also refer to the length of the first sample image area.
[0099] 5. Use the detection model to perform type recognition processing on the second sample image area corresponding to each first sample image area to obtain the object type of the sample object.
[0100] In a specific implementation, the second sample image area corresponding to each first sample image area can be input into the detection model for type recognition processing to obtain multiple first candidate sample object types of the sample object in the second sample image area, and the matching probability corresponding to each first candidate sample object type; the sample object type with the largest matching probability among the multiple first candidate sample object types is used as the object type of the sample object in the second sample image area.
[0101] Optionally, the detection model may include a first feature extraction layer, a second feature extraction layer and a feature classification layer, so the trained target detection model may also include a first feature extraction layer, a second feature extraction layer and a feature classification layer.
[0102] In a specific implementation, the detection model is used to perform type recognition processing on the second sample image area corresponding to each first sample image area, and the object types of the sample objects obtained include:
[0103] The first feature extraction layer in the detection model is used to extract features from the sample image to obtain a first feature; the second feature extraction layer in the detection model is used to extract features from the first feature to obtain a second feature; the first feature and the second feature are spliced to obtain a spliced feature; the feature classification layer in the detection model is used to identify the spliced feature to obtain an object type of the sample object.
[0104] The first feature is used to indicate the edge information of the sample image, and the second feature is used to indicate the semantic information of the sample image. The sample image information contained in the first feature is less than the sample image information contained in the second feature. For example, the first feature is used to indicate the image's outline, size, and other information, and the second feature is used to indicate the image's category and other information. Figure 6 As shown, Figure 6 A structural diagram of a detection model provided in an embodiment of the present application, Figure 6 In the example, l1 is the first feature extraction layer, l2 is the second feature extraction layer, l3 is the feature classification layer, and F is the object type of the sample object. The sample image is feature extracted by l1 to obtain the first feature; the first feature is feature extracted by l2 to obtain the second feature; the first feature and the second feature are spliced to obtain the spliced feature, that is, the spliced feature includes the first feature and the second feature; the spliced feature is identified by l3 to obtain the object type F of the sample object.
[0105] 6. Determine the accuracy of the detection model for image recognition based on the object type of the sample object and the object type of the labeled object.
[0106] Here, if the object type of the sample object is the same as the object type of the labeled object, the detection model is considered to have a higher accuracy for image recognition; if the object type of the sample object is different from the object type of the labeled object, the detection model is considered to have a higher accuracy for image recognition. In this application, the object type of the labeled object and the object type of the sample object can be stored in the blockchain.
[0107] 7. Adjust the detection model according to the accuracy, and determine the adjusted detection model as the target detection model.
[0108] Here, if the accuracy is low, for example, less than 80%, the detection model can be adjusted according to the accuracy; if the accuracy is high, for example, greater than or equal to 80%, the detection model recognition result can be considered to be more accurate, then the detection model training is completed, and the trained detection model is determined as the target detection model.
[0109] For example, the above processing is performed on 100 sample images. If the object type of the sample object in 50 of the sample images is different from the object type of the labeled object, it can be considered that the accuracy of the detection model is low, and the detection model continues to be adjusted; if the object type of the sample object in 90 of the sample images is the same as the object type of the labeled object, it can be considered that the accuracy of the detection model is high, and the detection model training is completed, and the trained detection model is determined as the target detection model.
[0110] The above method can obtain a target detection model with high accuracy. The method of using the target detection model to recognize an image can refer to the method of training a detection model, which will not be repeated here. Using the trained target detection model to recognize an image can make the image recognition result more accurate.
[0111] S203: Cut the image included in the target video data according to the first size information and the position information of the target object in the image included in the target video data to obtain at least one first image region.
[0112] S204, determining a reference image region from at least one first image region, and performing scaling processing on at least one first image region according to the reference image region to obtain a second image region corresponding to each first image region.
[0113] S205: Perform type recognition processing on the second image area corresponding to each first image area to obtain the object type of the target object.
[0114] Here, the specific implementation of steps S201 to S205 can be referred to Figure 1 The description of steps S101 to S105 in the corresponding embodiment will not be repeated here.
[0115] S206, obtaining position information of the camera device in the three-dimensional coordinate system.
[0116] Here, through the above steps, it is identified whether the target object is a vehicle. If it is determined that the target object is a vehicle, the identification result of the target object can be used in subsequent vehicle quantity counting or vehicle identification, etc. The vehicle identification can be, for example, a license plate number or other identification used to uniquely indicate the vehicle.
[0117] For example, after identifying the target object as a vehicle, the classification model can be used to identify the area corresponding to the target object and identify the vehicle identification such as the vehicle license plate number. Here, the classification model may include a residual neural network or other convolutional neural network that can identify the vehicle identification. After identifying the vehicle identification of the vehicle, the position information of the camera device in the three-dimensional coordinate system can be obtained, that is, the actual position of the camera device, for example, the intersection of No. XX, Kefa Road, Nanshan District, Shenzhen.
[0118] S207, determining the three-dimensional coordinate information of the target object according to the position information of the camera device in the three-dimensional coordinate system, and positioning the target object.
[0119] Optionally, the time when the camera device shoots the target video data can also be obtained, and the three-dimensional coordinate information of the target object can be determined according to the time when the camera device shoots the target video data and the position information of the camera device in the three-dimensional coordinate system to locate the target object.
[0120] Specifically, since the above steps determine the position information of the camera device in the three-dimensional coordinate system and the time of shooting the target video data, it can be determined that at this time, the target object (vehicle) travels to the target range corresponding to the actual position of the camera device. Therefore, the camera device within the target range or the camera device within a certain distance from the target range can be searched, and the video data in the searched camera device can be identified, so as to determine the position information of the vehicle at the next time and realize the positioning of the vehicle.
[0121] In an embodiment of the present application, the detection model is trained and saved when the detection model is trained to a certain accuracy. When the detection model is subsequently used for recognition, the recognition result is more accurate. Since the first feature (shallow feature) and the second feature (deep feature) of the image are extracted, the extracted image features are more complete, thereby improving the accuracy of image recognition. When the target object is identified as a vehicle, the position of the vehicle is determined by obtaining the position of the camera device that captures the vehicle, thereby achieving the positioning of the vehicle.
[0122] The method of the embodiment of the present application is introduced above, and the device of the embodiment of the present application is introduced below.
[0123] See also Figure 7 , Figure 7 70 is a schematic diagram of the composition structure of an image processing device provided in an embodiment of the present application. The above-mentioned image processing device can be a computer program (including program code) running in a computer device. For example, the image processing device is an application software; the device can be used to execute the corresponding steps in the method provided in the embodiment of the present application. The device 70 includes:
[0124] The video acquisition module 701 is used to acquire target video data, where the image in the target video data includes a target object;
[0125] The attribute acquisition module 702 is used to perform attribute recognition processing on the image in the target video data to obtain first attribute information of the target object, where the first attribute information includes first size information of the target object in a two-dimensional coordinate system and position information of the target object in the image included in the target video data;
[0126] An image cutting module 703 is used to cut the image included in the target video data according to the first size information and the position information of the target object in the image included in the target video data to obtain at least one first image area, each of which includes the target object;
[0127] An image scaling module 704 is configured to determine a reference image region from the at least one first image region, and to perform scaling processing on the at least one first image region according to the reference image region to obtain a second image region corresponding to each first image region;
[0128] The type acquisition module 705 is used to perform type recognition processing on the second image area corresponding to each first image area to obtain the object type of the target object.
[0129] Optionally, the image cutting module 703 is specifically used for:
[0130] constructing a perspective relationship diagram according to position information of a camera in a three-dimensional coordinate system, position information of the target object in the three-dimensional coordinate system, the first size information, and position information of the target object in an image included in the target video data, wherein the camera is used to shoot the target video data;
[0131] Determine the linear relationship between the first size information and the position information of the image included in the target video data in the perspective relationship diagram by using the perspective relationship diagram;
[0132] Calculating the first size information and the linear relationship to obtain the at least one reference size information;
[0133] The image included in the target video data is cut according to the at least one reference size information to obtain the at least one first image region, where one first image region corresponds to one reference size information.
[0134] Optionally, the image scaling module 704 is specifically configured to:
[0135] Using the image region with the largest region size in the at least one first image region as the reference image region;
[0136] Acquire a ratio between each of the at least one first image region and the reference image region;
[0137] Each first image region is scaled according to the ratio to obtain a second image region corresponding to each first image region.
[0138] Optionally, the type acquisition module 705 is specifically used to:
[0139] Inputting the second image region corresponding to each first image region into the target detection model for type recognition processing to obtain multiple first candidate object types of the target object in the second image region and the matching probability corresponding to each first candidate object type;
[0140] The object type with the highest matching probability among the multiple first candidate object types is used as the object type of the target object in the second image area.
[0141] Optionally, the device 70 further includes: a model training module 706, which is used to:
[0142] Obtaining a sample image and an object type of annotated objects in the sample image;
[0143] Performing attribute recognition processing on the sample image to obtain first attribute information of the sample object, the first attribute information including first sample size information of the sample object in a two-dimensional coordinate system and position information of the sample object in the sample image;
[0144] Cutting the sample image according to the first sample size information and the position information of the sample object in the sample image to obtain at least one first sample image area, each of which includes the sample object;
[0145] Determine a sample reference image region from the at least one first sample image region, and perform scaling processing on the at least one first sample image region according to the sample reference image region to obtain a second sample image region corresponding to each first sample image region;
[0146] Using the detection model to perform type recognition processing on the second sample image area corresponding to each first sample image area to obtain the object type of the sample object;
[0147] Determining the accuracy of the detection model for image recognition according to the object type of the sample object and the object type of the labeled object;
[0148] The detection model is adjusted according to the accuracy, and the adjusted detection model is determined as the target detection model.
[0149] Optionally, the detection model includes a first feature extraction layer, a second feature extraction layer and a feature classification layer; the model training module 706 is specifically used for:
[0150] Using the first feature extraction layer in the detection model to extract features from the sample image, to obtain a first feature, where the first feature is used to indicate edge information of the sample image;
[0151] Using the second feature extraction layer in the detection model to extract the first feature, to obtain a second feature, where the second feature is used to indicate semantic information of the sample image;
[0152] Performing splicing processing on the first feature and the second feature to obtain a spliced feature;
[0153] The feature classification layer in the detection model is used to identify the concatenated features to obtain the object type of the sample object.
[0154] Optionally, the device 70 further includes: a target positioning module 707, configured to:
[0155] Obtaining position information of the camera device in a three-dimensional coordinate system;
[0156] The three-dimensional coordinate information of the target object is determined according to the position information of the camera device in the three-dimensional coordinate system, and the target object is positioned.
[0157] It should be noted that Figure 7 For the contents not mentioned in the corresponding embodiments, please refer to the description of the method embodiments, which will not be repeated here.
[0158] According to one embodiment of the present application, Figure 1 The steps involved in the image processing method shown can be Figure 7 The various modules in the image processing device shown are executed. For example, Figure 1 The step S101 shown in FIG. 1 can be performed by Figure 7 The video acquisition module 701 in the embodiment is used to execute, Figure 1 The step S102 shown in FIG. 1 can be performed by Figure 7 The attribute acquisition module 702 is executed; Figure 1 The step S103 shown in FIG. 1 can be performed by Figure 7 The image cutting module 703 is used to execute; Figure 1 The step S104 shown in FIG. 1 can be performed by Figure 7 The image scaling module 704 is used to execute; Figure 1 The step S105 shown in FIG. 1 can be performed by Figure 7 The type acquisition module 705 in is executed, and so on. According to one embodiment of the present application, Figure 7The various modules in the image processing device shown can be separately or all combined into one or several units to constitute, or one (some) of the units can be further divided into multiple functionally smaller sub-units, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above modules are divided based on logical functions. In practical applications, the functions of a module can also be implemented by multiple units, or the functions of multiple modules can be implemented by one unit. In other embodiments of the present application, the image processing device may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.
[0159] According to another embodiment of the present application, the program can be executed by running on a general-purpose computer device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 1 A computer program (including program code) for each step involved in the corresponding method shown in Figure 7 The image processing apparatus shown in the figure and the image processing method of the embodiment of the present application are implemented. The above computer program can be recorded on a computer-readable recording medium, for example, and loaded into the above computing device through the computer-readable recording medium and run therein.
[0160] In the embodiment of the present application, since the first attribute information includes the first size information of the target object in the two-dimensional coordinate system and the position information of the target object in the image included in the target video data, the target object is included in the first image area obtained after the image is cut according to the first attribute information. The size of the reference image area can be, for example, a size that facilitates the identification of the object in the image, so the first image area is scaled to a second image area of the same size as the reference image area, and the image is unified to the same scale for identification again, which can improve the accuracy of image recognition; it can reduce the missed detection rate of the target object in image recognition, thereby making the image recognition result more accurate.
[0161] See also Figure 8 , Figure 8 Schematic diagram of the structure of a computer device provided in an embodiment of the present application. Figure 8As shown, the above-mentioned computer device 80 may include: a processor 801, a network interface 804 and a memory 805. In addition, the above-mentioned computer device 80 may also include: a user interface 803, and at least one communication bus 802. Among them, the communication bus 802 is used to realize the connection and communication between these components. Among them, the user interface 803 may include a display screen (Display), a keyboard (Keyboard), and the optional user interface 803 may also include a standard wired interface and a wireless interface. The network interface 804 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 805 may be a high-speed RAM memory, or it may be a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 805 may optionally also be at least one storage device located away from the aforementioned processor 801. As Figure 8 As shown, the memory 805 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a device control application program.
[0162] exist Figure 8 In the computer device 80 shown, the network interface 804 can provide a network communication function; the user interface 803 is mainly used to provide an input interface for the user; and the processor 801 can be used to call the device control application stored in the memory 805 to achieve:
[0163] Acquire target video data, where an image in the target video data includes a target object;
[0164] Performing attribute recognition processing on the image in the target video data to obtain first attribute information of the target object, the first attribute information including first size information of the target object in a two-dimensional coordinate system and position information of the target object in the image included in the target video data;
[0165] Cutting the image included in the target video data according to the first size information and the position information of the target object in the image included in the target video data to obtain at least one first image area, each of which includes the target object;
[0166] Determine a reference image region from the at least one first image region, and perform scaling processing on the at least one first image region according to the reference image region to obtain a second image region corresponding to each first image region;
[0167] Type recognition processing is performed on the second image area corresponding to each first image area to obtain the object type of the target object.
[0168] In one embodiment, the processor 801 executes the step of cutting the image included in the target video data according to the first size information and the position information of the target object in the image included in the target video data to obtain at least one first image area, including:
[0169] constructing a perspective relationship diagram according to position information of a camera in a three-dimensional coordinate system, position information of the target object in the three-dimensional coordinate system, the first size information, and position information of the target object in an image included in the target video data, wherein the camera is used to shoot the target video data;
[0170] Determine the linear relationship between the first size information and the position information of the image included in the target video data in the perspective relationship diagram by using the perspective relationship diagram;
[0171] Calculating the first size information and the linear relationship to obtain the at least one reference size information;
[0172] The image included in the target video data is cut according to the at least one reference size information to obtain the at least one first image region, where one first image region corresponds to one reference size information.
[0173] In one embodiment, the processor 801 determines a reference image region from the at least one first image region, and performs scaling processing on the at least one first image region according to the reference image region to obtain a second image region corresponding to each first image region, including:
[0174] Using the image region with the largest region size in the at least one first image region as the reference image region;
[0175] Acquire a ratio between each of the at least one first image region and the reference image region;
[0176] Each first image region is scaled according to the ratio to obtain a second image region corresponding to each first image region.
[0177] In one embodiment, the processor 801 performs type recognition processing on the second image area corresponding to each first image area to obtain the object type of the target object, including:
[0178] Inputting the second image region corresponding to each first image region into the target detection model for type recognition processing to obtain multiple first candidate object types of the target object in the second image region and the matching probability corresponding to each first candidate object type;
[0179] The object type with the highest matching probability among the multiple first candidate object types is used as the object type of the target object in the second image area.
[0180] In one embodiment, the processor 801 may call the program code to perform the following operations:
[0181] Obtaining a sample image and an object type of annotated objects in the sample image;
[0182] Performing attribute recognition processing on the sample image to obtain first attribute information of the sample object, the first attribute information including first sample size information of the sample object in a two-dimensional coordinate system and position information of the sample object in the sample image;
[0183] Cutting the sample image according to the first sample size information and the position information of the sample object in the sample image to obtain at least one first sample image area, each of which includes the sample object;
[0184] Determine a sample reference image region from the at least one first sample image region, and perform scaling processing on the at least one first sample image region according to the sample reference image region to obtain a second sample image region corresponding to each first sample image region;
[0185] Using the detection model to perform type recognition processing on the second sample image area corresponding to each first sample image area to obtain the object type of the sample object;
[0186] Determining the accuracy of the detection model for image recognition according to the object type of the sample object and the object type of the labeled object;
[0187] The detection model is adjusted according to the accuracy, and the adjusted detection model is determined as the target detection model.
[0188] In one embodiment, the detection model includes a first feature extraction layer, a second feature extraction layer, and a feature classification layer; the processor 801 performs type recognition processing on the second sample image area corresponding to each first sample image area using the detection model to obtain the object type of the sample object, including:
[0189] Using the first feature extraction layer in the detection model to extract features from the sample image, to obtain a first feature, where the first feature is used to indicate edge information of the sample image;
[0190] Using the second feature extraction layer in the detection model to extract the first feature, to obtain a second feature, where the second feature is used to indicate semantic information of the sample image;
[0191] Performing splicing processing on the first feature and the second feature to obtain a spliced feature;
[0192] The feature classification layer in the detection model is used to identify the concatenated features to obtain the object type of the sample object.
[0193] In one embodiment, the processor 801 may call the program code to perform the following operations:
[0194] Obtaining position information of the camera device in a three-dimensional coordinate system;
[0195] The three-dimensional coordinate information of the target object is determined according to the position information of the camera device in the three-dimensional coordinate system, and the target object is positioned.
[0196] It should be understood that the computer device 80 described in the embodiment of the present application can execute the above Figure 1 as well as Figure 5 The description of the above-mentioned image processing device method in the corresponding embodiment can also be performed as described above. Figure 7 The description of the above-mentioned image processing device in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated here.
[0197] In the embodiment of the present application, since the first attribute information includes the first size information of the target object in the two-dimensional coordinate system and the position information of the target object in the image included in the target video data, the target object is included in the first image area obtained after the image is cut according to the first attribute information. The size of the reference image area can be, for example, a size that facilitates the identification of the object in the image, so the first image area is scaled to a second image area of the same size as the reference image area, and the image is unified to the same scale for identification again, which can improve the accuracy of image recognition; it can reduce the missed detection rate of the target object in image recognition, thereby making the image recognition result more accurate.
[0198] The embodiment of the present application also provides a computer-readable storage medium, which stores a computer program, which includes program instructions, which, when executed by a computer, causes the computer to execute the method of the aforementioned embodiment, and the computer may be part of the computer device mentioned above. For example, the processor 801 mentioned above. As an example, the program instructions may be deployed on a computer device for execution, or deployed on multiple computer devices located at one location for execution, or, executed on multiple computer devices distributed at multiple locations and interconnected by a communication network, and multiple computer devices distributed at multiple locations and interconnected by a communication network may constitute a blockchain network.
[0199] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0200] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. An image processing method, characterized in that: include: Acquire target video data, wherein an image in the target video data includes a target object; Performing attribute recognition processing on the image in the target video data to obtain first attribute information of the target object, wherein the first attribute information includes first size information of the target object in a two-dimensional coordinate system and position information of the target object in the image included in the target video data; constructing a perspective relationship diagram according to position information of a camera in a three-dimensional coordinate system, position information of the target object in the three-dimensional coordinate system, the first size information, and position information of the target object in an image included in the target video data, wherein the camera is used to shoot the target video data; Determine, using the perspective relationship graph, a linear relationship between the first size information and position information of an image included in the target video data in the perspective relationship graph; The first size information and the linear relationship are calculated to obtain at least one reference size information as follows: ; Where A is the traffic capacity, is the starting position of the y-axis in the perspective relationship diagram, , h is the first size information, is the size of the smallest detectable target object in the perspective relationship diagram, It is equal to the length of BC in the perspective diagram, For reference size information; Cutting the image included in the target video data according to the at least one reference size information to obtain at least one first image region, one first image region corresponds to one reference size information, and each first image region includes the target object; Determine a reference image region from the at least one first image region, and perform scaling processing on the at least one first image region according to the reference image region to obtain a second image region corresponding to each first image region; Performing type recognition processing on the second image area corresponding to each of the first image areas to obtain the object type of the target object; the object type of the target object includes one of a vehicle type, a tree type, a pedestrian type or an obstacle type; If the object type of the target object is a vehicle type, obtaining position information of the camera device in a three-dimensional coordinate system; The three-dimensional coordinate information of the target object is determined according to the position information of the camera device in the three-dimensional coordinate system, and the target object is positioned.
2. The method according to claim 1, characterized in that The step of determining a reference image region from the at least one first image region, and performing scaling processing on the at least one first image region according to the reference image region to obtain a second image region corresponding to each first image region includes: Using the image region with the largest area size in the at least one first image region as the reference image region; Acquire a ratio between each of the at least one first image region and the reference image region; Each of the first image regions is scaled according to the ratio to obtain a second image region corresponding to each of the first image regions.
3. The method according to claim 1, characterized in that The performing type recognition processing on the second image area corresponding to each of the first image areas to obtain the object type of the target object includes: Inputting the second image region corresponding to each of the first image regions into the target detection model for type recognition processing to obtain a plurality of first candidate object types of the target object in the second image region and a matching probability corresponding to each first candidate object type; The object type with the highest matching probability among the multiple first candidate object types is used as the object type of the target object in the second image area.
4. The method according to claim 3, characterized in that Before performing attribute recognition processing on the image in the target video data to obtain the first attribute information of the target object, the method further includes: Acquire a sample image and an object type of annotated object in the sample image; Performing attribute recognition processing on the sample image to obtain first attribute information of the sample object, wherein the first attribute information includes first sample size information of the sample object in a two-dimensional coordinate system and position information of the sample object in the sample image; Cutting the sample image according to the first sample size information and the position information of the sample object in the sample image to obtain at least one first sample image area, each of which includes the sample object; Determine a sample reference image region from the at least one first sample image region, and perform scaling processing on the at least one first sample image region according to the sample reference image region to obtain a second sample image region corresponding to each first sample image region; Using a detection model to perform type recognition processing on the second sample image area corresponding to each first sample image area to obtain the object type of the sample object; Determining the accuracy of the detection model for image recognition according to the object type of the sample object and the object type of the labeled object; The detection model is adjusted according to the accuracy, and the adjusted detection model is determined as the target detection model.
5. The method according to claim 4, characterized in that The detection model includes a first feature extraction layer, a second feature extraction layer and a feature classification layer; The adopting the detection model to perform type recognition processing on the second sample image area corresponding to each first sample image area to obtain the object type of the sample object includes: Using the first feature extraction layer in the detection model to extract features from the sample image to obtain a first feature, where the first feature is used to indicate edge information of the sample image; Using the second feature extraction layer in the detection model to extract the first feature to obtain a second feature, where the second feature is used to indicate semantic information of the sample image; Performing splicing processing on the first feature and the second feature to obtain a spliced feature; The feature classification layer in the detection model is used to identify the features after the splicing process to obtain the object type of the sample object.
6. An image processing device, characterized in that: include: A video acquisition module, used to acquire target video data, wherein the image in the target video data includes a target object; an attribute acquisition module, configured to perform attribute recognition processing on the image in the target video data to obtain first attribute information of the target object, wherein the first attribute information includes first size information of the target object in a two-dimensional coordinate system and position information of the target object in the image included in the target video data; The image cutting module is used to construct a perspective relationship diagram according to the position information of the camera device in the three-dimensional coordinate system, the position information of the target object in the three-dimensional coordinate system, the first size information, and the position information of the target object in the image included in the target video data, wherein the camera device is used to shoot the target video data; use the perspective relationship diagram to determine the linear relationship between the first size information and the position information of the image included in the target video data in the perspective relationship diagram; calculate the first size information and the linear relationship to obtain a formula for at least one reference size information as follows: ; Where A is the traffic capacity, is the starting position of the y-axis in the perspective relationship diagram, , h is the first size information, is the size of the smallest detectable target object in the perspective relationship diagram, It is equal to the length of BC in the perspective diagram, For reference size information; The image cutting module is further used to cut the image included in the target video data according to the at least one reference size information to obtain at least one first image area, one first image area corresponds to one reference size information, and each first image area includes the target object; An image scaling module, configured to determine a reference image region from the at least one first image region, and scale the at least one first image region according to the reference image region to obtain a second image region corresponding to each first image region; a type acquisition module, configured to perform type recognition processing on the second image area corresponding to each of the first image areas to obtain the object type of the target object; the object type of the target object includes one of a vehicle type, a tree type, a pedestrian type or an obstacle type; The target positioning module is used to obtain the position information of the camera device in the three-dimensional coordinate system if the object type of the target object is a vehicle type; determine the three-dimensional coordinate information of the target object according to the position information of the camera device in the three-dimensional coordinate system, and locate the target object.
7. A computer device, characterized in that: include: Processor, memory, and network interface; The processor is connected to the memory and the network interface, wherein the network interface is used to provide a data communication function, the memory is used to store program codes, and the processor is used to call the program codes to execute the method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Rail transit scene pedestrian detection method and device
CN108491795A
Image processing method and device and related device
CN109165645A
A method and apparatus for presenting associated information of an icon on a user device
CN109815854A
Object detection method and device
CN110287907A
Image processing method and device, computer equipment and readable storage medium
CN111062871A
