CN117727023A - Voxel block detection method, voxel block detection device, electronic equipment and storage medium - Google Patents

Voxel block detection method, voxel block detection device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117727023A
CN117727023A CN202311703850.3A CN202311703850A CN117727023A CN 117727023 A CN117727023 A CN 117727023A CN 202311703850 A CN202311703850 A CN 202311703850A CN 117727023 A CN117727023 A CN 117727023A
Authority
CN
China
Prior art keywords
ray
target
voxel
determining
point
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
Application number
CN202311703850.3A
Other languages
Chinese (zh)
Inventor
蒋恒
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Pixel Software Technology Co Ltd
Original Assignee
Beijing Pixel Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Pixel Software Technology Co Ltd filed Critical Beijing Pixel Software Technology Co Ltd
Priority to CN202311703850.3A priority Critical patent/CN117727023A/en
Publication of CN117727023A publication Critical patent/CN117727023A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Generation (AREA)

Abstract

The embodiment of the invention provides a voxel block detection method, a voxel block detection device, electronic equipment and a storage medium, and relates to the field of data processing, wherein the voxel block detection method comprises the following steps: constructing a height field data structure in a voxel space, dividing the height field data structure into a plurality of vertical continuous voxel blocks, transmitting a target ray into the voxel space, determining a stepping direction based on the target ray, taking a starting point of the target ray as a starting point, stepping based on the stepping direction, determining a termination point in the stepped target ray, and determining whether a ray segment formed by the starting point and the termination point passes through any one of the vertical continuous voxel blocks, if so, taking the passed vertical continuous voxel block as the target voxel block. Successive voxel blocks through which the ray passes can be computed in a more efficient manner. By detecting in discrete steps, the computational overhead is reduced.

Description

