Intrusion detection method and device, nonvolatile storage medium and computer device

By acquiring the degree of camera deflection and correcting the image coordinate system, the system can accurately determine whether a vehicle has intruded into a restricted area, thus solving the problem of false judgments caused by camera deflection and improving the accuracy of intrusion detection.

CN116206284BActive Publication Date: 2026-11-24ISA TECH CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310218975.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-08
Publication Date
2026-11-24
Estimated Expiration
2043-03-08

AI Technical Summary

Technical Problem

The deflection of surveillance cameras makes it impossible to accurately determine whether a vehicle has entered a restricted area, leading to misjudgments of area intrusion.

Method used

By acquiring target image and template image information, the degree of camera deflection is determined, and the target image and template image are corrected to the same image coordinate system based on the degree of deflection to determine whether the target vehicle has intruded into the target area.

Benefits of technology

It improves the accuracy of identifying regional intrusion phenomena and solves the problem of misjudgment caused by camera deflection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116206284B_ABST
    Figure CN116206284B_ABST
Patent Text Reader

Abstract

The application discloses an intrusion detection method and device, a nonvolatile storage medium and computer equipment. The method comprises the following steps: obtaining a target picture obtained by shooting a target vehicle by using a camera, and obtaining template picture information of a template picture, wherein the template picture information is used for representing a template picture obtained by pre-shooting a correction region by using the camera, and the template picture information comprises first region coordinates of the correction region in the template picture, and second region coordinates of a target region in the template picture in the template picture; determining third region coordinates of the correction region in the target picture; determining a deflection degree of the camera according to the first region coordinates and the third region coordinates; and determining whether the target vehicle in a scene corresponding to the target picture has intruded into the target region according to the deflection degree of the camera, the second region coordinates and the target picture. The application solves the technical problem that a monitoring camera cannot accurately determine whether a vehicle has driven into a no-entry region due to deflection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image recognition, and more specifically, to an intrusion detection method, apparatus, non-volatile storage medium, and computer equipment. Background Technology

[0002] Motor vehicle area intrusion refers to a motor vehicle's failure to follow traffic rules, driving into lanes that are prohibited by regulations, or entering areas where the vehicle is forbidden. Examples include driving in bus lanes during rush hour, failing to follow lane markings, failing to yield to pedestrians at crosswalks and entering marked crosswalk areas, or driving into non-motorized vehicle lanes that are prohibited. The underlying logic of all these phenomena is area intrusion.

[0003] To monitor these intrusion incidents, roadside cameras are typically used to capture images as evidence. When a vehicle is seen encroaching on the restricted area in the camera's image, it is considered an intrusion. However, fixed roadside cameras may change orientation due to external forces, causing the area captured by the camera to change, which can lead to misjudgments when determining vehicle intrusion.

[0004] There is currently no effective solution to the above problems. Summary of the Invention

[0005] This invention provides an intrusion detection method, apparatus, non-volatile storage medium, and computer equipment to at least solve the technical problem that the inability to accurately determine whether a vehicle has entered a restricted area due to the deflection of a surveillance camera.

[0006] According to one aspect of the present invention, an intrusion detection method is provided, comprising: acquiring target image and template image information, wherein the target image is obtained by a camera capturing a target vehicle, and the template image information is used to characterize a template image obtained by the camera pre-capturing a correction area, the template image information including: first region coordinates of the correction area in the template image, and second region coordinates of the target area in the template image; determining third region coordinates of the correction area in the target image; determining the deflection degree of the camera based on the first region coordinates and the third region coordinates, wherein the deflection degree characterizes the deviation between the orientation angle of the camera when capturing the target image and the orientation angle of the camera when capturing the template image; and determining whether the target vehicle has intruded into the target area in the scene corresponding to the target image based on the camera deflection degree, the second region coordinates, and the target image.

[0007] Optionally, determining whether the target vehicle in the target image has intruded into the target area based on the camera deflection degree, the third area coordinates, and the target image includes: identifying the target vehicle coordinates in the target image; determining the fourth area coordinates of the target area in the target image based on the camera deflection degree and the second area coordinates; and determining whether the target vehicle has intruded into the target area in the scene corresponding to the target image based on the target vehicle coordinates and the fourth area coordinates.

[0008] Optionally, identifying the target vehicle's coordinates in the target image includes: identifying the target vehicle from the target image to obtain the vehicle type, orientation, and initial vehicle coordinates, wherein the initial vehicle coordinates represent the ground area occupied by the target vehicle; and correcting the vertex coordinates in the initial vehicle coordinates based on the vehicle type and orientation to obtain the target vehicle coordinates, wherein the vertex coordinates represent the vertex positions within the ground area occupied by the target vehicle.

