CN112346691A - Method for corresponding target height and gray level, computing device and storage medium - Google Patents
Method for corresponding target height and gray level, computing device and storage medium Download PDFInfo
- Publication number
- CN112346691A CN112346691A CN202011222288.9A CN202011222288A CN112346691A CN 112346691 A CN112346691 A CN 112346691A CN 202011222288 A CN202011222288 A CN 202011222288A CN 112346691 A CN112346691 A CN 112346691A
- Authority
- CN
- China
- Prior art keywords
- target image
- value
- height information
- gray
- height
- Prior art date
- Legal status (The legal status 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 status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 49
- 238000004590 computer program Methods 0.000 claims description 6
- 238000013507 mapping Methods 0.000 claims 1
- 238000010586 diagram Methods 0.000 description 7
- 230000003287 optical effect Effects 0.000 description 6
- 230000000007 visual effect Effects 0.000 description 5
- 230000006870 function Effects 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/14—Digital output to display device ; Cooperation and interconnection of the display device with other functional units
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/903—Querying
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Human Computer Interaction (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
One embodiment of the application discloses a method for corresponding target height and gray scale, a computing device and a storage medium, wherein the method comprises the following steps: s100, receiving a target image from a camera and height information h of the target image; s102, substituting the height information h of the target image into a formulaObtaining a gray value G corresponding to the height information h, wherein G is a gray value and takes a value from 0 to 255, k is a constant and is a natural number greater than 0; h is height information of the target image and the unit is m; and S104, sending the target image and the gray value to a display device, so that the display device displays the target image and displays the gray value at a preset position. The technical scheme solves the problem that the height information of the target image cannot be directly displayed on the planeThe problem is that the target image can be displayed more visually, and the working efficiency of an observer is effectively improved.
Description
Technical Field
The present application relates to the field of image display. And more particularly, to a method, a computing device, and a storage medium for target height and gray level correspondence.
Background
When displaying the spatial position of an object on a display, a top view of the object is often projected on the display, so that the height information of the object is lost when displayed. However, the height information is very important for observing the target, and the height information cannot be contained on the plane, which brings great inconvenience to the observer.
Disclosure of Invention
It is an object of the present application to provide a method, a computing device and a storage medium for target height and gray scale correspondence to solve at least one of the technical problems mentioned in the background section above.
In order to achieve the purpose, the following technical scheme is adopted in the application:
in a first aspect, the present application provides a method for correspondence between a target height and a gray scale, the method comprising:
s100, receiving a target image from a camera and height information h of the target image;
s102, substituting the height information h of the target image into a formula (1) to obtain a gray value G corresponding to the height information h,
in the formula, G is a gray value and takes a value from 0 to 255, k is a constant and k is a natural number greater than 0; h is height information of the target image and the unit is m;
and S104, sending the target image and the gray value to a display device, so that the display device displays the target image and displays the gray value at a preset position.
In a specific embodiment, the preset position is right in front of the target image.
In a specific embodiment, when the gray-scale value is 0, the height information h is 0, and when the gray-scale value is 255, the height information h is a preset maximum height value.
In a second aspect, the present application provides a method for correspondence between target height and gray scale, the method comprising:
displaying a target image and displaying a gray value G at a preset position, wherein the target image is acquired from a camera and sent by a computer; the grey value G is obtained according to formula (1),
in the formula, G is a gray value and takes a value from 0 to 255, k is a constant and k is a natural number greater than 0; h is height information of the target image and has a unit of m.
In a specific embodiment, the preset position is right in front of the target image.
In a specific embodiment, when the gray-scale value is 0, the height information h is 0, and when the gray-scale value is 255, the height information h is a preset maximum height value.
In a third aspect, the present application provides a computing device comprising a processor and a memory storing a program, wherein the processor implements the method of the first aspect when executing the program.
In a fourth aspect, the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of the first aspect described above.
In a fifth aspect, the present application provides a computing device comprising a processor and a memory storing a program, the processor implementing the method of the second aspect when executing the program.
In a sixth aspect, the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of the second aspect described above.
The beneficial effect of this application is as follows:
the application discloses a method for marking the height of a target on a plane, in particular to a method for corresponding the height and the gray level when the height is displayed on the plane, which solves the problem that the height information of the target cannot be directly displayed on the plane, enables the target image to achieve a more visual effect when being displayed, and effectively improves the working efficiency of an observer.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 shows an exemplary system architecture diagram in which the present application may be applied.
FIG. 2 illustrates a flow diagram of one embodiment of a method for target height and gray scale correspondence according to the present application.
Fig. 3 illustrates a schematic diagram of a display device displaying a target image according to an embodiment of the present application.
FIG. 4 illustrates a schematic diagram of a computing device suitable for use to implement embodiments of the present application.
Detailed Description
In order to more clearly illustrate the present application, the present application is further described below in conjunction with the preferred embodiments and the accompanying drawings. Similar parts in the figures are denoted by the same reference numerals. It is to be understood by persons skilled in the art that the following detailed description is illustrative and not restrictive, and is not intended to limit the scope of the present application.
As shown in fig. 1, a system architecture schematic diagram for implementing a target height and gray scale correspondence method according to an embodiment of the present application is shown, where the system architecture includes a camera 10, a computing device 20, and a display device 30, where the camera 10 collects a target image and sends the target image and height information h of the target image to the computing device 20, the computing device 20 obtains a gray scale value G corresponding to the target height information according to the target height information h, and further, the computing device 20 sends the target image and the gray scale value G to the display device 30; the display device 30 displays the target image and the gradation value G directly in front of the image.
It should be understood that the numbers in fig. 1 are merely exemplary. There may be any number of cameras, computing devices and display devices, as desired. In addition, the computing device 20 may also be a server providing various services for analyzing and processing the received data, which is not limited in this application.
Example one
FIG. 2 illustrates a flow diagram of one embodiment of a method for target height and gray scale correspondence according to the present application. The method for corresponding the target height and the gray level comprises the following steps:
s100, receiving a target image from a camera and height information h of the target image;
s102, substituting the height information h of the target image into a formula (1) to obtain a gray value G corresponding to the height information h,
in the formula, G is a gray value and takes a value of 0 to 255, h is the height of the target image, and the unit is m; k is a fixed value, and k is a natural number greater than 0;
in a specific embodiment, k is a constant, a value of k is determined according to an actual situation, for example, when k is 3, when the gray-scale value G is 0, the target height information h is 0m, when G is 1, the corresponding h is 3m, and so on, a correspondence relationship between the gray-scale value G and the target height information h is pre-stored in a database, and it should be noted that the correspondence relationship between the gray-scale value G and the target height information h in the database is determined according to the actual situation and is related to a value of the constant value k. In addition, when the gray value G is 255, the height information h is a maximum height value preset in the database, for example, 765 m.
By the method, the height information of the target image is displayed through the gray value, and the problem that the height information of the target cannot be directly displayed on a plane is solved.
And S104, sending the target image and the gray value to a display device, so that the display device displays the target image and displays the gray value at a preset position.
For example, the monitor is adopted as a display device of the computer, when the computer receives the target height information h, the target image is displayed on the monitor, the gray value of a dot is calculated according to the target height information h, and finally the dot is added in front of the target image.
When the target image is displayed, as shown in fig. 3, the preset position is right in front of the target image, a black and white dot representing target height information is added right in front of the image, and the gray value of the dot is used for identifying the target height. When the dots are black, i.e., G is 0, the height of the object is 0m, and when the dots are white, i.e., G is 255, the height of the object is maximum, and each level of gray scale increase represents a constant increase in height k, i.e., each level of gray scale value G increases by a constant value k, i.e., the corresponding object height increases by a distance k, e.g., 3 m.
When observing the target image, an operator can query the pre-stored database through the gray value of the dot to determine the height information of the target image.
The method for displaying the height information of the target image comprises the steps of setting a method for corresponding the height information of the target and the gray level, displaying the height information of the target image through the gray level, solving the problem that the height information of the target cannot be directly displayed on a plane, enabling the target image to achieve a more visual effect when being displayed, and effectively improving the working efficiency of an observer.
Example two
As shown in fig. 3, another embodiment of the present application provides a method for target height and gray scale correspondence, the method including:
displaying a target image and displaying a gray value G at a preset position, wherein the target image is acquired from a camera and sent by a computer; the grey value G is obtained according to formula (1),
in the formula, G is a gray value and takes a value of 0 to 255, k is a fixed value, and k is a natural number greater than 0; h is height information of the target image and has a unit of m.
In a specific embodiment, k is a constant, a value of k is determined according to an actual situation, for example, when k is 3, when the gray-scale value G is 0, the target height information h is 0m, when G is 1, the corresponding h is 3m, and so on, a correspondence relationship between the gray-scale value G and the target height information h is pre-stored in a database, and it should be noted that the correspondence relationship between the gray-scale value G and the target height information h in the database is determined according to the actual situation and is related to a value of the constant value k. In addition, when the gray value G is 255, the height information h is a maximum height value preset in the database, for example, 765 m.
By the method, the height information of the target image is displayed through the gray value, and the problem that the height information of the target cannot be directly displayed on a plane is solved.
For example, the monitor is adopted as a display device of the computer, when the computer receives the target height information h, the target image is displayed on the monitor, the gray value of a dot is calculated according to the target height information h, and finally the dot is added in front of the target image.
When the target image is displayed, as shown in fig. 3, the preset position is right in front of the target image, a black and white dot representing target height information is added right in front of the image, and the gray value of the dot is used for identifying the target height. When the dots are black, i.e., G is 0, the height of the object is 0m, and when the dots are white, i.e., G is 255, the height of the object is maximum, and each level of gray scale increase represents a constant increase in height k, i.e., each level of gray scale value G increases by a constant value k, i.e., the corresponding object height increases by a distance k, e.g., 3 m.
When observing the target image, an operator can query the pre-stored database through the gray value of the dot to determine the height information of the target image.
The method for displaying the height information of the target image comprises the steps of setting a method for corresponding the height information of the target and the gray level, displaying the height information of the target image through the gray level, solving the problem that the height information of the target cannot be directly displayed on a plane, enabling the target image to achieve a more visual effect when being displayed, and effectively improving the working efficiency of an observer.
EXAMPLE III
Fig. 4 shows a schematic structural diagram of a computing device according to another embodiment of the present application. The computing device 50 shown in fig. 4 is only one example and should not impose any limitations on the functionality or scope of use of embodiments of the present application.
As shown in fig. 4, computing device 50 is embodied in the form of a general purpose computing device. Components of computing device 50 may include, but are not limited to: one or more processors or processing units 500, a system memory 516, and a bus 501 that couples various system components including the system memory 516 and the processing unit 500.
The system memory 516 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)504 and/or cache memory 506. Computing device 50 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 508 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 501 by one or more data media interfaces. Memory 516 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiment one.
A program/utility 510 having a set (at least one) of program modules 512 may be stored, for example, in memory 516, such program modules 512 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 512 generally perform the functions and/or methodologies of the embodiments described herein.
The processor unit 500 executes various functional applications and data processing by running a program stored in the system memory 516, for example, to implement a method for target height and gray level correspondence provided in the first and second embodiments of the present application.
The application aims at the existing problems at present, and discloses a computing device applying a target height and gray level corresponding method, which displays the height information of a target image through a gray level value, solves the problem that the target height information cannot be directly displayed on a plane, enables the target image to achieve a more visual effect when being displayed, and effectively improves the working efficiency of an observer.
Example four
Another embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the methods provided by the first and second embodiments.
In practice, the computer-readable storage medium may take any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. 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 (a non-exhaustive list) of the computer readable storage medium would include the following: 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 embodiment, 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.
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, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application 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" programming 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 computer readable storage medium storing the methods provided by the first embodiment and the second embodiment is formulated to display the height information of the target image through the gray value, so that the problem that the height information of the target cannot be directly displayed on a plane is solved, a more visual effect is achieved when the target image is displayed, and the working efficiency of an observer is effectively improved.
It should be noted that in the description of the present application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
It should be understood that the above-mentioned examples are given for the purpose of illustrating the present application clearly and not for the purpose of limiting the same, and that various other modifications and variations of the present invention may be made by those skilled in the art in light of the above teachings, and it is not intended to be exhaustive or to limit the invention to the precise form disclosed.
Claims (10)
1. A method for mapping a target height to a gray level, comprising
S100, receiving a target image from a camera and height information h of the target image;
s102, substituting the height information h of the target image into a formula (1) to obtain a gray value G corresponding to the height information h,
in the formula, G is a gray value and takes a value from 0 to 255, k is a constant and k is a natural number greater than 0; h is height information of the target image and the unit is m;
and S104, sending the target image and the gray value to a display device, so that the display device displays the target image and displays the gray value at a preset position.
2. The method of claim 1, wherein the preset position is directly in front of the target image.
3. The method according to claim 1, wherein the height information h is 0 when the gray-scale value is 0, and indicates that the height information h is a preset maximum height value when the gray-scale value is 255.
4. A method for correspondence between target height and gray scale, comprising:
displaying a target image and displaying a gray value G at a preset position, wherein the target image is acquired from a camera and sent by a computer; the grey value G is obtained according to formula (1),
in the formula, G is a gray value and takes a value from 0 to 255, k is a constant and k is a natural number greater than 0; h is height information of the target image and has a unit of m.
5. The method of claim 4, wherein the preset position is directly in front of the target image.
6. The method according to claim 4, wherein the height information h is 0 when the gray-scale value is 0, and indicates that the height information h is a preset maximum height value when the gray-scale value is 255.
7. A computing device comprising a processor and a memory storing a program, wherein the processor implements the method of any one of claims 1-3 when executing the program.
8. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-3.
9. A computing device comprising a processor and a memory storing a program, wherein the processor implements the method of any of claims 4-6 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 4-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011222288.9A CN112346691A (en) | 2020-11-05 | 2020-11-05 | Method for corresponding target height and gray level, computing device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011222288.9A CN112346691A (en) | 2020-11-05 | 2020-11-05 | Method for corresponding target height and gray level, computing device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112346691A true CN112346691A (en) | 2021-02-09 |
Family
ID=74428792
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011222288.9A Pending CN112346691A (en) | 2020-11-05 | 2020-11-05 | Method for corresponding target height and gray level, computing device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112346691A (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110163904A (en) * | 2018-09-11 | 2019-08-23 | 腾讯大地通途(北京)科技有限公司 | Object marking method, control method for movement, device, equipment and storage medium |
CN110864665A (en) * | 2019-11-26 | 2020-03-06 | 北京电子工程总体研究所 | Height display method and system for target space position |
-
2020
- 2020-11-05 CN CN202011222288.9A patent/CN112346691A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110163904A (en) * | 2018-09-11 | 2019-08-23 | 腾讯大地通途(北京)科技有限公司 | Object marking method, control method for movement, device, equipment and storage medium |
CN110864665A (en) * | 2019-11-26 | 2020-03-06 | 北京电子工程总体研究所 | Height display method and system for target space position |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7453473B2 (en) | Method and apparatus for high-performance rendering and hit testing of a window tree | |
CN107908641B (en) | Method and system for acquiring image annotation data | |
CN111882634A (en) | Image rendering method, device and equipment and storage medium | |
CN109684566B (en) | Label engine implementation method and device, computer equipment and storage medium | |
CN110162757B (en) | Table structure extraction method and system | |
CN109086097B (en) | Method and device for starting small program, server and storage medium | |
CN112346691A (en) | Method for corresponding target height and gray level, computing device and storage medium | |
CN107452046B (en) | Texture processing method, device and equipment of three-dimensional city model and readable medium | |
CN113420581B (en) | Correction method and device for written document image, electronic equipment and readable medium | |
CN112669982B (en) | Method, device, equipment and storage medium for determining close contact person | |
CN111696154B (en) | Coordinate positioning method, device, equipment and storage medium | |
CN115880750A (en) | Side face evaluation method and system based on face sparse key points and similarity transformation | |
CN114821034A (en) | Training method and device of target detection model, electronic equipment and medium | |
CN115237931A (en) | Method and system for updating sub-service processing result of service arrangement | |
CN111124862A (en) | Intelligent equipment performance testing method and device and intelligent equipment | |
CN109460511A (en) | A kind of method, apparatus, electronic equipment and storage medium obtaining user's portrait | |
CN110610135A (en) | Display method, device, equipment and storage medium | |
CN113760317A (en) | Page display method, device, equipment and storage medium | |
CN112667116A (en) | Work order execution method and device, electronic equipment and storage medium | |
CN113781428B (en) | Image processing method and device, electronic equipment and storage medium | |
CN111080091A (en) | Project data processing method, device, server and medium | |
US8451294B2 (en) | Partial window visibility | |
CN113591772B (en) | Method, system, equipment and storage medium for structured identification and input of medical information | |
CN112233206B (en) | Character image generation method, device, equipment and storage medium | |
CN114092715A (en) | Pointer data transmission method, device, computer equipment, storage medium and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |