Image processing method for non-motor vehicle behavior recognition
By identifying and judging the speed of road image sequences, the accuracy of non-motor vehicle identification and tracking in the prior art is solved, and the precise capture and efficiency of illegal non-motor vehicles is improved.
Patent Information
- Application Number
- CN202510048163.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-13
- Publication Date
- 2025-02-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, it is difficult to accurately identify and track non-motor vehicles when monitoring electric vehicles, especially when the vehicle size changes, which can easily lead to excessive background inclusion in the search range and lead to misjudgment.
By acquiring the road image sequence, identifying and generating a positioning frame for a non-motor vehicle, combining the road image processing at adjacent time to determine the driving speed of the non-motor vehicle, and determining whether the speed is greater than the preset threshold, thereby identifying the behavior of the non-motor vehicle.
Accurate capture of illegal non-motor vehicles has been achieved, the efficiency and accuracy of traffic management has been improved, and misjudgment has been reduced.
Smart Images

Figure CN119516796A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of non-motor vehicle identification, and in particular to an image processing method for non-motor vehicle behavior identification. Background Art
[0002] With the continuous increase in the number of electric vehicles, there are more and more violations of electric vehicles. A large number of violations have led to more traffic hazards in electric vehicle travel, especially in express delivery, take-out and other drivers often speeding in order to deliver goods quickly, causing serious safety hazards to pedestrians and vehicles around. Existing technology usually uses monitoring to track electric vehicles. During the vehicle tracking process, the vehicle may move from far to near or from near to far, and the size of the non-motor vehicle in the video will change accordingly. However, once the non-motor vehicle in the video becomes smaller, it may include too much background in the search range of the tracking vehicle, resulting in the phenomenon of misjudgment of illegal non-motor vehicles. Summary of the invention
[0003] The purpose of the present invention is to provide an image processing method for non-motor vehicle behavior recognition to improve the above-mentioned problem.
[0004] In order to achieve the above objectives, the present application provides the following technical solutions: On the one hand, an embodiment of the present application provides an image processing method for non-motor vehicle behavior recognition, the method comprising: Acquire a road image sequence, wherein the road image sequence includes at least two road images collected in chronological order by road monitoring; Recognize the road image sequence to obtain a recognition result, wherein the recognition result includes a positioning frame of a non-motor vehicle in each road image; Determine the travel speed of the non-motor vehicle according to the recognition result to obtain speed information; Determine whether the speed information is greater than a preset speed threshold, and obtain a first determination result; The non-motor vehicle behavior is identified according to the first judgment result.
[0005] In a second aspect, an embodiment of the present application provides an image processing device for non-motor vehicle behavior recognition, the device comprising: An acquisition module, used to acquire a road image sequence, wherein the road image sequence includes at least two road images acquired in chronological order by road monitoring; A first processing module, configured to recognize the road image sequence to obtain a recognition result, wherein the recognition result includes a positioning frame of a non-motor vehicle in each road image; A second processing module is used to determine the travel speed of the non-motor vehicle according to the recognition result to obtain speed information; A judgment module, used to judge whether the speed information is greater than a preset speed threshold, and obtain a first judgment result; The third processing module is used to identify the non-motor vehicle behavior according to the first judgment result.
[0006] In a third aspect, an embodiment of the present application provides an image processing device for non-motor vehicle behavior recognition, the device comprising a memory and a processor. The memory is used to store a computer program; the processor is used to implement the steps of the above-mentioned image processing method for non-motor vehicle behavior recognition when executing the computer program.
[0007] In a fourth aspect, an embodiment of the present application provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the above-mentioned image processing method for non-motor vehicle behavior recognition are implemented.
[0008] The beneficial effects of the present invention are: The present invention generates a positioning frame of a non-motor vehicle by identifying the road image sequence through a real-time road image sequence, determines the travel speed of the non-motor vehicle by processing road images at adjacent times, obtains speed information, and then identifies the non-motor vehicle based on the speed information, thereby achieving accurate capture of illegal non-motor vehicles and improving the efficiency and accuracy of traffic management.
[0009] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by implementing the embodiments of the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0011] Figure 1 Schematic diagram of the flow of the image processing method for non-motor vehicle behavior recognition described in an embodiment of the present invention.
[0012] Figure 2 Schematic diagram of the structure of an image processing device for non-motor vehicle behavior recognition described in an embodiment of the present invention.
[0013] Figure 3 Schematic diagram of the structure of an image processing device for non-motor vehicle behavior recognition described in an embodiment of the present invention.
[0014] Labels in the figure: 800, image processing device for non-motor vehicle behavior recognition; 801, processor; 802, memory; 803, multimedia component; 804, I / O interface; 805, communication component; 901, acquisition module; 902, first processing module; 903, second processing module; 904, judgment module; 905, third processing module. DETAILED DESCRIPTION
[0015] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0016] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0017] Embodiment 1: This embodiment provides an image processing method for non-motor vehicle behavior recognition. It can be understood that in this embodiment, a scene can be laid out, for example: using monitoring to identify speeding electric vehicles on the road.
[0018] See also Figure 1 , the figure shows that the method includes step S1, step S2, step S3, step S4 and step S5.
[0019] Step S1, obtaining a road image sequence, wherein the road image sequence includes at least two road images collected in chronological order by road monitoring; In this step, non-motor vehicles traveling on the road are monitored in real time based on the road monitoring system installed on the road, and a road image sequence is collected.
[0020] Step S2, identifying the road image sequence to obtain a recognition result, wherein the recognition result includes a positioning frame of a non-motor vehicle in each road image; The step S2 also includes step S21, step S22, step S23, step S24, step S25 and step S26, which specifically include: Step S21, graying the road image sequence to obtain at least two grayed images; Step S22, determining a central pixel point in each of the grayscale processed images, and establishing a coordinate system based on the central pixel point; Step S23, determining the coordinate information of each pixel in the grayscale processed image according to the coordinate system; Step S24, determining the grayscale value of each pixel corresponding to the coordinate information of each pixel to obtain grayscale value information; Step S25, performing calculation according to the gray value information to obtain gray difference information, wherein the gray difference information includes a gray difference value corresponding to the same pixel point of two adjacent sequence images; In this step, the specific calculation formula of the grayscale difference information is: D=|P i+1 (x, y)-P i (x, y) |; In the above formula, D represents the grayscale difference, P i (x, y) represents the gray value corresponding to the pixel (x, y) on the i-th frame image, P i+1 (x, y) represents the gray value corresponding to the pixel point (x, y) on the i+1th frame image.
[0021] Step S26: Identify the pixel points according to the grayscale difference information to obtain a recognition result.
[0022] The step S26 also includes step S261, step S262, step S263 and step S264, which specifically include: Step S261, determining whether the grayscale difference information is greater than a preset grayscale threshold, and obtaining a second determination result; Step S262, determining the non-motor vehicle pixels corresponding to each road image according to the second judgment result; In this step, when the grayscale difference information is greater than the preset grayscale threshold, it indicates that the corresponding pixel point is a non-motor vehicle pixel; when the grayscale difference information is less than or equal to the preset grayscale threshold, it indicates that the corresponding pixel point is a road area pixel.
[0023] Step S263, merging the non-motor vehicle pixels of two adjacent road images to obtain a merging result; Step S264: determine the positioning frame of the non-motor vehicle according to the merging result to obtain a recognition result.
[0024] In this step, a minimum circumscribed rectangle is circumscribed around the merged non-motor vehicle pixel area to obtain a pixel rectangle of any non-motor vehicle in the road grayscale image, and the pixel rectangle is marked as the positioning frame of the non-motor vehicle to obtain a recognition result.
[0025] Step S3, determining the travel speed of the non-motor vehicle according to the recognition result to obtain speed information; In this step, the travel speed of the non-motor vehicle can be calculated according to the trajectory information of the positioning frame, thereby obtaining speed information.
[0026] The step S3 also includes step S31, step S32, step S33, step S34, step S35 and step S36, which specifically include: Step S31, acquiring a first road image; Step S32, determining a first pixel area according to the first road image, wherein the first pixel area includes any non-motor vehicle pixel area selected in the first road image; In this step, any non-motor vehicle pixel area selected in the first road image is used as a reference pixel area.
[0027] Step S33, determining a first reference point, a reference line, and a minimum circumscribed rectangular area corresponding to the first pixel area according to the first pixel area; In this step, the central pixel point of the reference pixel area is marked as the first reference point, a straight line passing through the first reference point and parallel to the road direction is extracted and calibrated as a reference line, and the minimum circumscribed rectangular area corresponding to the reference pixel area is marked as the standard area S1.
[0028] Step S34, acquiring a second road image, where the second road image is a road image at a next moment of the first road image; Step S35, determining a second pixel area according to the reference line, the minimum circumscribed rectangular area and the second road image; In this step, pixel areas Q1, Q2, ..., Q in the second road image are acquired point by point along the reference line in the road driving direction. n , n is a positive integer, where the area ratio of adjacent pixel regions satisfies a preset coefficient.
[0029] It should be noted that the area of the pixel region in the second road image is equal to the standard area S1.
[0030] Step S36: determine the travel speed of the non-motor vehicle according to the first pixel area and the second pixel area.
[0031] The step S36 also includes step S361, step S362, step S363, step S364, step S365 and step S366, which specifically include: Step S361, preprocessing the second pixel region to obtain a preprocessed second pixel region; The step S361 also includes step S3611 and step S3612, which specifically include: Step S3611, calculating according to the minimum circumscribed rectangular area corresponding to the first pixel region and the minimum circumscribed rectangular area corresponding to the second pixel region to obtain an adjustment coefficient; In this step, the specific calculation process of the adjustment coefficient is: ; In the above formula, Indicates the minimum circumscribed rectangular area corresponding to the first pixel region, i.e., the standard area. Indicates the minimum circumscribed rectangular area corresponding to the second pixel region.
[0032] Step S3612: resample the second pixel region using a bilinear interpolation method according to the adjustment coefficient to obtain the preprocessed second pixel region.
[0033] In this step, the second pixel area is resampled using a bilinear interpolation method so that the preprocessed second pixel area is equal to the standard area. .
[0034] It should be noted that when the adjustment coefficient is less than 1, the pixels in the second pixel area before preprocessing are marked as original pixels, and the pixels added in the second pixel area after preprocessing are marked as filling pixels. When calculating the grayscale difference of the pixel area, only the original pixels are calculated. The advantage of this is that when performing pixel-related calculations, the filling pixels are ignored and only the original pixels are operated. This can reduce the amount of calculation, improve the processing speed, and avoid the influence of noise or errors introduced by the filling pixels on the calculation results; when K is greater than 1, the pixels in the second pixel area after preprocessing are marked as fused pixels. When calculating the grayscale difference of the pixel area, only the fused pixels are calculated. By only calculating the fused pixels, the overall characteristics and information of the image can be maintained, while reducing the amount of data, which is convenient for subsequent processing.
[0035] Step S362, calculating the difference between the grayscale values of the pixels at the same position in the second pixel area after preprocessing and the first pixel area to obtain a first calculation result; Step S363, obtaining an absolute value of the first calculation result to obtain a second calculation result; Step S364, screening the second pixel area according to the second calculation result to obtain a screened pixel area; In this step, the pixel region corresponding to the minimum value in the second calculation result is selected as the filtered pixel region.
[0036] Step S365, taking the center of the filtered pixel area as a second reference point; Step S366: Calculate the average speed of the position change of each frame image according to the position change of the second reference point in each frame to obtain the driving speed of the non-motor vehicle.
[0037] In this step, based on the second reference point, the position information of the second reference point in each frame of the road image in the road image sequence is selected and the average speed of the position change of the non-motor vehicle in each frame of the road image is calculated according to the position change between adjacent frames, and the average speed is used as the driving speed of the non-motor vehicle.
[0038] Step S4, determining whether the speed information is greater than a preset speed threshold, and obtaining a first determination result; In this step, if the driving speed of the non-motor vehicle is greater than the preset speed threshold, the road image with the smallest non-motor vehicle positioning frame interaction ratio is selected from the road image sequence as the illegal captured image of the non-motor vehicle and stored in the preset database to obtain the first judgment result.
[0039] It can be understood that when any non-motor vehicle pixel rectangle has an overlapping area with any other vehicle pixel rectangle, the two non-motor vehicles are marked as pending vehicles; the pending vehicles are tracked in real time, an observation time T is preset, and the speeds of all pending vehicles within the observation time T are calculated. If there is any pending vehicle whose speed changes greater than a preset threshold within the observation time T, the road image at the end of the observation time T is selected as the captured image of the pending non-motor vehicle and stored in the preset database.
[0040] Step S5: Identify the non-motor vehicle behavior according to the first judgment result.
[0041] It is understandable that the prior art usually uses a camera to shoot each vehicle to be tracked to obtain a road video, and processes each frame of vehicle video image in the road video. After obtaining the vehicle video image to be processed, each vehicle in the vehicle video image is matched with each vehicle in the next frame of the vehicle video image according to the intersection-and-union ratio between the detection frame image of each vehicle in the vehicle video image and the detection frame image of each vehicle in the next frame of the vehicle video image, and the vehicles in the next frame of the vehicle video image that match the each vehicle in the vehicle video image are determined, thereby determining whether each vehicle in the vehicle video image appears in the next frame of the vehicle video image. However, in this way, the vehicle may be displaced from far to near or from near to far during the process of tracking the vehicle, and the size of the non-motor vehicle in the video will change accordingly. However, once the non-motor vehicle in the video becomes smaller, too much background may be included in the search range of the tracking vehicle. Only according to the intersection-and-union ratio between the detection frame images of the vehicle, each vehicle in the road video image is matched with each vehicle in the next frame of the road video image. The actual accuracy is low, resulting in misjudgment. Therefore, in the present invention, by acquiring and analyzing the road image in real time, judging according to the frame difference grayscale value in the road image, identifying the road surface area and the vehicle area in the image, generating a positioning frame according to the vehicle area, and processing and analyzing the pixel grayscale features in the road image at adjacent times. , the recognition and tracking of non-motor vehicles in different road images are realized by tracking through pixel matching, so as to calculate the driving speed of the non-motor vehicle, identify the target non-motor vehicle according to the driving speed, and select the road image with the smallest interaction ratio of the positioning frame of the target non-motor vehicle from the road image sequence as the illegal captured image of the non-motor vehicle and store it in a preset database. The image with the smallest interaction ratio means that the overlapping area between the target non-motor vehicle and other non-motor vehicles in the image is the smallest, so the characteristics of the target vehicle can be captured more clearly. The present invention realizes the monitoring and capturing of illegal behaviors of non-motor vehicles, and improves the efficiency and accuracy of traffic management.
[0042] It should be noted that the specific calculation process of the interaction ratio is: select any road image and obtain the total overlapping area of the non-motor vehicle pixel rectangle and any other vehicle pixel rectangle and mark it as X1, obtain the non-motor vehicle pixel rectangle X2, and calculate the interaction ratio of the motor vehicle in all road images according to the calculation formula B=X1 / X2. When there are two or more road images with the same positioning frame interaction ratio, the road image with the least number of positioning frames is selected as the illegal captured image of the non-motor vehicle and stored in the preset database. This can effectively reduce visual interference and make the captured illegal non-motor vehicle image clearer, thereby improving the accuracy of vehicle feature extraction, such as the recognition rate of key information such as license plate number, vehicle type, color, etc., to enhance the effectiveness of illegal evidence.
[0043] Embodiment 2: like Figure 2 As shown, this embodiment provides an image processing device for non-motor vehicle behavior recognition, the device includes an acquisition module 901, a first processing module 902, a second processing module 903, a judgment module 904 and a third processing module 905, which specifically include: An acquisition module 901 is used to acquire a road image sequence, wherein the road image sequence includes at least two road images collected in chronological order by road monitoring; A first processing module 902 is used to identify the road image sequence to obtain a recognition result, wherein the recognition result includes a positioning frame of a non-motor vehicle in each road image; The second processing module 903 is used to determine the travel speed of the non-motor vehicle according to the recognition result to obtain speed information; A judgment module 904 is used to judge whether the speed information is greater than a preset speed threshold, and obtain a first judgment result; The third processing module 905 is used to identify the non-motor vehicle behavior according to the first judgment result.
[0044] In a specific embodiment of the present disclosure, the first processing module further includes a first processing unit, a second processing unit, a third processing unit, a fourth processing unit, a first calculation unit and a fifth processing unit, which specifically include: A first processing unit is used to perform grayscale processing on the road image sequence to obtain at least two grayscale processed images; A second processing unit, used for determining a central pixel point in each of the grayscale processed images, and establishing a coordinate system based on the central pixel point; A third processing unit, used to determine the coordinate information of each pixel in the grayscale processed image according to the coordinate system; A fourth processing unit is used to determine the gray value of the pixel point corresponding to the coordinate information of each pixel point to obtain gray value information; A first calculation unit, configured to calculate according to the gray value information to obtain gray difference information, wherein the gray difference information includes a gray difference value corresponding to a same pixel point of two adjacent sequence images; The fifth processing unit is used to identify the pixel points according to the grayscale difference information to obtain an identification result.
[0045] In a specific implementation of the present disclosure, the fifth processing unit further includes a first judgment unit, a sixth processing unit, a seventh processing unit and an eighth processing unit, which specifically include: A first judgment unit, used to judge whether the grayscale difference information is greater than a preset grayscale threshold, and obtain a second judgment result; A sixth processing unit, configured to determine the non-motor vehicle pixels corresponding to each road image according to the second judgment result; A seventh processing unit, configured to merge the non-motor vehicle pixels of two adjacent road images to obtain a merged result; The eighth processing unit is used to determine the positioning frame of the non-motor vehicle according to the merging result to obtain the recognition result.
[0046] In a specific embodiment of the present disclosure, the second processing module further includes a first acquisition unit, a ninth processing unit, a tenth processing unit, a second acquisition unit, an eleventh processing unit and a twelfth processing unit, which specifically include: A first acquisition unit, used to acquire a first road image; a ninth processing unit, configured to determine a first pixel region according to the first road image, wherein the first pixel region includes any non-motor vehicle pixel region selected from the first road image; a tenth processing unit, configured to determine, according to the first pixel area, a first reference point, a reference line, and a minimum circumscribed rectangular area corresponding to the first pixel area; A second acquisition unit, used to acquire a second road image, where the second road image is a road image at a moment after the first road image; an eleventh processing unit, configured to determine a second pixel area according to the reference line, the minimum circumscribed rectangular area, and the second road image; A twelfth processing unit is used to determine the travel speed of the non-motor vehicle according to the first pixel area and the second pixel area.
[0047] In a specific implementation of the present disclosure, the twelfth processing unit also includes a thirteenth processing unit, a second calculation unit, a third calculation unit, a fourteenth processing unit, a fifteenth processing unit and a sixteenth processing unit, which specifically include: a thirteenth processing unit, configured to preprocess the second pixel region to obtain a preprocessed second pixel region; A second calculation unit is used to calculate the difference in grayscale value between the second pixel area after preprocessing and the pixel point at the same position in the first pixel area to obtain a first calculation result; A third calculation unit, used to obtain an absolute value of the first calculation result to obtain a second calculation result; a fourteenth processing unit, configured to filter the second pixel region according to the second calculation result to obtain a filtered pixel region; A fifteenth processing unit, configured to use the center of the filtered pixel area as a second reference point; The sixteenth processing unit is used to calculate the average speed of the position change of each frame image according to the position change of the second reference point of each frame, so as to obtain the driving speed of the non-motor vehicle.
[0048] In a specific implementation of the present disclosure, the thirteenth processing unit also includes a fourth calculation unit and a seventeenth processing unit, which specifically include: A fourth calculation unit, configured to calculate according to the minimum circumscribed rectangular area corresponding to the first pixel region and the minimum circumscribed rectangular area corresponding to the second pixel region to obtain an adjustment coefficient; A seventeenth processing unit is used to resample the second pixel region by a bilinear interpolation method according to the adjustment coefficient to obtain the preprocessed second pixel region.
[0049] It should be noted that, regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment of the method, and will not be elaborated here.
[0050] Embodiment 3: Corresponding to the above method embodiment, this embodiment also provides an image processing device for non-motor vehicle behavior recognition. The image processing device for non-motor vehicle behavior recognition described below and the image processing method for non-motor vehicle behavior recognition described above can be referenced to each other.
[0051] Figure 3 FIG. 8 is a block diagram of an image processing device 800 for non-motor vehicle behavior recognition according to an exemplary embodiment. Figure 3 As shown, the image processing device 800 for non-motor vehicle behavior recognition may include: a processor 801 and a memory 802. The image processing device 800 for non-motor vehicle behavior recognition may also include one or more of a multimedia component 803, an I / O interface 804, and a communication component 805.
[0052] The processor 801 is used to control the overall operation of the image processing device 800 for non-motor vehicle behavior recognition to complete all or part of the steps in the above-mentioned image processing method for non-motor vehicle behavior recognition. The memory 802 is used to store various types of data to support the operation of the image processing device 800 for non-motor vehicle behavior recognition, and these data may include, for example, instructions for any application or method operated on the image processing device 800 for non-motor vehicle behavior recognition, and application-related data, such as contact data, sent and received messages, pictures, audio, video, etc. The memory 802 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or optical disk. The multimedia component 803 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may be further stored in the memory 802 or sent via the communication component 805. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 804 provides an interface between the processor 801 and other interface modules, and the above-mentioned other interface modules can be keyboards, mice, buttons, etc. These buttons can be virtual buttons or physical buttons. The communication component 805 is used for wired or wireless communication between the image processing device 800 for non-motor vehicle behavior recognition and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so the corresponding communication component 805 can include: Wi-Fi module, Bluetooth module, NFC module.
[0053] In an exemplary embodiment, the image processing device 800 for non-motor vehicle behavior recognition can be implemented by one or more application specific integrated circuits (Application Specific Integrated Circuit, referred to as ASIC), digital signal processors (Digital Signal Processing Device, referred to as DSP), digital signal processing devices (Digital Signal Processing Device, referred to as DSPD), programmable logic devices (Programmable Logic Device, referred to as PLD), field programmable gate arrays (Field Programmable Gate Array, referred to as FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned image processing method for non-motor vehicle behavior recognition.
[0054] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the above-mentioned image processing method for non-motor vehicle behavior recognition are implemented. For example, the computer-readable storage medium may be the above-mentioned memory 802 including program instructions, and the above-mentioned program instructions may be executed by the processor 801 of the image processing device 800 for non-motor vehicle behavior recognition to complete the above-mentioned image processing method for non-motor vehicle behavior recognition.
[0055] Embodiment 4: Corresponding to the above method embodiment, a readable storage medium is also provided in this embodiment. The readable storage medium described below and the image processing method for non-motor vehicle behavior recognition described above can refer to each other.
[0056] A readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the image processing method for non-motor vehicle behavior recognition in the above method embodiment.
[0057] The readable storage medium may specifically be a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or other readable storage medium that can store program codes.
[0058] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
[0059] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. An image processing method for non-motor vehicle behavior recognition, characterized in that: include: Acquire a road image sequence, wherein the road image sequence includes at least two road images collected in chronological order by road monitoring; Recognize the road image sequence to obtain a recognition result, wherein the recognition result includes a positioning frame of a non-motor vehicle in each road image; Determine the travel speed of the non-motor vehicle according to the recognition result to obtain speed information; Determine whether the speed information is greater than a preset speed threshold, and obtain a first determination result; The non-motor vehicle behavior is identified according to the first judgment result.
2. The image processing method for non-motor vehicle behavior recognition according to claim 1, characterized in that: Recognizing the road image sequence to obtain a recognition result includes: grayscale the road image sequence to obtain at least two grayscale images; Determine a central pixel point in each of the grayscale processed images, and establish a coordinate system based on the central pixel point; Determine the coordinate information of each pixel in the grayscale processed image according to the coordinate system; Determine the grayscale value of each pixel corresponding to the coordinate information of each pixel to obtain grayscale value information; Calculating according to the gray value information to obtain gray difference information, wherein the gray difference information includes gray difference values corresponding to the same pixel point of two adjacent sequence images; The pixel points are identified according to the grayscale difference information to obtain an identification result.
3. The image processing method for non-motor vehicle behavior recognition according to claim 2, characterized in that: Identifying the pixel points according to the grayscale difference information to obtain an identification result includes: Determine whether the grayscale difference information is greater than a preset grayscale threshold, and obtain a second determination result; Determine the non-motor vehicle pixels corresponding to each road image according to the second judgment result; Merging the non-motor vehicle pixels of two adjacent road images to obtain a merged result; The positioning frame of the non-motor vehicle is determined according to the combined result to obtain a recognition result.
4. The image processing method for non-motor vehicle behavior recognition according to claim 1, characterized in that: Determining the travel speed of the non-motor vehicle according to the recognition result includes: Acquire a first road image; Determine a first pixel area according to the first road image, wherein the first pixel area includes any non-motor vehicle pixel area selected in the first road image; Determine, according to the first pixel area, a first reference point, a reference line, and a minimum circumscribed rectangular area corresponding to the first pixel area; Acquire a second road image, where the second road image is a road image at a next moment of the first road image; Determine a second pixel area according to the reference line, the minimum circumscribed rectangular area and the second road image; The travel speed of the non-motor vehicle is determined based on the first pixel area and the second pixel area.
5. The image processing method for non-motor vehicle behavior recognition according to claim 4, characterized in that: Determining the travel speed of the non-motor vehicle according to the first pixel area and the second pixel area includes: Preprocessing the second pixel region to obtain a preprocessed second pixel region; Calculate the difference in grayscale value between the second pixel area after preprocessing and the pixel point at the same position in the first pixel area to obtain a first calculation result; Calculating an absolute value of the first calculation result to obtain a second calculation result; Screening the second pixel area according to the second calculation result to obtain a screened pixel area; Taking the center of the filtered pixel area as a second reference point; The average speed of the position change of each frame image is calculated according to the position change of the second reference point of each frame to obtain the driving speed of the non-motor vehicle.
6. The image processing method for non-motor vehicle behavior recognition according to claim 2, characterized in that: The specific calculation formula of grayscale difference information is: D=|P i+1 (x,y)-P i (x,y)|; In the above formula, D represents the grayscale difference, P i (x, y) represents the gray value corresponding to the pixel (x, y) on the i-th frame image, P i+1 (x, y) represents the gray value corresponding to the pixel point (x, y) on the i+1th frame image.
7. The image processing method for non-motor vehicle behavior recognition according to claim 3, characterized in that: Determining the non-motor vehicle pixel corresponding to each road image according to the second judgment result includes: When the grayscale difference information is greater than a preset grayscale threshold, the corresponding pixel point is marked as a non-motor vehicle pixel; When the grayscale difference information is less than or equal to the preset grayscale threshold, the corresponding pixel point is marked as a road surface area pixel.
8. The image processing method for non-motor vehicle behavior recognition according to claim 5, characterized in that: Preprocessing the second pixel region to obtain a preprocessed second pixel region includes: An adjustment coefficient is obtained by calculating according to the minimum circumscribed rectangular area corresponding to the first pixel region and the minimum circumscribed rectangular area corresponding to the second pixel region; The second pixel region is resampled using a bilinear interpolation method according to the adjustment coefficient to obtain the preprocessed second pixel region.
9. The image processing method for non-motor vehicle behavior recognition according to claim 8, characterized in that: The specific calculation process of the adjustment coefficient is: ; In the above formula, Indicates the minimum circumscribed rectangular area corresponding to the first pixel region, i.e., the standard area. Indicates the minimum circumscribed rectangular area corresponding to the second pixel region.
10. The image processing method for non-motor vehicle behavior recognition according to claim 1, characterized in that: Determining whether the speed information is greater than a preset speed threshold includes: When the speed information is greater than a preset speed threshold, the road image with the smallest non-motor vehicle positioning frame interaction ratio is selected from the road image sequence as the first judgment result.
Citation Information
Patent Citations
Grayscale image sequence coding method for traffic access monitoring system
CN102196269A
Vehicle type classification method based on videos
CN104036288A
High-definition network camera intelligent code stream control method
CN107454395A
Non-motor vehicle traffic violation supervision method and device and electronic device
CN109635645A
A control method and device for a dual-camera device in a vehicle
CN109729256A