WO2021042792A1 - Method and apparatus for determining position of camera - Google Patents

Method and apparatus for determining position of camera Download PDF

Info

Publication number
WO2021042792A1
WO2021042792A1 PCT/CN2020/094793 CN2020094793W WO2021042792A1 WO 2021042792 A1 WO2021042792 A1 WO 2021042792A1 CN 2020094793 W CN2020094793 W CN 2020094793W WO 2021042792 A1 WO2021042792 A1 WO 2021042792A1
Authority
WO
WIPO (PCT)
Prior art keywords
vehicle
camera
image
distance
determining
Prior art date
Application number
PCT/CN2020/094793
Other languages
French (fr)
Chinese (zh)
Inventor
王钧
傅宇辉
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2021042792A1 publication Critical patent/WO2021042792A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30248Vehicle exterior or interior
    • G06T2207/30252Vehicle exterior; Vicinity of vehicle

Definitions

  • This application relates to the field of data processing, and in particular to a method and device for determining the position of a camera.
  • An application scenario of image analysis and processing technology is to analyze images taken by cameras installed on roads. For example, it is possible to analyze images including vehicles taken by cameras installed on roads to determine whether the vehicles have illegal driving behaviors. Another example is to analyze images including vehicles captured by cameras installed on roads, to track the itinerary of target users, such as criminal suspects, and so on.
  • the location of the cameras In practical applications, when analyzing images taken by cameras installed on roads, it is also important to determine the location of the cameras, because in practical applications it may be necessary to perform further analysis in conjunction with the location of the cameras. For example, after it is determined that the vehicle has an illegal driving behavior based on the image taken by the camera, the position of the camera that took the image can be combined to further determine the location of the vehicle's illegal driving behavior. For another example, when tracking the itinerary of the target user, the location of the vehicle driven by the target user can be determined in combination with the position of the camera, so as to determine the location of the target user.
  • the embodiments of the present application provide a method and device for determining the position of a camera, which can solve the problem of inaccurate position of the camera in the traditional technology.
  • the embodiments of the present application provide a method for determining the position of the camera.
  • the spatiotemporal trajectory data of the first vehicle with the spatiotemporal trajectory data reporting function, and the first position of the first vehicle at the time when the camera captures the first image including the first vehicle can be used to determine The location of the camera.
  • the “position of the geographic coordinates of the camera” is referred to as the “second position”.
  • the first image including the first vehicle captured by the camera may be acquired, and the shooting moment of the first image may be determined. And, acquiring the spatiotemporal trajectory data of the first vehicle, and determining the first position of the first vehicle at the shooting moment of the first image according to the spatiotemporal trajectory data of the first vehicle. And obtain the spatial position relationship between the first position and the second position, and then determine the second position according to the spatial position relationship between the first position and the second position.
  • the first position of the first vehicle at the moment of taking the first image is accurate, and the accuracy of the spatial position relationship between the first position and the second position is also accurate. It is relatively high, and therefore, the accuracy of the determined second position is also relatively high. Therefore, by using the solution provided by the embodiment of the present application, the location of the geographic coordinates of the camera can be accurately determined.
  • the spatial position relationship between the first position and the second position, and the spatial position relationship between the first position and the second position may include the distance between the first position and the second position; the first position The spatial position relationship with the second position may include the relative direction between the first position and the second position; of course, the spatial position relationship between the first position and the second position may include both the first position and the second position The distance includes the relative direction between the first position and the second position.
  • the second position may be determined based on the first position and the spatial position relationship between the first position and the second position.
  • the position of the target object on the first vehicle in the first image captured by the camera can reflect to a certain extent that the first image is captured by the camera.
  • the camera has an installation direction during installation, and the installation direction of the camera determines the shooting direction of the camera to a certain extent.
  • the shooting direction of the camera determines whether the first vehicle is driving from the first position to the direction of the second position, or from the direction of the second position. To the first position. That is, the relative direction between the first position and the second position can be determined according to the driving direction of the first vehicle and the shooting direction of the camera.
  • the traveling direction of the first vehicle can be determined according to the spatio-temporal trajectory data of the first vehicle, and the shooting direction of the camera can be determined, and then according to the traveling direction of the first vehicle and the shooting of the camera The direction determines the relative direction between the first position and the second position.
  • the spatial position relationship between the first position and the second position can be embodied as the distance between the first position and the second position. In this case, it can be based on the first position and the first position.
  • the distance between the second position and the second position determines the second position.
  • the position of the target object in the first image may be determined according to the first image, and the distance between the first position and the second position may be determined according to the obtained position of the target object in the first image; and then according to the first image
  • An image determines the position of the target object in the first image, and the distance between the first position and the second position is determined according to the obtained position of the target object in the first image.
  • it may be: determine the travel trajectory of the first vehicle according to the spatiotemporal trajectory data of the first vehicle, and determine the first vehicle’s travel trajectory according to the distance between the first position and the second position, the first position and the travel trajectory of the first vehicle Two positions.
  • the second position may be further determined in combination with the relative direction between the first position and the second position.
  • the traveling direction of the first vehicle can be determined according to the spatiotemporal trajectory data of the first vehicle; and the shooting direction of the camera can be determined.
  • the relative direction between the first position and the second position is determined.
  • the second position is determined according to the relative direction between the first position and the second position, the first position, and the distance between the first position and the second position.
  • the distance between the first position and the second position is determined.
  • the mapping relationship between the position and the distance can be predetermined to obtain The distance corresponding to the position of the target object in the first image, and then the distance obtained by using the mapping relationship is determined as the distance between the first position and the second position.
  • the embodiment of the present application does not specifically limit the foregoing predetermined mapping relationship between the position and the distance.
  • the predetermined mapping relationship between the position and the distance includes at least the position of the target object in the first image, and the second position and The mapping relationship between the distances between the first positions.
  • the first position may be determined as the second position, that is, the position of the first vehicle when the camera shoots the first image is determined as the geographic coordinate position of the camera. .
  • This approach is simple and efficient, but it may cause low accuracy.
  • the images captured by the camera include many vehicles, in addition to the aforementioned first vehicle, it may also include a second vehicle, a third vehicle, etc., instead of All vehicles are vehicles with spatio-temporal data reporting functions.
  • the first image taken by the camera it may be further determined whether the first vehicle included in the first image is a vehicle with spatiotemporal data reporting.
  • the first image can be analyzed to identify the license plate number of the first vehicle. Then match the license plate number of the first vehicle with the license plate number of the vehicle with spatiotemporal trajectory data reporting function.
  • the license plate number of the vehicle with spatiotemporal trajectory data reporting function includes the license plate of the aforementioned first vehicle
  • the first vehicle is a vehicle with the function of reporting spatiotemporal trajectory data.
  • the aforementioned target object on the first vehicle may be the license plate on the first vehicle or the vehicle logo on the first vehicle.
  • an embodiment of the present application provides a device for determining the position of a camera.
  • the device includes: a first acquiring unit configured to acquire a first image captured by the camera including a first vehicle; and a first determining unit configured to Determine the shooting moment of the first image; a second acquisition unit for acquiring spatio-temporal trajectory data of the first vehicle; a second determination unit for determining the first vehicle's spatiotemporal trajectory data The first position of the vehicle at the shooting moment; a third acquisition unit, configured to acquire the spatial position relationship between the first position and the second position, and the second position is the position of the geographic coordinates of the camera; The third determining unit is configured to determine the second position according to the first position, the spatial position relationship between the first position and the second position.
  • the spatial position relationship between the first position and the second position includes: the distance between the first position and the second position, and/or the first position And the relative direction between the second position.
  • the distance between the first position and the second position is determined by determining the position of the target object in the first image according to the first image, and According to the determined position of the target object in the first image, the distance between the first position and the second position is determined; the target object is located in the first vehicle.
  • the relative direction between the first position and the second position is determined in the following manner: determining the travel of the first vehicle according to the spatiotemporal trajectory data of the first vehicle Direction; and determining the shooting direction of the camera; determining the relative direction between the first position and the second position according to the driving direction of the first vehicle and the shooting direction of the camera; The shooting direction is consistent with the traveling direction of the first vehicle or coincides with the reverse direction of the traveling direction of the first vehicle.
  • the third determining unit includes: a first determining subunit, configured to determine the position of the target object in the first image according to the first image; the target object is located The first vehicle;
  • the second determining subunit is used to determine the distance between the first position and the second position according to the obtained position of the target object in the first image; the third determining subunit is used to determine the distance between the first position and the second position according to the obtained position of the target object in the first image; The space-time trajectory data of the first vehicle, the distance, and the first position determine the second position.
  • the third determining subunit is specifically configured to: determine the traveling direction of the first vehicle according to the spatiotemporal trajectory data of the first vehicle; and determine the shooting direction of the camera
  • the shooting direction of the camera is consistent with the driving direction of the first vehicle or the opposite direction to the driving direction of the first vehicle; according to the driving direction of the first vehicle and the shooting direction of the camera, Determine the relative direction between the first position and the second position; determine the first position according to the relative direction between the first position and the second position, the first position and the distance Two positions.
  • the second determining subunit is specifically configured to: obtain a position corresponding to the target object in the first image according to a predetermined mapping relationship between a position and a distance The obtained distance is determined as the distance between the first position and the second position; the mapping relationship between the predetermined position and the distance includes that the target object is in the first position A mapping relationship between a position in an image and the distance between the second position and the first position.
  • the third determining unit is specifically configured to determine the first position as the second position.
  • the device further includes: an image analysis unit, configured to analyze the first image, and identify the license plate number of the first vehicle; and a fourth determining unit, configured to compare all The license plate number of the first vehicle is matched with the license plate number of the vehicle with the spatiotemporal trajectory data reporting function. If the matching is successful, it is determined that the first vehicle is a vehicle with the spatiotemporal trajectory data reporting function.
  • the target object includes: a license plate or a vehicle logo.
  • an embodiment of the present application provides a device for determining the position of a camera.
  • the device includes: a processor and a memory; the memory is configured to store instructions; and the processor is configured to execute The instruction executes the method described in any one of the first aspect above.
  • an embodiment of the present application provides a computer-readable storage medium, including instructions, which when run on a computer, cause the computer to execute the method described in any one of the first aspects above.
  • the embodiments of the present application provide a computer program product containing instructions, which when run on a computer, cause the computer to execute the method described in any one of the above first aspect.
  • an embodiment of the present application provides a device for determining the position of a camera, wherein the device includes: a processor and an interface; the processor communicates with the interface, and the processor is configured to communicate through the interface The data is received, and the method described in any one of the first aspect is executed by running the program instructions.
  • FIG. 1 is a schematic flowchart of a method for determining a camera position according to an embodiment of the application
  • FIG. 2 is a schematic flowchart of a method for determining a second location according to an embodiment of this application
  • FIG. 3 is a schematic flowchart of another method for determining a second location provided by an embodiment of this application.
  • FIG. 4 is a schematic diagram of a driving track of a first vehicle according to an embodiment of the application.
  • FIG. 5 is a schematic diagram of another driving trajectory of a first vehicle according to an embodiment of the application.
  • FIG. 6 is a schematic structural diagram of a device for determining the position of a camera provided by an embodiment of the application.
  • FIG. 7 is a schematic structural diagram of a device for determining the position of a camera provided by an embodiment of the application.
  • the embodiment of the present application provides a method for determining the position of the camera, which is used to solve the problem that the position of the camera in the traditional technology is not very accurate.
  • the embodiment of the present application provides a method for determining the position of a camera, which is used to accurately determine the position of the camera.
  • the following describes the method for determining the position of the camera provided in the embodiments of the present application in conjunction with the accompanying drawings.
  • the spatiotemporal trajectory data reported can be considered as accurate data.
  • the camera when a vehicle with the spatio-temporal trajectory data reporting function passes near the camera, the camera can capture images including the spatio-temporal trajectory data reporting function, and when the camera captures the image, the camera and the spatio-temporal trajectory data report The spatial position relationship between functional vehicles can be determined.
  • a camera is used to capture images of a vehicle with spatiotemporal trajectory reporting function, and the spatial position relationship between the "location of the vehicle with spatiotemporal trajectory reporting function" and "the location of the camera's geographic coordinates", it can be accurately determined The location of the camera.
  • an image of a vehicle with a spatiotemporal trajectory report function can be acquired by the camera; then the time when the image was taken is determined, and further, the spatiotemporal trajectory data of the vehicle with the spatiotemporal trajectory data report function is used to determine the spatiotemporal trajectory The location of the vehicle with the data reporting function at the aforementioned shooting moment.
  • FIG. 1 is a schematic flowchart of a method for determining a camera position according to an embodiment of the application.
  • the method for determining the position of the camera provided in the embodiment of the present application may be executed by a server.
  • the embodiment of the present application does not specifically limit the server.
  • the server may be a dedicated server for determining the position of the camera, or the server may be a general-purpose server that also has other data processing functions.
  • the method for determining the position of the camera shown in FIG. 1 may be implemented through the following steps 101-104, for example.
  • Step 101 Acquire a first image including a first vehicle captured by a camera, and determine a shooting moment of the first image.
  • the first vehicle is a vehicle with a spatiotemporal trajectory data reporting function.
  • Spatio-temporal trajectory data includes at least two dimensions of time and space data.
  • the spatio-temporal trajectory data of the first vehicle is data describing the position of the first vehicle at a certain moment.
  • the first vehicle may be equipped with a positioning device, which is used to determine the position of the first vehicle in real time, and the first vehicle may determine the position of the first vehicle and the corresponding position when the first vehicle is at that position. Report at all times.
  • the location of the first vehicle may be described by the geographic coordinates of the location of the first vehicle, such as latitude and longitude.
  • the embodiment of the present application does not specifically limit the type of the first vehicle.
  • the aforementioned first vehicle may be a car-hailing vehicle.
  • some vehicles are specially used for position calibration, and these vehicles are also equipped with positioning devices. Therefore, in another implementation manner of the embodiment of the present application, the aforementioned first vehicle may also be a vehicle specifically used for position calibration.
  • the aforementioned positioning device on the first vehicle may be a positioning device fixed on the first vehicle, or a mobile positioning device, such as a mobile terminal with positioning function.
  • the device that reports the spatiotemporal trajectory data of the first vehicle may be a device fixed on the first vehicle, or a mobile device, such as a mobile terminal, etc., which is not specifically limited in the embodiment of the present application.
  • the camera will record a video image or capture a corresponding image when a vehicle passes by, and upload the recorded video image or the captured image to the corresponding server.
  • the camera will record a video image corresponding to the road or capture an image when a vehicle passes by, and report the recorded video image and the captured image to the relevant management department, such as the server of the traffic control department. Therefore, in the embodiment of the present application, when step 101 is specifically implemented, for example, the first image may be obtained from a server of a related management department, such as a traffic management department.
  • the shooting moment of the first image may be further determined.
  • the shooting time of the first image can be determined according to the video obtained from the server of the traffic control department.
  • Step 102 Obtain spatiotemporal trajectory data of the first vehicle, and determine the first position of the first vehicle at the shooting moment of the first image according to the spatiotemporal trajectory data of the first vehicle.
  • the spatiotemporal trajectory data of the first vehicle is data describing the position of the first vehicle at a certain moment.
  • the first vehicle may report the position of the first vehicle and the corresponding time when the first vehicle is at that position.
  • the aforementioned first vehicle may be obtained from a device that stores spatiotemporal trajectory data of the first vehicle.
  • the spatiotemporal trajectory data reported by the vehicle for example, the spatiotemporal trajectory data of the first vehicle is acquired from a server that stores the spatiotemporal trajectory data of the first vehicle.
  • the target time matching the shooting time of the first image can be determined from the spatio-temporal trajectory data of the first vehicle, and the location of the first vehicle corresponding to the target time , Determined as the aforementioned first position.
  • the aforementioned target time matched with the shooting time of the first image may be equal to the shooting time of the first image. It is understandable that when the target time is equal to the first image At the moment when the image is taken, the determined first position can be considered accurate.
  • the first vehicle does not correspond to every moment. Report all the positions, but report its own position and the corresponding time when the first vehicle is at that position according to a preset time period, or report based on the request of the administrator. Therefore, the aforementioned spatiotemporal trajectory data of the first vehicle may or may not include the shooting time of the first image. In the case where the shooting moment of the first image is not included, there may be multiple implementation manners for determining the position of the first vehicle at the shooting moment of the first image. Two possible implementation methods are described below.
  • the time closest to the shooting time of the first image in the aforementioned spatiotemporal trajectory data may be determined as the target time.
  • the aforementioned preset time period that is, the sampling period of the spatiotemporal position of the first vehicle is generally not too long. Therefore, if the time closest to the shooting time of the first image in the spatio-temporal trajectory data is determined as the target time, the position of the first vehicle at the shooting time of the first image is different from the position of the first vehicle at the target time.
  • the gap should not be very large. Therefore, determining the time closest to the shooting time of the first image in the aforementioned spatiotemporal trajectory data as the first position determined by the target time can also be considered to be relatively accurate.
  • the time closest to the shooting time of the first image in the aforementioned spatio-temporal trajectory data may be determined as the target time. Then, the spatio-temporal trajectory data of the first vehicle is used to perform simple interpolation calculation to determine the position of the first vehicle at the time of taking the first image, that is, to determine the first position. Because as mentioned above, in actual applications, in order to ensure the integrity of the spatiotemporal trajectory data of the first vehicle, the aforementioned preset time period, that is, the sampling period of the spatiotemporal position of the first vehicle is generally not too long.
  • Step 103 Obtain the spatial position relationship between the first position and the second position, where the second position is the position of the geographic coordinates of the camera.
  • Step 104 Determine the second position according to the first position, the spatial position relationship between the first position and the second position.
  • the installation of the camera may follow a certain installation specification.
  • the installation specification may include, for example, the installation height of the camera and the shooting range of the camera.
  • the camera is installed based on certain installation specifications, when the camera captures the first vehicle, the space between the first position of the first vehicle and the geographic coordinates of the camera, that is, the second position The positional relationship meets certain conditions.
  • the first image captured by the camera includes the first vehicle, the spatial position relationship between the second position and the first position can be determined.
  • the embodiment of the present application does not specifically limit the specific implementation manner for obtaining the spatial position relationship between the first position and the second position.
  • the spatial position relationship between the second position and the first position may be acquired based on the aforementioned installation specification of the camera.
  • the spatial position relationship between the first position and the second position can be acquired based on other external data such as the first image.
  • a pre-calibration method can be used to determine the spatial position relationship between the second position and the object photographed by the camera, and write the pre-calibrated spatial position relationship into the corresponding storage medium, and execute this
  • the processor in the server of the method for determining the camera position provided by the application embodiment can read the spatial position relationship between the first position and the second position from the aforementioned storage medium to obtain the spatial position relationship between the first position and the second position .
  • the spatial position relationship between the first position and the second position may be Including the distance between the first position and the second position; the spatial position relationship between the first position and the second position may include the relative direction between the first position and the second position; of course, the difference between the first position and the second position
  • the spatial position relationship may include not only the distance between the first position and the second position, but also the relative direction between the first position and the second position.
  • the second position can be determined according to the spatial position relationship between the first position, the first position, and the second position.
  • the first position of the first vehicle at the moment of taking the first image is relatively accurate, and the space between the first position and the second position is relatively accurate.
  • the accuracy of the position relationship is also relatively high, and therefore, the accuracy of the determined second position is also relatively high. Therefore, by using the solution provided by the embodiment of the present application, the location of the geographic coordinates of the camera can be accurately determined.
  • the spatial position relationship between the first position and the second position may be embodied as the distance between the first position and the second position, and/or the relative direction between the first position and the second position.
  • the specific method for determining the distance between the first position and the second position and the specific method for determining the relative direction between the first position and the second position are respectively introduced below.
  • the method for determining the distance between the first position and the second position is introduced.
  • a pre-calibration method can be used The condition satisfied by the distance between the aforementioned camera and the first vehicle is determined, and a value is determined from the distance that satisfies the condition as the distance between the first position and the second position. For example, a pre-calibration method is used to determine that when the distance between the first position and the second position is between 1 meter and 16 meters, the camera can capture the first vehicle, so the distance between the first position and the second position The distance is determined to be a value between 1 meter and 16 meters, such as 10 meters.
  • the position of the target object on the first vehicle in the first image captured by the camera can reflect to a certain extent that the first image captured by the camera
  • the position of the target object on the first vehicle in the first image captured by the camera can reflect the distance between the first position and the second position to a certain extent. Therefore, in an implementation manner of the embodiment of the present application, the position of the target object on the first vehicle in the first image can be determined according to the first image, and further, based on the obtained target object in the first image The position to determine the distance between the first position and the second position.
  • the target object is, for example, a license plate or a vehicle logo.
  • image analysis may be performed on the first image to identify the target object in the first image, so as to determine the position of the target object in the first image.
  • the image feature of the first image can be extracted, and the analysis is performed based on the extracted image feature, so as to identify the target object in the first image.
  • the realization of recognizing the target object in the first image it may be a classic image recognition technology, which will not be described in detail here.
  • the embodiments of the present application do not specifically limit the foregoing target objects.
  • the difference in the size of the license plate is not big, and the difference in the size of the corresponding car logo is not big.
  • the position of the license plate and vehicle logo on the car body is relatively fixed. Therefore, for different vehicles located at the first position, the positions of the license plates or logos of these different vehicles in the images containing the vehicles in the multiple images captured by the camera including these different vehicles can be considered to be relatively close. Therefore, in the embodiment of the present application, the aforementioned target object on the first vehicle may be the license plate on the first vehicle or the vehicle logo on the first vehicle.
  • the embodiment of the present application does not specifically limit the position of the aforementioned target object in the first image.
  • the position of the target object in the first image may be the image coordinates of the target object in the first image. Coordinates in the system.
  • the position of the target object in the first image may also be the relative position of the target object in the first image.
  • the relative position of the target object in the first image may be that the target object is in a certain area in the first image. For example, the target object is in the upper part of the first image, the target object is in the middle of the first image, and the target object is in the lower part of the first image, and so on.
  • the embodiment of the present application does not specifically limit the specific implementation manner of determining the distance between the first position and the second position according to the position of the target object in the first image.
  • the mapping between the position and the distance may be predetermined Relationship, the distance corresponding to the position of the target object in the first image is obtained, and then the distance obtained by using the mapping relationship is determined as the distance between the first position and the second position.
  • the embodiment of the present application does not specifically limit the foregoing predetermined mapping relationship between the position and the distance.
  • the predetermined mapping relationship between the position and the distance includes at least the position of the target object in the first image, and the second position and The mapping relationship between the distances between the first positions.
  • the predetermined mapping relationship between the position and the distance may be, for example, the mapping relationship shown in Table 1 below.
  • the target object on the first vehicle is located on the upper part of the first image, based on the mapping relationship shown in Table 1, it can be determined that the distance between the first position and the second position is 15 meters.
  • Table 1 is only shown for the convenience of understanding and does not constitute a limitation to the embodiment of the present application.
  • the position of the target object in the first image in the first image is not limited to the "upper part” shown in Table 1.
  • the three situations of "", “middle” and “lower” may also include other situations, which will not be listed here.
  • the camera has an installation direction when it is installed, and the installation direction of the camera determines the shooting direction of the camera to a certain extent.
  • the shooting direction of the camera determines whether the first vehicle is driving from the first position to the direction of the second position, or from the direction of the second position.
  • the relative direction between the first position and the second position can be determined according to the driving direction of the first vehicle and the shooting direction of the camera.
  • the traveling direction of the first vehicle can be determined according to the spatio-temporal trajectory data of the first vehicle, and the shooting direction of the camera can be determined, and then according to the traveling direction of the first vehicle and the shooting of the camera The direction determines the relative direction between the first position and the second position.
  • the traveling trajectory of the first vehicle when determining the traveling direction of the first vehicle according to the spatiotemporal trajectory data of the first vehicle, for example, the traveling trajectory of the first vehicle may be determined first according to the spatiotemporal trajectory data of the first vehicle, and then according to the first vehicle’s traveling direction.
  • the driving trajectory determines the driving direction of the first vehicle.
  • the driving direction of the first vehicle may be determined according to at least two positions on the driving trajectory of the first vehicle.
  • the direction of the tangent line passing through the first position in the driving track may be determined as the driving direction of the first vehicle.
  • the shooting direction of the camera may be determined according to the installation information of the camera.
  • the shooting direction of the camera may be the same as the traveling direction of the first vehicle, or the direction opposite to the traveling direction of the first vehicle.
  • the shooting direction of the camera is consistent with the driving direction of the first vehicle, and it can be considered that the angle between the shooting direction of the camera and the driving direction of the first vehicle is less than or equal to 90°.
  • the shooting direction of the camera is consistent with the reverse direction of the traveling direction of the first vehicle, and it can be considered that the angle between the shooting direction of the camera and the traveling direction of the first vehicle is greater than 90°.
  • the shooting direction of the camera is consistent with the driving direction of the first vehicle, when the camera shoots the first vehicle, the target object at the rear of the first vehicle can be captured. If the photographing direction of the camera is the same as the reverse direction of the traveling direction of the first vehicle, the camera can photograph the target object at the front of the first vehicle when photographing the first vehicle.
  • the relative direction between the aforementioned first position and the second position may also be preset, and the embodiment of the present application does not specifically limit the preset relative direction.
  • the preset relative direction may be a true north direction where the second position is located at the first position; for another example, the preset relative direction may be a true south direction where the second position is located at the first position; etc., I won’t enumerate one by one here.
  • the spatial position relationship between the first position and the second position can be embodied as the distance between the first position and the second position and/or the relative direction between the first position and the second position, which is described below in conjunction with FIG. 2 When the spatial position relationship between the first position and the second position is embodied as the distance between the first position and the second position, the specific implementation manner of the foregoing step 104.
  • FIG. 2 is a schematic flowchart of a method for determining a second position according to an embodiment of the application.
  • the method shown in FIG. 2 can be implemented through the following steps 201-202, for example.
  • Step 201 Determine the position of the target object in the first image according to the first image, and determine the distance between the first position and the second position according to the obtained position of the target object in the first image.
  • the target object mentioned here is located on the first vehicle.
  • step 201 reference may be made to the related description of the "distance between the first position and the second position" above, which will not be described in detail here.
  • Step 202 Determine the second position according to the spatiotemporal trajectory data of the first vehicle, the distance between the first position and the second position, and the first position.
  • it may be: determine the travel trajectory of the first vehicle according to the spatiotemporal trajectory data of the first vehicle, and determine the first vehicle’s travel trajectory according to the distance between the first position and the second position, the first position and the travel trajectory of the first vehicle Two positions.
  • the second position can be determined according to the first position and the distance between the first position and the second position.
  • the first vehicle may pass the geographic coordinates of the camera during the driving process, that is, pass the second position, or the second position is in the first position.
  • the spatiotemporal trajectory of the first vehicle may be determined according to the spatiotemporal trajectory data of the first vehicle.
  • the second position is determined according to the distance between the first position and the second position, the first position, and the travel trajectory of the first vehicle. For example, according to the driving trajectory, a position whose distance from the first position is equal to the distance between the aforementioned first position and the second position is determined as the second position.
  • the first position is generally not the starting point or the end point of the driving track of the first vehicle. Therefore, the determined distance from the first position, which is equal to the aforementioned "distance between the first position and the second position", may include two positions. In the embodiment of the present application, the two positions may be Any one of the positions is determined as the aforementioned second position.
  • the data volume of the spatiotemporal trajectory data of the first vehicle is relatively large, therefore, if all spatiotemporal trajectory data of the first vehicle is used, the data of the first vehicle is determined For a complete driving trajectory, the corresponding calculation amount will be relatively large.
  • the actual travel trajectory of the first vehicle that needs to be used is the travel trajectory of the first vehicle during a period of time near the shooting moment of the first image.
  • the spatio-temporal trajectory data of the first vehicle can be extracted from the time period.
  • the preset time period is a time period including the shooting moment of the aforementioned first image, and then based on the extracted spatio-temporal trajectory data within the preset time period, the driving trajectory of the first vehicle is determined.
  • the embodiment of the present application does not specifically limit the preset time period.
  • the preset time period is a time period from a first moment to a second moment, where the first moment is a certain moment before the shooting moment of the first image, The second moment is a moment after the shooting moment of the first image.
  • the position whose distance from the first position is equal to the distance between the aforementioned first position and the second position can be determined as the second position.
  • the distance between the first position and the first position in the travel trajectory of the first vehicle is equal to the aforementioned distance between the first position and the second position, and may include two positions.
  • any one of the two positions may be determined as the aforementioned second position.
  • the second position in order to further improve the accuracy of the determined second position, the second position may also be determined in combination with the relative direction between the first position and the second position.
  • another method for determining a second position provided by an embodiment of the present application will be introduced in conjunction with FIG. 3.
  • FIG. 3 is a schematic flowchart of yet another method for determining a second position according to an embodiment of the application.
  • the method shown in FIG. 3 can be implemented through the following steps 301-303, for example.
  • Step 301 Determine the driving direction of the first vehicle according to the spatio-temporal trajectory data of the first vehicle; and determine the shooting direction of the camera.
  • step 301 reference may be made to the related description of the "relative direction between the first position and the second position" above, and the description will not be repeated here.
  • Step 302 Determine the relative direction between the first position and the second position according to the driving direction of the first vehicle and the shooting direction of the camera.
  • Step 303 Determine the second position according to the relative direction between the first position and the second position, the first position, and the distance between the first position and the second position.
  • the first vehicle may pass through the second position while driving.
  • the relative direction between the first position and the second position may be determined by the relative positions of the first position and the second position in the driving trajectory of the first vehicle.
  • the relative position of the first position and the second position in the driving trajectory of the first vehicle refers to whether the first vehicle passes the first position and then the second position, or whether it passes the second position first. Pass the first position again. It can be understood that, in practical applications, if the driving direction of the first vehicle is the same as the shooting direction of the camera, the first vehicle first passes the second position, and then passes the first position. If the driving direction of the first vehicle is not consistent with the shooting direction of the camera, the first vehicle first passes through the first position and then passes through the second position.
  • the relative position and the first position of the first position and the second position in the driving trajectory of the first vehicle can be determined.
  • a position and the distance between the first position and the second position determine the second position. It can be understood with reference to FIG. 4, which is a schematic diagram of a driving track of a first vehicle according to an embodiment of the application.
  • 401 is the travel trajectory of the first vehicle, and the arrow 401 a on the travel trajectory 401 indicates the direction of the travel trajectory 401.
  • the first position is 402 shown in FIG. 4, and there are two positions on the driving track whose distance from the first position 402 is equal to the distance between the first position and the second position, namely 403 and 404, and the camera shooting If the direction is consistent with the driving trajectory 401, it is determined that the first vehicle passes the second position first, and then passes the first position 401. Therefore, the position 403 can be determined as the second position.
  • the second location may be near the driving track of the first vehicle.
  • the second position can be considered to be located on the first tangent line, where the first tangent line is the tangent line of the driving track of the first vehicle at the first position .
  • the relative direction between the first position and the second position may be determined by the relative position of the first position and the second position on the aforementioned first tangent line.
  • the relative position of the first position and the second position in the first tangent line refers to whether the first vehicle is moving from the first position to the direction of the second position, or from the second position Head to the first position in your direction.
  • the first vehicle will move from the direction of the second position to the first position. If the driving direction of the first vehicle is not consistent with the shooting direction of the camera, the first vehicle drives from the first position to the direction of the second position.
  • FIG. 5 is a schematic diagram of another driving trajectory of the first vehicle according to an embodiment of the application.
  • 501 is the driving trajectory of the first vehicle
  • the arrow 501 a on the driving trajectory 501 indicates the direction of the driving trajectory 501.
  • the first position is 502 shown in FIG. 5, and 503 is the tangent line of the travel trajectory 501 at the first position 502.
  • There are two positions on the tangent line 503 whose distance from the first position 502 is equal to the distance between the first position and the second position, 505 and 506 respectively. If the camera's shooting direction is consistent with the driving track 501, the first vehicle will move from the direction of the second position to the first position. Therefore, the position 506 can be determined as the second position.
  • step 104 may be implemented in other ways in addition to being implemented through steps 201-202.
  • the shooting field of view of the camera is limited, in other words, the position of the farthest object that can be shot by the camera is not far away from the second position. Therefore, in another implementation manner of the embodiment of the present application, the first position may be determined as the second position, that is, the position of the first vehicle when the camera shoots the first image is determined as the geographic coordinate position of the camera . This approach is simple and efficient, but it may cause low accuracy.
  • the first vehicle is a vehicle with the function of reporting spatio-temporal trajectory data. It is understandable that in practical applications, there are many vehicles included in the image captured by the camera. In addition to the aforementioned first vehicle, it may also include a second vehicle, a third vehicle, etc., and not all vehicles are equipped with Vehicles with spatio-temporal data reporting function. In an implementation manner of the present application, after acquiring the first image taken by the camera, it may be further determined whether the first vehicle included in the first image is a vehicle with spatiotemporal data reporting. Specifically, in this year's application embodiment, the first image can be analyzed to identify the license plate number of the first vehicle.
  • the license plate number of the first vehicle with the license plate number of the vehicle with spatiotemporal trajectory data reporting function. If the matching is successful, it is determined that the license plate number of the vehicle with spatiotemporal trajectory data reporting function includes the license plate of the aforementioned first vehicle When the number is displayed, it can be determined that the first vehicle is a vehicle with the function of reporting spatiotemporal trajectory data.
  • the license plate number of a vehicle with the function of reporting spatio-temporal trajectory data can be obtained from the server of the online car-hailing platform, and then further based on the acquisition
  • the license plate number of the vehicle with spatiotemporal trajectory data reporting function determines whether the first vehicle is a vehicle with spatiotemporal trajectory data reporting function.
  • a general image recognition technology can be used to determine it, which will not be described in detail here.
  • the target object on the first vehicle may be the license plate on the first vehicle. It is understandable that whether the first vehicle is a vehicle capable of reporting spatiotemporal trajectory data can be determined according to the license plate number of the first vehicle. In other words, when determining whether the first vehicle is a vehicle with a spatiotemporal trajectory reporting function, the license plate of the first vehicle in the first image has been identified. Therefore, if the target object on the first vehicle is the license plate of the first vehicle, rather than other objects, the second recognition of other objects on the vehicle can be avoided, part of the computing resources can be saved, and the efficiency of determining the second position can be improved accordingly.
  • an embodiment of the present application also provides an apparatus for determining the position of a camera, which is described below with reference to the accompanying drawings.
  • FIG. 6 is a schematic structural diagram of an apparatus for determining a camera position according to an embodiment of the application.
  • the device 600 for determining the position of the camera may include, for example, a first acquiring unit 601, a first determining unit 602, a second acquiring unit 603, a second determining unit 604, a third acquiring unit 605, and a third determining unit.
  • the first obtaining unit 601 is configured to obtain a first image including a first vehicle shot by a camera;
  • the first determining unit 602 is configured to determine the shooting moment of the first image
  • the second acquiring unit 603 is configured to acquire spatiotemporal trajectory data of the first vehicle
  • the second determining unit 604 is configured to determine the first position of the first vehicle at the shooting moment according to the spatio-temporal trajectory data of the first vehicle;
  • the third acquiring unit 605 is configured to acquire the spatial position relationship between the first position and the second position, where the second position is the geographic coordinate position of the camera;
  • the third determining unit 606 is configured to determine the second position according to the first position, the spatial position relationship between the first position and the second position.
  • the spatial position relationship between the first position and the second position includes:
  • the distance between the first position and the second position, and/or the relative direction between the first position and the second position is the distance between the first position and the second position, and/or the relative direction between the first position and the second position.
  • the distance between the first position and the second position is determined in the following manner:
  • the relative direction between the first position and the second position is determined in the following manner:
  • the third determining unit 606 includes:
  • the first determining subunit is configured to determine the position of the target object in the first image according to the first image; the target object is located in the first vehicle;
  • a second determining subunit configured to determine the distance between the first position and the second position according to the obtained position of the target object in the first image
  • the third determining subunit is configured to determine the second position according to the spatiotemporal trajectory data of the first vehicle, the distance, and the first position.
  • the third determining subunit is specifically configured to:
  • the spatio-temporal trajectory data of the first vehicle determine the traveling direction of the first vehicle; and determine the shooting direction of the camera; the shooting direction of the camera is consistent with the traveling direction of the first vehicle or is consistent with the traveling direction of the first vehicle.
  • the reverse direction of the driving direction of the first vehicle is the same; according to the driving direction of the first vehicle and the shooting direction of the camera, the relative direction between the first position and the second position is determined; according to the The relative direction between the first position and the second position, the first position and the distance determine the second position.
  • the second determining subunit is specifically used for:
  • the distance corresponding to the position of the target object in the first image is obtained, and the obtained distance is determined as the first position and the second position.
  • the distance between the positions; the predetermined mapping relationship between the position and the distance includes the position of the target object in the first image, and the distance between the second position and the first position The mapping relationship between distances.
  • the third determining unit 606 is specifically configured to:
  • the first position is determined as the second position.
  • the device 600 further includes: an image analysis unit, configured to analyze the first image and identify the license plate number of the first vehicle;
  • the fourth determining unit is configured to match the license plate number of the first vehicle with the license plate number of the vehicle with spatiotemporal trajectory data reporting function, and if the matching is successful, determine that the first vehicle is the one with spatiotemporal trajectory data reporting function vehicle.
  • the target object includes: a license plate or a vehicle logo.
  • the device 600 is a device corresponding to the method provided in the above method embodiment, the specific implementation of each unit of the device 600 is based on the same idea as the above method embodiment. Therefore, regarding each unit of the device 600 For specific implementation, please refer to the description part of the above method embodiment, which will not be repeated here.
  • the embodiment of the present application also provides a device for determining a camera position corresponding to the device 600 for determining the camera position, and the device for determining the camera position includes a processor and a memory;
  • the memory is used to store instructions
  • the processor is configured to execute the instructions in the memory, and execute the method for determining the position of the camera provided in the above embodiments.
  • the hardware structure of the device for determining the camera position of the device 600 for determining the camera position may be the structure shown in FIG. 7, which is a device provided by the embodiment of the present application.
  • the device 700 for determining the position of the camera includes a processor 710, a communication interface 720, and a memory 730.
  • the number of processors 710 in the device 700 for determining the camera position may be one or more.
  • One processor is taken as an example in FIG. 7.
  • the processor 710, the communication interface 720, and the memory 730 may be connected through a bus system or other methods. In FIG. 7, the connection through the bus system 740 is taken as an example.
  • the processor 710 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP.
  • the processor 710 may further include a hardware chip.
  • the aforementioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof.
  • ASIC application-specific integrated circuit
  • PLD programmable logic device
  • the above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
  • the memory 730 may include a volatile memory (English: volatile memory), such as random-access memory (RAM); the memory 730 may also include a non-volatile memory (English: non-volatile memory), such as fast Flash memory (English: flash memory), hard disk drive (HDD) or solid-state drive (SSD); the memory 730 may also include a combination of the foregoing types of memory.
  • volatile memory such as random-access memory (RAM)
  • non-volatile memory such as fast Flash memory (English: flash memory), hard disk drive (HDD) or solid-state drive (SSD)
  • HDD hard disk drive
  • SSD solid-state drive
  • the memory 730 may store data such as the spatial position relationship between the first position and the second position mentioned in the foregoing embodiment.
  • the memory 730 stores an operating system and a program, an executable module or a data structure, or a subset of them, or an extended set of them, where the program may include various operation instructions for implementing various operations.
  • the operating system may include various system programs for implementing various basic services and processing hardware-based tasks.
  • the processor 710 can read the program in the memory 730 to implement the method for determining the position of the camera provided in the embodiment of the present application.
  • the bus system 740 may be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc.
  • PCI peripheral component interconnect standard
  • EISA extended industry standard architecture
  • the bus system 740 can be divided into an address bus, a data bus, a control bus, and so on. For ease of representation, only one thick line is used in FIG. 7, but it does not mean that there is only one bus or one type of bus.
  • the memory is not necessary, or the memory can be integrated with the processor.
  • the embodiment of the present application also provides a device for determining the position of a camera.
  • the device includes: a processor and an interface; the interface communicates with the processor, and the interface is used to provide data (because the processor itself hardly owns The function of storing data, so the data required by the processor to execute the method can be obtained through the interface, for example: the first image, spatiotemporal trajectory data) to the processor.
  • the processor receives data through the interface and then runs program instructions to process the data provided by the interface, so as to execute the method for determining the position of the camera provided in the above embodiments.
  • communication methods other than the bus may be used between the interface and the processor.
  • the embodiments of the present application also provide a computer-readable storage medium, including instructions, which when run on a computer, cause the computer to execute the method for determining the position of the camera provided in the above embodiments.
  • the embodiments of the present application also provide a computer program product containing instructions, which when run on a computer, cause the computer to execute the method for determining the position of the camera provided in the above embodiments.
  • the disclosed system, device, and method may be implemented in other ways.
  • the device embodiments described above are merely illustrative, for example, the division of units is only a logical business division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or integrated. To another system, or some features can be ignored, or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • service units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software business unit.
  • the integrated unit is implemented in the form of a software business unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of the present application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes. .
  • the services described in the present invention can be implemented by hardware, software, firmware, or any combination thereof.
  • these services can be stored in a computer-readable medium or transmitted as one or more instructions or codes on the computer-readable medium.
  • the computer-readable medium includes a computer storage medium and a communication medium, where the communication medium includes any medium that facilitates the transfer of a computer program from one place to another.
  • the storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Traffic Control Systems (AREA)
  • Navigation (AREA)

