Parking space occupation condition detection method and device based on rotating frame detection technology

By adopting a parking space occupation detection method based on rotary frame detection technology in the parking lot, using the rotating rectangular operation strategy and convolutional neural network model, the problem of low parking space detection efficiency and accuracy in the existing technology is solved, and efficient and accurate parking space occupation status detection and panoramic visual monitoring of parking lots are achieved.

CN119516481APending Publication Date: 2025-02-25BEIJING BDK ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411487436.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The prior art is not efficient and accurate when detecting parking space occupancy, especially when there is an angle between the image acquisition point and the parking space direction, the horizontal frame detection method will introduce background image data, resulting in low detection efficiency and accuracy.

Method used

The parking space occupation detection method based on rotary frame detection technology is adopted, and parking space image data is collected through the camera, and the rotation rectangle operation strategy is used for segmentation and processing, and the parking space image data set is generated. Then, a binary classification network model is constructed based on the convolutional neural network, and the probability of parking space occupation or idle state is predicted through training models, and the panoramic visual monitoring of parking lots is realized through multi-threading and middleware technology.

Benefits of technology

It improves the efficiency and accuracy of parking space detection, can effectively detect and locate the rotating target parking space and vehicles, shorten the time to find idle parking spaces, and improve parking lot traffic efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119516481A_ABST
    Figure CN119516481A_ABST
Patent Text Reader

Abstract

The invention discloses a parking space occupation condition detection method and device based on a rotating frame detection technology. The method comprises the following steps: acquiring parking space picture data through a camera of a parking lot; carrying out segmentation and acquisition processing through a rotation rectangle operation strategy, and generating a parking space picture data set; according to the convolutional neural network, constructing a dichotomy network model, and performing training to obtain a trained dichotomy network model; inputting the processed picture data into a trained dichotomy network model for prediction processing, and obtaining the probability of the occupied or idle state of the parking space; and according to the probability of the occupied or idle state of the parking space, through multi-thread and middleware technology processing, panoramic visual monitoring of the parking lot is realized, the position information of the idle parking space is fed back to a human-computer interface, and real-time information of the parking lot is provided. According to the invention, the rotating target parking space and vehicle can be detected and positioned, and the detection efficiency and the detection precision are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of parking lot scheduling, and in particular to a method and device for detecting parking space occupancy based on a rotating frame detection technology. Background Art

[0002] In today's large parking lots, due to the large number of parking spaces and the frequent interaction of vehicles stopping and leaving, how to quickly capture and understand the occupancy status of parking spaces through parking lot cameras, shorten the time of searching for vacant parking spaces, and improve parking lot traffic efficiency is a problem that all major parking lots need to solve.

[0003] At present, the mainstream image-based parking lot detection method in the market is mainly based on horizontal frame detection. If there is a certain angle between the image acquisition point and the parking space direction, the horizontal frame range will exceed the target detection range relative to the target parking space, and more background image data will be introduced, so the detection efficiency and detection accuracy are not high. Although there are some methods based on rotating frames for parking space detection, they are mainly used in scenarios during the reasoning process. In the data collection and model training stages, traditional methods and public data sets are still used, and there are also problems with detection accuracy and efficiency.

[0004] Therefore, how to invent a parking space occupancy detection method to detect and locate the rotating target parking space and vehicle and improve the detection efficiency and detection accuracy has become an urgent problem to be solved. Summary of the invention

[0005] To this end, the present invention provides a parking space occupancy detection method and device based on a rotating frame detection technology, which can detect and locate a rotating target parking space and vehicle, thereby improving detection efficiency and detection accuracy.

[0006] In order to achieve the above object, the present invention provides the following technical solution: a parking space occupancy detection method based on a rotating frame detection technology, comprising:

[0007] Acquire parking space image data through camera collection in the parking lot; segment and collect the parking space image data through a rotating rectangle operation strategy to obtain processed parking space image data, and collect the processed parking space image data to generate a parking space image data set;

[0008] According to the convolutional neural network, a binary classification network model is constructed; the binary classification network model is trained by using the parking space image data set to obtain the trained binary classification network model;

[0009] Inputting the processed image data into the trained binary classification network model, and performing prediction processing by the binary classification network model to obtain the probability of a parking space being occupied or idle;