Voxel block detection method, voxel block detection device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data processing, and in particular, to a voxel block detection method, apparatus, electronic device, and storage medium.
Background
Radiation detection has been one of the key challenges in the fields of computer graphics, game development, virtual reality, and the like. Determining the intersection of a ray with an object or successive voxels in a three-dimensional scene requires efficient algorithms, in the case of voxel games (minecraft) it is of the order of magnitude higher than in a normal three-dimensional game due to the large number of squared elements present, and it is necessary to distinguish between the presence of each individual voxel, in this context a good ray detection algorithm is even more important.
The technical scheme in the prior art is to carry out ray detection through an Axis Alignment Bounding Box (AABB) under the octree. The ray detection process typically traverses the octree, starting from the root node, step-by-step to determine if the ray intersects the bounding box of each node. If the ray intersects the bounding box, the child node below the node is further detected. This process may be implemented by recursion or iteration. If the bounding box of a node intersects a ray, but the node has children, then the children are searched recursively.
The construction and maintenance of octree is a relatively complex process. The tree structure must be updated whenever objects in the scene change, which requires considerable computational overhead. For dynamic scenarios or applications requiring real-time updates, performance bottlenecks may be created.
Disclosure of Invention
The invention aims to provide a voxel block detection method, a voxel block detection device, electronic equipment and a storage medium, which can improve the continuous voxel block through which a determined ray passes, thereby reducing the calculation cost.
In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
in a first aspect, an embodiment of the present application provides a voxel block detection method, where the method includes:
constructing a high-field data structure in a voxel space;
partitioning the high field data structure into a plurality of vertically contiguous voxel blocks;
transmitting a target ray into the voxel space;
determining a stepping direction based on the target ray;
taking the starting point of the target ray as a starting point, stepping based on the stepping direction, and determining the ending point in the stepped target ray;
determining whether a ray segment formed by the starting point and the ending point passes through any of the vertically continuous voxel blocks;
if yes, the passing vertical continuous voxel block is taken as a target voxel block.
In an alternative embodiment, the step of determining a stepping direction based on the target ray includes:
determining an X-direction component and a Y-direction component of the target ray;
determining a smaller component from the components in the X direction and the Y direction as a target component;
the direction of the target component is determined as a step direction.
In an alternative embodiment, the step of taking the starting point of the target ray as a starting point, stepping based on the stepping direction, and determining the ending point in the stepped target ray includes:
determining a first absolute value of an X-direction component and a second absolute value of a Y-direction component of the target ray;
determining a larger target absolute value from the first absolute value and the second absolute value;
calculating the ratio of the component of the X direction of the target ray to the absolute value of the target as a first stepping amount of the X direction;
calculating the ratio of the component of the target ray in the Y direction to the absolute value of the target as a second stepping amount in the Y direction;
calculating the ratio of the component of the target ray in the Z direction to the absolute value of the target as a third stepping amount in the Z direction;
and determining an ending point in the stepped target ray based on the first stepping amount, the second stepping amount and the third stepping amount.
In an alternative embodiment, the method further comprises:
determining a first height range of each of the vertically consecutive voxel blocks;
the step of determining whether a ray segment formed by the start point and the end point passes through any of the vertically consecutive voxel blocks comprises:
determining a second height range of the Z direction of the ray line segment formed by the starting point and the ending point;
and judging the first height range and the height range, and determining whether the ray segment passes through any of the vertical continuous voxel blocks.
In an alternative embodiment, the first height range includes an upper height limit and a lower height limit, the second height range includes a high point height and a low point height, and the determining the first height range and the height range determines whether the ray line segment passes through any of the vertically consecutive voxel blocks, including:
judging whether the height of the high point is larger than the lower limit of the height;
judging whether the height of the low point is smaller than the upper height limit or not under the condition that the height of the high point is larger than the lower height limit;
in the event that the low point height is less than the upper height limit, determining that the ray segment passes through any of the vertically consecutive voxel blocks.
In an alternative embodiment, the method further comprises:
taking the ending point as a new starting point in the case that the high point height is smaller than the upper height limit or in the case that the low point height is larger than the upper height limit;
and returning to the step of stepping based on the stepping direction and determining the ending point in the target ray after stepping until determining whether the ray segment formed by the starting point and the ending point passes through any one of the vertical continuous voxel blocks or not until all the vertical continuous voxel blocks are traversed.
In an alternative embodiment, the method further comprises:
and constructing a voxel scene based on the target voxel block.
In a second aspect, an embodiment of the present application provides a voxel block detection apparatus, the apparatus including:
a construction module for constructing a high-field data structure in voxel space;
a segmentation module for dividing the high field data structure into a plurality of vertically consecutive voxel blocks;
a determining module, configured to transmit a target ray into the voxel space; determining a stepping direction based on the target ray; taking the starting point of the target ray as a starting point, stepping based on the stepping direction, and determining the ending point in the stepped target ray; determining whether a ray segment formed by the starting point and the ending point passes through any of the vertically continuous voxel blocks; if yes, the passing vertical continuous voxel block is taken as a target voxel block.
In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, where the memory stores a computer program, and the processor implements the steps of the voxel block detection method when executing the computer program.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the voxel block detection method.
The application has the following beneficial effects:
the method comprises the steps of constructing a high-field data structure in a voxel space, dividing the high-field data structure into a plurality of vertical continuous voxel blocks, transmitting a target ray into the voxel space, determining a stepping direction based on the target ray, taking a starting point of the target ray as a starting point, stepping based on the stepping direction, determining an ending point in the stepped target ray, and determining whether a ray segment formed by the starting point and the ending point passes through any one of the vertical continuous voxel blocks, if so, taking the passed vertical continuous voxel block as the target voxel block. Successive voxel blocks through which the ray passes can be computed in a more efficient manner. By detecting in discrete steps, the computational overhead is reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic block diagram of an electronic device according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a voxel block detection method according to an embodiment of the present invention;
FIG. 3 is a second flowchart of a voxel block detection method according to an embodiment of the present invention;
FIG. 4 is a third flowchart of a voxel block detection method according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating a voxel block detection method according to an embodiment of the present invention;
FIG. 6 is a flowchart of a voxel block detection method according to an embodiment of the present invention;
fig. 7 is a block diagram of a voxel block detection apparatus according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. The components of the embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the invention, as presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
In the description of the present invention, it should be noted that, if the terms "upper", "lower", "inner", "outer", and the like indicate an azimuth or a positional relationship based on the azimuth or the positional relationship shown in the drawings, or the azimuth or the positional relationship in which the inventive product is conventionally put in use, it is merely for convenience of describing the present invention and simplifying the description, and it is not indicated or implied that the apparatus or element referred to must have a specific azimuth, be configured and operated in a specific azimuth, and thus it should not be construed as limiting the present invention.
Furthermore, the terms "first," "second," and the like, if any, are used merely for distinguishing between descriptions and not for indicating or implying a relative importance.
In the description of the present application, it should also be noted that, unless explicitly specified and limited otherwise, the terms "disposed," "mounted," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communication between two elements. The specific meaning of the terms in this application will be understood by those of ordinary skill in the art in a specific context.
The inventor has found through extensive research that the technical scheme of the prior art is to perform ray detection through an Axis Alignment Bounding Box (AABB) under the octree. The ray detection process typically traverses the octree, starting from the root node, step-by-step to determine if the ray intersects the bounding box of each node. If the ray intersects the bounding box, the child node below the node is further detected. This process may be implemented by recursion or iteration. If the bounding box of a node intersects a ray, but the node has children, then the children are searched recursively. In this way, the intersection of the ray with different objects is detected at different levels of the octree, thereby more quickly finding the nearest intersection or determining whether the ray intersects any object in the scene.
The construction and maintenance of octree is a relatively complex process. The tree structure must be updated whenever objects in the scene change, which can require significant computational overhead. For dynamic scenarios or applications requiring real-time updates, this may become a performance bottleneck. Furthermore, the construction and maintenance of octree is a relatively complex process. The tree structure must be updated whenever objects in the scene change, which can require significant computational overhead. For dynamic scenarios or applications requiring real-time updates, this may become a performance bottleneck.
In view of the above-mentioned problems, the present embodiment provides a voxel block detection method, apparatus, electronic device, and storage medium, capable of dividing a height field data structure into a plurality of vertically continuous voxel blocks by constructing the height field data structure in a voxel space, transmitting a target ray into the voxel space, determining a stepping direction based on the target ray, taking a starting point of the target ray as a starting point, stepping based on the stepping direction, determining an ending point in the stepped target ray, and determining whether a ray segment formed by the starting point and the ending point passes through any vertically continuous voxel block, if so, taking the vertically continuous voxel block passed through as the target voxel block. Successive voxel blocks through which the ray passes can be computed in a more efficient manner. By performing the detection in discrete steps, the computational overhead is reduced, and the scheme provided in this embodiment is described in detail below.
The present embodiment provides an electronic device that can detect a voxel block. In one possible implementation, the electronic device may be a user terminal, for example, the electronic device may be, but is not limited to, a server, a smart phone, a personal computer (PersonalComputer, PC), a tablet, a personal digital assistant (Personal Digital Assistant, PDA), a mobile internet device (Mobile Internet Device, MID), or the like.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an electronic device 100 according to an embodiment of the disclosure. The electronic device 100 may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1. The components shown in fig. 1 may be implemented in hardware, software, or a combination thereof.
The electronic device 100 comprises voxel block detection means 110, a memory 120 and a processor 130.
The memory 120 and the processor 130 are electrically connected directly or indirectly to each other to realize data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines. The voxel block detection means 110 comprise at least one software functional module which may be stored in the memory 120 in the form of software or firmware (firmware) or cured in an Operating System (OS) of the electronic device 100. The processor 130 is configured to execute executable modules stored in the memory 120, such as software functional modules and computer programs included in the voxel block detection apparatus 110.
The Memory 120 may be, but is not limited to, a random access Memory (RandomAccess Memory, RAM), a Read Only Memory (ROM), a programmable Read Only Memory (Programmable Read-Only Memory, PROM), an erasable Read Only Memory (Erasable ProgrammableRead-Only Memory, EPROM), an electrically erasable Read Only Memory (Electric Erasable ProgrammableRead-Only Memory, EEPROM), etc. The memory 120 is configured to store a program, and the processor 130 executes the program after receiving an execution instruction.
Referring to fig. 2, fig. 2 is a flowchart of a voxel block detection method applied to the electronic device 100 of fig. 1, and the method includes various steps described in detail below.
S201: a high-field data structure is constructed in voxel space.
S202: the height field data structure is segmented into a plurality of vertically consecutive voxel blocks.
S203: the target ray is passed into voxel space.
S204: based on the target rays, a stepping direction is determined.
S205: taking the starting point of the target ray as a starting point, stepping based on the stepping direction, and determining the ending point of the stepped target ray.
S206: it is determined whether a ray segment formed by the start point and the end point passes through any of the vertically consecutive voxel blocks.
S207: if yes, the passing vertical continuous voxel block is taken as a target voxel block.
The voxel is a basic unit in three-dimensional graphic computation, is a point composed of one three-dimensional coordinate and attribute value, and in the fields of computer graphics and computer vision, the voxel space refers to a three-dimensional space composed of voxels.
For a voxel space, a series of height field data structures divided in the abscissa and ordinate are built in advance, and a plurality of groups are first used to store vertically consecutive voxel blocks in the space. Each element (x, y) represents a vertical height field within the range of [ x, x+1), [ y, y+1 ].
The height field is divided into individual vertically consecutive voxel blocks, each having two specific values, an upper height limit max and a lower height limit min, respectively, wherein the upper height limit, the lower height limit represent voxel blocks having continuity in the range ([ x, x+1), [ y, y+1)), the lowest height being the lower height limit min and the highest height being the upper height limit max.
And injecting target rays into the voxel space in any injection direction, calculating coordinates of the voxel space reached by the target rays, and judging whether the ray segments after each step intersect with the vertical continuous voxel blocks according to a stepping mode, so as to determine the target voxel blocks through which the rays pass.
It should be noted that, the starting point of the target ray is taken as a starting point, stepping is performed based on the stepping direction, and the ending point of the stepped target ray is determined, and a ray segment is formed by the starting point and the ending point.
There are various implementations of determining the stepping direction of the target ray, and in one implementation, as shown in fig. 3, the method includes the steps of:
s204-1: the components of the target ray in the X-direction and the Y-direction are determined.
S204-2: a larger component is determined as a target component from the components in the X direction and the components in the Y direction.
S204-3: the direction of the target component is determined as a step direction.
The projection or decomposition of the target ray in a certain coordinate system is taken as a component in the direction, and the component of the target ray in the X direction represents the projection size of the target ray on the X axis, and the component of the target ray in the Y direction represents the projection size of the target ray on the Y axis.
When the component in the X direction is larger than the component in the Y direction, the X direction is defined as the step direction, and when the component in the X direction is smaller than the component in the Y direction, the Y direction is defined as the step direction.
There are various implementations of determining the termination point in the stepped target ray when stepping in the stepping direction, and in one implementation, as shown in fig. 4, the method includes the steps of:
s205-1: a first absolute value of a component of the target ray in the X-direction and a second absolute value of a component of the target ray in the Y-direction are determined.
S205-2: a larger target absolute value is determined from the first absolute value and the second absolute value.
S205-3: the ratio of the component of the X-direction of the target ray to the target absolute value is calculated as a first step amount in the X-direction.
S205-4: the ratio of the component of the target ray in the Y direction to the target absolute value is calculated as a second step amount in the Y direction.
S205-5: and calculating the ratio of the component of the target ray in the Z direction to the absolute value of the target as a third stepping amount in the Z direction.
S205-6: an end point in the stepped target ray is determined based on the first step amount, the second step amount, and the third step amount.
Illustratively, the first absolute value of the component of the X-direction of the target ray is a, the second absolute value of the Y-direction of the target ray is B, the first absolute value a and the second absolute value B are compared, and when the first absolute value a is greater than the second absolute value B, the first absolute value a is determined to be the target absolute value. At this time, the ratio of the X-direction component to the first absolute value A of the target image is calculated, and is 1 or-1, 1 or-1 is the first absolute value of the target ray in the X-direction and the stepping amount in the stepping direction is 1, the ratio of the Y-direction component to the target absolute value is calculated within a range (-1, 1), and the ratio of the Z-direction component to the target absolute value is calculated within a range (-1, 1). The first stepping amount, the second stepping amount and the third stepping amount in the X direction, the Y direction and the Z direction can be used for carrying out the end point after stepping in the target ray, so that the ray line segment can be determined based on the determined start point and the determined end point of the target ray.
There are various implementations of how to determine whether a ray segment passes through a vertically consecutive voxel block, in one implementation, as shown in fig. 5, comprising the steps of:
s301: a first height range of each vertically consecutive voxel block is determined.
S302: a second height range in the Z direction of the ray segment formed by the start point and the end point is determined.
S303: a first height range and a second height range are determined to determine whether a ray segment passes through any of the vertically consecutive voxel blocks.
For a vertically consecutive voxel block, the vertically consecutive voxel block has two specific values, namely an upper height limit max and a lower height limit min, wherein the upper height limit and the lower height limit represent voxel blocks with continuous height in the range of ([ x, x+1), [ y, y+1)), the lowest height is the lower height limit min, and the highest height is the upper height limit max. For the ray segment, there are a start point and an end point, when the value of the Z axis direction of the start point is greater than the value of the Z axis direction of the end point, the value of the Z axis of the start point is the high point height, the value of the Z axis of the end point is the low point height, and the second height range formed by the start point and the end point is the (value of the Z axis of the end point, the value of the Z axis of the start point). When the value of the Z axis direction of the start point is smaller than the value of the Z axis direction of the end point, the value of the Z axis of the start point is the low point height, and the value of the Z axis of the end point is the high point height, the second height range formed by the start point and the end point at this time is (the value of the Z axis of the start point, the value of the Z axis of the end point).
There are a number of ways to determine whether a ray segment passes through a vertically consecutive block of voxels for a first and second height range, in one implementation:
judging whether the height of the high point is larger than the lower limit of the height, and judging whether the height of the low point is smaller than the upper limit of the height under the condition that the height of the high point is larger than the lower limit of the height; in the case where the low point height is less than the upper height limit, a ray line segment is determined to traverse any vertically consecutive voxel block. And if the high-point height is larger than the lower height limit and the low-point height is smaller than the upper height limit, determining that the ray segment passes through any vertical continuous voxel block, and outputting the target voxel block.
In the case where the high point height is less than the lower height limit or the low point height is greater than the upper height limit, the implementation manner of determining whether the ray passes through the vertically continuous voxel block may further be, as shown in fig. 6, including the following steps:
s401: in the case where the high point height is less than the upper height limit, or in the case where the low point height is greater than the upper height limit, the ending point is taken as a new starting point.
S402: and returning to the step of stepping based on the stepping direction, and determining the ending point in the stepped target ray until determining whether the ray segment formed by the starting point and the ending point passes through any one of the vertical continuous voxel blocks or not until all the vertical continuous voxel blocks are traversed.
If the high point height is smaller than the lower height limit or the low point height is larger than the upper height limit, determining that the ray line segment does not pass through the vertical continuous voxel block, determining whether the ending point of the ray line segment is beyond the range of the pre-built height field data structure, if the ending point of the ray line segment does not exceed the range of the pre-built height field data structure, moving the next step, taking the ending point of the last step as the starting point of the next step, taking the ending point after the step as the new ending point, and forming the new ray line segment by the new ending point and the ending point of the last step. And re-determining a second height range of the new ray segment in the Z-direction, determining whether the new ray segment passes through the vertically consecutive voxel block based on the second height range of the new ray segment in the Z-direction and the respective first height ranges. When the new ray segment does not pass through the vertically continuous voxel blocks, determining the new ray segment after stepping again until all the vertically continuous voxel blocks are traversed.
Referring to fig. 7, an embodiment of the present application further provides a voxel block detection apparatus 110 applied to the electronic device 100 shown in fig. 1, where the voxel block detection apparatus 110 includes:
a construction module 111 for constructing a high-field data structure in voxel space;
a segmentation module 112 for dividing the high field data structure into a plurality of vertically consecutive voxel blocks;
a determining module 113, configured to introduce a target ray into the voxel space; determining a stepping direction based on the target ray; taking the starting point of the target ray as a starting point, stepping based on the stepping direction, and determining the ending point in the stepped target ray; determining whether a ray segment formed by the starting point and the ending point passes through any of the vertically continuous voxel blocks; if yes, the passing vertical continuous voxel block is taken as a target voxel block.
The present application also provides an electronic device 100, the electronic device 100 comprising a processor 130 and a memory 120. Memory 120 stores computer-executable instructions that, when executed by processor 130, implement the voxel block detection method.
The embodiments of the present application also provide a computer readable storage medium storing a computer program which, when executed by the processor 130, implements the voxel block detection method.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners as well. The apparatus embodiments described above are merely illustrative, for example, flow diagrams and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. 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.
In addition, the functional modules in the embodiments of the present application may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part. The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is merely various embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered in the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A voxel block detection method, the method comprising:
constructing a high-field data structure in a voxel space;
partitioning the high field data structure into a plurality of vertically contiguous voxel blocks;
transmitting a target ray into the voxel space;
determining a stepping direction based on the target ray;
taking the starting point of the target ray as a starting point, stepping based on the stepping direction, and determining the ending point in the stepped target ray;
determining whether a ray segment formed by the starting point and the ending point passes through any of the vertically continuous voxel blocks;
if yes, the passing vertical continuous voxel block is taken as a target voxel block.
2. The method of claim 1, wherein the step of determining a stepping direction based on the target ray comprises:
determining an X-direction component and a Y-direction component of the target ray;
determining a larger component from the components in the X direction and the Y direction as a target component;
the direction of the target component is determined as a step direction.
3. The method of claim 2, wherein the steps of taking the start point of the target ray as a starting point, stepping based on the stepping direction, and determining the end point in the stepped target ray comprise:
determining a first absolute value of an X-direction component and a second absolute value of a Y-direction component of the target ray;
determining a larger target absolute value from the first absolute value and the second absolute value;
calculating the ratio of the component of the X direction of the target ray to the absolute value of the target as a first stepping amount of the X direction;
calculating the ratio of the component of the target ray in the Y direction to the absolute value of the target as a second stepping amount in the Y direction;
calculating the ratio of the component of the target ray in the Z direction to the absolute value of the target as a third stepping amount in the Z direction;
and determining an ending point in the stepped target ray based on the first stepping amount, the second stepping amount and the third stepping amount.
4. The method according to claim 1, wherein the method further comprises:
determining a first height range of each of the vertically consecutive voxel blocks;
the step of determining whether a ray segment formed by the start point and the end point passes through any of the vertically consecutive voxel blocks comprises:
determining a second height range of the Z direction of the ray line segment formed by the starting point and the ending point;
and judging the first height range and the height range, and determining whether the ray segment passes through any of the vertical continuous voxel blocks.
5. The method of claim 4, wherein the first height range includes an upper height limit and a lower height limit, the second height range includes a high point height and a low point height, the determining the first height range and the height range, determining whether the ray segment passes through any of the vertically consecutive blocks of voxels, comprising:
judging whether the height of the high point is larger than the lower limit of the height;
judging whether the height of the low point is smaller than the upper height limit or not under the condition that the height of the high point is larger than the lower height limit;
in the event that the low point height is less than the upper height limit, determining that the ray segment passes through any of the vertically consecutive voxel blocks.
6. The method of claim 5, wherein the method further comprises:
taking the ending point as a new starting point in the case that the high point height is smaller than the upper height limit or in the case that the low point height is larger than the upper height limit;
and returning to the step of stepping based on the stepping direction and determining the ending point in the target ray after stepping until determining whether the ray segment formed by the starting point and the ending point passes through any one of the vertical continuous voxel blocks or not until all the vertical continuous voxel blocks are traversed.
7. The method according to claim 1, wherein the method further comprises:
and constructing a voxel scene based on the target voxel block.
8. A voxel block detection apparatus, the apparatus comprising:
a construction module for constructing a high-field data structure in voxel space;
a segmentation module for dividing the high field data structure into a plurality of vertically consecutive voxel blocks;
a determining module, configured to transmit a target ray into the voxel space; determining a stepping direction based on the target ray; taking the starting point of the target ray as a starting point, stepping based on the stepping direction, and determining the ending point in the stepped target ray; determining whether a ray segment formed by the starting point and the ending point passes through any of the vertically continuous voxel blocks; if yes, the passing vertical continuous voxel block is taken as a target voxel block.
9. An electronic device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1-7 when executing the computer program.
10. A readable storage medium having stored thereon a computer program, which when executed by a processor performs the steps of the method according to any of claims 1-7.
CN202311703850.3A 2023-12-12 2023-12-12 Voxel block detection method, voxel block detection device, electronic equipment and storage medium Pending CN117727023A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311703850.3A CN117727023A (en) 2023-12-12 2023-12-12 Voxel block detection method, voxel block detection device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311703850.3A CN117727023A (en) 2023-12-12 2023-12-12 Voxel block detection method, voxel block detection device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117727023A true CN117727023A (en) 2024-03-19