[0009] Optionally, identifying the target vehicle's coordinates in the target image includes: inputting the target image into a RepVGG model to obtain the target vehicle, wherein the RepVGG model is a multi-attribute classification model; and determining the target vehicle's coordinates in the target image.

[0010] Optionally, determining the target vehicle coordinates in the target image includes: when the target image comprises multiple target images, obtaining multiple sets of vehicle features output by the RepVGG model that correspond one-to-one with the multiple target images, wherein the multiple sets of vehicle features are the features of the target vehicle extracted by the RepVGG model from the multiple images respectively; determining the driving trajectory of the target vehicle in the target image based on the multiple target images and the multiple sets of vehicle features; and determining the target vehicle coordinates in the target image based on the driving trajectory of the target vehicle, wherein the target vehicle coordinates represent the area range traversed by the target vehicle while driving along the driving trajectory.

[0011] Optionally, determining the third region coordinates of the correction region in the target image includes: identifying a deflection marker from the target image, wherein the deflection marker is used to characterize the correction region, and the deflection marker is an object whose position remains fixed in the scene captured by the camera; and determining the coordinates of the image region occupied by the deflection marker in the target image as the third region coordinates.

[0012] Optionally, determining the degree of camera deflection based on the first region coordinates and the third region coordinates includes: determining a first orientation of the camera relative to the deflection marker when capturing the template image based on the first region coordinates; determining a second orientation of the camera relative to the deflection marker when capturing the target image based on the third region coordinates; and determining the degree of camera deflection based on the first orientation and the second orientation.

[0013] According to another aspect of the present invention, an intrusion detection device is also provided, comprising: an acquisition module, configured to acquire a target image and template image information, wherein the target image is obtained by a camera capturing a target vehicle, and the template image information is used to characterize a template image obtained by the camera in advance capturing a correction area, the template image information including: first region coordinates of the correction area in the template image, and second region coordinates of the target area in the template image; a first determination module, configured to determine third region coordinates of the correction area in the target image; a second determination module, configured to determine the deflection degree of the camera based on the first region coordinates and the third region coordinates, wherein the deflection degree characterizes the deviation between the orientation angle of the camera when capturing the target image and the orientation angle of the camera when capturing the template image; and a third determination module, configured to determine whether the target vehicle intrudes into the target area in the scene corresponding to the target image based on the camera deflection degree, the second region coordinates, and the target image.

[0014] According to another aspect of the present invention, a non-volatile storage medium is also provided, the non-volatile storage medium including a stored program, wherein, when the program is executed, it controls the device where the non-volatile storage medium is located to execute any of the intrusion detection methods described above.

[0015] According to another aspect of the present invention, a computer device is also provided, the computer device including a memory and a processor, the memory being used to store a program, and the processor being used to run the program stored in the memory, wherein the program, when running, executes any of the intrusion detection methods described above.

[0016] In this embodiment of the invention, a correction region is selected in the real area corresponding to the image captured by the camera as the deflection correction reference. By comparing the coordinates of the correction region in the target image captured by the camera in real time with the coordinates of the correction region in the template image, the degree of camera deflection is determined. Based on the degree of deflection, the target image and the template image are corrected to the same image coordinate system, thereby achieving the purpose of accurately determining whether the target vehicle in the target image has invaded the target area. This achieves the technical effect of improving the recognition accuracy of regional intrusion phenomena, and solves the technical problem that the deflection of the monitoring camera makes it impossible to accurately determine whether a vehicle has entered a restricted area. Attached Figure Description

[0017] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0018] Figure 1 A hardware structure block diagram of a computer terminal for implementing an intrusion detection method is shown.

[0019] Figure 2 This is a flowchart illustrating the intrusion detection method provided according to an embodiment of the present invention;

[0020] Figure 3 This is a schematic diagram of the structure of the RepVGG model provided in an optional embodiment of the present invention;

[0021] Figure 4 This is a flowchart for determining a vehicle's intrusion into a region, provided by an optional embodiment of the present invention;

[0022] Figure 5 This is a structural block diagram of an intrusion detection device provided according to an embodiment of the present invention. Detailed Implementation

[0023] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0025] According to an embodiment of the present invention, an intrusion detection method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0026] The method embodiment provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 A hardware block diagram of a computer terminal for implementing an intrusion detection method is shown. Figure 1 As shown, the computer terminal 10 may include one or more processors (shown as 102a, 102b, ..., 102n in the figure) (the processor may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0027] It should be noted that the aforementioned one or more processors and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be implemented wholly or partially as software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be wholly or partially integrated into any other element in the computer terminal 10. As involved in the embodiments of this application, the data processing circuits serve as processor control (e.g., selection of a variable resistor termination path connected to an interface).