[0010] Based on the obtained probability of the parking space being occupied or idle, panoramic visual monitoring of the parking lot is achieved through multi-threading and middleware technology processing, and the location information of the idle parking spaces is fed back to the human-computer interface to provide real-time parking lot information.

[0011] As a preferred solution of a parking space occupancy detection method based on a rotating frame detection technology, in the process of segmenting and collecting the parking space image data by using the rotating rectangle operation strategy, the steps of the rotating rectangle operation strategy processing are:

[0012] Find the rotated rectangle that fits the target parking space image point set through the first setting function;

[0013] The coordinates of four vertices of the rotated rectangle are obtained by a second setting function, and the width, height and rotation angle of the rotated rectangle are calculated by a setting formula according to the coordinates of the four vertices;

[0014] Calculate and obtain an affine transformation matrix according to the width, height and rotation angle of the rotated rectangle;

[0015] According to the affine transformation matrix, a new width and a new height of the rotated rectangle are obtained by setting a trigonometric function calculation process; the rotated rectangle is translated and new coordinates of the four vertices of the rotated rectangle are calculated and obtained.

[0016] As a preferred solution of a parking space occupancy detection method based on a rotating frame detection technology, in the process of calculating the width, height and rotation angle of the rotating rectangle according to the coordinates of the four vertices of the rotating rectangle by setting a formula, the setting formula is:

[0017]

[0018] Where d is the width or height of the rotated rectangle; x1 and x2 are the horizontal coordinates of the vertices of the rotated rectangle; y1 and y2 are the vertical coordinates of the vertices of the rotated rectangle;

[0019]

[0020] In the formula, are the vectors from the origin to points PT4 and PT1 respectively; For vector and

[0021] The dot product of Respectively, vector The modulus of , that is, the distance between two points.

[0022] As a preferred solution of a parking space occupancy detection method based on a rotating frame detection technology, the expression of the affine transformation matrix is:

[0023]

[0024] Where cos(θ) is the cosine of the angle θ; sin(θ) is the sine of the angle θ, and the affine transformation matrix M represents a rotation operation.

[0025] As a preferred solution of the parking space occupancy detection method based on the rotating box detection technology, in the process of training the binary classification network model through the parking space image dataset, the parking space image dataset is divided into a training set, a validation set and a test set according to a set ratio; the training set is used to train the binary classification network model; the validation set is used to debug and optimize the binary classification network model; and the test set is used to evaluate the generalization ability of the binary classification network model.

[0026] The present invention also provides a parking space occupancy detection device based on a rotating frame detection technology, based on the above parking space occupancy detection method based on a rotating frame detection technology, comprising:

[0027] The parking space image data collection and processing module is used to obtain parking space image data through the camera of the parking lot; segment and collect the parking space image data through the rotating rectangle operation strategy to obtain the processed parking space image data, and collect the processed parking space image data to generate a parking space image data set;

[0028] A binary classification network model construction and training module is used to construct a binary classification network model based on a convolutional neural network; the binary classification network model is trained by the parking space image data set to obtain the trained binary classification network model;

[0029] A binary classification network model prediction processing module, used to input the processed image data into the trained binary classification network model, and obtain the probability of parking space occupation or vacancy through the binary classification network model prediction processing;

[0030] The result conversion output module is used to realize panoramic visual monitoring of the parking lot based on the obtained probability of the parking space being occupied or idle, through multi-threading and middleware technology processing, and feed back the location information of the idle parking spaces to the human-computer interface to provide real-time parking lot information.

[0031] As a preferred solution of a parking space occupancy detection device based on the rotating frame detection technology, in the parking space image data acquisition and processing module, the rotating rectangle operation strategy processing submodule includes:

[0032] A rotation rectangle acquisition submodule, used to find a rotation rectangle that fits the target parking space image point set through a first setting function;

[0033] A submodule for calculating the width, height and rotation angle of a rotated rectangle, for obtaining the coordinates of four vertices of the rotated rectangle through a second setting function, and calculating the width, height and rotation angle of the rotated rectangle through a setting formula according to the coordinates of the four vertices;

[0034] An affine transformation matrix acquisition submodule is used to calculate and obtain an affine transformation matrix according to the width, height and rotation angle of the rotation rectangle;