Family

ID=90199158

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311703850.3A Pending CN117727023A (en) 2023-12-12 2023-12-12 Voxel block detection method, voxel block detection device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117727023A (en)

Similar Documents

Publication Publication Date Title
US11086016B2 (en) Method and apparatus for tracking obstacle
CN109344899B (en) Multi-target detection method and device and electronic equipment
JP2004164596A (en) Method and system for traversing n-dimensional bi-tree
CN111308500B (en) Obstacle sensing method and device based on single-line laser radar and computer terminal
CN111090712A (en) Data processing method, device and equipment and computer storage medium
CN101727580A (en) Image processing apparatus, electronic medium, and image processing method
CN111744199B (en) Image processing method and device, computer readable storage medium and electronic equipment
CN110009662B (en) Face tracking method and device, electronic equipment and computer readable storage medium
CN116036604B (en) Data processing method, device, computer and readable storage medium
CN113591566A (en) Training method and device of image recognition model, electronic equipment and storage medium
CN113256719A (en) Parking navigation positioning method and device, electronic equipment and storage medium
CN114565513A (en) Method and device for generating confrontation image, electronic equipment and storage medium
CN116415652A (en) Data generation method and device, readable storage medium and terminal equipment
CN112861595A (en) Method and device for identifying data points and computer-readable storage medium
CN113791425A (en) Radar P display interface generation method and device, computer equipment and storage medium
CN110887490B (en) Key frame selection method, medium, terminal and device for laser positioning navigation
CN113312560A (en) Group detection method and device and electronic equipment
CN117727023A (en) Voxel block detection method, voxel block detection device, electronic equipment and storage medium
CN116358528A (en) Map updating method, map updating device, self-mobile device and storage medium
CN116481513A (en) Map generation method and device and electronic equipment
CN112288759B (en) Boundary extraction method, device, equipment and storage medium
CN115481268A (en) Parallel line wall data identification method, device, equipment and storage medium
CN115861626A (en) Target detection method and device, terminal equipment and computer readable storage medium
CN115100508A (en) Laser repositioning method, device and equipment for mobile robot and storage medium
CN113808196A (en) Plane fusion positioning method and device, electronic equipment and storage medium

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