[0028] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the intrusion detection method in this embodiment of the invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the intrusion detection method of the aforementioned application. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0029] The display may be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10.

[0030] To monitor trespassing, overhead cameras are typically used to capture images as evidence. When a vehicle is seen entering the restricted area within the camera's view, it is considered a trespass. However, fixed cameras can be affected by external forces, causing changes in their orientation and thus altering the area they capture. This can lead to misjudgments in trespass detection. For example, when a camera is first installed, the lower right quarter of its view might be designated as a restricted area for private cars. With the camera's position and orientation fixed, if a car is detected in the lower right quarter of a subsequent image, it can be considered a restricted area. However, after installation, the camera's position may change due to external forces, such as lens rotation. In this case, the lower right quarter of the camera's view no longer matches the actual restricted area, leading to errors in determining trespassing based on the old rules.

[0031] The intrusion detection method provided in this application can solve the above-mentioned technical problems. Figure 2 This is a flowchart illustrating the intrusion detection method provided according to an embodiment of the present invention, as shown below. Figure 2 As shown, the method includes the following steps:

[0032] Step S202: Obtain target image and template image information. The target image is obtained by the camera capturing the target vehicle. The template image information is used to represent the template image obtained by the camera in advance capturing the correction area. The template image information includes the first region coordinates of the correction area in the template image and the second region coordinates of the target area in the template image.

[0033] Optionally, the target image can be a real-time captured image by the camera, while the template image is an image captured when the camera is first installed and before any pose changes. The template image serves as a standard for calibrating the camera's initial pose. By comparing the real-time captured target image with the template image, it can be determined whether the camera has undergone lens tilt when capturing the target image relative to when capturing the template image. The correction region is a specific area within the spatial region captured by the camera, used for subsequent calibration of the target and template images. The position and orientation of this correction region in the real world should remain unchanged; therefore, the degree of tilt of the camera between the two images can be determined based on the difference between the position of the correction region in the target image and its position in the template image.

[0034] Furthermore, the target area can be a real-world restricted area for vehicles captured by the camera, meaning the target vehicle is prohibited from entering this area. If the target vehicle enters the target area, it can be determined that the target vehicle has committed an intrusion into the area. Optionally, the target area can be a lane, such as an emergency lane or a bus lane.

[0035] It should be noted that the above steps do not necessarily require actually acquiring the template images to complete the image calibration. Since the template images have already been pre-captured and thoroughly analyzed, the key information can be extracted from them to obtain the template image information, which can then be saved separately, thus avoiding the consumption of data storage space and computing power.

[0036] Step S204: Determine the coordinates of the third region of the correction area in the target image.

[0037] It should be noted that the coordinates of the first, second, and third regions are all coordinates of the regions within the image, and the coordinate system used to calibrate these three coordinates can be the same. Optionally, to obtain or determine the coordinates of the first to third regions, an image coordinate system can be established based on the image captured by the camera. For example, a Cartesian coordinate system can be established with the lower left corner of the image captured by the camera as the origin, and the long and short sides of the image as the X and Y axes, respectively. Then, the position and range of the correction region or target region in the image can be represented using coordinates in the Cartesian coordinate system. Using the above method to determine the coordinates ensures that the coordinates of the correction region remain unchanged in both the target and template images, provided the camera does not deflect. If the coordinates of the correction region change between the target and template images, it indicates that the camera deflected during the two consecutive shots.

[0038] Step S206: Determine the degree of camera deflection based on the coordinates of the first region and the third region, wherein the degree of deflection characterizes the deviation between the orientation angle of the camera when capturing the target image and the orientation angle of the camera when capturing the template image.

[0039] The coordinates of the first and third regions are the coordinates of the correction region in the template image and the target image, respectively. Therefore, the coordinate difference between the two can be used to characterize the degree of camera deflection. Optionally, the degree of camera deflection can be characterized by the pose state, or by the coordinate system transformation relationship between the imaging coordinate system when the camera captures the template image and the imaging coordinate system when the camera captures the target image. Based on the degree of camera deflection, those skilled in the art can transform the coordinates of any object in the target image to the coordinate system of the template image, and vice versa.