Abstract

A method for determining the position of a camera. The method comprises: obtaining a first image photographed by a camera and comprising a first vehicle, and determining a photographing time point of the first image; obtaining spatio-temporal trajectory data of the first vehicle, and determining, according to the spatio-temporal trajectory data, a first position where the first vehicle is located at the time point of photographing the first image; obtaining a spatial position relationship between the first position and a second position; and finally determining the second position according to the first position and the spatial position relationship between the first position and the second position. The second position is a position of a geographical coordinate of the camera. Because the first position is accurate, and the spatial position relationship between the first position and the second position is also relatively accurate, the accuracy of the determined second position is also high.

Description

一种摄像机位置的确定方法及装置Method and device for determining camera position 技术领域Technical field
本申请涉及数据处理领域,尤其涉及一种摄像机位置的确定方法及装置。This application relates to the field of data processing, and in particular to a method and device for determining the position of a camera.
背景技术Background technique
随着科学技术的发展,图像分析与处理技术的应用也越来越广泛。图像分析与处理技术的一个应用场景是对道路上安装的摄像机拍摄的图像进行分析。例如,可以对道路上安装的摄像机拍摄的包括车辆的图像进行分析,确定车辆是否存在违规驾驶行为。又如,对道路上安装的摄像机拍摄的包括车辆的图像进行分析,对目标用户例如犯罪嫌疑人的行程进行追踪,等等。With the development of science and technology, the application of image analysis and processing technology has become more and more extensive. An application scenario of image analysis and processing technology is to analyze images taken by cameras installed on roads. For example, it is possible to analyze images including vehicles taken by cameras installed on roads to determine whether the vehicles have illegal driving behaviors. Another example is to analyze images including vehicles captured by cameras installed on roads, to track the itinerary of target users, such as criminal suspects, and so on.
在实际应用中,对道路上安装的摄像机拍摄的图像进行分析时,确定摄像机的位置也很重要,因为在实际应用中可能需要结合摄像机的位置进行进一步的分析。例如,根据摄像机拍摄的图像确定出车辆存在违规驾驶行为之后,还可以结合拍摄该图像的摄像机的位置,进一步确定车辆发生违规驾驶行为的位置。又如,对目标用户的行程进行追踪时,可以结合摄像机的位置确定该目标用户驾驶的车辆所处的位置,从而确定该目标用户所处的位置。In practical applications, when analyzing images taken by cameras installed on roads, it is also important to determine the location of the cameras, because in practical applications it may be necessary to perform further analysis in conjunction with the location of the cameras. For example, after it is determined that the vehicle has an illegal driving behavior based on the image taken by the camera, the position of the camera that took the image can be combined to further determine the location of the vehicle's illegal driving behavior. For another example, when tracking the itinerary of the target user, the location of the vehicle driven by the target user can be determined in combination with the position of the camera, so as to determine the location of the target user.
但是在传统技术中,摄像机的位置往往不是很准确,进一步地导致结合摄像机的位置进行进一步分析得到的结果也不准确。因此,急需一种方案,能够准确的确定出摄像机的位置。However, in traditional technology, the position of the camera is often not very accurate, which further leads to inaccurate results obtained by further analysis combined with the position of the camera. Therefore, there is an urgent need for a solution that can accurately determine the location of the camera.
发明内容Summary of the invention
本申请实施例提供了一种摄像机位置的确定方法及装置,可以解决传统技术中摄像机的位置不准确的问题。The embodiments of the present application provide a method and device for determining the position of a camera, which can solve the problem of inaccurate position of the camera in the traditional technology.
第一方面,本申请实施例提供了一种摄像机位置的确定方法,考虑到在实际应用中,一方面,有一类车辆具备时空轨迹数据上报功能,其上报的时空轨迹数据可以认为是准确的数据。另一方面,摄像机拍摄车辆时,摄像机和车辆之间的空间位置关系是可以确定的。故而在本申请实施例中,可以利用具备时空轨迹数据上报功能的第一车辆的时空轨迹数据,以及摄像机拍摄包括第一车辆的第一图像的拍摄时刻第一车辆所处的第一位置,确定摄像机的位置。为方便描述,将“摄像机的地理坐标的位置”称为“第二位置”。具体地,在本申请实施例中,可以获取摄像机拍摄的包括第一车辆的第一图像,并确定第一图像的拍摄时刻。以及,获取第一车辆的时空轨迹数据,并根据第一车辆的时空轨迹数据确定第一车辆在第一图像的拍摄时刻所处的第一位置。并获取第一位置和第二位置的空间位置关系,而后,根据第一位置和第二位置之间的空间位置关系,确定第二位置。由于第一车辆的时空轨迹数据是准确的,因此,第一车辆在第一图像的拍摄时刻所处的第一位置是准确的,而第一位置和第二位置的空间位置关系的准确度也比较高,因此,所确定出的第二位置的准确性也比较高。故而利用本申请实施例提供的方案,可以准确的确定出摄像机的地理坐标的位置。In the first aspect, the embodiments of the present application provide a method for determining the position of the camera. Considering that in practical applications, on the one hand, there is a type of vehicle with spatio-temporal trajectory data reporting function, and the reported spatio-temporal trajectory data can be considered as accurate data. . On the other hand, when a camera shoots a vehicle, the spatial position relationship between the camera and the vehicle can be determined. Therefore, in the embodiment of the present application, the spatiotemporal trajectory data of the first vehicle with the spatiotemporal trajectory data reporting function, and the first position of the first vehicle at the time when the camera captures the first image including the first vehicle can be used to determine The location of the camera. For the convenience of description, the “position of the geographic coordinates of the camera” is referred to as the “second position”. Specifically, in the embodiment of the present application, the first image including the first vehicle captured by the camera may be acquired, and the shooting moment of the first image may be determined. And, acquiring the spatiotemporal trajectory data of the first vehicle, and determining the first position of the first vehicle at the shooting moment of the first image according to the spatiotemporal trajectory data of the first vehicle. And obtain the spatial position relationship between the first position and the second position, and then determine the second position according to the spatial position relationship between the first position and the second position. Since the spatio-temporal trajectory data of the first vehicle is accurate, the first position of the first vehicle at the moment of taking the first image is accurate, and the accuracy of the spatial position relationship between the first position and the second position is also accurate. It is relatively high, and therefore, the accuracy of the determined second position is also relatively high. Therefore, by using the solution provided by the embodiment of the present application, the location of the geographic coordinates of the camera can be accurately determined.
在一种可能的实现方式中,第一位置和第二位置的空间位置关系,第一位置和第二位置的空间位置关系,可以包括第一位置和第二位置之间的距离;第一位置和第二位置的空间位置关系,可以包括第一位置和第二位置之间的相对方向;当然,第一位置和第二位置的空间位置关系,可以既包括第一位置和第二位置之间的距离,又包括第一位置和第二位 置之间的相对方向。获取第一位置和第二位置的空间位置关系之后,可以基于第一位置、以及第一位置和第二位置的空间位置关系,确定第二位置。In a possible implementation, the spatial position relationship between the first position and the second position, and the spatial position relationship between the first position and the second position may include the distance between the first position and the second position; the first position The spatial position relationship with the second position may include the relative direction between the first position and the second position; of course, the spatial position relationship between the first position and the second position may include both the first position and the second position The distance includes the relative direction between the first position and the second position. After obtaining the spatial position relationship between the first position and the second position, the second position may be determined based on the first position and the spatial position relationship between the first position and the second position.
在一种可能的实现方式中,考虑到在实际应用中,第一车辆上的目标对象在摄像机拍摄的第一图像中的位置,在一定程度上可以体现摄像机拍摄该第一图像时,该第一车辆所处的第一位置与摄像机的地理坐标的位置之间的距离。即第一车辆上的目标对象在摄像机拍摄的第一图像中的位置,在一定程度上可以体现第一位置和第二位置之间的距离。因此,在本申请实施例的一种实现方式中,可以根据第一图像确定第一车辆上的目标对象在第一图像中的位置,进一步地,基于所获得的该目标对象在第一图像中的位置,确定第一位置与第二位置之间的距离。In a possible implementation manner, considering that in actual applications, the position of the target object on the first vehicle in the first image captured by the camera can reflect to a certain extent that the first image is captured by the camera. The distance between the first position where a vehicle is located and the geographic coordinates of the camera. That is, the position of the target object on the first vehicle in the first image captured by the camera can reflect the distance between the first position and the second position to a certain extent. Therefore, in an implementation manner of the embodiment of the present application, the position of the target object on the first vehicle in the first image can be determined according to the first image, and further, based on the obtained target object in the first image The position to determine the distance between the first position and the second position.
在一种可能的实现方式中,考虑到在实际应用中,摄像机在安装时是具备安装方向的,摄像机的安装方向在一定程度上决定了摄像机的拍摄方向。对于在道路上行驶的第一车辆而言,摄像机的拍摄方向,决定了第一车辆在行驶过程中,是由第一位置驶向第二位置所在的方向,还是由第二位置所在的方向驶向第一位置。即可以根据第一车辆的行驶方向和摄像机的拍摄方向,确定第一位置和第二位置之间的相对方向。故而在本申请实施例的一种实现方式中,可以根据第一车辆的时空轨迹数据,确定第一车辆的行驶方向,并确定摄像机的拍摄方向,而后根据第一车辆的行驶方向和摄像机的拍摄方向,确定所述第一位置和所述第二位置之间的相对方向。In a possible implementation manner, considering that in actual applications, the camera has an installation direction during installation, and the installation direction of the camera determines the shooting direction of the camera to a certain extent. For the first vehicle driving on the road, the shooting direction of the camera determines whether the first vehicle is driving from the first position to the direction of the second position, or from the direction of the second position. To the first position. That is, the relative direction between the first position and the second position can be determined according to the driving direction of the first vehicle and the shooting direction of the camera. Therefore, in an implementation of the embodiment of the present application, the traveling direction of the first vehicle can be determined according to the spatio-temporal trajectory data of the first vehicle, and the shooting direction of the camera can be determined, and then according to the traveling direction of the first vehicle and the shooting of the camera The direction determines the relative direction between the first position and the second position.
在一种可能的实现方式中,第一位置和第二位置的空间位置关系,可以体现为第一位置和第二位置之间的距离,对于这种情况,可以根据第一位置,第一位置和第二位置之间的距离,确定第二位置。具体地,可以根据第一图像确定目标对象在第一图像中的位置,并根据所获得的目标对象在第一图像中的位置,确定第一位置与第二位置之间的距离;而后根据第一图像确定目标对象在第一图像中的位置,并根据所获得的目标对象在第一图像中的位置,确定第一位置与第二位置之间的距离。具体而言可以是:根据第一车辆的时空轨迹数据,确定第一车辆的行驶轨迹,并根据第一位置与第二位置之间的距离、第一位置以及第一车辆的行驶轨迹,确定第二位置。In a possible implementation manner, the spatial position relationship between the first position and the second position can be embodied as the distance between the first position and the second position. In this case, it can be based on the first position and the first position. The distance between the second position and the second position determines the second position. Specifically, the position of the target object in the first image may be determined according to the first image, and the distance between the first position and the second position may be determined according to the obtained position of the target object in the first image; and then according to the first image An image determines the position of the target object in the first image, and the distance between the first position and the second position is determined according to the obtained position of the target object in the first image. Specifically, it may be: determine the travel trajectory of the first vehicle according to the spatiotemporal trajectory data of the first vehicle, and determine the first vehicle’s travel trajectory according to the distance between the first position and the second position, the first position and the travel trajectory of the first vehicle Two positions.
在一种可能的实现方式中,为了进一步提升所确定的第二位置的准确性,还可以进一步结合第一位置和第二位置之间的相对方向,确定第二位置。具体地,可以根据第一车辆的时空轨迹数据,确定第一车辆的行驶方向;并确定摄像机的拍摄方向。而后根据第一车辆的行驶方向和摄像机的拍摄方向,确定第一位置和第二位置之间的相对方向。最后根据第一位置和第二位置之间的相对方向、第一位置、以及第一位置和第二位置之间的距离,确定第二位置。In a possible implementation manner, in order to further improve the accuracy of the determined second position, the second position may be further determined in combination with the relative direction between the first position and the second position. Specifically, the traveling direction of the first vehicle can be determined according to the spatiotemporal trajectory data of the first vehicle; and the shooting direction of the camera can be determined. Then, according to the driving direction of the first vehicle and the shooting direction of the camera, the relative direction between the first position and the second position is determined. Finally, the second position is determined according to the relative direction between the first position and the second position, the first position, and the distance between the first position and the second position.
在一种可能的实现方式中,根据目标对象在第一图像中的位置,确定第一位置和第二位置之间的距离在具体实现时,可以预先确定位置与距离之间的映射关系,获取与目标对象在第一图像中的位置所对应的距离,而后,将利用该映射关系所获得的距离,确定为第一位置与第二位置之间的距离。本申请实施例不具体限定前述预先确定的位置与距离之间的映射关系,该预先确定的位置与距离之间的映射关系,至少包括目标对象在第一图像中的位置、与第二位置与第一位置之间的距离之间的映射关系。In a possible implementation manner, according to the position of the target object in the first image, the distance between the first position and the second position is determined. In a specific implementation, the mapping relationship between the position and the distance can be predetermined to obtain The distance corresponding to the position of the target object in the first image, and then the distance obtained by using the mapping relationship is determined as the distance between the first position and the second position. The embodiment of the present application does not specifically limit the foregoing predetermined mapping relationship between the position and the distance. The predetermined mapping relationship between the position and the distance includes at least the position of the target object in the first image, and the second position and The mapping relationship between the distances between the first positions.
在一种可能的实现方式中,考虑到在实际应用中,摄像机的拍摄视野是有限的,换言之,摄像机所能拍摄到的最远的物体的位置,与第二位置之间的距离也不会很远。因此, 在本申请实施例的又一种实现方式中,可以将第一位置确定为第二位置,即将摄像机拍摄第一图像时,第一车辆所处的位置,确定为摄像机的地理坐标的位置。这种做法简洁、高效,但是可能造成精度偏低。In a possible implementation, considering that in practical applications, the camera’s shooting field of view is limited. In other words, the distance between the farthest object that the camera can shoot and the second position will not be far away. Therefore, in another implementation manner of the embodiment of the present application, the first position may be determined as the second position, that is, the position of the first vehicle when the camera shoots the first image is determined as the geographic coordinate position of the camera. . This approach is simple and efficient, but it may cause low accuracy.
在一种可能的实现方式中,考虑到在实际应用中,摄像机拍摄的图像中包括的车辆有很多,除了前述第一车辆之外,还可能包括第二车辆、第三车辆等等,而并非所有的车辆均为具备时空数据上报功能的车辆。在本申请的一种实现方式中,获取到摄像机拍摄的第一图像之后,还可以进一步确定第一图像中包括的第一车辆是否为具备时空数据上报的车辆。具体地,在本年申请实施例中,可以对第一图像进行分析,识别出第一车辆的车牌号。然后将第一车辆的车牌号与具备时空轨迹数据上报功能的车辆的车牌号进行匹配,若匹配成功,即当确定具备时空轨迹数据上报功能的车辆的车牌号中,包括前述第一车辆的车牌号时,则可以确定第一车辆为具备时空轨迹数据上报功能的车辆。In a possible implementation manner, considering that in practical applications, the images captured by the camera include many vehicles, in addition to the aforementioned first vehicle, it may also include a second vehicle, a third vehicle, etc., instead of All vehicles are vehicles with spatio-temporal data reporting functions. In an implementation manner of the present application, after acquiring the first image taken by the camera, it may be further determined whether the first vehicle included in the first image is a vehicle with spatiotemporal data reporting. Specifically, in this year's application embodiment, the first image can be analyzed to identify the license plate number of the first vehicle. Then match the license plate number of the first vehicle with the license plate number of the vehicle with spatiotemporal trajectory data reporting function. If the matching is successful, it is determined that the license plate number of the vehicle with spatiotemporal trajectory data reporting function includes the license plate of the aforementioned first vehicle When the number is displayed, it can be determined that the first vehicle is a vehicle with the function of reporting spatiotemporal trajectory data.
在一种可能的实现方式中,考虑到在实际应用中,各个类型的车辆虽然车身大小等有所区别,但是车牌的大小的区别不大,相应的车标的大小的区别也不大。而且,车牌和车标在车身上所处的位置也相对比较固定。因此,对于位于第一位置的不同车辆,摄像机拍摄的包括这些不同车辆的多个图像中,这些不同车辆的车牌或者车标在包含该车辆的图像中的位置,可以认为是比较接近的。因此,在本申请实施例中,前述第一车辆上的目标对象可以为第一车辆上的车牌或者第一车辆上的车标。In a possible implementation manner, considering that in practical applications, although the size of the body of each type of vehicle is different, the difference in the size of the license plate is not large, and the difference in the size of the corresponding vehicle logo is not large. Moreover, the position of the license plate and vehicle logo on the car body is relatively fixed. Therefore, for different vehicles located at the first position, the positions of the license plates or logos of these different vehicles in the images containing the vehicles in the multiple images captured by the camera including these different vehicles can be considered to be relatively close. Therefore, in the embodiment of the present application, the aforementioned target object on the first vehicle may be the license plate on the first vehicle or the vehicle logo on the first vehicle.
第二方面,本申请实施例提供了一种摄像机位置的确定装置,所述装置包括:第一获取单元,用于获取摄像机拍摄的包括第一车辆的第一图像;第一确定单元,用于确定所述第一图像的拍摄时刻;第二获取单元,用于获取所述第一车辆的时空轨迹数据;第二确定单元,用于根据所述第一车辆的时空轨迹数据确定所述第一车辆在所述拍摄时刻所处的第一位置;第三获取单元,用于获取所述第一位置和第二位置的空间位置关系,所述第二位置为所述摄像机的地理坐标的位置;第三确定单元,用于根据所述第一位置、所述第一位置和第二位置的空间位置关系,确定所述第二位置。In a second aspect, an embodiment of the present application provides a device for determining the position of a camera. The device includes: a first acquiring unit configured to acquire a first image captured by the camera including a first vehicle; and a first determining unit configured to Determine the shooting moment of the first image; a second acquisition unit for acquiring spatio-temporal trajectory data of the first vehicle; a second determination unit for determining the first vehicle's spatiotemporal trajectory data The first position of the vehicle at the shooting moment; a third acquisition unit, configured to acquire the spatial position relationship between the first position and the second position, and the second position is the position of the geographic coordinates of the camera; The third determining unit is configured to determine the second position according to the first position, the spatial position relationship between the first position and the second position.
在一种可能的实现方式中,所述第一位置和第二位置的空间位置关系,包括:所述第一位置和所述第二位置之间的距离,和/或,所述第一位置和所述第二位置之间的相对方向。In a possible implementation manner, the spatial position relationship between the first position and the second position includes: the distance between the first position and the second position, and/or the first position And the relative direction between the second position.
在一种可能的实现方式中,所述第一位置和所述第二位置之间的距离,通过如下方式确定:根据所述第一图像确定目标对象在所述第一图像中的位置,并根据所确定的所述目标对象在所述第一图像中的位置,确定所述第一位置与第二位置之间的距离;所述目标对象位于所述第一车辆。In a possible implementation manner, the distance between the first position and the second position is determined by determining the position of the target object in the first image according to the first image, and According to the determined position of the target object in the first image, the distance between the first position and the second position is determined; the target object is located in the first vehicle.
在一种可能的实现方式中,所述第一位置和所述第二位置之间的相对方向,通过如下方式确定:根据所述第一车辆的时空轨迹数据,确定所述第一车辆的行驶方向;以及确定所述摄像机的拍摄方向;根据所述第一车辆的行驶方向和所述摄像机的拍摄方向,确定所述第一位置和所述第二位置之间的相对方向;所述摄像机的拍摄方向,与所述第一车辆的行驶方向一致或者与所述第一车辆的行驶方向的逆方向一致。In a possible implementation manner, the relative direction between the first position and the second position is determined in the following manner: determining the travel of the first vehicle according to the spatiotemporal trajectory data of the first vehicle Direction; and determining the shooting direction of the camera; determining the relative direction between the first position and the second position according to the driving direction of the first vehicle and the shooting direction of the camera; The shooting direction is consistent with the traveling direction of the first vehicle or coincides with the reverse direction of the traveling direction of the first vehicle.
在一种可能的实现方式中,所述第三确定单元,包括:第一确定子单元,用于根据所述第一图像确定目标对象在所述第一图像中的位置;所述目标对象位于所述第一车辆;In a possible implementation manner, the third determining unit includes: a first determining subunit, configured to determine the position of the target object in the first image according to the first image; the target object is located The first vehicle;
第二确定子单元,用于根据所获得的所述目标对象在所述第一图像中的位置,确定所述第一位置与第二位置之间的距离;第三确定子单元,用于根据所述第一车辆的时空轨迹 数据、所述距离以及所述第一位置,确定所述第二位置。The second determining subunit is used to determine the distance between the first position and the second position according to the obtained position of the target object in the first image; the third determining subunit is used to determine the distance between the first position and the second position according to the obtained position of the target object in the first image; The space-time trajectory data of the first vehicle, the distance, and the first position determine the second position.
在一种可能的实现方式中,所述第三确定子单元,具体用于:根据所述第一车辆的时空轨迹数据,确定所述第一车辆的行驶方向;并确定所述摄像机的拍摄方向;所述摄像机的拍摄方向,与所述第一车辆的行驶方向一致或者与所述第一车辆的行驶方向的逆方向一致;根据所述第一车辆的行驶方向和所述摄像机的拍摄方向,确定所述第一位置和所述第二位置之间的相对方向;根据所述第一位置和所述第二位置之间的相对方向、所述第一位置和所述距离,确定所述第二位置。In a possible implementation manner, the third determining subunit is specifically configured to: determine the traveling direction of the first vehicle according to the spatiotemporal trajectory data of the first vehicle; and determine the shooting direction of the camera The shooting direction of the camera is consistent with the driving direction of the first vehicle or the opposite direction to the driving direction of the first vehicle; according to the driving direction of the first vehicle and the shooting direction of the camera, Determine the relative direction between the first position and the second position; determine the first position according to the relative direction between the first position and the second position, the first position and the distance Two positions.
在一种可能的实现方式中,所述第二确定子单元,具体用于:根据预先确定的位置与距离之间的映射关系,获得与所述目标对象在所述第一图像中的位置对应的距离,将获得的所述距离确定为所述第一位置与所述第二位置之间的距离;所述预先确定的位置与距离之间的映射关系,包括所述目标对象在所述第一图像中的位置、与所述第二位置与所述第一位置之间的距离之间的映射关系。In a possible implementation manner, the second determining subunit is specifically configured to: obtain a position corresponding to the target object in the first image according to a predetermined mapping relationship between a position and a distance The obtained distance is determined as the distance between the first position and the second position; the mapping relationship between the predetermined position and the distance includes that the target object is in the first position A mapping relationship between a position in an image and the distance between the second position and the first position.
在一种可能的实现方式中,所述第三确定单元,具体用于:将所述第一位置确定为所述第二位置。In a possible implementation manner, the third determining unit is specifically configured to determine the first position as the second position.
在一种可能的实现方式中,所述装置还包括:图像分析单元,用于对所述第一图像进行分析,识别出所述第一车辆的车牌号;第四确定单元,用于将所述第一车辆的车牌号与具备时空轨迹数据上报功能的车辆的车牌号进行匹配,若匹配成功,则确定所述第一车辆为具备时空轨迹数据上报功能的车辆。In a possible implementation manner, the device further includes: an image analysis unit, configured to analyze the first image, and identify the license plate number of the first vehicle; and a fourth determining unit, configured to compare all The license plate number of the first vehicle is matched with the license plate number of the vehicle with the spatiotemporal trajectory data reporting function. If the matching is successful, it is determined that the first vehicle is a vehicle with the spatiotemporal trajectory data reporting function.
在一种可能的实现方式中,所述目标对象,包括:车牌,或者,车标。In a possible implementation manner, the target object includes: a license plate or a vehicle logo.
第三方面,本申请实施例提供了一种摄像机位置的确定设备,所述设备包括:处理器和存储器;所述存储器,用于存储指令;所述处理器,用于执行所述存储器中的所述指令,执行以上第一方面任意一项所述的方法。In a third aspect, an embodiment of the present application provides a device for determining the position of a camera. The device includes: a processor and a memory; the memory is configured to store instructions; and the processor is configured to execute The instruction executes the method described in any one of the first aspect above.
第四方面,本申请实施例提供了一种计算机可读存储介质,包括指令,当其在计算机上运行时,使得计算机执行以上第一方面任意一项所述的方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, including instructions, which when run on a computer, cause the computer to execute the method described in any one of the first aspects above.
第五方面,本申请实施例提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行以上第一方面任意一项所述的方法。In the fifth aspect, the embodiments of the present application provide a computer program product containing instructions, which when run on a computer, cause the computer to execute the method described in any one of the above first aspect.
第六方面,本申请实施例提供一种摄像机位置的确定设备,其特征在于,所述设备包括:处理器和接口;所述处理器和所述接口通信,所述处理器用于通过所述接口接收数据,通过运行程序指令执行以上第一方面任意一项所述的方法。In a sixth aspect, an embodiment of the present application provides a device for determining the position of a camera, wherein the device includes: a processor and an interface; the processor communicates with the interface, and the processor is configured to communicate through the interface The data is received, and the method described in any one of the first aspect is executed by running the program instructions.
附图说明Description of the drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly describe the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments described in this application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work.
图1为本申请实施例提供的一种摄像机位置的确定方法的流程示意图;FIG. 1 is a schematic flowchart of a method for determining a camera position according to an embodiment of the application;
图2为本申请实施例提供的一种确定第二位置的方法的流程示意图;2 is a schematic flowchart of a method for determining a second location according to an embodiment of this application;
图3为本申请实施例提供的又一种确定第二位置的方法的流程示意图;FIG. 3 is a schematic flowchart of another method for determining a second location provided by an embodiment of this application;
图4为本申请实施例提供的一种第一车辆的行驶轨迹的示意图;4 is a schematic diagram of a driving track of a first vehicle according to an embodiment of the application;
图5为本申请实施例提供的又一种第一车辆的行驶轨迹的示意图;FIG. 5 is a schematic diagram of another driving trajectory of a first vehicle according to an embodiment of the application;
图6为本申请实施例提供的一种摄像机位置的确定装置的结构示意图;FIG. 6 is a schematic structural diagram of a device for determining the position of a camera provided by an embodiment of the application;
图7为本申请实施例提供的一种摄像机位置的确定设备的结构示意图。FIG. 7 is a schematic structural diagram of a device for determining the position of a camera provided by an embodiment of the application.
具体实施方式detailed description
本申请实施例提供了一种摄像机位置的确定方法,用于解决传统技术中摄像机的位置不是很准确的问题。The embodiment of the present application provides a method for determining the position of the camera, which is used to solve the problem that the position of the camera in the traditional technology is not very accurate.
在实际应用中,确定道路上安装的摄像机的位置十分重要。但是在传统技术中,所确定的摄像机的位置不准确。因为,在传统技术中,对于摄像机位置大多采用“**路”这种描述方式。而“**路”这种描述本身所体现的是一个区域范围,而不是一个具体位置,因此,采用这种方式描述的摄像机的位置不是很准确。另外,在实际应用中,存在一些对描述摄像机的位置的数据进行传输交换的过程,例如,相关管理部门的系统更新,导致描述摄像机的位置的数据在进行传输交换的过程中发生了错误,从而使得摄像机的位置不准确。In practical applications, it is very important to determine the location of the camera installed on the road. However, in the traditional technology, the determined position of the camera is not accurate. Because, in traditional technology, most of the camera positions are described by "** road". The description of "** road" itself reflects an area range, not a specific location. Therefore, the location of the camera described in this way is not very accurate. In addition, in actual applications, there are some processes for the transmission and exchange of data describing the location of the camera. For example, the system update of the relevant management department leads to errors in the transmission and exchange of the data describing the location of the camera. Make the position of the camera inaccurate.
鉴于此,本申请实施例提供了一种摄像机位置的确定方法,用于准确的确定摄像机的位置。以下结合附图介绍本申请实施例提供的摄像机位置的确定方法。In view of this, the embodiment of the present application provides a method for determining the position of a camera, which is used to accurately determine the position of the camera. The following describes the method for determining the position of the camera provided in the embodiments of the present application in conjunction with the accompanying drawings.
具体地,在本申请实施例中,考虑到在实际应用中,一方面,有一类车辆具备时空轨迹数据上报功能,其上报的时空轨迹数据可以认为是准确的数据。另一方面,当具备时空轨迹数据上报功能的车辆经过摄像机附近时,摄像机可以拍摄包括该具备时空轨迹数据上报功能的车辆的图像,而摄像机拍摄包括该图像时,摄像机和该具备时空轨迹数据上报功能的车辆之间的空间位置关系是可以确定的。因此,若利用摄像机拍摄具备时空轨迹上报功能的车辆的图像、以及该“具备时空轨迹上报功能的车辆所处的位置”与“摄像机的地理坐标的位置”的空间位置关系,则可以准确的确定出摄像机的位置。具体地,可以获取摄像机拍摄的包括具备时空轨迹上报功能的车辆的图像;而后确定该图像的拍摄时刻,进一步地,利用该具备时空轨迹数据上报功能的车辆的时空轨迹数据,确定该具备时空轨迹数据上报功能的车辆在前述拍摄时刻所处的位置。并获取该“具备时空轨迹上报功能的车辆所处的位置”与“摄像机的地理坐标的位置”的空间位置关系,最后基于具备时空轨迹上报功能的车辆所处的位置,以及所确定的空间位置关系,确定出摄像机的地理坐标的位置。Specifically, in the embodiments of the present application, considering that in practical applications, on the one hand, there is a type of vehicle with a spatiotemporal trajectory data reporting function, and the spatiotemporal trajectory data reported can be considered as accurate data. On the other hand, when a vehicle with the spatio-temporal trajectory data reporting function passes near the camera, the camera can capture images including the spatio-temporal trajectory data reporting function, and when the camera captures the image, the camera and the spatio-temporal trajectory data report The spatial position relationship between functional vehicles can be determined. Therefore, if a camera is used to capture images of a vehicle with spatiotemporal trajectory reporting function, and the spatial position relationship between the "location of the vehicle with spatiotemporal trajectory reporting function" and "the location of the camera's geographic coordinates", it can be accurately determined The location of the camera. Specifically, an image of a vehicle with a spatiotemporal trajectory report function can be acquired by the camera; then the time when the image was taken is determined, and further, the spatiotemporal trajectory data of the vehicle with the spatiotemporal trajectory data report function is used to determine the spatiotemporal trajectory The location of the vehicle with the data reporting function at the aforementioned shooting moment. And obtain the spatial position relationship between the "position of the vehicle with spatiotemporal trajectory reporting function" and the "location of the geographic coordinates of the camera", and finally based on the location of the vehicle with spatiotemporal trajectory reporting function and the determined spatial position Relationship, determine the location of the geographic coordinates of the camera.
以下对本申请实施例提供的摄像机位置的确定方法进行详细介绍。The method for determining the position of the camera provided by the embodiment of the present application will be described in detail below.
参见图1,该图为本申请实施例提供的一种摄像机位置的确定方法的流程示意图。Refer to FIG. 1, which is a schematic flowchart of a method for determining a camera position according to an embodiment of the application.
本申请实施例提供的摄像机位置的确定方法,可以由服务器执行。本申请实施例对该服务器不做具体限定,该服务器可以为用于确定摄像机的位置的专用服务器,该服务器也可以为还具备其它数据处理功能的通用服务器。The method for determining the position of the camera provided in the embodiment of the present application may be executed by a server. The embodiment of the present application does not specifically limit the server. The server may be a dedicated server for determining the position of the camera, or the server may be a general-purpose server that also has other data processing functions.
图1所示的摄像机位置的确定方法,例如可以通过如下步骤101-104实现。The method for determining the position of the camera shown in FIG. 1 may be implemented through the following steps 101-104, for example.
步骤101:获取摄像机拍摄的包括第一车辆的第一图像,并确定第一图像的拍摄时刻。Step 101: Acquire a first image including a first vehicle captured by a camera, and determine a shooting moment of the first image.
在本申请实施例中,第一车辆为具备时空轨迹数据上报功能的车辆。时空轨迹数据,至少包括时间和空间两个维度的数据。第一车辆的时空轨迹数据,为描述第一车辆在某一时刻所处的位置的数据。具体地,第一车辆上可以配置有定位装置,该定位装置用于实时确定第一车辆所处的位置,第一车辆可以将第一车辆所处的位置以及第一车辆处于该位置时对应的时刻进行上报。其中,第一车辆所处的位置可以用第一车辆所处的位置的地理坐标例如经纬度来描述。本申请实施例不具体限定第一车辆的类型。考虑到在实际应用中, 为了保证乘客安全以及对驾驶人员进行监控。一些货车、出租车、网约车(例如滴滴、Uber)上均配置有定位装置。因此,在本申请实施例的一种实现方式中,前述第一车辆可以为网约车车辆。考虑到在实际应用中,有一些车辆是专门用于位置校准的,这些车辆上也配置有定位装置。因此,在本申请实施例的又一种实现方式中,前述第一车辆也可以为专门用于位置校准的车辆。In the embodiment of the present application, the first vehicle is a vehicle with a spatiotemporal trajectory data reporting function. Spatio-temporal trajectory data includes at least two dimensions of time and space data. The spatio-temporal trajectory data of the first vehicle is data describing the position of the first vehicle at a certain moment. Specifically, the first vehicle may be equipped with a positioning device, which is used to determine the position of the first vehicle in real time, and the first vehicle may determine the position of the first vehicle and the corresponding position when the first vehicle is at that position. Report at all times. Wherein, the location of the first vehicle may be described by the geographic coordinates of the location of the first vehicle, such as latitude and longitude. The embodiment of the present application does not specifically limit the type of the first vehicle. Considering that in practical applications, in order to ensure the safety of passengers and monitor the driver. Some trucks, taxis, and online taxis (such as Didi and Uber) are equipped with positioning devices. Therefore, in an implementation manner of the embodiment of the present application, the aforementioned first vehicle may be a car-hailing vehicle. Considering that in practical applications, some vehicles are specially used for position calibration, and these vehicles are also equipped with positioning devices. Therefore, in another implementation manner of the embodiment of the present application, the aforementioned first vehicle may also be a vehicle specifically used for position calibration.
需要说明的是,前述提及的第一车辆上的定位装置可以是固定于第一车辆上的定位装置,也可以是移动定位装置,例如具备定位功能的移动终端等等,本申请实施例不作具体限定。相应的,对第一车辆的时空轨迹数据进行上报的设备,可以是固定于第一车辆上的设备,也可以是移动设备,例如移动终端等等,本申请实施例也不做具体限定。It should be noted that the aforementioned positioning device on the first vehicle may be a positioning device fixed on the first vehicle, or a mobile positioning device, such as a mobile terminal with positioning function. Specific restrictions. Correspondingly, the device that reports the spatiotemporal trajectory data of the first vehicle may be a device fixed on the first vehicle, or a mobile device, such as a mobile terminal, etc., which is not specifically limited in the embodiment of the present application.
可以理解的是,在实际应用中,摄像机会录制视频图像或者在有车辆经过时抓拍对应的图像,并将录制的视频图像或者抓拍的图像上传至对应的服务器。例如,对于安装在道路上的摄像机而言,摄像机会录制对应道路的视频图像或者抓拍有车辆经过时的图像,并将录制的视频图像以及抓拍的图像上报给相关管理部门例如交管部门的服务器。因此,在本申请实施例中,步骤101在具体实现时,例如可以从相关管理部门例如交管部门的服务器中获取该第一图像。It is understandable that in practical applications, the camera will record a video image or capture a corresponding image when a vehicle passes by, and upload the recorded video image or the captured image to the corresponding server. For example, for a camera installed on a road, the camera will record a video image corresponding to the road or capture an image when a vehicle passes by, and report the recorded video image and the captured image to the relevant management department, such as the server of the traffic control department. Therefore, in the embodiment of the present application, when step 101 is specifically implemented, for example, the first image may be obtained from a server of a related management department, such as a traffic management department.
获取到摄像机拍摄的包括第一车辆的第一图像之后,可以进一步确定第一图像的拍摄时刻。在本申请实施例中,考虑到在实际应用中,摄像机上报的视频中,携带有时间信息,因此,可以根据前述交管部门的服务器中获取的视频,确定第一图像的拍摄时刻。After the first image including the first vehicle captured by the camera is acquired, the shooting moment of the first image may be further determined. In the embodiment of the present application, considering that in actual applications, the video reported by the camera carries time information, therefore, the shooting time of the first image can be determined according to the video obtained from the server of the traffic control department.
步骤102:获取第一车辆的时空轨迹数据,并根据第一车辆的时空轨迹数据确定第一车辆在第一图像的拍摄时刻所处的第一位置。Step 102: Obtain spatiotemporal trajectory data of the first vehicle, and determine the first position of the first vehicle at the shooting moment of the first image according to the spatiotemporal trajectory data of the first vehicle.
如前文所述,第一车辆的时空轨迹数据,为描述第一车辆在某一时刻所处的位置的数据。第一车辆可以将第一车辆所处的位置以及第一车辆处于该位置时对应的时刻进行上报,在本申请实施例中,可以从存储第一车辆的时空轨迹数据的设备中获取前述第一车辆上报的时空轨迹数据,例如,从存储第一车辆的时空轨迹数据的服务器中获取第一车辆的时空轨迹数据。当确定第一图像的拍摄时刻之后,即可从第一车辆的时空轨迹数据中,确定出与第一图像的拍摄时刻匹配的目标时刻,并将该目标时刻对应的第一车辆所处的位置,确定为前述第一位置。As mentioned above, the spatiotemporal trajectory data of the first vehicle is data describing the position of the first vehicle at a certain moment. The first vehicle may report the position of the first vehicle and the corresponding time when the first vehicle is at that position. In the embodiment of the present application, the aforementioned first vehicle may be obtained from a device that stores spatiotemporal trajectory data of the first vehicle. For the spatiotemporal trajectory data reported by the vehicle, for example, the spatiotemporal trajectory data of the first vehicle is acquired from a server that stores the spatiotemporal trajectory data of the first vehicle. After the shooting time of the first image is determined, the target time matching the shooting time of the first image can be determined from the spatio-temporal trajectory data of the first vehicle, and the location of the first vehicle corresponding to the target time , Determined as the aforementioned first position.
关于前述目标时刻,需要说明的是,在本申请实施例中,前述与第一图像的拍摄时刻匹配的目标时刻,可以等于第一图像的拍摄时刻,可以理解的是,当目标时刻等于第一图像的拍摄时刻时,所确定的第一位置可以认为是准确无误的。Regarding the aforementioned target time, it should be noted that, in the embodiment of the present application, the aforementioned target time matched with the shooting time of the first image may be equal to the shooting time of the first image. It is understandable that when the target time is equal to the first image At the moment when the image is taken, the determined first position can be considered accurate.
在本申请实施例的又一种实现方式中,考虑到在实际应用中,出于节省第一车辆上报时空轨迹数据所占用的带宽等原因,第一车辆并非将每一个时刻与每一个时刻对应的位置均进行上报,而是按照预设时间周期将自身的位置以及第一车辆处于该位置时对应的时刻进行上报,或者基于管理员的请求进行上报。因此,前述第一车辆的时空轨迹数据中,可能包括第一图像的拍摄时刻,也可能并不包括第一图像的拍摄时刻。在不包括第一图像的拍摄时刻的情况下,确定第一车辆在第一图像的拍摄时刻所处的位置可以有多种实现方式。以下介绍两种可能的实现方式。In yet another implementation manner of the embodiment of the present application, considering that in practical applications, for reasons such as saving the bandwidth occupied by the first vehicle reporting spatio-temporal trajectory data, the first vehicle does not correspond to every moment. Report all the positions, but report its own position and the corresponding time when the first vehicle is at that position according to a preset time period, or report based on the request of the administrator. Therefore, the aforementioned spatiotemporal trajectory data of the first vehicle may or may not include the shooting time of the first image. In the case where the shooting moment of the first image is not included, there may be multiple implementation manners for determining the position of the first vehicle at the shooting moment of the first image. Two possible implementation methods are described below.
在一种实现方式中,可以将前述时空轨迹数据中与第一图像的拍摄时刻最近的时刻,确定为目标时刻。因为在实际应用中,为了保证第一车辆的时空轨迹数据的完整性,前述 预设时间周期即第一车辆的时空位置的采样周期一般不会太长。因此,若将时空轨迹数据中与第一图像的拍摄时刻最近的时刻,确定为目标时刻,第一车辆在第一图像的拍摄时刻所处的位置,与目标时刻第一车辆所处的位置之间的差距应该不是很大。因此,将前述时空轨迹数据中与第一图像的拍摄时刻最近的时刻,确定为目标时刻所确定的第一位置,也可以认为是比较准确的。In an implementation manner, the time closest to the shooting time of the first image in the aforementioned spatiotemporal trajectory data may be determined as the target time. Because in practical applications, in order to ensure the integrity of the spatiotemporal trajectory data of the first vehicle, the aforementioned preset time period, that is, the sampling period of the spatiotemporal position of the first vehicle is generally not too long. Therefore, if the time closest to the shooting time of the first image in the spatio-temporal trajectory data is determined as the target time, the position of the first vehicle at the shooting time of the first image is different from the position of the first vehicle at the target time. The gap should not be very large. Therefore, determining the time closest to the shooting time of the first image in the aforementioned spatiotemporal trajectory data as the first position determined by the target time can also be considered to be relatively accurate.
在另一种实现方式中,可以将前述时空轨迹数据中与第一图像的拍摄时刻最近的时刻确定为目标时刻。而后利用第一车辆的时空轨迹数据进行简单插值计算,确定第一图像的拍摄时刻第一车辆所处的位置,即确定第一位置。因为如前所述,在实际应用中,为了保证第一车辆的时空轨迹数据的完整性,前述预设时间周期即第一车辆的时空位置的采样周期一般不会太长,因此,如果第一图像的拍摄时刻在时空轨迹数据的两个采样点时刻之间,通过对采样点对应的地理位置进行线性插值计算就可以确定第一位置。采用这种方式确定的第一位置可以认为是比较准确的。关于线性插值计算的具体算法,可以采用经典的线性插值算法,此处不再详细描述。步骤103:获取第一位置和第二位置的空间位置关系,第二位置为摄像机的地理坐标的位置。In another implementation manner, the time closest to the shooting time of the first image in the aforementioned spatio-temporal trajectory data may be determined as the target time. Then, the spatio-temporal trajectory data of the first vehicle is used to perform simple interpolation calculation to determine the position of the first vehicle at the time of taking the first image, that is, to determine the first position. Because as mentioned above, in actual applications, in order to ensure the integrity of the spatiotemporal trajectory data of the first vehicle, the aforementioned preset time period, that is, the sampling period of the spatiotemporal position of the first vehicle is generally not too long. Therefore, if the first vehicle The shooting moment of the image is between the two sampling point moments of the spatiotemporal trajectory data, and the first position can be determined by performing linear interpolation calculation on the geographic location corresponding to the sampling point. The first position determined in this way can be considered more accurate. Regarding the specific algorithm of linear interpolation calculation, a classic linear interpolation algorithm can be used, which will not be described in detail here. Step 103: Obtain the spatial position relationship between the first position and the second position, where the second position is the position of the geographic coordinates of the camera.
步骤104:根据第一位置,第一位置和第二位置的空间位置关系,确定第二位置。Step 104: Determine the second position according to the first position, the spatial position relationship between the first position and the second position.
关于步骤103和步骤104,需要说明的是,在实际应用中,摄像机的安装可以遵循一定的安装规范,该安装规范例如可以包括摄像机的安装高度以及摄像机的拍摄范围等内容。换言之,由于该摄像机是基于一定的安装规范安装的,因此,当该摄像机拍摄到第一车辆时,第一车辆所处的第一位置与摄像机的地理坐标的位置即第二位置之间的空间位置关系,是符合一定的条件的。换言之,若摄像机拍摄的第一图像中包括第一车辆,则第二位置与第一位置之间的空间位置关系是可以确定的。Regarding step 103 and step 104, it should be noted that, in actual applications, the installation of the camera may follow a certain installation specification. The installation specification may include, for example, the installation height of the camera and the shooting range of the camera. In other words, because the camera is installed based on certain installation specifications, when the camera captures the first vehicle, the space between the first position of the first vehicle and the geographic coordinates of the camera, that is, the second position The positional relationship meets certain conditions. In other words, if the first image captured by the camera includes the first vehicle, the spatial position relationship between the second position and the first position can be determined.
本申请实施例不具体限定获取第一位置和第二位置的空间位置关系的具体实现方式。在本申请实施例的一种实现方式中,例如可以基于前述提及的摄像机的安装规范,获取第二位置与第一位置之间的空间位置关系。又如可以基于其它外部数据例如第一图像获取第一位置和第二位置的空间位置关系。作为又一种示例,可以采用预先标定的方式,确定该第二位置与该摄像机拍摄的物体之间的空间位置关系,并将预先标定的空间位置关系写入到相应的存储介质中,执行本申请实施例提供的摄像机位置的确定方法的服务器中的处理器,可以从前述存储介质中读取第一位置和第二位置的空间位置关系,以得到第一位置和第二位置的空间位置关系。The embodiment of the present application does not specifically limit the specific implementation manner for obtaining the spatial position relationship between the first position and the second position. In an implementation manner of the embodiment of the present application, for example, the spatial position relationship between the second position and the first position may be acquired based on the aforementioned installation specification of the camera. For another example, the spatial position relationship between the first position and the second position can be acquired based on other external data such as the first image. As another example, a pre-calibration method can be used to determine the spatial position relationship between the second position and the object photographed by the camera, and write the pre-calibrated spatial position relationship into the corresponding storage medium, and execute this The processor in the server of the method for determining the camera position provided by the application embodiment can read the spatial position relationship between the first position and the second position from the aforementioned storage medium to obtain the spatial position relationship between the first position and the second position .
关于第一位置和第二位置的空间位置关系,需要说明的是,本申请实施例不具体限定第一位置和第二位置的空间位置关系,第一位置和第二位置的空间位置关系,可以包括第一位置和第二位置之间的距离;第一位置和第二位置的空间位置关系,可以包括第一位置和第二位置之间的相对方向;当然,第一位置和第二位置的空间位置关系,可以既包括第一位置和第二位置之间的距离,又包括第一位置和第二位置之间的相对方向。Regarding the spatial position relationship between the first position and the second position, it should be noted that the embodiment of the present application does not specifically limit the spatial position relationship between the first position and the second position. The spatial position relationship between the first position and the second position may be Including the distance between the first position and the second position; the spatial position relationship between the first position and the second position may include the relative direction between the first position and the second position; of course, the difference between the first position and the second position The spatial position relationship may include not only the distance between the first position and the second position, but also the relative direction between the first position and the second position.
确定第一位置和第二位置的空间位置关系之后,即可根据第一位置、第一位置和第二位置的空间位置关系,确定第二位置。After the spatial position relationship between the first position and the second position is determined, the second position can be determined according to the spatial position relationship between the first position, the first position, and the second position.
通过以上描述可知,由于第一车辆的时空轨迹数据是准确的,因此,第一车辆在第一图像的拍摄时刻所处的第一位置是相对准确的,而第一位置和第二位置的空间位置关系的准确度也比较高,因此,所确定出的第二位置的准确性也比较高。故而利用本申请实施例 提供的方案,可以准确的确定出摄像机的地理坐标的位置。It can be seen from the above description that since the spatio-temporal trajectory data of the first vehicle is accurate, the first position of the first vehicle at the moment of taking the first image is relatively accurate, and the space between the first position and the second position is relatively accurate. The accuracy of the position relationship is also relatively high, and therefore, the accuracy of the determined second position is also relatively high. Therefore, by using the solution provided by the embodiment of the present application, the location of the geographic coordinates of the camera can be accurately determined.
如上文,第一位置和第二位置的空间位置关系,可以体现为第一位置和第二位置之间的距离,和/或,第一位置和第二位置之间的相对方向。以下分别介绍第一位置和第二位置之间的距离的具体确定方式,以及第一位置和第二位置之间的相对方向的具体确定方式。As above, the spatial position relationship between the first position and the second position may be embodied as the distance between the first position and the second position, and/or the relative direction between the first position and the second position. The specific method for determining the distance between the first position and the second position and the specific method for determining the relative direction between the first position and the second position are respectively introduced below.
首先,对第一位置和第二位置之间的距离的确定方式进行介绍。First, the method for determining the distance between the first position and the second position is introduced.
可以理解的是,摄像机可以拍摄到第一车辆,因此摄像机和第一车辆之间的距离在理论上可以满足一定的条件,在本申请实施例的一种实现方式中,可以采用预先标定的方式确定前述摄像机和第一车辆之间的距离所满足的条件,并从满足条件的距离中确定出一个值作为第一位置和第二位置之间的距离。例如,采用预先标定的方式确定当第一位置和第二位置之间的距离在1米至16米之间时,摄像机可以拍摄到第一车辆,故而可以将第一位置和第二位置之间的距离,确定为1米和16米之间的某一值,例如10米。在本申请实施例的又一种实现方式中,考虑到在实际应用中,第一车辆上的目标对象在摄像机拍摄的第一图像中的位置,在一定程度上可以体现摄像机拍摄该第一图像时,该第一车辆所处的第一位置与摄像机的地理坐标的位置之间的距离。即第一车辆上的目标对象在摄像机拍摄的第一图像中的位置,在一定程度上可以体现第一位置和第二位置之间的距离。因此,在本申请实施例的一种实现方式中,可以根据第一图像确定第一车辆上的目标对象在第一图像中的位置,进一步地,基于所获得的该目标对象在第一图像中的位置,确定第一位置与第二位置之间的距离。所述目标对象例如是车牌、车标。It is understandable that the camera can photograph the first vehicle, so the distance between the camera and the first vehicle can theoretically satisfy certain conditions. In an implementation of the embodiment of the present application, a pre-calibration method can be used The condition satisfied by the distance between the aforementioned camera and the first vehicle is determined, and a value is determined from the distance that satisfies the condition as the distance between the first position and the second position. For example, a pre-calibration method is used to determine that when the distance between the first position and the second position is between 1 meter and 16 meters, the camera can capture the first vehicle, so the distance between the first position and the second position The distance is determined to be a value between 1 meter and 16 meters, such as 10 meters. In yet another implementation manner of the embodiments of the present application, considering that in actual applications, the position of the target object on the first vehicle in the first image captured by the camera can reflect to a certain extent that the first image captured by the camera When, the distance between the first position where the first vehicle is located and the geographic coordinate position of the camera. That is, the position of the target object on the first vehicle in the first image captured by the camera can reflect the distance between the first position and the second position to a certain extent. Therefore, in an implementation manner of the embodiment of the present application, the position of the target object on the first vehicle in the first image can be determined according to the first image, and further, based on the obtained target object in the first image The position to determine the distance between the first position and the second position. The target object is, for example, a license plate or a vehicle logo.
在本申请实施例中,可以对第一图像进行图像分析,识别出第一图像中的目标对象,从而确定目标对象在第一图像中的位置。关于对第一图像进行图像分析的方法,例如可以提取第一图像的图像特征,并基于提取的图像特征进行分析,从而识别出第一图像中的目标对象。关于识别第一图像中的目标对象的实现方式,可以为经典的图像识别技术,此处不再详细说明。In the embodiment of the present application, image analysis may be performed on the first image to identify the target object in the first image, so as to determine the position of the target object in the first image. Regarding the method of performing image analysis on the first image, for example, the image feature of the first image can be extracted, and the analysis is performed based on the extracted image feature, so as to identify the target object in the first image. Regarding the realization of recognizing the target object in the first image, it may be a classic image recognition technology, which will not be described in detail here.
需要说明的是,本申请实施例不具体限定前述目标对象。考虑到在实际应用中,各个类型的车辆虽然车身大小等有所区别,但是车牌的大小的区别不大,相应的车标的大小的区别也不大。而且,车牌和车标在车身上所处的位置也相对比较固定。因此,对于位于第一位置的不同车辆,摄像机拍摄的包括这些不同车辆的多个图像中,这些不同车辆的车牌或者车标在包含该车辆的图像中的位置,可以认为是比较接近的。因此,在本申请实施例中,前述第一车辆上的目标对象可以为第一车辆上的车牌或者第一车辆上的车标。It should be noted that the embodiments of the present application do not specifically limit the foregoing target objects. Considering that in practical applications, although various types of vehicles have different body sizes, the difference in the size of the license plate is not big, and the difference in the size of the corresponding car logo is not big. Moreover, the position of the license plate and vehicle logo on the car body is relatively fixed. Therefore, for different vehicles located at the first position, the positions of the license plates or logos of these different vehicles in the images containing the vehicles in the multiple images captured by the camera including these different vehicles can be considered to be relatively close. Therefore, in the embodiment of the present application, the aforementioned target object on the first vehicle may be the license plate on the first vehicle or the vehicle logo on the first vehicle.
需要说明的是,本申请实施例不具体限定前述目标对象在第一图像中的位置,作为一种示例,目标对象在第一图像中的位置,可以为目标对象在第一图像对应的图像坐标系中的坐标。作为又一种示例,目标对象在第一图像中的位置,又如可以为目标对象在第一图像中的相对位置。其中,目标对象在第一图像中的相对位置,可以为目标对象处于第一图像中的某一区域。例如,目标对象处于第一图像的上部、目标对象处于第一图像的中部、以及目标对象处于第一图像的下部等等。It should be noted that the embodiment of the present application does not specifically limit the position of the aforementioned target object in the first image. As an example, the position of the target object in the first image may be the image coordinates of the target object in the first image. Coordinates in the system. As another example, the position of the target object in the first image may also be the relative position of the target object in the first image. Wherein, the relative position of the target object in the first image may be that the target object is in a certain area in the first image. For example, the target object is in the upper part of the first image, the target object is in the middle of the first image, and the target object is in the lower part of the first image, and so on.
本申请实施例不具体限定根据目标对象在第一图像中的位置,确定第一位置和第二位置之间的距离的具体实现方式,作为一种示例,可以预先确定位置与距离之间的映射关系,获取与目标对象在第一图像中的位置所对应的距离,而后,将利用该映射关系所获得的距离,确定为第一位置与第二位置之间的距离。本申请实施例不具体限定前述预先确定的位 置与距离之间的映射关系,该预先确定的位置与距离之间的映射关系,至少包括目标对象在第一图像中的位置、与第二位置与第一位置之间的距离之间的映射关系。The embodiment of the present application does not specifically limit the specific implementation manner of determining the distance between the first position and the second position according to the position of the target object in the first image. As an example, the mapping between the position and the distance may be predetermined Relationship, the distance corresponding to the position of the target object in the first image is obtained, and then the distance obtained by using the mapping relationship is determined as the distance between the first position and the second position. The embodiment of the present application does not specifically limit the foregoing predetermined mapping relationship between the position and the distance. The predetermined mapping relationship between the position and the distance includes at least the position of the target object in the first image, and the second position and The mapping relationship between the distances between the first positions.
该预先确定的位置与距离之间的映射关系,例如可以为下表1所示的映射关系。The predetermined mapping relationship between the position and the distance may be, for example, the mapping relationship shown in Table 1 below.
表1Table 1
位置position 距离distance
上部Upper part 15米15 meters
中部Central 10米10 meters
下部Lower part 5米5 meters
可以理解的是,若第一车辆上的目标对象位于第一图像的上部,则基于表1所示的映射关系,则可以确定第一位置和第二位置之间的距离为15米。It is understandable that if the target object on the first vehicle is located on the upper part of the first image, based on the mapping relationship shown in Table 1, it can be determined that the distance between the first position and the second position is 15 meters.
需要说明的是,表1只是为了方便理解而示出,其并不构成对本申请实施例的限定,第一图像中的目标对象在第一图像中的位置,不限于表1所示的“上部”、“中部”和“下部”三种情况,还可以包括其它情况,此处不再一一列举说明。It should be noted that Table 1 is only shown for the convenience of understanding and does not constitute a limitation to the embodiment of the present application. The position of the target object in the first image in the first image is not limited to the "upper part" shown in Table 1. The three situations of "", "middle" and "lower" may also include other situations, which will not be listed here.
接下来,对第一位置和第二位置之间的相对方向的确定方式进行介绍。考虑到在实际应用中,摄像机在安装时是具备安装方向的,摄像机的安装方向在一定程度上决定了摄像机的拍摄方向。对于在道路上行驶的第一车辆而言,摄像机的拍摄方向,决定了第一车辆在行驶过程中,是由第一位置驶向第二位置所在的方向,还是由第二位置所在的方向驶向第一位置。即可以根据第一车辆的行驶方向和摄像机的拍摄方向,确定第一位置和第二位置之间的相对方向。Next, the method for determining the relative direction between the first position and the second position will be introduced. Considering that in practical applications, the camera has an installation direction when it is installed, and the installation direction of the camera determines the shooting direction of the camera to a certain extent. For the first vehicle driving on the road, the shooting direction of the camera determines whether the first vehicle is driving from the first position to the direction of the second position, or from the direction of the second position. To the first position. That is, the relative direction between the first position and the second position can be determined according to the driving direction of the first vehicle and the shooting direction of the camera.
故而在本申请实施例的一种实现方式中,可以根据第一车辆的时空轨迹数据,确定第一车辆的行驶方向,并确定摄像机的拍摄方向,而后根据第一车辆的行驶方向和摄像机的拍摄方向,确定所述第一位置和所述第二位置之间的相对方向。Therefore, in an implementation of the embodiment of the present application, the traveling direction of the first vehicle can be determined according to the spatio-temporal trajectory data of the first vehicle, and the shooting direction of the camera can be determined, and then according to the traveling direction of the first vehicle and the shooting of the camera The direction determines the relative direction between the first position and the second position.
在本申请实施例中,根据第一车辆的时空轨迹数据确定第一车辆的行驶方向时,例如可以首先根据第一车辆的时空轨迹数据,确定第一车辆的行驶轨迹,而后根据第一车辆的行驶轨迹确定第一车辆的行驶方向。In the embodiment of the present application, when determining the traveling direction of the first vehicle according to the spatiotemporal trajectory data of the first vehicle, for example, the traveling trajectory of the first vehicle may be determined first according to the spatiotemporal trajectory data of the first vehicle, and then according to the first vehicle’s traveling direction. The driving trajectory determines the driving direction of the first vehicle.
根据第一车辆的行驶轨迹确定第一车辆的行驶方向时,可以有多种实现方式,作为一种示例,可以根据第一车辆的行驶轨迹上的至少两个位置,确定第一车辆的行驶方向。作为又一种示例,可以将所述行驶轨迹中经过第一位置的切线的方向,确定为第一车辆的行驶方向。When determining the driving direction of the first vehicle according to the driving trajectory of the first vehicle, there may be multiple implementation manners. As an example, the driving direction of the first vehicle may be determined according to at least two positions on the driving trajectory of the first vehicle. . As another example, the direction of the tangent line passing through the first position in the driving track may be determined as the driving direction of the first vehicle.
在本申请实施例中,摄像机的拍摄方向,可以根据摄像机的安装信息来确定。本申请实施例中,摄像机的拍摄方向,可以与第一车辆的行驶方向一致,或者与第一车辆的行驶方向的逆方向一致。在本申请实施例中,摄像机的拍摄方向与第一车辆的行驶方向一致,可以认为是摄像机的拍摄方向与第一车辆的行驶方向之间的夹角小于或者等于90°。摄像机的拍摄方向与第一车辆的行驶方向的逆方向一致,可以认为是摄像机的拍摄方向与第一车辆的行驶方向之间的夹角大于90°。可以理解的是,若摄像机的拍摄方向与第一车辆的行驶方向一致,则摄像机拍摄第一车辆时,可以拍摄到第一车辆车尾的目标对象。若摄像机的拍摄方向与第一车辆的行驶方向的逆方向一致,则摄像机拍摄第一车辆时,可以拍摄到第一车辆车头的目标对象。In the embodiment of the present application, the shooting direction of the camera may be determined according to the installation information of the camera. In the embodiment of the present application, the shooting direction of the camera may be the same as the traveling direction of the first vehicle, or the direction opposite to the traveling direction of the first vehicle. In the embodiment of the present application, the shooting direction of the camera is consistent with the driving direction of the first vehicle, and it can be considered that the angle between the shooting direction of the camera and the driving direction of the first vehicle is less than or equal to 90°. The shooting direction of the camera is consistent with the reverse direction of the traveling direction of the first vehicle, and it can be considered that the angle between the shooting direction of the camera and the traveling direction of the first vehicle is greater than 90°. It is understandable that if the shooting direction of the camera is consistent with the driving direction of the first vehicle, when the camera shoots the first vehicle, the target object at the rear of the first vehicle can be captured. If the photographing direction of the camera is the same as the reverse direction of the traveling direction of the first vehicle, the camera can photograph the target object at the front of the first vehicle when photographing the first vehicle.
当然,在本申请实施例中,前述第一位置和第二位置之间的相对方向,也可以是预设 的,本申请实施例不具体限定该预设的相对方向。例如,该预设的相对方向,可以为第二位置位于第一位置的正北方向;又如,该预设的相对方向,可以为第二位置位于第一位置的正南方向;等等,此处不再一一列举说明。如上文,第一位置和第二位置的空间位置关系,可以体现为第一位置和第二位置之间的距离和/或第一位置和第二位置之间的相对方向,以下结合图2介绍当第一位置和第二位置的空间位置关系,体现为第一位置和第二位置之间的距离时,前述步骤104的具体实现方式。Of course, in the embodiment of the present application, the relative direction between the aforementioned first position and the second position may also be preset, and the embodiment of the present application does not specifically limit the preset relative direction. For example, the preset relative direction may be a true north direction where the second position is located at the first position; for another example, the preset relative direction may be a true south direction where the second position is located at the first position; etc., I won’t enumerate one by one here. As mentioned above, the spatial position relationship between the first position and the second position can be embodied as the distance between the first position and the second position and/or the relative direction between the first position and the second position, which is described below in conjunction with FIG. 2 When the spatial position relationship between the first position and the second position is embodied as the distance between the first position and the second position, the specific implementation manner of the foregoing step 104.
参见图2,该图为本申请实施例提供的一种确定第二位置的方法的流程示意图。图2所示的方法,例如可以通过如下步骤201-202实现。Refer to FIG. 2, which is a schematic flowchart of a method for determining a second position according to an embodiment of the application. The method shown in FIG. 2 can be implemented through the following steps 201-202, for example.
步骤201:根据第一图像确定目标对象在第一图像中的位置,并根据所获得的目标对象在第一图像中的位置,确定第一位置与第二位置之间的距离。Step 201: Determine the position of the target object in the first image according to the first image, and determine the distance between the first position and the second position according to the obtained position of the target object in the first image.
需要说明的是,此处提及的目标对象,位于第一车辆上。It should be noted that the target object mentioned here is located on the first vehicle.
关于步骤201的具体实现方式,可以参考前文关于“第一位置和第二位置之间的距离”的相关描述,此处不再详述。Regarding the specific implementation of step 201, reference may be made to the related description of the "distance between the first position and the second position" above, which will not be described in detail here.
步骤202:根据第一车辆的时空轨迹数据、第一位置与第二位置之间的距离以及第一位置,确定第二位置。Step 202: Determine the second position according to the spatiotemporal trajectory data of the first vehicle, the distance between the first position and the second position, and the first position.
具体而言可以是:根据第一车辆的时空轨迹数据,确定第一车辆的行驶轨迹,并根据第一位置与第二位置之间的距离、第一位置以及第一车辆的行驶轨迹,确定第二位置。Specifically, it may be: determine the travel trajectory of the first vehicle according to the spatiotemporal trajectory data of the first vehicle, and determine the first vehicle’s travel trajectory according to the distance between the first position and the second position, the first position and the travel trajectory of the first vehicle Two positions.
确定第一位置和第二位置之间的距离之后,即可根据第一位置、以及第一位置和第二位置之间的距离,确定第二位置。在本申请实施例中,考虑到摄像机一般安装在道路上方,故而可以认为第一车辆在行驶的过程中,可能会经过摄像机的地理坐标的位置即经过第二位置,或者第二位置在第一车辆的行驶轨迹附近。故而在本申请实施例中,可以根据第一车辆的时空轨迹数据,确定第一车辆的时空轨迹。而后,根据第一位置与第二位置之间的距离、第一位置以及第一车辆的行驶轨迹,确定第二位置。例如,根据该行驶轨迹,将与第一位置的距离,等于前述第一位置和第二位置之间的距离的位置,确定为第二位置。After determining the distance between the first position and the second position, the second position can be determined according to the first position and the distance between the first position and the second position. In the embodiment of the present application, considering that the camera is generally installed above the road, it can be considered that the first vehicle may pass the geographic coordinates of the camera during the driving process, that is, pass the second position, or the second position is in the first position. Near the trajectory of the vehicle. Therefore, in the embodiment of the present application, the spatiotemporal trajectory of the first vehicle may be determined according to the spatiotemporal trajectory data of the first vehicle. Then, the second position is determined according to the distance between the first position and the second position, the first position, and the travel trajectory of the first vehicle. For example, according to the driving trajectory, a position whose distance from the first position is equal to the distance between the aforementioned first position and the second position is determined as the second position.
可以理解的是,在实际应用中,第一位置一般不会是第一车辆的行驶轨迹的起点或者终点。因此,所确定的与第一位置的距离,等于前述“第一位置和第二位置之间的距离”的位置,可能包括两个位置,在本申请实施例中,可以将该两个位置中的任意一个位置,确定为前述第二位置。It is understandable that in practical applications, the first position is generally not the starting point or the end point of the driving track of the first vehicle. Therefore, the determined distance from the first position, which is equal to the aforementioned "distance between the first position and the second position", may include two positions. In the embodiment of the present application, the two positions may be Any one of the positions is determined as the aforementioned second position.
在本申请实施例的一种实现方式中,考虑到在实际应用中,第一车辆的时空轨迹数据的数据量比较庞大,因此,若根据第一车辆的所有时空轨迹数据,确定第一车辆的完整的行驶轨迹,则对应的计算量会比较大。而在确定第二位置时,实际上需要使用的第一车辆的行驶轨迹,是第一车辆在前述第一图像的拍摄时刻附近的一段时间内的行驶轨迹。鉴于此,在本申请实施例中,为了降低确定第二位置的计算量,相应的也提升确定第二位置的效率,可以从第一车辆的时空轨迹数据中,提取出预设时间段内的时空轨迹数据,该预设时间段为包括前述第一图像的拍摄时刻的时间段,而后基于提取出的预设时间段内的时空轨迹数据,确定第一车辆的行驶轨迹。本申请实施例不具体限定该预设时间段,例如,该预设时间段为从第一时刻到第二时刻的时间段,其中第一时刻为第一图像的拍摄时刻之前的某一时刻,第二时刻为第一图像的拍摄时刻之后的某一时刻。In an implementation manner of the embodiment of the present application, considering that in practical applications, the data volume of the spatiotemporal trajectory data of the first vehicle is relatively large, therefore, if all spatiotemporal trajectory data of the first vehicle is used, the data of the first vehicle is determined For a complete driving trajectory, the corresponding calculation amount will be relatively large. When determining the second position, the actual travel trajectory of the first vehicle that needs to be used is the travel trajectory of the first vehicle during a period of time near the shooting moment of the first image. In view of this, in the embodiment of the present application, in order to reduce the amount of calculation for determining the second position, and correspondingly improve the efficiency of determining the second position, the spatio-temporal trajectory data of the first vehicle can be extracted from the time period. Spatio-temporal trajectory data, the preset time period is a time period including the shooting moment of the aforementioned first image, and then based on the extracted spatio-temporal trajectory data within the preset time period, the driving trajectory of the first vehicle is determined. The embodiment of the present application does not specifically limit the preset time period. For example, the preset time period is a time period from a first moment to a second moment, where the first moment is a certain moment before the shooting moment of the first image, The second moment is a moment after the shooting moment of the first image.
如前文所述,步骤202在具体实现时,可以根据第一车辆的行驶轨迹,将与第一位置的距离,等于前述第一位置和第二位置之间的距离的位置,确定为第二位置。而第一车辆的行驶轨迹中与第一位置的距离,等于前述第一位置和第二位置之间的距离的位置,可能包括两个位置。对于这种情况,在本申请实施例中,可以将该两个位置中的任意一个位置,确定为前述第二位置。在本申请实施例的一种实现方式中,为了进一步提升所确定的第二位置的准确性,还可以结合第一位置和第二位置之间的相对方向,来确定第二位置。以下结合图3介绍本申请实施例提供的又一种确定第二位置的方法。As mentioned above, when step 202 is specifically implemented, according to the driving trajectory of the first vehicle, the position whose distance from the first position is equal to the distance between the aforementioned first position and the second position can be determined as the second position. . The distance between the first position and the first position in the travel trajectory of the first vehicle is equal to the aforementioned distance between the first position and the second position, and may include two positions. In this case, in the embodiment of the present application, any one of the two positions may be determined as the aforementioned second position. In an implementation manner of the embodiment of the present application, in order to further improve the accuracy of the determined second position, the second position may also be determined in combination with the relative direction between the first position and the second position. In the following, another method for determining a second position provided by an embodiment of the present application will be introduced in conjunction with FIG. 3.
参见图3,该图为本申请实施例提供的又一种确定第二位置的方法的流程示意图。图3所示的方法,例如可以通过如下步骤301-303实现。Refer to FIG. 3, which is a schematic flowchart of yet another method for determining a second position according to an embodiment of the application. The method shown in FIG. 3 can be implemented through the following steps 301-303, for example.
步骤301:根据第一车辆的时空轨迹数据,确定第一车辆的行驶方向;并确定摄像机的拍摄方向。Step 301: Determine the driving direction of the first vehicle according to the spatio-temporal trajectory data of the first vehicle; and determine the shooting direction of the camera.
关于步骤301的具体实现方式,可以参考前文对于“第一位置和第二位置之间的相对方向”的相关描述,此处不再重复描述。Regarding the specific implementation of step 301, reference may be made to the related description of the "relative direction between the first position and the second position" above, and the description will not be repeated here.
步骤302:根据第一车辆的行驶方向和摄像机的拍摄方向,确定第一位置和第二位置之间的相对方向。步骤303:根据第一位置和第二位置之间的相对方向、第一位置、以及第一位置和第二位置之间的距离,确定第二位置。Step 302: Determine the relative direction between the first position and the second position according to the driving direction of the first vehicle and the shooting direction of the camera. Step 303: Determine the second position according to the relative direction between the first position and the second position, the first position, and the distance between the first position and the second position.
如前文,第一车辆在行驶的过程中,可能会经过第二位置。对于这种情况,在本申请实施例中,第一位置和第二位置之间的相对方向,可以由第一位置和第二位置在第一车辆的行驶轨迹中的相对位置确定。其中,第一位置和第二位置在第一车辆的行驶轨迹中的相对位置,指的是第一车辆在行驶过程中,是先经过第一位置再经过第二位置,还是先经过第二位置再经过第一位置。可以理解的是,在实际应用中,若第一车辆的行驶方向和摄像机的拍摄方向一致,则第一车辆先经过第二位置,再经过第一位置。若第一车辆的行驶方向和摄像机的拍摄方向不一致,则第一车辆先经过第一位置,再经过第二位置。As mentioned above, the first vehicle may pass through the second position while driving. In this case, in the embodiment of the present application, the relative direction between the first position and the second position may be determined by the relative positions of the first position and the second position in the driving trajectory of the first vehicle. Among them, the relative position of the first position and the second position in the driving trajectory of the first vehicle refers to whether the first vehicle passes the first position and then the second position, or whether it passes the second position first. Pass the first position again. It can be understood that, in practical applications, if the driving direction of the first vehicle is the same as the shooting direction of the camera, the first vehicle first passes the second position, and then passes the first position. If the driving direction of the first vehicle is not consistent with the shooting direction of the camera, the first vehicle first passes through the first position and then passes through the second position.
可以理解的是,确定第一位置和第二位置在第一车辆的行驶轨迹中的相对位置之后,即可根据该第一位置和第二位置在第一车辆的行驶轨迹中的相对位置、第一位置、以及第一位置和第二位置之间的距离,确定第二位置。可参见图4进行理解,图4为本申请实施例提供的一种第一车辆的行驶轨迹的示意图。It is understandable that after determining the relative position of the first position and the second position in the driving trajectory of the first vehicle, the relative position and the first position of the first position and the second position in the driving trajectory of the first vehicle can be determined. A position and the distance between the first position and the second position determine the second position. It can be understood with reference to FIG. 4, which is a schematic diagram of a driving track of a first vehicle according to an embodiment of the application.
在图4中,401为第一车辆的行驶轨迹,其中行驶轨迹401上的箭头401a表示行驶轨迹401的方向。第一位置为图4所示的402,该行驶轨迹上与第一位置402的距离等于第一位置与第二位置之间的距离的位置有两个,分别为403和404,而摄像机的拍摄方向,与行驶轨迹401一致,则确定第一车辆先经过第二位置,再经过第一位置401,因此,可以将位置403确定为第二位置。In FIG. 4, 401 is the travel trajectory of the first vehicle, and the arrow 401 a on the travel trajectory 401 indicates the direction of the travel trajectory 401. The first position is 402 shown in FIG. 4, and there are two positions on the driving track whose distance from the first position 402 is equal to the distance between the first position and the second position, namely 403 and 404, and the camera shooting If the direction is consistent with the driving trajectory 401, it is determined that the first vehicle passes the second position first, and then passes the first position 401. Therefore, the position 403 can be determined as the second position.
如前文,第二位置可能在第一车辆的行驶轨迹附近。对于这种情况,在本申请实施例的又一种实现方式中,可以认为第二位置位于第一切线上,其中,第一切线为第一车辆的行驶轨迹在第一位置处的切线。进一步地,第一位置和第二位置之间的相对方向,可以由第一位置和第二位置在前述第一切线上的相对位置确定。具体地,第一位置和第二位置在第一切线中的相对位置,指的是第一车辆在行驶过程中,是由第一位置驶向第二位置所在的方向,还是由第二位置所在的方向驶向第一位置。As before, the second location may be near the driving track of the first vehicle. In this case, in another implementation manner of the embodiment of the present application, the second position can be considered to be located on the first tangent line, where the first tangent line is the tangent line of the driving track of the first vehicle at the first position . Further, the relative direction between the first position and the second position may be determined by the relative position of the first position and the second position on the aforementioned first tangent line. Specifically, the relative position of the first position and the second position in the first tangent line refers to whether the first vehicle is moving from the first position to the direction of the second position, or from the second position Head to the first position in your direction.
在实际应用中,若第一车辆的行驶方向和摄像机的拍摄方向一致,则第一车辆由第二 位置所在的方向驶向第一位置。若第一车辆的行驶方向和摄像机的拍摄方向不一致,则第一车辆由第一位置驶向第二位置所在的方向。In practical applications, if the driving direction of the first vehicle is the same as the shooting direction of the camera, the first vehicle will move from the direction of the second position to the first position. If the driving direction of the first vehicle is not consistent with the shooting direction of the camera, the first vehicle drives from the first position to the direction of the second position.
可以理解的是,确定第一位置和第二位置在第一切线中的相对位置之后,即可根据该第一位置和第二位置在第一切线中的相对位置、第一位置、以及第一位置和第二位置之间的距离,确定第二位置。It is understandable that after determining the relative position of the first position and the second position in the first tangent, the relative position of the first position and the second position in the first tangent, the first position, and The distance between the first position and the second position determines the second position.
可参见图5进行理解,图5为本申请实施例提供的又一种第一车辆的行驶轨迹的示意图。It can be understood with reference to FIG. 5, which is a schematic diagram of another driving trajectory of the first vehicle according to an embodiment of the application.
在图5中,501为第一车辆的行驶轨迹,其中行驶轨迹501上的箭头501a表示行驶轨迹501的方向。第一位置为图5所示的502,503为行使轨迹501在第一位置502处的切线。切线503上与第一位置502的距离等于第一位置与第二位置之间的距离的位置有两个,分别为505和506。而摄像机的拍摄方向,与行驶轨迹501一致,则第一车辆由第二位置所在的方向驶向第一位置。因此,可以将位置506确定为第二位置。In FIG. 5, 501 is the driving trajectory of the first vehicle, and the arrow 501 a on the driving trajectory 501 indicates the direction of the driving trajectory 501. The first position is 502 shown in FIG. 5, and 503 is the tangent line of the travel trajectory 501 at the first position 502. There are two positions on the tangent line 503 whose distance from the first position 502 is equal to the distance between the first position and the second position, 505 and 506 respectively. If the camera's shooting direction is consistent with the driving track 501, the first vehicle will move from the direction of the second position to the first position. Therefore, the position 506 can be determined as the second position.
需要说明的是,前述步骤104除了可以通过步骤201-202实现之外,还可以采用其它方式实现。具体地,考虑到在实际应用中,摄像机的拍摄视野是有限的,换言之,摄像机所能拍摄到的最远的物体的位置,与第二位置之间的距离也不会很远。因此,在本申请实施例的又一种实现方式中,可以将第一位置确定为第二位置,即将摄像机拍摄第一图像时,第一车辆所处的位置,确定为摄像机的地理坐标的位置。这种做法简洁、高效,但是可能造成精度偏低。It should be noted that the foregoing step 104 may be implemented in other ways in addition to being implemented through steps 201-202. Specifically, considering that in practical applications, the shooting field of view of the camera is limited, in other words, the position of the farthest object that can be shot by the camera is not far away from the second position. Therefore, in another implementation manner of the embodiment of the present application, the first position may be determined as the second position, that is, the position of the first vehicle when the camera shoots the first image is determined as the geographic coordinate position of the camera . This approach is simple and efficient, but it may cause low accuracy.
如前文,第一车辆为具备时空轨迹数据上报功能的车辆。可以理解的是,在实际应用中,摄像机拍摄的图像中包括的车辆有很多,除了前述第一车辆之外,还可能包括第二车辆、第三车辆等等,而并非所有的车辆均为具备时空数据上报功能的车辆。在本申请的一种实现方式中,获取到摄像机拍摄的第一图像之后,还可以进一步确定第一图像中包括的第一车辆是否为具备时空数据上报的车辆。具体地,在本年申请实施例中,可以对第一图像进行分析,识别出第一车辆的车牌号。然后将第一车辆的车牌号与具备时空轨迹数据上报功能的车辆的车牌号进行匹配,若匹配成功,即当确定具备时空轨迹数据上报功能的车辆的车牌号中,包括前述第一车辆的车牌号时,则可以确定第一车辆为具备时空轨迹数据上报功能的车辆。As mentioned above, the first vehicle is a vehicle with the function of reporting spatio-temporal trajectory data. It is understandable that in practical applications, there are many vehicles included in the image captured by the camera. In addition to the aforementioned first vehicle, it may also include a second vehicle, a third vehicle, etc., and not all vehicles are equipped with Vehicles with spatio-temporal data reporting function. In an implementation manner of the present application, after acquiring the first image taken by the camera, it may be further determined whether the first vehicle included in the first image is a vehicle with spatiotemporal data reporting. Specifically, in this year's application embodiment, the first image can be analyzed to identify the license plate number of the first vehicle. Then match the license plate number of the first vehicle with the license plate number of the vehicle with spatiotemporal trajectory data reporting function. If the matching is successful, it is determined that the license plate number of the vehicle with spatiotemporal trajectory data reporting function includes the license plate of the aforementioned first vehicle When the number is displayed, it can be determined that the first vehicle is a vehicle with the function of reporting spatiotemporal trajectory data.
如前文,一些网约车具备时空数据上报的功能,因此,在本申请实施例中,可以从网约车平台的服务器中,获取具备时空轨迹数据上报功能的车辆的车牌号,而后进一步基于获取的具备时空轨迹数据上报功能的车辆的车牌号,确定第一车辆是否为具备时空轨迹数据上报功能的车辆。关于识别第一车辆的车牌号的具体实现方式,例如可以采用通用的图像识别技术来确定,此处不再详细说明。As mentioned above, some online car-hailing has the function of reporting spatio-temporal data. Therefore, in this embodiment of the application, the license plate number of a vehicle with the function of reporting spatio-temporal trajectory data can be obtained from the server of the online car-hailing platform, and then further based on the acquisition The license plate number of the vehicle with spatiotemporal trajectory data reporting function determines whether the first vehicle is a vehicle with spatiotemporal trajectory data reporting function. Regarding the specific implementation manner of recognizing the license plate number of the first vehicle, for example, a general image recognition technology can be used to determine it, which will not be described in detail here.
如前文,第一车辆上的目标对象可以为第一车辆上的车牌。可以理解的是,由于可以根据第一车辆的车牌号确定第一车辆是否为具备时空轨迹数据上报功能的车辆。换言之,在确定第一车辆是否为具备时空轨迹上报功能的车辆时,已经识别了第一图像中第一车辆的车牌。因此,若第一车辆上的目标对象为第一车辆的车牌,而不是其他对象,则可以避免二次识别车辆上的其它对象,节省部分计算资源,相应的可以提升确定第二位置的效率。As mentioned above, the target object on the first vehicle may be the license plate on the first vehicle. It is understandable that whether the first vehicle is a vehicle capable of reporting spatiotemporal trajectory data can be determined according to the license plate number of the first vehicle. In other words, when determining whether the first vehicle is a vehicle with a spatiotemporal trajectory reporting function, the license plate of the first vehicle in the first image has been identified. Therefore, if the target object on the first vehicle is the license plate of the first vehicle, rather than other objects, the second recognition of other objects on the vehicle can be avoided, part of the computing resources can be saved, and the efficiency of determining the second position can be improved accordingly.
基于以上实施例提供的摄像机位置的确定方法,本申请实施例还提供了一种摄像机位置的确定装置,以下结合附图介绍该装置。Based on the method for determining the position of the camera provided in the above embodiments, an embodiment of the present application also provides an apparatus for determining the position of a camera, which is described below with reference to the accompanying drawings.
参见图6,该图为本申请实施例提供的一种摄像机位置的确定装置的结构示意图。Refer to FIG. 6, which is a schematic structural diagram of an apparatus for determining a camera position according to an embodiment of the application.
本申请实施例提供的摄像机位置的确定装置600,例如可以包括:第一获取单元601、第一确定单元602、第二获取单元603、第二确定单元604、第三获取单元605和第三确定单元606。The device 600 for determining the position of the camera provided in the embodiment of the present application may include, for example, a first acquiring unit 601, a first determining unit 602, a second acquiring unit 603, a second determining unit 604, a third acquiring unit 605, and a third determining unit. Unit 606.
第一获取单元601,用于获取摄像机拍摄的包括第一车辆的第一图像;The first obtaining unit 601 is configured to obtain a first image including a first vehicle shot by a camera;
第一确定单元602,用于确定所述第一图像的拍摄时刻;The first determining unit 602 is configured to determine the shooting moment of the first image;
第二获取单元603,用于获取所述第一车辆的时空轨迹数据;The second acquiring unit 603 is configured to acquire spatiotemporal trajectory data of the first vehicle;
第二确定单元604,用于根据所述第一车辆的时空轨迹数据确定所述第一车辆在所述拍摄时刻所处的第一位置;The second determining unit 604 is configured to determine the first position of the first vehicle at the shooting moment according to the spatio-temporal trajectory data of the first vehicle;
第三获取单元605,用于获取所述第一位置和第二位置的空间位置关系,所述第二位置为所述摄像机的地理坐标的位置;The third acquiring unit 605 is configured to acquire the spatial position relationship between the first position and the second position, where the second position is the geographic coordinate position of the camera;
第三确定单元606,用于根据所述第一位置、所述第一位置和第二位置的空间位置关系,确定所述第二位置。The third determining unit 606 is configured to determine the second position according to the first position, the spatial position relationship between the first position and the second position.
在一种可能的实现方式中,所述第一位置和第二位置的空间位置关系,包括:In a possible implementation manner, the spatial position relationship between the first position and the second position includes:
所述第一位置和所述第二位置之间的距离,和/或,所述第一位置和所述第二位置之间的相对方向。The distance between the first position and the second position, and/or the relative direction between the first position and the second position.
在一种可能的实现方式中,所述第一位置和所述第二位置之间的距离,通过如下方式确定:In a possible implementation manner, the distance between the first position and the second position is determined in the following manner:
根据所述第一图像确定目标对象在所述第一图像中的位置,并根据所确定的所述目标对象在所述第一图像中的位置,确定所述第一位置与第二位置之间的距离;所述目标对象位于所述第一车辆。Determine the position of the target object in the first image according to the first image, and determine the position between the first position and the second position according to the determined position of the target object in the first image The distance; the target object is located in the first vehicle.
在一种可能的实现方式中,所述第一位置和所述第二位置之间的相对方向,通过如下方式确定:In a possible implementation manner, the relative direction between the first position and the second position is determined in the following manner:
根据所述第一车辆的时空轨迹数据,确定所述第一车辆的行驶方向;以及确定所述摄像机的拍摄方向;根据所述第一车辆的行驶方向和所述摄像机的拍摄方向,确定所述第一位置和所述第二位置之间的相对方向;所述摄像机的拍摄方向,与所述第一车辆的行驶方向一致或者与所述第一车辆的行驶方向的逆方向一致。Determine the traveling direction of the first vehicle according to the spatiotemporal trajectory data of the first vehicle; and determine the shooting direction of the camera; determine the traveling direction of the first vehicle and the shooting direction of the camera The relative direction between the first position and the second position; the shooting direction of the camera is consistent with the traveling direction of the first vehicle or the opposite direction of the traveling direction of the first vehicle.
在一种可能的实现方式中,所述第三确定单元606,包括:In a possible implementation manner, the third determining unit 606 includes:
第一确定子单元,用于根据所述第一图像确定目标对象在所述第一图像中的位置;所述目标对象位于所述第一车辆;The first determining subunit is configured to determine the position of the target object in the first image according to the first image; the target object is located in the first vehicle;
第二确定子单元,用于根据所获得的所述目标对象在所述第一图像中的位置,确定所述第一位置与第二位置之间的距离;A second determining subunit, configured to determine the distance between the first position and the second position according to the obtained position of the target object in the first image;
第三确定子单元,用于根据所述第一车辆的时空轨迹数据、所述距离以及所述第一位置,确定所述第二位置。The third determining subunit is configured to determine the second position according to the spatiotemporal trajectory data of the first vehicle, the distance, and the first position.
在一种可能的实现方式中,所述第三确定子单元,具体用于:In a possible implementation manner, the third determining subunit is specifically configured to:
根据所述第一车辆的时空轨迹数据,确定所述第一车辆的行驶方向;并确定所述摄像机的拍摄方向;所述摄像机的拍摄方向,与所述第一车辆的行驶方向一致或者与所述第一 车辆的行驶方向的逆方向一致;根据所述第一车辆的行驶方向和所述摄像机的拍摄方向,确定所述第一位置和所述第二位置之间的相对方向;根据所述第一位置和所述第二位置之间的相对方向、所述第一位置和所述距离,确定所述第二位置。According to the spatio-temporal trajectory data of the first vehicle, determine the traveling direction of the first vehicle; and determine the shooting direction of the camera; the shooting direction of the camera is consistent with the traveling direction of the first vehicle or is consistent with the traveling direction of the first vehicle. The reverse direction of the driving direction of the first vehicle is the same; according to the driving direction of the first vehicle and the shooting direction of the camera, the relative direction between the first position and the second position is determined; according to the The relative direction between the first position and the second position, the first position and the distance determine the second position.
在一种可能的实现方式中,所述第二确定子单元,具体用于:In a possible implementation manner, the second determining subunit is specifically used for:
根据预先确定的位置与距离之间的映射关系,获得与所述目标对象在所述第一图像中的位置对应的距离,将获得的所述距离确定为所述第一位置与所述第二位置之间的距离;所述预先确定的位置与距离之间的映射关系,包括所述目标对象在所述第一图像中的位置、与所述第二位置与所述第一位置之间的距离之间的映射关系。According to the predetermined mapping relationship between the position and the distance, the distance corresponding to the position of the target object in the first image is obtained, and the obtained distance is determined as the first position and the second position. The distance between the positions; the predetermined mapping relationship between the position and the distance includes the position of the target object in the first image, and the distance between the second position and the first position The mapping relationship between distances.
在一种可能的实现方式中,所述第三确定单元606,具体用于:In a possible implementation manner, the third determining unit 606 is specifically configured to:
将所述第一位置确定为所述第二位置。The first position is determined as the second position.
在一种可能的实现方式中,所述装置600还包括:图像分析单元,用于对所述第一图像进行分析,识别出所述第一车辆的车牌号;In a possible implementation manner, the device 600 further includes: an image analysis unit, configured to analyze the first image and identify the license plate number of the first vehicle;
第四确定单元,用于将所述第一车辆的车牌号与具备时空轨迹数据上报功能的车辆的车牌号进行匹配,若匹配成功,则确定所述第一车辆为具备时空轨迹数据上报功能的车辆。The fourth determining unit is configured to match the license plate number of the first vehicle with the license plate number of the vehicle with spatiotemporal trajectory data reporting function, and if the matching is successful, determine that the first vehicle is the one with spatiotemporal trajectory data reporting function vehicle.
在一种可能的实现方式中,所述目标对象,包括:车牌,或者,车标。In a possible implementation manner, the target object includes: a license plate or a vehicle logo.
由于所述装置600是与以上方法实施例提供的方法对应的装置,所述装置600的各个单元的具体实现,均与以上方法实施例为同一构思,因此,关于所述装置600的各个单元的具体实现,可以参考以上方法实施例的描述部分,此处不再赘述。Since the device 600 is a device corresponding to the method provided in the above method embodiment, the specific implementation of each unit of the device 600 is based on the same idea as the above method embodiment. Therefore, regarding each unit of the device 600 For specific implementation, please refer to the description part of the above method embodiment, which will not be repeated here.
本申请实施例还提供了一种对应于摄像机位置的确定装置600的摄像机位置的确定设备,该摄像机位置的确定设备包括处理器和存储器;The embodiment of the present application also provides a device for determining a camera position corresponding to the device 600 for determining the camera position, and the device for determining the camera position includes a processor and a memory;
所述存储器,用于存储指令;The memory is used to store instructions;
所述处理器,用于执行所述存储器中的所述指令,执行以上实施例提供的摄像机位置的确定方法。The processor is configured to execute the instructions in the memory, and execute the method for determining the position of the camera provided in the above embodiments.
需要说明的是,本申请实施例中提供的对应于摄像机位置的确定装置600的摄像机位置的确定设备,其硬件结构可以为如图7所示的结构,图7为本申请实施例提供的一种摄像机位置的确定设备的结构示意图。It should be noted that the hardware structure of the device for determining the camera position of the device 600 for determining the camera position provided in the embodiment of the present application may be the structure shown in FIG. 7, which is a device provided by the embodiment of the present application. A schematic diagram of the structure of a device for determining the camera position.
请参阅图7所示,摄像机位置的确定设备700包括:处理器710、通信接口720和存储器730。其中摄像机位置的确定设备700中的处理器710的数量可以一个或多个,图7中以一个处理器为例。本申请实施例中,处理器710、通信接口720和存储器730可通过总线系统或其它方式连接,其中,图7中以通过总线系统740连接为例。Please refer to FIG. 7, the device 700 for determining the position of the camera includes a processor 710, a communication interface 720, and a memory 730. The number of processors 710 in the device 700 for determining the camera position may be one or more. One processor is taken as an example in FIG. 7. In the embodiment of the present application, the processor 710, the communication interface 720, and the memory 730 may be connected through a bus system or other methods. In FIG. 7, the connection through the bus system 740 is taken as an example.
处理器710可以是中央处理器(central processing unit,CPU),网络处理器(network processor,NP)或者CPU和NP的组合。处理器710还可以进一步包括硬件芯片。上述硬件芯片可以是专用集成电路(application-specific integrated circuit,ASIC),可编程逻辑器件(programmable logic device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,CPLD),现场可编程逻辑门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。The processor 710 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP. The processor 710 may further include a hardware chip. The aforementioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
存储器730可以包括易失性存储器(英文:volatile memory),例如随机存取存储器(random-access memory,RAM);存储器730也可以包括非易失性存储器(英文:non-volatile memory),例如快闪存储器(英文:flash memory),硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD);存储器730还可以包括上述种类的存储器的组合。The memory 730 may include a volatile memory (English: volatile memory), such as random-access memory (RAM); the memory 730 may also include a non-volatile memory (English: non-volatile memory), such as fast Flash memory (English: flash memory), hard disk drive (HDD) or solid-state drive (SSD); the memory 730 may also include a combination of the foregoing types of memory.
存储器730可以将前述实施例提及的第一位置和第二位置的空间位置关系等数据。The memory 730 may store data such as the spatial position relationship between the first position and the second position mentioned in the foregoing embodiment.
可选地,存储器730存储有操作系统和程序、可执行模块或者数据结构,或者它们的子集,或者它们的扩展集,其中,程序可包括各种操作指令,用于实现各种操作。操作系统可包括各种系统程序,用于实现各种基础业务以及处理基于硬件的任务。处理器710可以读取存储器730中的程序,实现本申请实施例提供的摄像机的位置确定方法。Optionally, the memory 730 stores an operating system and a program, an executable module or a data structure, or a subset of them, or an extended set of them, where the program may include various operation instructions for implementing various operations. The operating system may include various system programs for implementing various basic services and processing hardware-based tasks. The processor 710 can read the program in the memory 730 to implement the method for determining the position of the camera provided in the embodiment of the present application.
总线系统740可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。总线系统740可以分为地址总线、数据总线、控制总线等。为便于表示,图7中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The bus system 740 may be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus system 740 can be divided into an address bus, a data bus, a control bus, and so on. For ease of representation, only one thick line is used in FIG. 7, but it does not mean that there is only one bus or one type of bus.
在一些情况下,存储器不是必须的,或者,存储器可以和处理器集成在一起。本申请实施例还提供了一种摄像机位置的确定设备,所述设备包括:处理器和接口;所述接口和所述处理器通信,所述接口用于提供数据(由于处理器本身几乎不拥有存储数据的功能,因此处理器执行方法时所需要的数据都可以通过接口获得,例如:第一图像、时空轨迹数据)给所述处理器。所述处理器通过所述接口接收数据然后运行程序指令,以便对所述接口提供的数据进行处理,从而执行以上实施例提供的摄像机位置的确定方法。在一些情况下,接口和处理器之间可以采用总线之外的其他通信方式。In some cases, the memory is not necessary, or the memory can be integrated with the processor. The embodiment of the present application also provides a device for determining the position of a camera. The device includes: a processor and an interface; the interface communicates with the processor, and the interface is used to provide data (because the processor itself hardly owns The function of storing data, so the data required by the processor to execute the method can be obtained through the interface, for example: the first image, spatiotemporal trajectory data) to the processor. The processor receives data through the interface and then runs program instructions to process the data provided by the interface, so as to execute the method for determining the position of the camera provided in the above embodiments. In some cases, communication methods other than the bus may be used between the interface and the processor.
本申请实施例还提供了一种计算机可读存储介质,包括指令,当其在计算机上运行时,使得计算机执行以上实施例提供的摄像机位置的确定方法。The embodiments of the present application also provide a computer-readable storage medium, including instructions, which when run on a computer, cause the computer to execute the method for determining the position of the camera provided in the above embodiments.
本申请实施例还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行以上实施例提供的摄像机位置的确定方法。The embodiments of the present application also provide a computer program product containing instructions, which when run on a computer, cause the computer to execute the method for determining the position of the camera provided in the above embodiments.
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third", "fourth", etc. (if any) in the description and claims of this application and the above-mentioned drawings are used to distinguish similar objects, without having to use To describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments described herein can be implemented in a sequence other than the content illustrated or described herein. In addition, the terms "including" and "having" and any variations of them are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those clearly listed. Those steps or units may include other steps or units that are not clearly listed or are inherent to these processes, methods, products, or equipment.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and conciseness of the description, the specific working process of the above-described system, device, and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,单元的划分,仅仅为一种逻辑业务划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以 结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, device, and method may be implemented in other ways. For example, the device embodiments described above are merely illustrative, for example, the division of units is only a logical business division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or integrated. To another system, or some features can be ignored, or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各业务单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件业务单元的形式实现。In addition, the service units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software business unit.
集成的单元如果以软件业务单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software business unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solution of the present application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods in the various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes. .
本领域技术人员应该可以意识到,在上述一个或多个示例中,本发明所描述的业务可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些业务存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。Those skilled in the art should be aware that, in one or more of the foregoing examples, the services described in the present invention can be implemented by hardware, software, firmware, or any combination thereof. When implemented by software, these services can be stored in a computer-readable medium or transmitted as one or more instructions or codes on the computer-readable medium. The computer-readable medium includes a computer storage medium and a communication medium, where the communication medium includes any medium that facilitates the transfer of a computer program from one place to another. The storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.
以上的具体实施方式,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上仅为本发明的具体实施方式而已。The above specific implementations further describe the objectives, technical solutions, and beneficial effects of the present invention in further detail. It should be understood that the above are only specific implementations of the present invention.
以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。The above embodiments are only used to illustrate the technical solutions of the application, not to limit them; although the application has been described in detail with reference to the foregoing embodiments: it is still possible to modify or modify the technical solutions described in the foregoing embodiments. Some of the technical features are equivalently replaced; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims (18)

  1. 一种摄像机位置的确定方法,其特征在于,所述方法包括:A method for determining the position of a camera, characterized in that the method includes:
    获取摄像机拍摄的包括第一车辆的第一图像,并确定所述第一图像的拍摄时刻;Acquiring a first image including a first vehicle captured by a camera, and determining a shooting moment of the first image;
    获取所述第一车辆的时空轨迹数据,并根据所述第一车辆的时空轨迹数据确定所述第一车辆在所述拍摄时刻所处的第一位置;Acquiring spatiotemporal trajectory data of the first vehicle, and determining the first position of the first vehicle at the shooting moment according to the spatiotemporal trajectory data of the first vehicle;
    获取所述第一位置和第二位置的空间位置关系,所述第二位置为所述摄像机的地理坐标的位置;Acquiring a spatial position relationship between the first position and a second position, where the second position is the geographic coordinate position of the camera;
    根据所述第一位置、所述第一位置和第二位置的空间位置关系,确定所述第二位置。The second position is determined according to the spatial position relationship between the first position, the first position, and the second position.
  2. 根据权利要求1所述的方法,其特征在于,所述第一位置和第二位置的空间位置关系,包括:The method according to claim 1, wherein the spatial position relationship between the first position and the second position comprises:
    所述第一位置和所述第二位置之间的距离,和/或,所述第一位置和所述第二位置之间的相对方向。The distance between the first position and the second position, and/or the relative direction between the first position and the second position.
  3. 根据权利要求2所述的方法,其特征在于,所述第一位置和所述第二位置之间的距离,通过如下方式确定:The method according to claim 2, wherein the distance between the first position and the second position is determined in the following manner:
    根据所述第一图像确定目标对象在所述第一图像中的位置,并根据所确定的所述目标对象在所述第一图像中的位置,确定所述第一位置与第二位置之间的距离;所述目标对象位于所述第一车辆。Determine the position of the target object in the first image according to the first image, and determine the position between the first position and the second position according to the determined position of the target object in the first image The distance; the target object is located in the first vehicle.
  4. 根据权利要求2所述的方法,其特征在于,所述第一位置和所述第二位置之间的相对方向,通过如下方式确定:The method according to claim 2, wherein the relative direction between the first position and the second position is determined in the following manner:
    根据所述第一车辆的时空轨迹数据,确定所述第一车辆的行驶方向;以及确定所述摄像机的拍摄方向;Determining the traveling direction of the first vehicle according to the spatiotemporal trajectory data of the first vehicle; and determining the shooting direction of the camera;
    根据所述第一车辆的行驶方向和所述摄像机的拍摄方向,确定所述第一位置和所述第二位置之间的相对方向;所述摄像机的拍摄方向,与所述第一车辆的行驶方向一致或者与所述第一车辆的行驶方向的逆方向一致。According to the driving direction of the first vehicle and the shooting direction of the camera, determine the relative direction between the first position and the second position; the shooting direction of the camera is the same as the driving direction of the first vehicle The direction is the same or the direction opposite to the traveling direction of the first vehicle.
  5. 根据权利要求1所述的方法,其特征在于,所述根据所述第一位置、所述第一位置和第二位置的空间位置关系,确定所述第二位置,包括:The method according to claim 1, wherein the determining the second position according to the spatial position relationship between the first position, the first position and the second position comprises:
    根据所述第一图像确定目标对象在所述第一图像中的位置,并根据所获得的所述目标对象在所述第一图像中的位置,确定所述第一位置与第二位置之间的距离;所述目标对象位于所述第一车辆;Determine the position of the target object in the first image according to the first image, and determine the position between the first position and the second position according to the obtained position of the target object in the first image The distance; the target object is located in the first vehicle;
    根据所述第一车辆的时空轨迹数据、所述距离以及所述第一位置,确定所述第二位置。The second position is determined according to the spatiotemporal trajectory data of the first vehicle, the distance, and the first position.
  6. 根据权利要求5所述的方法,其特征在于,所述根据所述第一车辆的时空轨迹数据、所述距离以及所述第一位置,确定所述第二位置,包括:The method according to claim 5, wherein the determining the second position according to the spatiotemporal trajectory data of the first vehicle, the distance, and the first position comprises:
    根据所述第一车辆的时空轨迹数据,确定所述第一车辆的行驶方向;并确定所述摄像机的拍摄方向;所述摄像机的拍摄方向,与所述第一车辆的行驶方向一致或者与所述第一车辆的行驶方向的逆方向一致;According to the spatio-temporal trajectory data of the first vehicle, determine the traveling direction of the first vehicle; and determine the shooting direction of the camera; the shooting direction of the camera is consistent with the traveling direction of the first vehicle or is consistent with the traveling direction of the first vehicle. The reverse direction of the traveling direction of the first vehicle is consistent;
    根据所述第一车辆的行驶方向和所述摄像机的拍摄方向,确定所述第一位置和所述第二位置之间的相对方向;Determining the relative direction between the first position and the second position according to the driving direction of the first vehicle and the shooting direction of the camera;
    根据所述第一位置和所述第二位置之间的相对方向、所述第一位置和所述距离,确 定所述第二位置。The second position is determined according to the relative direction between the first position and the second position, the first position and the distance.
  7. 根据权利要求3或5所述的方法,其特征在于,所述根据所述目标对象在所述第一图像中的位置,确定所述第一位置与第二位置之间的距离,包括:The method according to claim 3 or 5, wherein the determining the distance between the first position and the second position according to the position of the target object in the first image comprises:
    根据预先确定的位置与距离之间的映射关系,获得与所述目标对象在所述第一图像中的位置对应的距离,将获得的所述距离确定为所述第一位置与所述第二位置之间的距离;According to the predetermined mapping relationship between the position and the distance, the distance corresponding to the position of the target object in the first image is obtained, and the obtained distance is determined as the first position and the second position. The distance between locations;
    所述预先确定的位置与距离之间的映射关系,包括所述目标对象在所述第一图像中的位置、与所述第二位置与所述第一位置之间的距离之间的映射关系。The predetermined mapping relationship between the position and the distance includes the mapping relationship between the position of the target object in the first image and the distance between the second position and the first position .
  8. 根据权利要求1所述的方法,其特征在于,所述根据所述第一位置、第一位置和第二位置的空间位置关系,确定所述第二位置,包括:The method according to claim 1, wherein the determining the second position according to the spatial position relationship between the first position, the first position and the second position comprises:
    将所述第一位置确定为所述第二位置。The first position is determined as the second position.
  9. 根据权利要求1所述的方法,其特征在于,在获取摄像机拍摄的包括第一车辆的第一图像之后,确定所述第一图像的拍摄时刻之前,所述方法还包括:The method according to claim 1, wherein after acquiring the first image including the first vehicle captured by the camera and before determining the shooting moment of the first image, the method further comprises:
    对所述第一图像进行分析,识别出所述第一车辆的车牌号;Analyzing the first image to identify the license plate number of the first vehicle;
    将所述第一车辆的车牌号与具备时空轨迹数据上报功能的车辆的车牌号进行匹配,若匹配成功,则确定所述第一车辆为具备时空轨迹数据上报功能的车辆。The license plate number of the first vehicle is matched with the license plate number of the vehicle with the spatiotemporal trajectory data reporting function, and if the matching is successful, it is determined that the first vehicle is a vehicle with the spatiotemporal trajectory data reporting function.
  10. 根据权利要求3、5-7任意一项所述的方法,其特征在于,所述目标对象,包括:The method according to any one of claims 3 and 5-7, wherein the target object comprises:
    车牌,或者,车标。License plate, or, car logo.
  11. 一种摄像机位置的确定装置,其特征在于,所述装置包括:A device for determining the position of a camera, characterized in that the device comprises:
    第一获取单元,用于获取摄像机拍摄的包括第一车辆的第一图像;The first acquiring unit is configured to acquire the first image including the first vehicle captured by the camera;
    第一确定单元,用于确定所述第一图像的拍摄时刻;A first determining unit, configured to determine the shooting moment of the first image;
    第二获取单元,用于获取所述第一车辆的时空轨迹数据;The second acquiring unit is used to acquire the spatiotemporal trajectory data of the first vehicle;
    第二确定单元,用于根据所述第一车辆的时空轨迹数据确定所述第一车辆在所述拍摄时刻所处的第一位置;A second determining unit, configured to determine the first position of the first vehicle at the shooting moment according to the spatio-temporal trajectory data of the first vehicle;
    第三获取单元,用于获取所述第一位置和第二位置的空间位置关系,所述第二位置为所述摄像机的地理坐标的位置;A third acquiring unit, configured to acquire the spatial position relationship between the first position and the second position, where the second position is the geographic coordinate position of the camera;
    第三确定单元,用于根据所述第一位置、所述第一位置和第二位置的空间位置关系,确定所述第二位置。The third determining unit is configured to determine the second position according to the first position, the spatial position relationship between the first position and the second position.
  12. 根据权利要求11所述的装置,其特征在于,所述第三确定单元,包括:The device according to claim 11, wherein the third determining unit comprises:
    第一确定子单元,用于根据所述第一图像确定目标对象在所述第一图像中的位置;所述目标对象位于所述第一车辆;The first determining subunit is configured to determine the position of the target object in the first image according to the first image; the target object is located in the first vehicle;
    第二确定子单元,用于根据所获得的所述目标对象在所述第一图像中的位置,确定所述第一位置与第二位置之间的距离;A second determining subunit, configured to determine the distance between the first position and the second position according to the obtained position of the target object in the first image;
    第三确定子单元,用于根据所述第一车辆的时空轨迹数据、所述距离以及所述第一位置,确定所述第二位置。The third determining subunit is configured to determine the second position according to the spatiotemporal trajectory data of the first vehicle, the distance, and the first position.
  13. 根据权利要求12所述的装置,其特征在于,所述第三确定子单元,具体用于:The device according to claim 12, wherein the third determining subunit is specifically configured to:
    根据所述第一车辆的时空轨迹数据,确定所述第一车辆的行驶方向;并确定所述摄像机的拍摄方向;所述摄像机的拍摄方向,与所述第一车辆的行驶方向一致或者与所述 第一车辆的行驶方向的逆方向一致;According to the spatio-temporal trajectory data of the first vehicle, determine the traveling direction of the first vehicle; and determine the shooting direction of the camera; the shooting direction of the camera is consistent with the traveling direction of the first vehicle or is consistent with the traveling direction of the first vehicle. The reverse direction of the traveling direction of the first vehicle is consistent;
    根据所述第一车辆的行驶方向和所述摄像机的拍摄方向,确定所述第一位置和所述第二位置之间的相对方向;Determining the relative direction between the first position and the second position according to the driving direction of the first vehicle and the shooting direction of the camera;
    根据所述第一位置和所述第二位置之间的相对方向、所述第一位置和所述距离,确定所述第二位置。The second position is determined according to the relative direction between the first position and the second position, the first position and the distance.
  14. 根据权利要求12所述的装置,其特征在于,所述第二确定子单元,具体用于:The device according to claim 12, wherein the second determining subunit is specifically configured to:
    根据预先确定的位置与距离之间的映射关系,获得与所述目标对象在所述第一图像中的位置对应的距离,将获得的所述距离确定为所述第一位置与所述第二位置之间的距离;According to the predetermined mapping relationship between the position and the distance, the distance corresponding to the position of the target object in the first image is obtained, and the obtained distance is determined as the first position and the second position. The distance between locations;
    所述预先确定的位置与距离之间的映射关系,包括所述目标对象在所述第一图像中的位置、与所述第二位置与所述第一位置之间的距离之间的映射关系。The predetermined mapping relationship between the position and the distance includes the mapping relationship between the position of the target object in the first image and the distance between the second position and the first position .
  15. 根据权利要求11所述的装置,其特征在于,所述第三确定单元,具体用于:The device according to claim 11, wherein the third determining unit is specifically configured to:
    将所述第一位置确定为所述第二位置。The first position is determined as the second position.
  16. 根据权利要求11所述的装置,其特征在于,所述装置还包括:The device according to claim 11, wherein the device further comprises:
    图像分析单元,用于对所述第一图像进行分析,识别出所述第一车辆的车牌号;An image analysis unit, configured to analyze the first image and identify the license plate number of the first vehicle;
    第四确定单元,用于将所述第一车辆的车牌号与具备时空轨迹数据上报功能的车辆的车牌号进行匹配,若匹配成功,则确定所述第一车辆为具备时空轨迹数据上报功能的车辆。The fourth determining unit is configured to match the license plate number of the first vehicle with the license plate number of the vehicle with spatiotemporal trajectory data reporting function, and if the matching is successful, determine that the first vehicle is the one with spatiotemporal trajectory data reporting function vehicle.
  17. 一种摄像机位置的确定设备,其特征在于,所述设备包括:处理器和接口;A device for determining the position of a camera, characterized in that the device includes: a processor and an interface;
    所述接口,用于提供数据给所述处理器;The interface is used to provide data to the processor;
    所述处理器和所述接口通信,用于通过所述接口接收数据,通过运行程序指令执行权利要求1-10任意一项所述的方法。The processor communicates with the interface, and is configured to receive data through the interface, and execute the method according to any one of claims 1-10 by running program instructions.
  18. 一种计算机可读存储介质,其特征在于,包括指令,当其在计算机上运行时,使得计算机执行以上权利要求1-10任意一项所述的方法。A computer-readable storage medium, characterized by comprising instructions, which when run on a computer, causes the computer to execute the method according to any one of claims 1-10.