[0035] The submodule for obtaining the new coordinates of the rotated rectangle is used to obtain the new width and new height of the rotated rectangle after rotation by setting trigonometric function calculation processing according to the affine transformation matrix; the rotated rectangle after rotation is translated to calculate the new coordinates of the four vertices of the rotated rectangle after rotation.

[0036] As a preferred solution of a parking space occupancy detection device based on a rotating frame detection technology, in the parking space image data acquisition and processing module, in the process of calculating the width, height and rotation angle of the rotating rectangle by setting a formula according to the coordinates of the four vertices of the rotating rectangle, the setting formula is:

[0037]

[0038] Where d is the width or height of the rotated rectangle; x1 and x2 are the horizontal coordinates of the vertices of the rotated rectangle; y1 and y2 are the vertical coordinates of the vertices of the rotated rectangle;

[0039]

[0040] In the formula, are the vectors from the origin to points PT4 and PT1 respectively; For vector and The dot product of Respectively, vector The modulus of , that is, the distance between two points.

[0041] As a preferred solution of a parking space occupancy detection device based on the rotating frame detection technology, in the parking space image data acquisition and processing module, the expression of the affine transformation matrix is:

[0042]

[0043] Where cos(θ) is the cosine of the angle θ; sin(θ) is the sine of the angle θ, and the affine transformation matrix M represents a rotation operation.

[0044] As a preferred solution of a parking space occupancy detection device based on rotating frame detection technology, in the binary classification network model construction and training module, in the process of training the binary classification network model through the parking space image data set, the parking space image data set is divided into a training set, a validation set and a test set according to a set ratio; the training set is used to train the binary classification network model; the validation set is used to debug and optimize the binary classification network model; and the test set is used to evaluate the generalization ability of the binary classification network model.

[0045] The present invention has the following advantages: obtaining parking space image data through camera collection of the parking lot; segmenting and collecting the parking space image data through the rotating rectangle operation strategy to obtain the processed parking space image data, and collecting the processed parking space image data to generate a parking space image data set; constructing a binary classification network model according to a convolutional neural network; training the binary classification network model through the parking space image data set to obtain the trained binary classification network model; inputting the processed image data into the trained binary classification network model, and obtaining the probability of the parking space being occupied or idle through the prediction processing of the binary classification network model; according to the obtained probability of the parking space being occupied or idle, through multi-threading and middleware technology processing, the panoramic visualization monitoring of the parking lot is realized, and the position information of the idle parking space is fed back to the human-computer interface to provide real-time parking information. In the daily operation process of the parking lot, the present invention applies machine vision algorithms such as image segmentation and edge detection and uses a convolutional neural network model to predict the parking space status in the image, and uses multi-threading and message middleware and other technologies to realize the panoramic visualization monitoring of the park parking lot, and at the same time, the position information of the idle parking space is fed back to the human-computer interface, so that drivers and managers can obtain real-time parking information. The present invention can detect and locate a rotating target parking space and a vehicle, thereby improving detection efficiency and detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the implementation methods of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the implementation methods or the description of the prior art. Obviously, the drawings in the following description are only exemplary, and for ordinary technicians in this field, other implementation drawings can be derived from the provided drawings without creative work.

[0047] The structures, proportions, sizes, etc. illustrated in this specification are only used to match the contents disclosed in the specification so as to facilitate understanding and reading by persons familiar with the technology. They are not used to limit the conditions under which the present invention can be implemented, and therefore have no substantial technical significance. Any structural modification, change in proportion or adjustment of size shall still fall within the scope of the technical contents disclosed in the present invention without affecting the effects and purposes that can be achieved by the present invention.

[0048] Figure 1 A schematic flow chart of a method for detecting parking space occupancy based on a rotating frame detection technology provided in Embodiment 1 of the present invention;

[0049] Figure 2 A schematic diagram of an original full-frame image in a parking space occupancy detection method based on a rotating frame detection technology provided in Embodiment 1 of the present invention;

[0050] Figure 3 A schematic diagram of performing parking space image acquisition according to an original image and parking space coordinates in a parking space occupancy detection method based on a rotating frame detection technology provided in Embodiment 1 of the present invention;

[0051] Figure 4 A schematic diagram of a whole frame image after being rotated according to the parking space angle in a parking space occupancy detection method based on a rotating frame detection technology provided in Embodiment 1 of the present invention;

[0052] Figure 5 A schematic diagram of performing parking space image acquisition according to a rotated image and new coordinates in a parking space occupancy detection method based on a rotating frame detection technology provided in Embodiment 1 of the present invention;

[0053] Figure 6 This is a schematic diagram of the architecture of a parking space occupancy detection device based on the rotating frame detection technology provided in Example 2 of the present invention. DETAILED DESCRIPTION

[0054] The following is a description of the implementation of the present invention by specific embodiments. People familiar with the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0055] Example 1

[0056] See also Figure 1 Embodiment 1 of the present invention provides a method for detecting parking space occupancy based on a rotating frame detection technology, comprising the following steps:

[0057] S1. Acquire parking space image data through a camera in a parking lot; segment and collect the parking space image data through a rotating rectangle operation strategy to obtain processed parking space image data, and collect the processed parking space image data to generate a parking space image data set;

[0058] S2. Construct a binary classification network model according to a convolutional neural network; train the binary classification network model using the parking space image dataset to obtain the trained binary classification network model;

[0059] S3, inputting the processed image data into the trained binary classification network model, and performing prediction processing by the binary classification network model to obtain the probability of the parking space being occupied or idle;

[0060] S4. Based on the obtained probability of the parking space being occupied or idle, the panoramic visual monitoring of the parking lot is realized through multi-threading and middleware technology processing, and the location information of the idle parking spaces is fed back to the human-computer interface to provide real-time parking lot information.

[0061] In this embodiment, in step S1, parking space image data is acquired through camera collection in the parking lot; the parking space image data is segmented and collected through a rotating rectangle operation strategy to obtain processed parking space image data, and the processed parking space image data is collected to generate a parking space image data set;

[0062] Specifically, the steps of the rotating rectangle operation strategy processing are:

[0063] S11, finding a rotated rectangle that fits the target parking space image point set through a first setting function;

[0064] Among them, the first setting function is cv2.minAreaRect(point_array);

[0065] Specifically, cv2.minAreaRect(point_array) is used to find a rotated rectangle that fits the target parking space image point set; the rotated rectangle is usually not axis-aligned and therefore has a rotation angle.

[0066] S12, obtaining the coordinates of four vertices of the rotated rectangle through a second setting function, and calculating the width, height and rotation angle of the rotated rectangle through a setting formula according to the coordinates of the four vertices;

[0067] Among them, the second setting function is cv2.boxPoints(rotatedRect);

[0068] Specifically, the four vertices PT1, PT2, PT3, and PT4 of the rotated rectangle are obtained through cv2.boxPoints(rotatedRect); and according to the coordinates of the four vertices, the width, height, and rotation angle of the rotated rectangle are calculated by setting a formula;

[0069] The setting formula is:

[0070]

[0071] Where d is the width or height of the rotated rectangle; x1 and x2 are the horizontal coordinates of the vertices of the rotated rectangle; y1 and y2 are the vertical coordinates of the vertices of the rotated rectangle;

[0072]

[0073] In the formula, are the vectors from the origin to points PT4 and PT1 respectively; For vector and The dot product of Respectively, vector The modulus of , that is, the distance between two points.

[0074] S13, calculating and obtaining an affine transformation matrix according to the width, height and rotation angle of the rotated rectangle;

[0075] Specifically, an affine transformation matrix is ​​calculated according to the width, height and rotation angle of the rotation rectangle, and the matrix is ​​used to rotate the original image to align with the minimum circumscribed rectangle.

[0076] Wherein, the expression of the affine transformation matrix is:

[0077]

[0078] Where cos(θ) is the cosine of the angle θ; sin(θ) is the sine of the angle θ, and the affine transformation matrix M represents a rotation operation without scaling and translation operations.

[0079] S14. According to the affine transformation matrix, a new width and a new height of the rotated rectangle are obtained by setting a trigonometric function calculation process; the rotated rectangle is translated to calculate and obtain new coordinates of the four vertices of the rotated rectangle.