[0040] As an optional embodiment, in order to determine the third region coordinates of the correction region in the target image, the following steps may be included: identifying deflection markers from the target image, wherein the deflection markers are used to characterize the correction region, and the deflection markers are objects whose positions remain fixed in the scene captured by the camera; and determining the coordinates of the image region occupied by the deflection markers in the target image as the third region coordinates.

[0041] Alternatively, the deflection marker can be determined based on the characteristics of the entire area captured by the camera. For example, if the area captured by the camera is an intersection of a traffic road, the traffic lights at the intersection can be selected as deflection markers, since traffic lights are usually fixed in position and do not change easily. Or, if the area captured by the camera is the middle section of a traffic road, the road signs can be selected as deflection markers.

[0042] As an optional embodiment, determining the degree of camera deflection based on the first region coordinates and the third region coordinates includes: determining a first orientation of the camera relative to the deflection marker when capturing a template image based on the first region coordinates; determining a second orientation of the camera relative to the deflection marker when capturing a target image based on the third region coordinates; and determining the degree of camera deflection based on the first and second orientations.

[0043] Step S208: Based on the camera deflection degree, the coordinates of the second region, and the target image, determine whether the target vehicle has intruded into the target area in the scene corresponding to the target image.

[0044] As an optional embodiment, when determining whether a target vehicle in a target image has intruded into a target area, the following method can be used: identify the target vehicle's coordinates in the target image; determine the fourth area coordinates of the target area in the target image based on the camera's deflection degree and the second area coordinates; and determine whether the target vehicle has intruded into the target area in the scene corresponding to the target image based on the target vehicle coordinates and the fourth area coordinates.

[0045] In the above optional embodiments, after identifying the coordinates of the target vehicle in the target image, the coordinates of the target area are transformed from being represented in the coordinate system of the template image to being represented in the coordinate system of the target image. At this time, the vehicle coordinates of the target vehicle and the coordinates of the target area where the target vehicle is prohibited from entering are represented in a unified coordinate system. Therefore, it is possible to determine whether the target vehicle has intruded into the target area. The above judgment method is convenient and fast, the amount of data computation required for the judgment process is very small, it does not require the use of complex neural network algorithms, and it can support real-time response for area intrusion recognition.

[0046] As an optional embodiment, identifying the target vehicle's coordinates in the target image includes: identifying the target vehicle from the target image to obtain the vehicle's model, orientation, and initial vehicle coordinates, wherein the initial vehicle coordinates represent the ground area occupied by the target vehicle; and correcting the vertex coordinates in the initial vehicle coordinates based on the vehicle's model and orientation to obtain the target vehicle coordinates, wherein the vertex coordinates represent the vertex positions within the ground area occupied by the target vehicle.

[0047] Optionally, the ground area occupied by the vehicle can be a rectangle, and the initial vehicle coordinates and the target vehicle coordinates can be used to represent the vertex positions of the rectangle. When the target vehicle is large, even a small change in the vehicle's driving angle can cause a large shift in the target vehicle's rectangle coordinates. Based on vehicle type and vehicle orientation classification, the target vehicle's rectangle coordinates can be optimized, and unreasonable shifts in the rectangle coordinates can be corrected. This allows the target vehicle coordinates to more accurately represent the area occupied by the vehicle, improving the accuracy of determining the positional relationship between the target and the detection area, and thus increasing the accuracy of identifying area intrusion phenomena.

[0048] As an optional embodiment, identifying the target vehicle's coordinates within the target image includes: inputting the target image into a RepVGG model to obtain the target vehicle, wherein the RepVGG model is a multi-attribute classification model; and determining the target vehicle's coordinates within the target image. Based on this optional embodiment, the technical effect of accelerating feature extraction can be achieved.

[0049] Figure 3 This is a schematic diagram of the RepVGG model provided in an optional embodiment of the present invention. The RepVGG model (structural reparameterization technique Visual GeometryGroup, abbreviated as RepVGG) is a convolutional neural network model that uses reparameterization technology to decouple training time and inference time, thereby accelerating the feature extraction rate.

[0050] like Figure 3 As shown, the first step of the model is to fuse the Conv2d operator and the BN operator and to convert the branch with only BN into a Conv2d operator. The second step is to fuse the 3x3 convolutional layers on each branch into a single convolutional layer.