PCT/CN2020/094793 2019-09-05 2020-06-07 Method and apparatus for determining position of camera WO2021042792A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910839184.3A CN112446920A (en) 2019-09-05 2019-09-05 Method and device for determining position of camera
CN201910839184.3 2019-09-05

Publications (1)

Publication Number Publication Date
WO2021042792A1 true WO2021042792A1 (en) 2021-03-11

Family

ID=74733005

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/094793 WO2021042792A1 (en) 2019-09-05 2020-06-07 Method and apparatus for determining position of camera

Country Status (2)

Country Link
CN (1) CN112446920A (en)
WO (1) WO2021042792A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112950726B (en) * 2021-03-25 2022-11-11 深圳市商汤科技有限公司 Camera orientation calibration method and related product

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105336171A (en) * 2015-10-16 2016-02-17 浙江宇视科技有限公司 Camera position calibration method and device
CN106412402A (en) * 2016-10-31 2017-02-15 浙江宇视科技有限公司 Configuration method and apparatus of camera preset positions
CN106651916A (en) * 2016-12-29 2017-05-10 深圳市深网视界科技有限公司 Target positioning tracking method and device
CN106650724A (en) * 2016-10-31 2017-05-10 北京汽车集团有限公司 Method and device for building traffic sign database
CN109146958A (en) * 2018-08-15 2019-01-04 北京领骏科技有限公司 A kind of traffic sign method for measuring spatial location based on two dimensional image

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109166155B (en) * 2018-09-26 2021-12-17 北京图森智途科技有限公司 Method and device for calculating distance measurement error of vehicle-mounted binocular camera
CN109829401A (en) * 2019-01-21 2019-05-31 深圳市能信安科技股份有限公司 Traffic sign recognition method and device based on double capture apparatus

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105336171A (en) * 2015-10-16 2016-02-17 浙江宇视科技有限公司 Camera position calibration method and device
CN106412402A (en) * 2016-10-31 2017-02-15 浙江宇视科技有限公司 Configuration method and apparatus of camera preset positions
CN106650724A (en) * 2016-10-31 2017-05-10 北京汽车集团有限公司 Method and device for building traffic sign database
CN106651916A (en) * 2016-12-29 2017-05-10 深圳市深网视界科技有限公司 Target positioning tracking method and device
CN109146958A (en) * 2018-08-15 2019-01-04 北京领骏科技有限公司 A kind of traffic sign method for measuring spatial location based on two dimensional image

