Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose a method, an apparatus, and a terminal device for planning a path on a video screen to solve one or more of the technical problems mentioned in the above background.
In a first aspect, some embodiments of the present disclosure provide a method of planning a path on a video screen, the method comprising: acquiring a target image to be processed, a start point coordinate and an end point coordinate, wherein the target image is a camera picture image, and the start point coordinate and the end point coordinate are pixel coordinates in the target image; generating a target starting point coordinate and a target ending point coordinate based on the starting point coordinate and the ending point coordinate, wherein the target starting point coordinate and the target ending point coordinate are earth coordinates in a physical space; generating a target path coordinate sequence based on the target starting point coordinate and the target ending point coordinate; generating an image path coordinate sequence based on the target path coordinate sequence; and sending the target image and the image path coordinate sequence to target equipment with a display function, wherein the target equipment displays the target image and the image path coordinate sequence.
In some embodiments, said generating target start point coordinates and target end point coordinates based on said start point coordinates and said end point coordinates comprises:
generating target starting point coordinates based on the starting point coordinates using the following equation:
wherein (u)1,v1) For the start point coordinates, the lower right hand corner mark 1 characterizes the start point, (X)1,Y1) The coordinates of the target starting point, R is a rotation matrix, t is a translation matrix, R and t are predetermined matrices, s is a predetermined depth value of the camera, and M is a predetermined parameter matrix of the camera;
generating target end point coordinates based on the end point coordinates using the following equation:
wherein (A), (B), (C), (D), (C), (B), (C)u2,v2) For the coordinates of the termination point, the lower right corner mark 2 characterizes the termination point, (X)2,Y2) And (3) regarding the coordinates of the target termination point, wherein R is a rotation matrix, t is a translation matrix, R and t are predetermined matrices, s is a predetermined camera depth value, and M is a predetermined camera parameter matrix.
In some embodiments, said converting the target path coordinates to image path coordinates comprises:
the target path coordinates are converted to image path coordinates using the following equation:
wherein (u)i,vi) For the image path coordinates, the lower right hand corner mark i characterizes the target path, (X)i,Yi) For the target path coordinates, R is a rotation matrix, t is a translation matrix, R and t are predetermined matrices, s is a predetermined camera depth value, and M is a predetermined camera parameter matrix.
In a second aspect, some embodiments of the present disclosure provide an apparatus for planning an optimal path on a video screen, the apparatus comprising: the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is configured to acquire a target image to be processed, a starting point coordinate and an ending point coordinate, wherein the target image is a camera picture image, and the starting point coordinate and the ending point coordinate are pixel coordinates in the target image; a first generating unit configured to generate a target start point coordinate and a target end point coordinate based on a start point coordinate and an end point coordinate, wherein the target start point coordinate and the target end point coordinate are earth coordinates in a physical space; a second generation unit configured to generate a target path coordinate sequence based on the target start point coordinates and the target end point coordinates; a third generating unit configured to generate an image path coordinate sequence based on the target path coordinate sequence; a display unit configured to transmit the target image and the image path coordinate sequence to a target device having a display function, wherein the target device displays the target image and the image path coordinate sequence.
In a third aspect, some embodiments of the present disclosure provide a terminal device, including: one or more processors; a storage device having one or more programs stored thereon which, when executed by one or more processors, cause the one or more processors to implement a method as in any one of the first aspects.
In a fourth aspect, some embodiments of the disclosure provide a computer readable storage medium having a computer program stored thereon, wherein the program when executed by a processor implements the method as in any one of the first aspect.
The above embodiments of the present disclosure have the following advantages: according to the method for planning the optimal path on the video picture, the target path coordinate sequence can be generated according to the starting point coordinate and the ending point coordinate in the target image, the target path coordinate sequence is converted into the image path coordinate sequence, the target image and the image path coordinate sequence are directly displayed by the target equipment, the path can be directly planned in the camera picture image to be processed, and the path planning efficiency is improved. Specifically, the inventor finds that the reason why the optimal path cannot be planned on the real-time video and the route track is displayed on the video layer in an overlapping manner at present is as follows: in the prior art, only path planning is carried out in a two-dimensional/three-dimensional map model, and a starting point and an end point cannot be directly set on a real-time video picture. Based on this, first, some embodiments of the present disclosure acquire a target image to be processed, start point coordinates, and end point coordinates. The target image is a camera picture image captured in real time, and the starting point coordinate and the ending point coordinate are pixel coordinates in the target image. And secondly, generating target starting point coordinates and target end point coordinates based on the starting point coordinates and the end point coordinates. And the target starting point coordinate and the target end point coordinate are earth coordinates in a physical space. And thirdly, generating a target path coordinate sequence based on the target starting point coordinate and the target end point coordinate, so that the starting point coordinate and the end point coordinate in the two-dimensional/three-dimensional map model are converted into the earth coordinate in the physical space, and then the target path coordinate sequence in the earth space is generated. Then, based on the target path coordinate sequence, an image path coordinate sequence is generated. The shortest path in earth space is translated back to the shortest path in the two-dimensional/three-dimensional map model. And finally, sending the target image and the image path coordinate sequence to target equipment with a display function. Wherein the target device displays the target image and the image path coordinate sequence. The target device superposes and displays the route track on the video layer, thereby solving the problem of directly determining and displaying the shortest path in the video and improving the user experience.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary system architecture 100 to which embodiments of the method of planning a path on a video screen of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as a data processing application, an information generation application, a path planning application, and the like.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various terminal devices having a display screen, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the above-listed terminal apparatuses. It may be implemented as a plurality of software or software modules (e.g. to provide the initial information sequence and the set of candidate information, etc.) or as a single software or software module. And is not particularly limited herein.
The server 105 may be a server that provides various services, such as a server that stores target images to be processed, start point coordinates, end point coordinates, and the like, which are input by the terminal apparatuses 101, 102, 103. The server may process the received target image to be processed, the start point coordinates, and the end point coordinates, and feed back a processing result (e.g., a target path coordinate sequence) to the terminal device.
It should be noted that the method for planning a path on a video screen provided by the embodiment of the present disclosure may be executed by the server 105, or may be executed by the terminal device.
It should be noted that the local area of the server 105 may also directly store the target image to be processed, the start point coordinates, and the end point coordinates, and the server 105 may directly extract the local target image to be processed, the start point coordinates, and the end point coordinates to obtain the image path coordinate sequence after processing, in this case, the exemplary system architecture 100 may not include the terminal devices 101, 102, 103 and the network 104.
It should be noted that the terminal apparatuses 101, 102, and 103 may also have a path planning application installed thereon, and in this case, the processing method may also be executed by the terminal apparatuses 101, 102, and 103. At this point, the exemplary system architecture 100 may also not include the server 105 and the network 104.
The server 105 may be hardware or software. When the server 105 is hardware, it may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When the server is software, it may be implemented as a plurality of software or software modules (for example, for providing a service of planning a path on a video screen), or may be implemented as a single software or software module. And is not particularly limited herein.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to fig. 2, a flow 200 of some embodiments of a method of planning a path on a video screen in accordance with the present disclosure is shown. The method for planning the path on the video picture comprises the following steps:
step 201, acquiring a target image to be processed, a start point coordinate and an end point coordinate.
In some embodiments, an executing body (e.g., a server shown in fig. 1) of the method of planning a path on a video screen acquires a target image to be processed, start point coordinates, and end point coordinates. The target image is a camera picture image, and the starting point coordinate and the ending point coordinate are pixel coordinates in the target image. Specifically, the target image may be a frame image captured in real time from a video played by the camera. The start point coordinates and the end point coordinates may be coordinates in an image coordinate system.
Step 202, generating a target starting point coordinate and a target ending point coordinate based on the starting point coordinate and the ending point coordinate.
In some embodiments, the execution subject generates the target start point coordinates and the target end point coordinates based on the start point coordinates and the end point coordinates. Specifically, the start point coordinate and the end point coordinate are used for calculating the angle offset of the start point coordinate and the end point coordinate in the camera mirror surface according to the optical path tracking mode, and the three-dimensional penetration calculation of a three-dimensional emission ray and an earth model is realized through the position, the height, the posture and the angle deviation of the camera, so that the earth coordinate position of the intersection point is determined. Specifically, the target start point coordinates and the target end point coordinates may be coordinates in an earth coordinate system.
Specifically, the target start point coordinates may be generated based on the start point coordinates using the following equation:
wherein (u)1,v1) For the coordinates of the starting point, the lower right hand corner 1 characterizes the starting point. (X)1,Y1) Is the coordinate of the target starting point, R is the rotation matrix, t is the translation momentThe matrix, R and t are predetermined matrices, and s is a predetermined camera depth value. M is a predetermined camera parameter matrix. Specifically, R, t, s, and M are all camera-related predetermined parameters, determined by the particular camera that captured the video.
Specifically, the target termination point coordinate may be generated based on the termination point coordinate using the following formula:
wherein (u)2,v2) For the coordinates of the termination point, the lower right corner mark 2 characterizes the termination point. (X)2,Y2) The coordinates of the target end point, R is a rotation matrix, t is a translation matrix, R and t are predetermined matrices, and s is a predetermined camera depth value. M is a predetermined camera parameter matrix. Specifically, R, t, s, and M are all camera-related predetermined parameters, determined by the particular camera that captured the video.
Specifically, the target start point and the target end point may be generated by using a coordinate transformation method in an image space and a physical space in consideration of a camera distortion effect.
And step 203, generating a target path coordinate sequence based on the target starting point coordinate and the target ending point coordinate.
In some embodiments, the execution subject generates the target path coordinate sequence based on the target start point coordinates and the target end point coordinates.
Optionally, for each pixel point in the target image, the target pixel coordinate of the pixel point is determined, so as to obtain a target pixel set. The target start point coordinates are deleted from the target set of pixels. Specifically, the target pixel set is obtained by deleting the target starting point. The target pixel set includes pixels of the target image other than the target start point.
Optionally, a first coordinate sequence is generated. Wherein the first coordinate sequence is an empty set. And putting the target starting point coordinates into the first coordinate sequence. The target set of pixels is determined as a second sequence of coordinates. Selecting a first coordinate from the first coordinate sequence, and executing the following steps:
the method comprises the following steps: and determining candidate first coordinates according to the first coordinate and the second coordinate sequence. And the candidate first coordinate is the coordinate with the shortest distance from the first coordinate, and the candidate first coordinate is the coordinate in the second coordinate sequence. And deleting the candidate first coordinate from the second coordinate sequence. And putting the candidate first coordinate into the first coordinate sequence. And determining the first coordinate sequence as a target path coordinate sequence in response to the target end point coordinate being placed in the first coordinate sequence. Specifically, the candidate first coordinate may be determined by a dixotera algorithm, or may be determined by a verloede algorithm. Specifically, the candidate first coordinate may be a coordinate that meets a driving route requirement, and the candidate first coordinate may also be a coordinate that meets a riding route requirement. The candidate first coordinates may also be coordinates that satisfy the pedestrian-link requirement.
And step 204, generating an image path coordinate sequence based on the target path coordinate sequence.
In some embodiments, the execution subject generates the image path coordinate sequence based on the target path coordinate sequence. Optionally, for each target path coordinate in the target path coordinate sequence, the target path coordinate is converted into an image path coordinate to obtain an image path coordinate sequence. For each target path coordinate in the target path coordinate sequence, converting the target path coordinate to an image path coordinate using:
wherein (u)i,vi) For the image path coordinates, the lower right hand corner mark i characterizes the target path. (X)i,Yi) For the target path coordinates, R is a rotation matrix, t is a translation matrix, and R and t are predetermined matrices. s is a predetermined camera depth value and M is a predetermined camera parameter matrix. In particular, R, t, s and M are camera-dependent predeterminationsThe specific parameters are determined by a camera which specifically shoots the video.
The optional contents in the above step 202 and step 204 are: the technical content of generating the image path coordinate sequence according to the starting point and the ending point directly defined in the video is taken as an invention point of the embodiment of the disclosure, and the technical problem mentioned in the background technology is solved. ". The factors that result in failing to meet the shortest path application requirements in the real world are often as follows: in the prior art, only path planning is performed in a two-dimensional/three-dimensional map model, and the path planning application in the video playing process cannot be met. If the above factors are solved, the effect of improving the application level of the path planning can be achieved. To achieve this effect, the present disclosure introduces a way of converting an image coordinate system and a terrestrial coordinate system to perform path planning. First, the start point coordinates and the end point coordinates in the image coordinate system are converted into target start point coordinates and target end point coordinates in the terrestrial coordinate system. And then, determining a target path coordinate sequence according to the target starting point coordinate and the target end point coordinate. The target path coordinate sequence is the shortest path in the earth coordinate system. And finally, converting the target path coordinate sequence into an image path coordinate sequence. The image path coordinate sequence is the shortest path in the image coordinate system and can be subsequently used for overlaying display directly in the video. The shortest path can be directly determined in the image captured in real time in the video of the camera by converting the coordinates in the image coordinate system and the earth coordinate system, so that the path planning in the video playing process is met, the application level of the path planning is improved, and the technical problem II is solved.
Step 205, the target image and the image path coordinate sequence are sent to a target device with a display function.
Optionally, the execution body sends the target image and the image path coordinate sequence to a target device with a display function. Wherein the target device displays the target image and the image path coordinate sequence. Optionally, the target device displays, in the target image, a line corresponding to each image path coordinate in the image path coordinate sequence in a layer-by-layer manner. Specifically, the image layer superposition may be to superimpose the image path coordinate sequence according to the brightness of the target image to form a superimposed presentation effect. Specifically, the image path coordinate sequence and the target image may be merged into one image layer by an intersection, union, or erasure method for displaying.
One embodiment presented in fig. 2 has the following beneficial effects: acquiring a target image to be processed, a start point coordinate and an end point coordinate, wherein the target image is a camera picture image; generating a target starting point coordinate and a target ending point coordinate based on the starting point coordinate and the ending point coordinate; generating a target path coordinate sequence; generating an image path coordinate sequence based on the target path coordinate sequence; and sending the target image and the image path coordinate sequence to a target device with a display function. The method comprises the steps of generating a target path coordinate sequence according to a starting point coordinate and an ending point coordinate in a target image, converting the target path coordinate sequence into an image path coordinate sequence, and directly displaying the target image and the image path coordinate sequence by using target equipment so as to directly plan a path in a camera picture image to be processed and improve path planning efficiency.
With further reference to fig. 3, as an implementation of the above-described methods for the above-described figures, the present disclosure provides some embodiments of an apparatus for planning an optimal path on a video screen, which correspond to those of the method embodiments described above for fig. 2, and which may be applied in various terminal devices in particular.
As shown in fig. 3, the apparatus 300 for planning an optimal path on a video screen of some embodiments includes: a receiving unit 301, a first generating unit 302, a second generating unit 303, a third generating unit 304, and a display unit 305. The receiving unit 301 is configured to acquire a target image to be processed, a start point coordinate, and an end point coordinate. The target image is a camera picture image, and the starting point coordinate and the ending point coordinate are pixel coordinates in the target image. A first generating unit 302 configured to generate a target start point coordinate and a target end point coordinate based on the start point coordinate and the end point coordinate. And the target starting point coordinate and the target end point coordinate are earth coordinates in a physical space. A second generating unit 303 configured to generate a target path coordinate sequence based on the target start point coordinates and the target end point coordinates. A third generating unit 304 configured to generate an image path coordinate sequence based on the target path coordinate sequence. A display unit 305 configured to transmit the target image and the image path coordinate sequence to a target device having a display function. Wherein the target device displays the target image and the image path coordinate sequence.
It will be understood that the units described in the apparatus 300 correspond to the various steps in the method described with reference to fig. 2. Thus, the operations, features and resulting advantages described above with respect to the method are also applicable to the apparatus 300 and the units included therein, and are not described herein again.
Referring now to FIG. 4, shown is a block diagram of a computer system 400 suitable for use in implementing a terminal device of an embodiment of the present disclosure. The terminal device shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 4, the computer system 400 includes a Central Processing Unit (CPU)401 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 402 or a program loaded from a storage section 406 into a Random Access Memory (RAM) 403. In the RAM403, various programs and data necessary for the operation of the system 400 are also stored. The CPU 401, ROM 402, and RAM403 are connected to each other via a bus 404. An Input/Output (I/O) interface 405 is also connected to the bus 404.
The following components are connected to the I/O interface 405: a storage section 406 including a hard disk and the like; and a communication section 407 including a Network interface card such as a LAN (Local Area Network) card, a modem, or the like. The communication section 407 performs communication processing via a network such as the internet. A drive 408 is also connected to the I/O interface 405 as needed. A removable medium 409 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted as necessary on the drive 408, so that a computer program read out therefrom is mounted as necessary in the storage section 406.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 407 and/or installed from the removable medium 409. The above-described functions defined in the method of the present disclosure are performed when the computer program is executed by a Central Processing Unit (CPU) 401. It should be noted that the computer readable medium in the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer-readable signal medium may include a propagated data signal with computer-readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the C language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is possible without departing from the inventive concept as defined above. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.