[0051] As an optional embodiment, determining the target vehicle coordinates in a target image includes: when the target image comprises multiple target images, acquiring multiple sets of vehicle features output by a RepVGG model that correspond one-to-one with the multiple target images, wherein the multiple sets of vehicle features are the features of the target vehicle extracted by the RepVGG model from the multiple images respectively; determining the driving trajectory of the target vehicle in the target image based on the multiple target images and the multiple sets of vehicle features; and determining the target vehicle coordinates in the target image based on the driving trajectory of the target vehicle, wherein the target vehicle coordinates represent the area range traversed by the target vehicle while driving along the driving trajectory. Based on this optional embodiment, dynamic tracking of the target vehicle can be supported, by continuously capturing multiple images of the target vehicle by a camera, then identifying the continuous movement trajectory of the target vehicle, and determining whether the vehicle has intruded into the target area during its driving process.

[0052] In the above steps, a correction area is selected in the real area corresponding to the image captured by the camera as the deflection correction reference. By comparing the coordinates of the correction area in the target image captured by the camera in real time with the coordinates of the correction area in the template image, the degree of camera deflection is determined. Based on the degree of deflection, the target image and the template image are corrected to the same image coordinate system, thereby achieving the goal of accurately determining whether the target vehicle in the target image has intruded into the target area. This improves the technical accuracy of identifying area intrusion phenomena and solves the technical problem that the deflection of the surveillance camera makes it impossible to accurately determine whether a vehicle has entered a restricted area.

[0053] Figure 4 This is a flowchart for determining a vehicle's intrusion into a designated area, provided by an optional embodiment of the present invention, such as... Figure 4 As shown, a complete area intrusion detection process can include the following steps:

[0054] Step S1: Read information such as the illegal image (i.e., the target image), template image, and coordinates of the intrusion area captured by the camera.

[0055] Step S2: Use the read template image information to perform template matching in the current illegal image, calculate whether the coordinates of the corrected area after matching are offset from the stored coordinates of the corrected area. If an offset occurs, update the coordinates of the intrusion area according to the offset. If no offset occurs, proceed to the next step.

[0056] Step S3 involves detecting the target vehicle in each illegal image and inputting it into a multi-attribute classification model to obtain the target's multi-dimensional features. Optionally, the model primarily uses object detection and object classification. Object detection refers to obtaining the location of semantic objects in the image, while object classification refers to clustering images with the same attributes into the same category, such as the common classification of cats and dogs. Specifically, images are first collected, then each image is labeled, and the labeled images are input into the classification network. The network automatically learns its features based on the label information and the backpropagation algorithm, and finally completes the classification through the classification layer. Optionally, the RepVGG model can be used for this step. The RepVGG model mainly accelerates the model's processing speed through structural reparameterization.

[0057] Step S4: Based on the multi-dimensional features of the target vehicle extracted in the previous step, match the target vehicle in other images among multiple violation images, and obtain the movement trajectory of the target vehicle by calculating the Euclidean distance of the same feature of the target vehicle among multiple violation images.

[0058] Step S5: Select feature points within the rectangular bounding box of the ground area occupied by the vehicle based on the vehicle model and vehicle orientation, and adjust the position of the feature points within the rectangular bounding box to avoid the impact of target box offset caused by angular deviation.

[0059] S6. Based on the rectangular feature points obtained in the previous step, determine whether the feature points are located within the intrusion area. If they are within the intrusion area, it means that the target vehicle has intruded into the area. If they are not within the intrusion area, it means that the target vehicle is driving normally.

[0060] In the above optional embodiments, configuration only needs to be done once for different road conditions in different cities, eliminating concerns about image shifts caused by changes in camera angle. Based on the target size and orientation, different coordinate points and monitoring areas are selected for target location determination, effectively improving accuracy.

[0061] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.

[0062] Through the above description of the embodiments, those skilled in the art can clearly understand that the intrusion detection method according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.

[0063] According to embodiments of the present invention, an intrusion detection apparatus for implementing the above-described intrusion detection method is also provided. Figure 5 This is a structural block diagram of an intrusion detection device provided according to an embodiment of the present invention, such as... Figure 5 As shown, the intrusion detection device includes: an acquisition module 52, a first determination module 54, a second determination module 56, and a third determination module 58. The intrusion detection device will be described below.

[0064] The acquisition module 52 is used to acquire target image and template image information. The target image is obtained by the camera capturing the target vehicle. The template image information is used to represent the template image obtained by the camera in advance capturing the correction area. The template image information includes: the first region coordinates of the correction area in the template image, and the second region coordinates of the target area in the template image.

[0065] The first determining module 54 is connected to the above-mentioned obtaining module 52 and is used to determine the coordinates of the third region of the correction region in the target image;

[0066] The second determining module 56 is connected to the first determining module 54 and is used to determine the degree of camera deflection based on the coordinates of the first region and the coordinates of the third region. The degree of deflection represents the deviation between the orientation angle of the camera when capturing the target image and the orientation angle of the camera when capturing the template image.

