Method and apparatus for calculating actual distances between coordinates in an image
The method transforms pixel coordinates into world coordinates using camera parameters and orientation, addressing the lack of actual distance reflection in 3D tours, enabling precise spatial measurements.
Patent Information
- Application Number
- JP2022169083
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2022-05-27
- Filing Date
- 2022-10-21
- Publication Date
- 2024-10-30
- Estimated Expiration
- 2042-10-21
AI Technical Summary
Existing 3D tours generated from 360-degree images lack the ability to accurately reflect actual distances, making it difficult for users to make informed decisions about space arrangements.
A method and apparatus for calculating actual distances between coordinates in an image using camera internal parameters and orientation information to transform pixel coordinates into world coordinates, allowing for precise distance measurements.
Enables accurate calculation of distances and heights within 3D tours, facilitating better spatial understanding and decision-making based on actual lengths.
Smart Images

Figure 0007575805000006 
Figure 0007575805000007 
Figure 0007575805000008
Abstract
Description
[Technical field]
[0001] The technical field relates to providing images to a user, and more particularly to an apparatus and method for calculating actual distances between coordinates in an image. [Background technology]
[0002] The most preferable method for recording a 3D space is to photograph the space in all directions (360 degrees), store it in the form of a 360-degree image, and connect the 360-degree images for each position to create a 3D tour. Such a 3D tour can be visually viewed by a user through a virtual reality viewer (VR viewer). However, a 3D tour is merely a method for checking an image virtually from a user's position, and it is difficult to consider that the actual length is actually reflected. Therefore, in order for a user to spherically arrange interiors and furniture arrangements taking into account the actual length of the space reflected through the 3D tour, a method is required for measuring the actual length within the 3D tour, i.e., within the 360-degree image. Summary of the Invention [Problem to be solved by the invention]
[0003] One embodiment may provide a method and apparatus for calculating the actual distance represented by the distance between two coordinates in an image. [Means for solving the problem]
[0004] According to one embodiment, a method for calculating an actual distance between coordinates in an image performed by an electronic device includes an operation of generating a normal image for an original image captured through a camera based on internal parameters of the camera and attitude information of the camera, an operation of calculating a first world coordinate corresponding to the first coordinate in a preset world coordinate system based on a first coordinate received on the normal image, an operation of calculating a second world coordinate corresponding to the second coordinate in the world coordinate system based on a second coordinate received on the normal image, and an operation of calculating a distance between the first world coordinate and the second world coordinate.
[0005] The first coordinate and the second coordinate may be located within a base plane within the normal image.
[0006] The operation of calculating the first world coordinate includes an operation of receiving the first coordinate on the normal image from a user, and, when the first coordinate is received, an operation of calculating the first world coordinate in the world coordinate system corresponding to the first coordinate, wherein the first world coordinate and the second world coordinate may be coordinates having the same height but different planar positions in the world coordinate system.
[0007] The first coordinate may be located within a base plane in the normal image, and the second coordinate may be located in the air above the base plane.
[0008] The operation of calculating the second world coordinate includes an operation of receiving reference coordinates on the normal image along with a bottom shift input from a user; when the bottom shift input and the reference coordinates are received, an operation of calculating a reference world coordinate in the world coordinate system corresponding to the reference coordinate; an operation of outputting a UI for receiving height information for the reference world coordinate; an operation of receiving the second coordinate indicating height information from the user via the UI; and an operation of calculating the second world coordinate corresponding to the second coordinate, and the reference world coordinate and the second world coordinate may be coordinates that have the same planar position but different heights in the world coordinate system.
[0009] The first coordinate and the second coordinate may each be located in the air below a base plane within the normal image.
[0010] The method may further include determining a vanishing point for the normal image, and determining a bottom surface within the normal image based on the vanishing point.
[0011] The method may further include an operation of calculating a third world coordinate corresponding to the third coordinate in the world coordinate system based on a third coordinate received on the normal image, and an operation of calculating an area for a geometric structure formed by the first world coordinate, the second world coordinate, and the third world coordinate.
[0012] The method may further include an operation of calculating third and fourth world coordinates corresponding to the third and fourth coordinates in the world coordinate system based on the third and fourth coordinates received on the normal image, and an operation of calculating a volume with respect to a geometric structure formed by the first world coordinate, the second world coordinate, the third world coordinate, and the fourth world coordinate.
[0013] The original image may be a panoramic image or a 360 degree image.
[0014] According to an embodiment, an electronic device for performing a method for calculating an actual distance between coordinates in an image includes a memory having a program recorded therein for calculating an actual distance between coordinates in an image, and a processor for executing the program, wherein the processor may perform an operation of generating a normal image for an original image captured through the camera based on internal parameters of the camera and attitude information of the camera, an operation of calculating a first world coordinate corresponding to the first coordinate in a predetermined world coordinate system based on a first coordinate received on the normal image, an operation of calculating a second world coordinate corresponding to the second coordinate in the world coordinate system based on a second coordinate received on the normal image, and an operation of calculating a distance between the first world coordinate and the second world coordinate. Effect of the Invention
[0015] According to the present invention, there is provided a method and apparatus for calculating an actual distance indicated by a distance between two coordinates in an image. [Brief description of the drawings]
[0016] [Figure 1] 1 illustrates images generated according to a type of camera lens according to an example. [Diagram 2] 4 shows coordinates of a point in a world coordinate system and a point projected onto an image plane of a camera according to an example. [Diagram 3] 1 illustrates a method for calculating the height of an object located vertically above a ground surface according to an example. [Figure 4] FIG. 1 is a configuration diagram of an electronic device according to an embodiment. [Diagram 5] 4 is a flow chart of a method for calculating actual distances between coordinates in an image according to one embodiment. [Figure 6] 1 is a flowchart of a method for determining a bottom surface in a normal image according to an example. [Figure 7] 1 illustrates an object that positions a normal image according to an example. [Figure 8]1 is a flowchart of a method for calculating world coordinates of a coordinate located within a bottom plane of a normal image according to an example. [Figure 9] 10 is a flowchart of a method for calculating world coordinates of coordinates located in the air of the bottom surface of a normal image according to an example. [Figure 10] 13 illustrates an example of a normal image in which a user input occurs. [Figure 11] A method of calculating coordinates based on the user's input method in the example of FIG. 10 is shown. [Figure 12] 13 is a flowchart of a method for calculating world coordinates of coordinates located in the air of the bottom surface of a normal image according to another example. [Figure 13] 13 illustrates an example of a normal image in which a user input occurs. [Figure 14] A method of calculating coordinates based on the user's input method in the example of FIG. 13 is shown. [Figure 15] 15 is a flowchart of a method for calculating world coordinates of a coordinate located in the air on the bottom surface of a normal image according to a further example. A method for calculating a second world coordinate Pv2 will be described with further reference to FIG. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0017] Hereinafter, the embodiments will be described in detail with reference to the accompanying drawings. However, the specific structural or functional description disclosed in this specification is merely for the purpose of describing the embodiments, and the embodiments may be implemented in various different forms, and the present invention is not limited to the embodiments described in this specification. It should be understood that all modifications, equivalents, or alternatives to the embodiments are included in the scope of the claims.
[0018] The terms used in the embodiments are merely used for the purpose of explanation and are not to be construed as being limiting. A singular expression includes a plural expression unless the context clearly indicates otherwise. In this specification, the terms "include" or "have" indicate the presence of a feature, number, step, operation, component, part, or combination thereof described in the specification, and should be understood as not precluding the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.
[0019] Unless otherwise defined, all terms used herein, including technical or scientific terms, have the same meaning as commonly understood by a person of ordinary skill in the art to which the present invention belongs. Commonly used predefined terms should be interpreted as having a meaning consistent with the meaning they have in the context of the relevant art, and should not be interpreted as ideal or overly formal unless expressly defined in this specification.
[0020] In addition, in the description with reference to the accompanying drawings, the same components are given the same reference numerals regardless of the reference numerals, and duplicated descriptions thereof will be omitted. In the description of the embodiments, if a detailed description of related known technology is determined to unnecessarily obscure the gist of the embodiments, the detailed description thereof will be omitted.
[0021] FIG. 1 shows images generated according to the type of camera lens according to one example.
[0022] According to an embodiment, when a scene 120 is captured using a camera 110, different images are generated depending on the type of lens of the camera 110. For example, a pinhole image 130 generated using a pinhole lens can show the scene 120 without distortion. As another example, a fisheye lens image 140 generated using a wide-angle lens such as a fisheye lens shows the scene 120 with distortion. For example, when an image is captured using a wide-angle camera lens (e.g., a fisheye lens), the captured image may show radial distortion caused by a phenomenon in which light passing through a distant point with respect to the center of the lens is bent more than light passing through a close point, and tangential distortion caused by the lens and the image plane not being parallel during the manufacturing process of the camera. In order to perform post-processing using an original image captured using such a lens, the distortion effect caused by the lens must first be removed from the original image. For example, an image from which the distortion effect caused by the lens has been removed may be called a normal image. After the normal image is represented in the camera coordinate system, the coordinates of pixels (or points) shown in the normal image can be transformed to the world coordinate system by matching the camera coordinate system and the world coordinate system.
[0023] Hereinafter, a method for matching the camera coordinate system and the world coordinate system will be described in detail with reference to FIG.
[0024] FIG. 2 illustrates the coordinates of a point in a world coordinate system and the projected point onto the image plane of a camera according to an example.
[0025] According to an embodiment, a normal image 220 corresponding to an original image can be generated based on the intrinsic parameters of the camera 110 and the pose information of the camera 110. The normal image 220 may be located on an image plane in the camera coordinate system. For example, the intrinsic parameters include f, which indicates the focal length of the lens. x and f yIncludes c, which indicates the principal point. x and c y For example, the pose information may be an extrinsic parameter and may include rotation information and translation information.
[0026] According to one embodiment, a target imaging point p222 on an image plane is defined for a target point P232 in a three-dimensional space. The coordinates of the camera coordinate system for the target point P232 are c , the coordinate in the world coordinate system is P w It is expressed as P c and P w The conversion relationship between them can be expressed as the following equation (1).
[0027]
number
[0028] In the formula (1), R represents the rotation information of the camera 110, and t represents the translation information of the camera 110.
[0029] The pixel coordinates must be transformed into normal coordinates to remove the effect of image distortion due to the internal parameters of the camera 110. For example, the transformation relationship between the pixel coordinates and the normal coordinates can be expressed as the following Equation (2).
[0030]
number
[0031] The coordinates (x, y) of the target pixel in the pixel coordinate system are transformed to the coordinates (u, v) of the target point in the normal coordinate system. The image plane of the normal image is the plane with focal length 1 at the origin of the camera, so the coordinates (u, v) of the target point on the normal image correspond to the coordinates (u, v, 1) of the target point in the camera coordinate system. The coordinates (u, v, 1) of the target imaging point in the camera coordinate system are p c = (u, v, 1).
[0032] Next, the camera origin 210 and p c When the point where the line connecting 222 touches the bottom surface is found, the ground coordinates of the target point P232 in the desired three-dimensional space are calculated. In order to calculate the ground coordinates of the target point P232, it must be calculated in a world coordinate system that is not a camera coordinate system. If the coordinates of the camera origin 210 in the camera coordinate system are C c The coordinates of the camera origin 210 in the world coordinate system are C w , p c The coordinates in the world coordinate system corresponding to p w If expressed as p w and C w can be calculated through the following formula (3). The coordinates of the origin of the camera in the camera coordinate system are (0,0,0). That is, C c =(0,0,0).
[0033]
number
[0034] Next, the world coordinate system C w and p w The point where the line connecting the points touches the ground is calculated. w and p w Any point P on the line connecting the lines can be expressed as the following equation (4).
[0035]
number
[0036] In the world coordinate system, the ground has a z-axis of 0, so JPEG0007575805000005.jpg932 The k value may be calculated so that the z coordinate of the target point P becomes 0. When the calculated k value is substituted into Equation (4), the ground coordinate of the target point P may be calculated. For example, the ground coordinate of the target point P may change depending on how the world coordinate system is set.
[0037] Through the above process, target coordinates in the world coordinate system corresponding to the coordinates of the target pixel in the original image or the normal image can be calculated. Since the world coordinate system can express an actual distance, an actual distance corresponding to the distance between two coordinates in an image can be calculated by calculating the distance between two coordinates in the world coordinate system.
[0038] FIG. 3 illustrates a method for calculating the height of an object located vertically above the ground according to an example.
[0039] Using the distance calculation method described above with reference to FIG. 2, the actual height of the object shown on the image can also be calculated. cam When the camera is positioned at a second point 302 that is a few meters away from the first point 301, the distance d1 between the first point 301 and the point 303 on the ground where the object is located, and the distance d2 between the first point 301 and the second point 302 and the point 305 where the line connecting the top end of the object and the ground meet are obtained, the actual height of the object, h obj h cam ×(d2-d1) / d2.
[0040] According to one embodiment, the method for measuring the actual height of an object using the above method can calculate the height of an object based on a first coordinate indicating the ground or bottom surface in an image received from a user and a second coordinate indicating the topmost point of the object in the image, but in some cases, the distance between the bottom surface coordinates corresponding to the first and second coordinates (i.e., the point where the second coordinate is projected onto the bottom surface) may be calculated instead of the height of the object.
[0041] In order to solve the above problems, a new method for measuring the distance between coordinates is introduced. A method for calculating the actual distance between coordinates in an image will be described in detail below with reference to FIGS.
[0042] FIG. 4 is a block diagram of an electronic device according to an embodiment.
[0043] The electronic device 400 includes a communication unit 410, a processor 420, and a memory 430. The electronic device 400 may be a personal computer (PC), a mobile device, or a smartphone, and is not limited to the described embodiment.
[0044] The communication unit 410 is connected to the processor 420 and the memory 430 to transmit and receive data. The communication unit 410 can connect to other external devices to transmit and receive data. Hereinafter, the expression "transmitting and receiving "A" indicates transmitting and receiving "information or data indicating A".
[0045] The communication unit 410 can be realized in a circuit network within the electronic device 400. For example, the communication unit 410 may include an internal bus and an external bus. As another example, the communication unit 410 may be an element that connects the electronic device 400 to an external device. The communication unit 410 may be an interface. The communication unit 410 can receive data from an external device and transmit the data to the processor 420 and the memory 430.
[0046] The processor 420 processes data received by the communication unit 410 and data stored in the memory 430. The "processor" may be a data processing device implemented in hardware having circuits with a physical structure for performing desired operations. For example, the desired operations may include code or instructions included in a program. For example, the data processing device implemented in hardware may include a microprocessor, a central processing unit, a processor core, a multi-core processor, a multiprocessor, an application-specific integrated circuit (ASIC), or a field programmable gate array (FPGA).
[0047] Processor 420 executes computer readable code (eg, software) stored in a memory (eg, memory 430) and instructions triggered by processor 420.
[0048] The memory 430 stores data received by the communication unit 410 and data processed by the processor 420. For example, the memory 430 can store a program (or an application, software). The stored program may be a set of syntax that is coded to calculate the actual distance between coordinates in an image and is executable by the processor 420.
[0049] In one aspect, memory 430 may include one or more of volatile memory, non-volatile memory and random access memory (RAM), flash memory, a hard disk drive, and an optical disk drive.
[0050] The memory 430 stores a set of instructions (eg, software) for operating the electronic device 400. The set of instructions for operating the electronic device 400 are executed by the processor 420.
[0051] The communication unit 410, the processor 420 and the memory 430 are described in detail below with reference to FIGS.
[0052] FIG. 5 is a flow chart of a method for calculating actual distances between coordinates in an image according to one embodiment.
[0053] The following operations 510-550 may be performed by the electronic device 400 described above with reference to FIG.
[0054] In operation 510, the electronic device 400 acquires an original image. For example, the original image may be an image generated via a camera. For example, the original image may be a panoramic image. As a different example, the original image may be a 360-degree image.
[0055] In operation 520, the electronic device 400 generates a normal image for the original image captured by the camera based on the internal parameters of the camera that generated the original image and the camera's attitude information. For example, the normal image is an image in which distortion caused by the camera lens is removed from the original image, and may be located on the image plane of the camera.
[0056] According to one embodiment, the method for generating a normal image based on an original image can use the method described above with reference to FIG.
[0057] In operation 530, the electronic device 400 calculates a first world coordinate corresponding to the first coordinate in a world coordinate system based on the first coordinate received on the normal image. For example, the world coordinate system may be preset.
[0058] For example, the electronic device 400 may output a normal image to a user and receive coordinates on the normal image. As a different example, the electronic device 400 may output an original image to a user and receive coordinates on the original image. The electronic device 400 may convert the received coordinates on the original image into first coordinates on the normal image.
[0059] According to one embodiment, the first coordinate is located in the bottom surface (or ground surface) in the normal image, i.e. the first coordinate may be a coordinate located on the bottom surface.
[0060] According to a different embodiment, the first coordinate may be a coordinate located in the air of the bottom surface in the normal image. A method for receiving a coordinate located in the air of the bottom surface in the normal image is described in detail with reference to FIG. 9 below.
[0061] In operation 540, the electronic device 400 calculates a second world coordinate corresponding to the second coordinate in a world coordinate system based on the second coordinate received on the normal image.
[0062] According to one embodiment, the second coordinate may be located in the bottom plane in the normal image, i.e. the second coordinate may be a coordinate located on the bottom plane.
[0063] According to a different embodiment, the second coordinate may be a coordinate located in the air at the bottom surface in the normal image.
[0064] In an operation 550, the electronic device 400 calculates the distance between the first world coordinate and the second world coordinate.
[0065] According to an embodiment, the electronic device 400 may output the calculated actual distance on the normal image. For example, the electronic device 400 may output a line connecting the first coordinate and the second coordinate, and output the actual distance associated with the output line.
[0066] According to an embodiment, after the operation 550 is performed, the following operations may be further performed. For example, the electronic device 400 performs an operation of calculating a third world coordinate corresponding to the third coordinate in the world coordinate system based on the third coordinate received on the normal image. The electronic device 400 may calculate an area for a geometric structure formed by the first world coordinate, the second world coordinate, and the third world coordinate.
[0067] According to an embodiment, after the above operation is performed, the following operation may be further performed. For example, the electronic device 400 may calculate a fourth world coordinate corresponding to the fourth coordinate in the world coordinate system based on the fourth coordinate received on the normal image. The electronic device 400 may calculate a volume for a geometric structure formed by the first world coordinate, the second world coordinate, the third world coordinate, and the fourth world coordinate.
[0068] FIG. 6 is a flow chart of a method for determining a bottom surface in a normal image according to an example.
[0069] According to one embodiment, after operation 520 described above with reference to FIG. 5 has been performed, the following operations 610 and 620 may further be performed.
[0070] In operation 610, the electronic device 400 determines a vanishing point for the normal image. According to another embodiment, the electronic device 400 determines a height on the normal image that corresponds to the height of the camera if no vanishing point is indicated.
[0071] In operation 620, the electronic device 400 determines a bottom surface in the normal image based on the vanishing point. For example, two regions are divided based on the vanishing point, and the lower region of the divided regions is determined to be the bottom surface.
[0072] According to one embodiment, if a first coordinate in a normal image specified by a user corresponds to the bottom surface, the electronic device 400 may determine that the first coordinate corresponds to a portion of a point on the bottom surface in real space.
[0073] According to a different embodiment, even if a first coordinate in a normal image specified by a user corresponds to a bottom surface, if the first coordinate relates to an additional input (e.g., a shifted input of the bottom surface), the electronic device 400 can determine that the first coordinate corresponds to a point located in the air above the bottom surface in real space, i.e., within a virtual shifted plane parallel to the bottom surface.
[0074] FIG. 7 shows an object located in a normal image according to an example.
[0075] According to one embodiment, normalized image 700 includes object 710. For example, assume that a user wishes to calculate the length of each side of object 710, the area of one side of object 710, or the volume of object 710 via normalized image 700.
[0076] According to an embodiment, a user inputs a first coordinate 711 and a second coordinate 712 to the electronic device 400 to calculate an actual distance between the actual points indicated by the first coordinate 711 and the second coordinate 712 of the object 710. The first coordinate 711 and the second coordinate 712 are coordinates on the bottom surface. The electronic device 400 can calculate the actual distance between the actual points indicated by the first coordinate 711 and the second coordinate 712 by calculating a first world coordinate and a second world coordinate for the actual points corresponding to the first coordinate 711 and the second coordinate 712 and calculating the distance between the first world coordinate and the second world coordinate.
[0077] According to a different embodiment, the user inputs the first coordinate 711 and the third coordinate 713 to the electronic device 400 to calculate the actual distance between the actual points indicated by the first coordinate 711 and the third coordinate 713 of the object 710. The third coordinate 713 may be a coordinate located in the air on the bottom surface. The user may input an additional input (e.g., a shift input of the bottom surface) to the electronic device 400 to indicate that the third coordinate 713 is a coordinate located in the air on the bottom surface. When the third coordinate 713 is received together with the additional input, the electronic device 400 may calculate a third world coordinate corresponding to the third coordinate 713. For example, the actual point indicated by the third coordinate 713 may be located in a vertical direction from the actual point indicated by the first coordinate 711. In such a case, the third world coordinate has the same x-axis coordinate and y-axis coordinate as the first world coordinate, and only differs in the z-axis coordinate. Based on the first world coordinate and the third world coordinate, the actual distance between the actual points indicated by the first coordinate 711 and the third coordinate 713 may be calculated.
[0078] According to a further embodiment, the user can input the third coordinate 713 and the fourth coordinate 714 to the electronic device 400 to calculate the actual distance between the actual points indicated by the third coordinate 713 and the fourth coordinate 714 of the object 710. The third coordinate 713 and the fourth coordinate 714 may be coordinates located in the air at the bottom surface. When the third coordinate 713 and the fourth coordinate 714 are received together with the additional input, respectively, the electronic device 400 calculates the third world coordinate and the fourth world coordinate corresponding to the third coordinate 713 and the fourth coordinate 714, respectively. Based on the third world coordinate and the fourth world coordinate, the actual distance between the actual points indicated by the third coordinate 713 and the fourth coordinate 714 can be calculated.
[0079] The embodiment in which the user inputs coordinates for a normal image has been described with reference to Fig. 7, but this is merely an example. As another example, the user may input coordinates for an original image, and the electronic device 400 may convert the image into a normal image and then perform the above-mentioned coordinate calculation.
[0080] FIG. 8 is a flowchart of a method for calculating world coordinates of a coordinate located within the bottom plane of a normal image according to an example.
[0081] According to one embodiment, operation 530 described above with reference to Fig. 5 includes the following operations 810 and 820. According to another embodiment, operation 540 includes the following operations 810-820.
[0082] In operation 810, the electronic device 400 receives a first coordinate on the normal image from the user. For example, if the electronic device 400 provides a normal image to the user, the electronic device 400 may directly receive the first coordinate on the normal image from the user. As a different example, if the electronic device 400 provides an original image to the user, the electronic device 400 may receive an initial coordinate on the original image from the user and convert the initial coordinate into a coordinate on the normal image to receive the first coordinate. The received first coordinate on the normal image may be a coordinate within the bottom plane.
[0083] When the first coordinate is received, the electronic device 400 calculates a first world coordinate in the world coordinate system corresponding to the first coordinate in operation 820. Since the camera coordinate system and the world coordinate system are matched in advance, the electronic device 400 can calculate the first world coordinate by converting the first coordinate in the camera coordinate system into a coordinate in the world coordinate system.
[0084] According to one embodiment, if the first and second coordinates on the normal image received from the user are all located within the bottom plane (e.g., the first coordinate 711 and the second coordinate 712 shown in FIG. 7), operations 810 and 820 are performed on the first and second coordinates, respectively. For the above embodiment, a first world coordinate and a second world coordinate in a world coordinate system with the z-axis at 0 may be calculated. Based on the first and second world coordinates, an actual distance between the actual points indicated by the first and second coordinates may be calculated.
[0085] FIG. 9 is a flowchart of a method for calculating world coordinates of a coordinate located in the air on the bottom surface of a normal image according to an example.
[0086] According to one embodiment, operation 540 described above with reference to Figure 5 includes the following operations 910-950: According to another embodiment, operation 530 includes the following operations 910-950:
[0087] In operation 910, the electronic device 400 receives a reference coordinate on the normal image together with a bottom shift input (or after the bottom shift input) as an additional input from the user. For example, the user inputs the additional input to the electronic device 400 together to indicate that the reference coordinate is not the final input coordinate. For example, the additional input may be a specific key input (e.g., a shift key) of a keyboard. The reference coordinate may be a coordinate within the bottom plane.
[0088] In operation 920, the electronic device 400 calculates a reference world coordinate in a world coordinate system that corresponds to the reference coordinate.
[0089] In operation 930, the electronic device 400 outputs a user interface (UI) for receiving height information for the reference world coordinates. For example, the UI may be a graphic effect. When the UI is output, the user can recognize that the current state is a state in which height information for the reference coordinates can be input.
[0090] According to an embodiment, the UI is output so that the user can adjust the length in the height direction. For example, the length of the UI may be adjustable in the z-axis direction based on the world coordinate system. The user may position the UI at a desired second coordinate on the normal image by adjusting the length of the UI.
[0091] In operation 940, the electronic device 400 receives a second coordinate indicating height information from the user via the UI. The user can input the second coordinate of the normal image via the UI that is output on the normal image. By selecting the second coordinate desired by the user, the second coordinate is input to be located vertically from the reference coordinate.
[0092] In operation 950, the electronic device 400 calculates a second world coordinate corresponding to the second coordinate based on the received second coordinate.
[0093] According to an embodiment, the x-axis and y-axis coordinates of the second world coordinates corresponding to the received second coordinates may be the same as the x-axis and y-axis coordinates of the reference world coordinates, respectively, and the z-axis coordinate of the second world coordinates may be different from the z-axis coordinate of the reference world coordinates. Therefore, in order to calculate the second world coordinates, the electronic device 400 may set the x-axis and y-axis coordinates of the second world coordinates to the x-axis and y-axis coordinates of the reference world coordinates, and calculate the z-axis coordinate of the second world coordinates based on the second coordinates.
[0094] Through operations 910 to 950, a world coordinate in the world coordinate system for a coordinate (eg, the second coordinate 712) located in the air at the bottom of the normal image can be calculated.
[0095] According to one embodiment, if the first and second coordinates of the normal image received from the user are all coordinates located in the air at the bottom surface (e.g., the third coordinate 713 and the fourth coordinate 714), operations 910 to 950 are performed for operations 530 and 540, respectively.
[0096] 10 shows an example of a normal image in which a user input occurs, and FIG 11 shows a method of calculating coordinates according to the user input in the example shown in FIG 10.
[0097] According to one embodiment, as an example shown in FIG. 10, a user can input two points, ie, two coordinates P1 and P2, between which the distance is to be measured, via a normal image 701.
[0098] When the user inputs a first coordinate P1 on the normal image, the electronic device 400 can calculate a first world coordinate Pf1 in the world coordinate system corresponding to the first coordinate P1 of the normal image 701, as in the example shown in FIG.
[0099] Thereafter, for example, when the user inputs a second coordinate P2 on the normal image, the electronic device 400 calculates a second world coordinate Pf2 in the world coordinate system corresponding to the second coordinate P2 of the normal image 701. In such an example, since the user has not input a shift input of the bottom surface, the first world coordinate Pf1 and the second world coordinate Pf2 are all points on the bottom surface, and the distance dh12 between the two points can be calculated as a distance in the same horizontal plane.
[0100] As another example, when a user inputs a second coordinate P2 on the normal image along with a shift input of the bottom surface, the electronic device 400 may set a second coordinate Pv2 located in a direction perpendicular to the first coordinate P1. The electronic device 400 may set the second world coordinate Pv2 to a coordinate that is equal to the x-axis coordinate and the y-axis coordinate of the first world coordinate Pf1 and whose z-axis coordinate is raised by dv12. In this case, the first world coordinate Pf1 and the second world coordinate Pv2 exist on a plane perpendicular to the bottom surface.
[0101] In the above description, the pixel distance between the first coordinate P1 and the second coordinate P2 in the normal image 701 is the same, but the same pixel distance is calculated differently as a distance dh12 in the bottom plane in the world coordinate system and a vertical distance dv12 in the world coordinate system depending on whether or not a bottom shift input is present. In this way, the electronic device 400 can calculate the vertical distance between two points when a bottom shift input is present, and calculate the horizontal distance between the two points as points in the same bottom plane when no bottom shift input is present. The calculation of the vertical distance can be understood from the contents already described with reference to FIG. 3.
[0102] According to an embodiment, the photographing conditions of the camera may be set in advance. That is, the height of the camera during photographing (h cam ) and the camera's shooting angle may be set to a constant value. For example, the height and the shooting angle of the camera may be kept constant by shooting using a tri-ford with a fixed shooting angle and height. As a result, the vanishing point or vanishing line may be formed evenly in the original image or the normal image. In such an embodiment, the electronic device 400 may store information regarding the horizontal distance and the vertical distance per pixel at each position in the original image or the normal image in advance. The horizontal distance and the vertical distance of one pixel are different at each position based on the vanishing point or the vanishing line, and the electronic device 400 may calculate the horizontal distance and the vertical distance per pixel on the base plane at the first coordinate P1 in advance or may receive and store the data. For example, in the example shown in FIG. 10 and FIG. 11, the electronic device 400 may store data (e.g., the data may include a distance value per pixel or a distance enhancement value for a distance value of a previous pixel per pixel) regarding the horizontal distance dh12 per pixel on the base plane at the first coordinate P1 and the vertical distance dv12 per pixel on the vertical plane perpendicular to the base plane. Since the horizontal and vertical distances of the same pixel are different, the horizontal distance per pixel and the vertical distance per pixel are stored separately.
[0103] According to an embodiment, the electronic device 400 may calculate a difference between a vanishing point or vanishing line set according to a preset photographing condition and a vanishing point or vanishing line derived from an original image, and set a correction weight according to the calculated difference. The correction weight is calculated to be larger in proportion to the difference between the vanishing points or vanishing lines. The electronic device 400 may apply the correction weight to the above-mentioned data (data for the horizontal distance per pixel on the bottom plane at each position and the vertical distance per pixel on the vertical plane perpendicular to the bottom plane) to correct distance errors due to errors in the photographing conditions.
[0104] 12 is a flowchart of a method for calculating world coordinates of a coordinate located in the air of the bottom surface of a normal image according to another example. The different example shown in FIG. 12 relates to an embodiment in which the electronic device 400 directly calculates height information of the second coordinate.
[0105] According to one embodiment, operation 540 described above with reference to FIG. 5 includes the following operations 1210-1240.
[0106] In operation 1210, the electronic device 400 receives a second coordinate on the normal image together with (or after) a bottom shift input as an input for the second coordinate from the user. For example, the bottom shift input may be a specific key input (e.g., a shift key) on a keyboard.
[0107] In operation 1220, the electronic device 400 calculates a second reference world coordinate for a point on the bottom surface corresponding to the second coordinate of the normal image. In FIG. 11, for example, the electronic device 400 may calculate the world coordinate of the second reference coordinate Pf2 obtained by projecting the second coordinate P2 onto the bottom surface. The world coordinate of the second reference coordinate Pf2 is used to calculate the distance dh12 on the bottom surface between the first coordinate P1 and the second reference coordinate Pf2. In addition, the distance dh12 on the bottom surface is used to calculate the height information dv12 of the second coordinate.
[0108] In operation 1230, the electronic device 400 may calculate a height dv12 of a second world coordinate using the camera height (Hcam), the first world coordinate Pf1, and the second reference world coordinate Pf2. The second world coordinate Pv2 corresponds to the second coordinate of the normal image and is perpendicular to the first world coordinate Pf1 and is vertically spaced apart by a height dv12. The calculation of the height dv12 of the second world coordinate has been described above with reference to FIG. 3 and can be easily understood.
[0109] In operation 1240, the electronic device 400 can confirm the coordinates on the bottom plane of the first world coordinates - (x, y) coordinates - and calculate the second world coordinates by reflecting the height dv12 of the second world coordinates thereto.
[0110] 13 shows an example of a normal image in which a user input occurs, and FIG. 14 shows a method of calculating coordinates according to the user input in the example shown in FIG.
[0111] According to one embodiment, as shown in the example of Fig. 13, a user inputs two points, i.e., two coordinates P1 and P2, between which the distance is to be measured, via a normal image 701. The first coordinate P1 relates to a point within the bottom surface in the world coordinate system, and the second coordinate P2 relates to a point having a predetermined height from the bottom surface in the world coordinate system and having at least one of an x coordinate and a y coordinate different from the first coordinate in the world coordinate system.
[0112] When the user inputs a first coordinate P1 on the normal image, the electronic device 400 can calculate a first world coordinate Pf1 in the world coordinate system that corresponds to the first coordinate P1 of the normal image 701 as described above.
[0113] Then, as an example, when the user inputs a second coordinate P2 on the normal image along with a shift input of the bottom surface, the electronic device 400 can calculate a second world coordinate Pv2 having a height dv12 from the bottom surface and spaced a distance dh12 on the horizontal plane from the first coordinate.
[0114] FIG. 15 is a flowchart of a method for calculating world coordinates of coordinates located in the air on the bottom surface of the normal image according to a further example. The method for calculating the second world coordinates Pv2 will be described with further reference to FIG.
[0115] According to one embodiment, the operation 540 described above with reference to FIG. 5 includes the following operations 1510-1540.
[0116] In operation 1510, the electronic device 400 receives a second coordinate on the normal image together with (or after) the bottom shift input as an input for the second coordinate from the user. For example, the bottom shift input may be a specific key input (e.g., the shift key) of a keyboard. As shown in the examples of Figs. 13 and 14, the first coordinate P1 may relate to a point in the bottom surface in the world coordinate system, and the second coordinate P2 may have a predetermined height from the bottom surface in the world coordinate system, and at least one of the x coordinate and the y coordinate may be different from the first coordinate in the world coordinate system.
[0117] In operation 1520, the electronic device 400 calculates a height change amount in the world coordinate system based on a vertical change amount in the normal image (a change amount in the y-axis when the two-dimensional coordinate axes xy of the normal image shown in FIG. 13 are used as a reference). That is, when a bottom shift input is received from a user as an input for the second coordinate, the electronic device 400 may calculate a change amount in the y-axis in the normal image only in relation to a height change amount dv12 in the world coordinate system. A specific calculation method has been described above with reference to FIG. 13 and may be easily understood.
[0118] In operation 1530, the electronic device 400 calculates a change dh12 on a plane in the world coordinate system based on a horizontal change between the first coordinate and the second coordinate in the normal image (a change in the y-axis when the two-dimensional coordinate axes xy of the normal image shown in FIG. 13 are used as a reference). That is, the change in the x-axis between the first coordinate and the second coordinate in the normal image can be calculated only in relation to the change on the surface between the first world coordinate system and the second world coordinate system on the same surface in the world coordinate system (i.e., the change in the x-axis and the change in the y-axis in the world coordinate system). The calculation of the change on the same plane has been described above with reference to FIGS. 2 to 9, and should be easily understood.
[0119] In operation 1540, the electronic device 400 can calculate a second world coordinate for the second coordinate by reflecting the height change amount and the change amount on the plane in the first world coordinate (x, y, z) for the first coordinate.
[0120] The devices described above may be implemented using hardware components, software components, or a combination of hardware and software components. For example, the devices and components described herein may be implemented using one or more general-purpose or special-purpose computers, such as a processor, a controller, an arithmetic logic unit (ALU), a digital signal processor, a microcomputer, a field programmable array (FPA), a programmable logic unit (PLU), a microprocessor, or other devices that execute and respond to instructions. The processing device executes an operating system (OS) and one or more software applications that run on the operating system. The processing device also accesses, stores, manipulates, processes, and generates data in response to the execution of the software. For ease of understanding, the processing device may be described as being one in which only one processing device is used, but one skilled in the art will appreciate that the processing device may include multiple processing elements and / or multiple types of processing elements. For example, the processing device may include multiple processors or one processor and one controller. Other processing configurations, such as parallel processors, are also possible.
[0121] The software may include computer programs, codes, instructions, or any combination of one or more thereof, capable of configuring or instructing a processing device to operate as desired, either independently or in combination. The software and / or data may be embodied in any type of machine, component, physical device, virtual device, computer storage medium or device, or transmitted signal wave, either permanently or temporarily, to be interpreted by the processing device or to provide instructions or data to the processing device. The software may be distributed across computer systems coupled to a network, and may be stored and executed in a distributed manner. The software and data may be stored on one or more computer readable recording media.
[0122] The method according to the present invention may be embodied in the form of program instructions to be executed by various computer means and recorded on a computer-readable recording medium. The recording medium may include program instructions, data files, data structures, and the like, alone or in combination. The recording medium and the program instructions may be specially designed and constructed for the purposes of the present invention, or may be well known and available to those skilled in the art of computer software. Examples of computer-readable recording media include magnetic media such as hard disks, floppy disks, and magnetic tapes, optical recording media such as CD-ROMs and DVDs, magneto-optical media such as floptical disks, and hardware devices specially configured to store and execute program instructions, such as ROMs, RAMs, flash memories, and the like. Examples of program instructions include not only machine code, such as that generated by a compiler, but also high-level language code executed by a computer using an interpreter, and the like. The hardware devices described above may be configured to operate as one or more software modules to perform the operations shown in the present invention, and vice versa.
[0123] Although the embodiments have been described above with reference to limited drawings, those skilled in the art may apply various technical modifications and variations based on the above description. For example, the described techniques may be performed in a different order than described, and / or the components of the described systems, structures, devices, circuits, etc. may be combined or combined in a different form than described, and may be replaced or substituted with other components or equivalents to achieve appropriate results.
[0124] Accordingly, other implementations, embodiments, and equivalents of the claims are intended to be within the scope of the following claims.
Claims
1. The method of calculating the actual distance between coordinates in the image performed by the electronic device is generating a normal image for an original image captured through the camera based on internal parameters of the camera and pose information of the camera; calculating, based on the received first coordinates on the normal image, a first world coordinate corresponding to the first coordinates in a preset world coordinate system; calculating, based on the received second coordinates on the normal image, second world coordinates corresponding to the second coordinates in the world coordinate system; calculating a distance between the first world coordinate and the second world coordinate; The method includes:
2. The method of claim 1 , wherein the first and second coordinates lie on a ground surface within the normal image.
3. The operation of calculating the first world coordinates includes: receiving the first coordinate on the normal image from a user; calculating, when the first coordinate is received, the first world coordinate in the world coordinate system corresponding to the first coordinate; Including, The method according to claim 1 , wherein the first world coordinate and the second world coordinate are coordinates that have the same height in the world coordinate system but different planar positions.
4. the first coordinate is located on a ground surface within the normal image; The method of claim 1 , wherein the second coordinate lies on an imaginary plane that is above and parallel to a ground surface in the normal image.
5. The operation of calculating the second world coordinates includes: receiving a reference coordinate on said normal image along with a ground shift input from a user; calculating a reference world coordinate in the world coordinate system corresponding to the reference coordinate when the ground shift input and the reference coordinate are received; an operation of outputting a UI for receiving height information with respect to the reference world coordinate; receiving the second coordinate indicating height information from the user via the UI; calculating the second world coordinates corresponding to the second coordinates; Including, the reference world coordinates and the second world coordinates are coordinates that have the same planar position in the world coordinate system but different heights, 5. The method of claim 4, wherein when the second coordinate is related to a shifted input of the ground, the second coordinate corresponds to a position on an imaginary plane that is above and parallel to the ground in the normal image.
6. The method of claim 1 , wherein the first and second coordinates each lie on an imaginary plane that is above and parallel to a ground surface in the normal image.
7. determining a vanishing point for said normal image; determining a ground surface within the normal image based on the vanishing point; The method of claim 1 further comprising:
8. calculating, based on the received third coordinate on the normal image, a third world coordinate corresponding to the third coordinate in the world coordinate system; an operation of calculating an area of a geometric structure formed by the first world coordinates, the second world coordinates, and the third world coordinates; The method of claim 1 further comprising:
9. calculating third and fourth world coordinates corresponding to the third and fourth coordinates in the world coordinate system based on the received third and fourth coordinates on the normal image; an operation of calculating a volume for a geometric structure formed by the first world coordinates, the second world coordinates, the third world coordinates, and the fourth world coordinates; The method of claim 1 further comprising:
10. The method of claim 1 , wherein the original image is a panoramic image or a 360 degree image.
11. A computer-readable recording medium storing a program for carrying out the method according to any one of claims 1 to 10.
12. The electronic device for carrying out the method for calculating the actual distance between coordinates in an image comprises: a memory storing a program for calculating the actual distance between coordinates in an image; A processor for executing the program; Including, The processor, generating a normal image for an original image captured through the camera based on internal parameters of the camera and pose information of the camera; calculating, based on the received first coordinates on the normal image, a first world coordinate corresponding to the first coordinates in a preset world coordinate system; calculating, based on the received second coordinates on the normal image, second world coordinates corresponding to the second coordinates in the world coordinate system; calculating a distance between the first world coordinate and the second world coordinate; An electronic device that performs
Citation Information
Patent Citations
On-vehicle image processor and viewpoint change information generating method
JP2008048266A
Calculation method of camera calibration
JP2010239515A
Imaging apparatus and control method for the same
JP2015070328A
panel conversion
JP2018533098A
Program, information processing method, and information processing apparatus
JP2019194625A