[0080] Specifically, to ensure that the rotated image can completely contain all the contents of the original image, a new width and a new height of the rotated rectangle are obtained by setting a trigonometric function calculation process;

[0081] The calculation formula for trigonometric function calculation is:

[0082] NewWidth=Width×|sin(Angle)|+Height×|cos(Angle)|

[0083] NewHeight=Height×|sin(Angle)|+Width×|cos(Angle)

[0084] Where Angle is the rotation angle; Width and Height are the width and height of the rotated rectangle of the original image, respectively.

[0085] In order to obtain the new coordinates of the four vertices of the rotated rectangle, the image needs to be translated, and the affine transformation matrix becomes:

[0086]

[0087] In the formula, x center ,y center The third column represents the distances required to translate on the x and y axes.

[0088] The expressions of the new coordinates (x′, y′) of the four vertices of the rotated rectangle after rotation are:

[0089]

[0090] The parking lot image segmentation and collection are performed through the rotating rectangle operation strategy. The collection effect can meet the expectations, especially for parking spaces with incorrect directions, which greatly improves the data quality and plays a good basic role in the subsequent feature extraction, model training and reasoning process. Figure 2 , Figure 3 , Figure 4 and Figure 5 shown.

[0091] In this embodiment, in step S2, a binary classification network model is constructed according to a convolutional neural network; the binary classification network model is trained by the parking space image dataset to obtain the trained binary classification network model;

[0092] Specifically, due to the increasingly prominent autonomous learning ability of deep learning algorithms for image features, the connection between deep learning and machine vision is becoming closer and closer, and it is being used more and more widely in practical engineering. The detection algorithm of the present invention is based on a binary classification network model constructed by Convolutional Neural Networks (CNN); CNN is the basic network model of the deep learning algorithm, and uses traditional machine vision technology to collect and segment parking lot images to obtain a parking space image data set. The binary classification network model is trained with the parking space image data set, and the detection parameters are continuously optimized to ensure the detection of small targets in a larger range of scenes.

[0093] Among them, the parking space image dataset is divided into a training set, a validation set and a test set in a ratio of 6:2:2; the training set is used to train the binary classification network model; the validation set is used to debug and optimize the binary classification network model; and the test set is used to evaluate the generalization ability of the binary classification network model.

[0094] During the training process, the present invention uses the BCEWithLogitsLoss or BCELoss loss function in the torch.nn module to train the binary classification task. First, a deep learning neural network model is constructed, using the nn.Sequential model in PyTorch. The model uses the nn.Linear layer to define the weight of the network, and uses activation functions such as ReLU and Sigmoid to adjust the output. In the output layer, the method uses the Sigmoid or Softmax function to map the output to the range of [0,1] to obtain the probability of each parking space being occupied or idle. During the training process, the aforementioned loss function is used to calculate the loss between the network output and the true label of the data set. Among them, BCEWithLogitsLoss applies the Sigmoid function to the network output before calculating the loss, while BCELoss directly uses the cross entropy loss between the network output and the true label when calculating the loss. During the training process, the model parameters are continuously adjusted to gradually reduce the loss and achieve the goal of the binary classification task.

[0095] In this embodiment, in step S3, the processed image data is input into the trained binary classification network model, and the probability of the parking space being occupied or idle is obtained through prediction processing by the binary classification network model.

[0096] In this embodiment, in step S4, based on the obtained probability of the parking space being occupied or idle, panoramic visual monitoring of the parking lot is achieved through multi-threading and middleware technology processing, and the location information of the idle parking spaces is fed back to the human-computer interface to provide real-time parking lot information.

[0097] Specifically, according to the obtained probability of the parking space being occupied or idle, the panoramic visualization monitoring of the park parking lot is realized by using multithreading and middleware technologies. For the display of the prediction results, the algorithm, service, and business display are processed separately through multithreading and middleware technologies, and the complex image analysis algorithm is handed over to multiple image processing units and GPUs for processing, ensuring the continuous playback of the video and improving the display effect.