Also Published As

Publication number Publication date
CN112446920A (en) 2021-03-05

Similar Documents

Publication Publication Date Title
CN109657564B (en) Personnel on-duty detection method and device, storage medium and terminal equipment
US11212491B2 (en) Data management of connected cars cameras for homeland security and smart cities
CN109974734A (en) A kind of event report method, device, terminal and storage medium for AR navigation
US20200074196A1 (en) Method and apparatus for recognizing object, device, vehicle and medium
US10984275B1 (en) Determining location coordinates of a vehicle based on license plate metadata and video analytics
CN111046762A (en) Object positioning method, device electronic equipment and storage medium
CN114666473B (en) Method, system, terminal and storage medium for monitoring farmland protection video
CN109814137B (en) Positioning method, positioning device and computing equipment
CN112950717B (en) Space calibration method and system
WO2021184628A1 (en) Image processing method and device
WO2021042792A1 (en) Method and apparatus for determining position of camera
CN111178235A (en) Target quantity determination method, device, equipment and storage medium
EP3588325A1 (en) Method, device and system for processing image tagging information
CN113252045B (en) Device positioning method and device, electronic device and readable storage medium
US11417098B1 (en) Determining location coordinates of a vehicle based on license plate metadata and video analytics
CN111507332A (en) Vehicle VIN code detection method and equipment
WO2021088504A1 (en) Road junction detection method and apparatus, neural network training method and apparatus, intelligent driving method and apparatus, and device
CN114820679B (en) Image labeling method and device electronic device and storage medium
CN109345567B (en) Object motion track identification method, device, equipment and storage medium
WO2022204953A1 (en) Method and apparatus for determining pitch angle, and terminal device
CN111982132A (en) Data processing method, device and storage medium
WO2022016355A1 (en) Method and apparatus for determining labeling information
CN112215036A (en) Cross-mirror tracking method, device, equipment and storage medium
CN110427911B (en) Road detection method, device, equipment and storage medium
CN112883973A (en) License plate recognition method and device, electronic equipment and computer storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20861420

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20861420

Country of ref document: EP

Kind code of ref document: A1