[0067] The third determining module 58, connected to the second determining module 56, is used to determine whether the target vehicle has intruded into the target area in the scene corresponding to the target image, based on the camera deflection degree, the coordinates of the second area, and the target image.

[0068] It should be noted that the aforementioned acquisition module 52, first determination module 54, second determination module 56, and third determination module 58 correspond to steps S202 to S208 in the embodiments. Multiple modules and their corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in the above embodiments. It should also be noted that the aforementioned modules, as part of the device, can run on the computer terminal 10 provided in the embodiments.

[0069] Embodiments of the present invention may provide a computer device. Optionally, in this embodiment, the computer device may be located in at least one of a plurality of network devices in a computer network. The computer device includes a memory and a processor.

[0070] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the intrusion detection method and apparatus in this embodiment of the invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the aforementioned intrusion detection method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to a computer terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0071] The processor can access information and applications stored in memory via a transmission device to perform the following steps: acquiring target image and template image information, wherein the target image is obtained by a camera capturing the target vehicle, and the template image information is used to characterize a template image obtained by the camera in advance capturing a correction area, the template image information including: the first region coordinates of the correction area in the template image, and the second region coordinates of the target area in the template image; determining the third region coordinates of the correction area in the target image; determining the camera deflection degree based on the first region coordinates and the third region coordinates, wherein the deflection degree characterizes the deviation between the camera's orientation angle when capturing the target image and the camera's orientation angle when capturing the template image; and determining whether the target vehicle has intruded into the target area in the scene corresponding to the target image based on the camera deflection degree, the second region coordinates, and the target image.

[0072] Optionally, the processor may also execute program code that performs the following steps: determining whether a target vehicle in the target image has intruded into the target area based on the camera deflection degree, the coordinates of the third region, and the target image, including: identifying the target vehicle coordinates in the target image; determining the fourth region coordinates of the target area in the target image based on the camera deflection degree and the second region coordinates; and determining whether the target vehicle has intruded into the target area in the scene corresponding to the target image based on the target vehicle coordinates and the fourth region coordinates.

[0073] Optionally, the processor may also execute program code for the following steps: identifying the target vehicle coordinates in the target image, including: identifying the target vehicle from the target image, obtaining the vehicle type, orientation, and initial vehicle coordinates, wherein the initial vehicle coordinates represent the ground area occupied by the target vehicle; and correcting the vertex coordinates in the initial vehicle coordinates according to the vehicle type and orientation to obtain the target vehicle coordinates, wherein the vertex coordinates represent the vertex positions in the ground area occupied by the target vehicle.

[0074] Optionally, the processor may also execute program code for the following steps: identifying the target vehicle coordinates in the target image, including: inputting the target image into a RepVGG model to obtain the target vehicle, wherein the RepVGG model is a multi-attribute classification model; and determining the target vehicle coordinates in the target image.

[0075] Optionally, the processor may also execute program code for the following steps: determining the target vehicle coordinates in the target image, including: when the target image includes multiple target images, obtaining multiple sets of vehicle features output by the RepVGG model that correspond one-to-one with the multiple target images, wherein the multiple sets of vehicle features are the features of the target vehicle extracted by the RepVGG model from the multiple images respectively; determining the driving trajectory of the target vehicle in the target image based on the multiple target images and the multiple sets of vehicle features; and determining the target vehicle coordinates in the target image based on the driving trajectory of the target vehicle, wherein the target vehicle coordinates represent the area range traversed by the target vehicle while driving along the driving trajectory.

[0076] Optionally, the processor may also execute program code for the following steps: determining the coordinates of a third region in the target image for the correction region, including: identifying a deflection marker from the target image, wherein the deflection marker is used to characterize the correction region, and the deflection marker is an object whose position remains fixed in the scene captured by the camera; and determining the coordinates of the image region occupied by the deflection marker in the target image as the coordinates of the third region.

[0077] Optionally, the processor may also execute program code that performs the following steps: determining the degree of camera deflection based on the coordinates of the first region and the coordinates of the third region, including: determining the first orientation of the camera relative to the deflection marker when capturing the template image based on the coordinates of the first region; determining the second orientation of the camera relative to the deflection marker when capturing the target image based on the coordinates of the third region; and determining the degree of camera deflection based on the first and second orientations.

[0078] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a non-volatile storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc.

[0079] Embodiments of the present invention also provide a non-volatile storage medium. Optionally, in this embodiment, the aforementioned non-volatile storage medium can be used to store the program code executed by the intrusion detection method provided in the above embodiments.