[0098] In summary, the present invention obtains parking space image data through camera acquisition of the parking lot; the parking space image data is segmented and collected through the rotating rectangle operation strategy to obtain the processed parking space image data, and the processed parking space image data is collected to generate a parking space image data set; according to the convolutional neural network, a binary classification network model is constructed; the binary classification network model is trained through the parking space image data set to obtain the trained binary classification network model; the processed image data is input into the trained binary classification network model, and the probability of the parking space being occupied or idle is obtained through the prediction processing of the binary classification network model; according to the obtained probability of the parking space being occupied or idle, the panoramic visualization monitoring of the parking lot is realized through multi-threading and middleware technology processing, and the position information of the idle parking space is fed back to the human-computer interface to provide real-time parking information. In the daily operation process of the parking lot, the present invention applies machine vision algorithms such as image segmentation and edge detection and uses a convolutional neural network model to predict the parking space status in the image, and uses multi-threading and message middleware and other technologies to realize the panoramic visualization monitoring of the park parking lot, and at the same time, the position information of the idle parking space is fed back to the human-computer interface, so that drivers and managers can obtain real-time parking information. The present invention can detect and locate a rotating target parking space and a vehicle, thereby improving detection efficiency and detection accuracy.

[0099] It should be noted that the method of the embodiment of the present disclosure can be performed by a single device, such as a computer or a server. The method of the present embodiment can also be applied in a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present disclosure, and the multiple devices will interact with each other to complete the described method.

[0100] It should be noted that the above describes some embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0101] Example 2

[0102] See also Figure 6 Embodiment 2 of the present invention further provides a parking space occupancy detection device based on a rotating frame detection technology, comprising:

[0103] The parking space image data acquisition and processing module 001 is used to acquire parking space image data through the camera of the parking lot; segment and acquire the parking space image data through the rotating rectangle operation strategy to acquire the processed parking space image data, and collect the processed parking space image data to generate a parking space image data set;

[0104] A binary classification network model construction and training module 002 is used to construct a binary classification network model according to a convolutional neural network; the binary classification network model is trained by the parking space image data set to obtain the trained binary classification network model;

[0105] The binary classification network model prediction processing module 003 is used to input the processed image data into the trained binary classification network model, and obtain the probability of parking space occupation or vacancy through the binary classification network model prediction processing;

[0106] The result conversion output module 004 is used to realize panoramic visual monitoring of the parking lot based on the obtained probability of the parking space being occupied or idle, through multi-threading and middleware technology processing, and feed back the location information of the idle parking spaces to the human-computer interface to provide real-time parking lot information.

[0107] In this embodiment, in the parking space image data collection and processing module 001, the rotating rectangle operation strategy processing submodule includes:

[0108] A rotation rectangle acquisition submodule 011 is used to find a rotation rectangle that fits the target parking space image point set through a first setting function;

[0109] The width, height and rotation angle calculation submodule 012 of the rotated rectangle is used to obtain the coordinates of the four vertices of the rotated rectangle through a second setting function, and calculate the width, height and rotation angle of the rotated rectangle through a setting formula according to the coordinates of the four vertices;

[0110] Affine transformation matrix acquisition submodule 013, used to calculate and obtain the affine transformation matrix according to the width, height and rotation angle of the rotated rectangle;

[0111] The submodule 014 for obtaining the new coordinates of the rotated rectangle is used to obtain the new width and new height of the rotated rectangle by setting trigonometric function calculation processing according to the affine transformation matrix; the rotated rectangle is translated and the new coordinates of the four vertices of the rotated rectangle are calculated.

[0112] In this embodiment, in the parking space image data acquisition and processing module 001, in the process of calculating the width, height and rotation angle of the rotated rectangle according to the four vertex coordinates of the rotated rectangle by setting a formula, the setting formula is:

[0113]

[0114] Where d is the width or height of the rotated rectangle; x1 and x2 are the horizontal coordinates of the vertices of the rotated rectangle; y1 and y2 are the vertical coordinates of the vertices of the rotated rectangle;

[0115]

[0116] In the formula, are the vectors from the origin to points PT4 and PT1 respectively; For vector and The dot product of Respectively, vector The modulus of , that is, the distance between two points.

[0117] In this embodiment, in the parking space image data collection and processing module 001, the expression of the affine transformation matrix is:

[0118]

[0119] Where cos(θ) is the cosine of the angle θ; sin(θ) is the sine of the angle θ, and the affine transformation matrix M represents a rotation operation without scaling and translation operations.

[0120] In this embodiment, in the binary classification network model construction and training module 002, in the process of training the binary classification network model through the parking space image dataset, the parking space image dataset is divided into a training set, a validation set and a test set according to a set ratio; the training set is used to train the binary classification network model; the validation set is used to debug and optimize the binary classification network model; and the test set is used to evaluate the generalization ability of the binary classification network model.

[0121] It should be noted that the information interaction, execution process and other contents between the modules of the above-mentioned system are based on the same concept as the method embodiment in Example 1 of the present application, and the technical effects they bring are the same as those of the method embodiment of the present application. For specific contents, please refer to the description in the method embodiment shown above in the present application, and will not be repeated here.

[0122] Example 3

[0123] Embodiment 3 of the present invention provides a non-transitory computer-readable storage medium, in which a program code for a parking space occupancy detection method based on a rotating box detection technology is stored. The program code includes instructions for executing embodiment 1 or any possible implementation method of a parking space occupancy detection method based on a rotating box detection technology.

[0124] The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).

[0125] Example 4

[0126] Embodiment 4 of the present invention provides an electronic device, including: a memory and a processor;

[0127] The processor and the memory communicate with each other via a bus; the memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute a parking space occupancy detection method based on a rotating frame detection technology in Example 1 or any possible implementation thereof.

[0128] Specifically, the processor can be implemented by hardware or by software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc.; when implemented by software, the processor can be a general-purpose processor implemented by reading software codes stored in a memory. The memory can be integrated in the processor or can be located outside the processor and exist independently.

[0129] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable systems. The computer instructions can be stored in a computer-readable storage medium, or transmitted from a computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center.

[0130] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing system, they can be concentrated on a single computing system, or distributed on a network composed of multiple computing systems, and optionally, they can be implemented by a program code executable by a computing system, so that they can be stored in a storage system and executed by the computing system, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0131] Although the present invention has been described in detail above by general description and specific embodiments, it is obvious to those skilled in the art that some modifications or improvements can be made to the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all belong to the scope of protection claimed by the present invention.

Claims

1. A parking space occupancy detection method based on rotating frame detection technology, characterized in that: include: Obtain parking space image data through the camera in the parking lot; Segmenting and collecting the parking space image data by a rotating rectangle operation strategy to obtain processed parking space image data, and aggregating the processed parking space image data to generate a parking space image data set; According to the convolutional neural network, a binary classification network model is constructed; the binary classification network model is trained by using the parking space image data set to obtain the trained binary classification network model; Inputting the processed image data into the trained binary classification network model, and performing prediction processing by the binary classification network model to obtain the probability of a parking space being occupied or idle; Based on the obtained probability of the parking space being occupied or idle, panoramic visual monitoring of the parking lot is achieved through multi-threading and middleware technology processing, and the location information of the idle parking spaces is fed back to the human-computer interface to provide real-time parking lot information.

2. The parking space occupancy detection method based on rotating frame detection technology according to claim 1 is characterized in that: In the process of segmenting and collecting the parking space image data by using the rotating rectangle operation strategy, the steps of the rotating rectangle operation strategy processing are: Find the rotated rectangle that fits the target parking space image point set through the first setting function; The coordinates of four vertices of the rotated rectangle are obtained by a second setting function, and the width, height and rotation angle of the rotated rectangle are calculated by a setting formula according to the coordinates of the four vertices; Calculate and obtain an affine transformation matrix according to the width, height and rotation angle of the rotated rectangle; According to the affine transformation matrix, a new width and a new height of the rotated rectangle are obtained by setting a trigonometric function calculation process; the rotated rectangle is translated and new coordinates of the four vertices of the rotated rectangle are calculated and obtained.

3. The parking space occupancy detection method based on rotating frame detection technology according to claim 2 is characterized in that: In the process of calculating the width, height and rotation angle of the rotated rectangle by setting a formula according to the coordinates of the four vertices of the rotated rectangle, the setting formula is: Where d is the width or height of the rotated rectangle; x1 and x2 are the horizontal coordinates of the vertices of the rotated rectangle; y1 and y2 are the vertical coordinates of the vertices of the rotated rectangle; In the formula, and are the vectors from the origin to points PT4 and PT1 respectively; For vector and The dot product of and Respectively, vector and The modulus of , that is, the distance between two points.