[0080] Optionally, in this embodiment, the non-volatile storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0081] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: acquiring target image and template image information, wherein the target image is obtained by a camera capturing a target vehicle, and the template image information is used to characterize a template image obtained by the camera pre-capturing a correction area, the template image information including: the first region coordinates of the correction area in the template image, and the second region coordinates of the target area in the template image; determining the third region coordinates of the correction area in the target image; determining the camera deflection degree based on the first region coordinates and the third region coordinates, wherein the deflection degree characterizes the deviation between the camera's orientation angle when capturing the target image and the camera's orientation angle when capturing the template image; and determining whether the target vehicle has intruded into the target area in the scene corresponding to the target image based on the camera deflection degree, the second region coordinates, and the target image.

[0082] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: determining whether a target vehicle in a target image has intruded into a target area based on the camera deflection degree, the coordinates of a third region, and the target image, including: identifying the target vehicle coordinates in the target image; determining the fourth region coordinates of the target area in the target image based on the camera deflection degree and the second region coordinates; and determining whether the target vehicle has intruded into the target area in the scene corresponding to the target image based on the target vehicle coordinates and the fourth region coordinates.

[0083] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: identifying the target vehicle coordinates in the target image, including: identifying the target vehicle from the target image, obtaining the vehicle type, orientation, and initial vehicle coordinates, wherein the initial vehicle coordinates represent the ground area occupied by the target vehicle; and correcting the vertex coordinates in the initial vehicle coordinates according to the vehicle type and orientation to obtain the target vehicle coordinates, wherein the vertex coordinates represent the vertex positions in the ground area occupied by the target vehicle.

[0084] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: identifying the target vehicle coordinates in the target image from the target image, including: inputting the target image into a RepVGG model to obtain the target vehicle, wherein the RepVGG model is a multi-attribute classification model; and determining the target vehicle coordinates in the target image.

[0085] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: determining the target vehicle coordinates in the target image, including: when the target image includes multiple target images, obtaining multiple sets of vehicle features output by the RepVGG model that correspond one-to-one with the multiple target images, wherein the multiple sets of vehicle features are the features of the target vehicle extracted by the RepVGG model from the multiple images respectively; determining the driving trajectory of the target vehicle in the target image based on the multiple target images and the multiple sets of vehicle features; determining the target vehicle coordinates in the target image based on the driving trajectory of the target vehicle, wherein the target vehicle coordinates represent the area range traversed by the target vehicle while driving along the driving trajectory.

[0086] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: determining the coordinates of a third region in the target image for the correction region, including: identifying a deflection marker from the target image, wherein the deflection marker is used to characterize the correction region, and the deflection marker is an object whose position remains fixed in the scene captured by the camera; determining the coordinates of the image area occupied by the deflection marker in the target image as the coordinates of the third region.

[0087] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: determining the degree of camera deflection based on the first region coordinates and the third region coordinates, including: determining the first orientation of the camera relative to the deflection marker when capturing a template image based on the first region coordinates; determining the second orientation of the camera relative to the deflection marker when capturing a target image based on the third region coordinates; and determining the degree of camera deflection based on the first and second orientations.

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

[0089] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0090] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between units or modules may be electrical or other forms.

[0091] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0092] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0093] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0094] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. An intrusion detection method, characterized by, include: The system acquires target image and template image information. The target image is obtained by a camera capturing a target vehicle. The template image information is used to represent a template image obtained by the camera in advance by capturing a correction area. The template image information includes: the coordinates of a first region of the correction area in the template image, and the coordinates of a second region of the target area in the template image. The correction area is a region whose position and posture remain unchanged in reality. The target image includes a deflection marker, which is used to represent the correction area. The deflection marker is an object whose position remains fixed in the scene captured by the camera. Determine the coordinates of the third region of the correction area in the target image; The degree of deflection of the camera is determined based on the coordinates of the first region and the coordinates of the third region, wherein the degree of deflection characterizes the deviation between the orientation angle of the camera when capturing the target image and the orientation angle of the camera when capturing the template image; Based on the camera deflection degree, the coordinates of the second region, and the target image, it is determined whether the target vehicle in the scene corresponding to the target image has intruded into the target region; The step of determining whether the target vehicle in the target image has intruded into the target area based on the camera deflection degree, the second area coordinates, and the target image includes: identifying the target vehicle coordinates in the target image; determining the fourth area coordinates of the target area in the target image based on the camera deflection degree and the second area coordinates; and determining whether the target vehicle has intruded into the target area in the scene corresponding to the target image based on the target vehicle coordinates and the fourth area coordinates. The step of identifying the target vehicle's coordinates in the target image includes: identifying the target vehicle from the target image to obtain the vehicle type, orientation, and initial vehicle coordinates, wherein the initial vehicle coordinates represent the ground area occupied by the target vehicle; correcting the vertex coordinates in the initial vehicle coordinates based on the vehicle type and orientation to obtain the target vehicle coordinates, wherein the vertex coordinates represent the vertex positions within the ground area occupied by the target vehicle; or inputting the target image into a RepVGG model to obtain the target vehicle, wherein the RepVGG model is a multi-attribute classification model; and determining the target vehicle's coordinates in the target image.