4. The parking space occupancy detection method based on rotating frame detection technology according to claim 3 is characterized in that: The expression of the affine transformation matrix is: Where cos(θ) is the cosine of the angle θ; sin(θ) is the sine of the angle θ, and the affine transformation matrix M represents a rotation operation.

5. The parking space occupancy detection method based on rotating frame detection technology according to claim 4 is characterized in that: In the process of training the binary classification network model by using the parking space image dataset, the parking space image dataset is divided into a training set, a validation set and a test set according to a set ratio; the training set is used to train the binary classification network model; The validation set is used to debug and optimize the binary classification network model; the test set is used to evaluate the generalization ability of the binary classification network model.

6. A parking space occupancy detection device based on rotating frame detection technology, using a parking space occupancy detection method based on rotating frame detection technology according to any one of claims 1 to 5, characterized in that: include: The parking space image data collection and processing module is used to obtain parking space image data through the camera in the parking lot; Segmenting and collecting the parking space image data by a rotating rectangle operation strategy to obtain processed parking space image data, and aggregating the processed parking space image data to generate a parking space image data set; A binary classification network model construction and training module is used to construct a binary classification network model based on a convolutional neural network; the binary classification network model is trained by the parking space image data set to obtain the trained binary classification network model; A binary classification network model prediction processing module, used to input the processed image data into the trained binary classification network model, and obtain the probability of parking space occupation or vacancy through the binary classification network model prediction processing; The result conversion output module is used to realize panoramic visual monitoring of the parking lot based on the obtained probability of the parking space being occupied or idle, through multi-threading and middleware technology processing, and feed back the location information of the idle parking spaces to the human-computer interface to provide real-time parking lot information.

7. The parking space occupancy detection device based on the rotating frame detection technology according to claim 6, characterized in that: In the parking space image data collection and processing module, the rotating rectangle operation strategy processing submodule includes: A rotation rectangle acquisition submodule, used to find a rotation rectangle that fits the target parking space image point set through a first setting function; A submodule for calculating the width, height and rotation angle of a rotated rectangle, for obtaining the coordinates of four vertices of the rotated rectangle through a second setting function, and calculating the width, height and rotation angle of the rotated rectangle through a setting formula according to the coordinates of the four vertices; An affine transformation matrix acquisition submodule is used to calculate and obtain an affine transformation matrix according to the width, height and rotation angle of the rotation rectangle; The submodule for obtaining the new coordinates of the rotated rectangle is used to obtain the new width and new height of the rotated rectangle after rotation by setting trigonometric function calculation processing according to the affine transformation matrix; the rotated rectangle after rotation is translated to calculate the new coordinates of the four vertices of the rotated rectangle after rotation.

8. The parking space occupancy detection device based on the rotating frame detection technology according to claim 7, characterized in that: In the parking space image data acquisition and processing module, in the process of calculating the width, height and rotation angle of the rotating rectangle according to the four vertex coordinates of the rotating rectangle by setting a formula, the setting formula is: Where d is the width or height of the rotated rectangle; x1 and x2 are the horizontal coordinates of the vertices of the rotated rectangle; y1 and y2 are the vertical coordinates of the vertices of the rotated rectangle; In the formula, and are the vectors from the origin to points PT4 and PT1 respectively; For vector and The dot product of and Respectively, vector and The modulus of , that is, the distance between two points.

9. The parking space occupancy detection device based on the rotating frame detection technology according to claim 8, characterized in that: In the parking space image data acquisition and processing module, the expression of the affine transformation matrix is: Where cos(θ) is the cosine of the angle θ; sin(θ) is the sine of the angle θ, and the affine transformation matrix M represents a rotation operation.

10. The parking space occupancy detection device based on the rotating frame detection technology according to claim 9, characterized in that: In the binary classification network model construction and training module, in the process of training the binary classification network model through the parking space image dataset, the parking space image dataset is divided into a training set, a validation set and a test set according to a set ratio; the training set is used to train the binary classification network model; The validation set is used to debug and optimize the binary classification network model; the test set is used to evaluate the generalization ability of the binary classification network model.