2. The method of claim 1, wherein, Determining the target vehicle's coordinates in the target image includes: When the target image includes multiple target images, multiple sets of vehicle features output by the RepVGG model that correspond one-to-one with the multiple target images are obtained. The multiple sets of vehicle features are the features of the target vehicle extracted by the RepVGG model from the multiple images respectively. Based on the multiple target images and the multiple sets of vehicle features, the driving trajectory of the target vehicle in the target images is determined; Based on the driving trajectory of the target vehicle, the target vehicle coordinates in the target image are determined, wherein the target vehicle coordinates represent the area range traversed by the target vehicle while driving along the driving trajectory.

3. The method according to any one of claims 1 to 2, characterized in that, Determining the coordinates of the third region of the correction region in the target image includes: Deflection markers are identified from the target image, wherein the deflection markers are used to characterize the correction area, and the deflection markers are objects whose positions remain fixed in the scene captured by the camera; The coordinates of the image region occupied by the deflection marker in the target image are determined as the coordinates of the third region.

4. The method of claim 3, wherein, Determining the camera's deflection degree based on the first region coordinates and the third region coordinates includes: Based on the coordinates of the first region, determine the first orientation of the camera relative to the deflection marker when capturing the template image; Based on the coordinates of the third region, determine the second orientation of the camera relative to the deflection marker when capturing the target image; The degree of camera deflection is determined based on the first orientation and the second orientation.

5. An intrusion detection apparatus characterized by comprising: include: The acquisition module is used to acquire target image and template image information. The target image is obtained by a camera capturing a target vehicle. The template image information is used to represent a template image obtained by the camera in advance by capturing a correction area. The template image information includes: the first region coordinates of the correction area in the template image, the second region coordinates of the target area in the template image, the correction area being an area whose position and posture remain unchanged in reality, and the target image including a deflection marker, which is used to represent the correction area. The deflection marker is an object whose position remains fixed in the scene captured by the camera. The first determining module is used to determine the coordinates of the third region of the correction region in the target image; The second determining module is used to determine the degree of deflection of the camera based on the coordinates of the first region and the coordinates of the third region, wherein the degree of deflection characterizes the deviation between the orientation angle of the camera when capturing the target image and the orientation angle of the camera when capturing the template image; The third determining module is used to determine, based on the camera deflection degree, the second region coordinates and the target image, whether the target vehicle intrudes into the target region in the scene corresponding to the target image; The third determining module is further configured to identify the target vehicle coordinates in the target image; determine the fourth region coordinates of the target region in the target image based on the camera deflection degree and the second region coordinates; and determine whether the target vehicle has intruded into the target region in the scene corresponding to the target image based on the target vehicle coordinates and the fourth region coordinates. The third determining module is further configured to identify the target vehicle from the target image, obtain the vehicle type, orientation, and initial vehicle coordinates, wherein the initial vehicle coordinates represent the ground area occupied by the target vehicle; correct the vertex coordinates in the initial vehicle coordinates according to the vehicle type and orientation to obtain the target vehicle coordinates, wherein the vertex coordinates represent the vertex positions in the ground area occupied by the target vehicle; or input the target image into a RepVGG model to obtain the target vehicle, wherein the RepVGG model is a multi-attribute classification model; and determine the target vehicle coordinates in the target image.

6. A non-volatile storage medium, characterized by, The non-volatile storage medium includes a stored program, wherein, when the program is executed, it controls the device containing the non-volatile storage medium to perform the intrusion detection method according to any one of claims 1 to 4.

7. A computer device, comprising: The computer device includes a memory and a processor, the memory being used to store a program, and the processor being used to run the program stored in the memory, wherein the program, when running, executes the intrusion detection method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Traffic camera automatic correction method, device, equipment and medium

    CN113382171A

  • Motor vehicle violation snapshot method and device and electronic equipment

    CN114333344A

  • Vehicle state detection device, vehicle behavior detection device and vehicle state detection method

    JP2013171319A