Questions tagged [octree]

An octree is a tree data structure in which each node has eight child nodes. A major application of octrees is in 3d graphics as they are the primary structure used for storing voxel (volumetric pixel) data.

Wikipedia: "An octree is a tree data structure in which each internal node has exactly eight children. Octrees are most often used to partition a three dimensional space by recursively subdividing it into eight octants. Octrees are the three-dimensional analog of quadtrees."

Relevant topics include voxels and color quantization.
For more information see http://en.wikipedia.org/wiki/Octree

148 questions
0
votes
1 answer

Efficient algorithm for nearest point search in a grid

I am looking for an algorithm that can do efficient search in a grid. I have a large array which includes all the centroid points (x,y,z) Now for a given location (xp,yp,zp) I want to find the closest centroid to that p location. Currently I am…
ATK
  • 1,296
  • 10
  • 26
0
votes
0 answers

how to use octree to find 3d point intersection?

i am trying to use an octree to find fast intersection between a volume of interest and several curves in 3d space, similar to what you see here at 0:25 https://www.youtube.com/watch?v=tL2AjQ4XEn4&t=119s basically, i want to be able to quickly…
Russell Butler
  • 326
  • 4
  • 15
0
votes
2 answers

Fastest way to find sphere a point is inside and closest to

I have a bunch of spheres with different radius scattered all over the place in a 3D system. What would be the fastest way to determine what sphere a point is inside, and if it is inside more than one - also the closest sphere based on the sphere's…
Daniela
  • 169
  • 2
  • 5
0
votes
1 answer

What is the logic to recursively subdivide an octree?

I am trying to recursively subdivide an octree and I am struggling with the logic of how to allow each node to be visited, but preventing an infinite recursion. It only seems to be visiting the first node, and then stopping and I understand why it…
jjmcc
  • 795
  • 2
  • 11
  • 27
0
votes
1 answer

vector of reference wrapper, push_back failure?

I have a problem that is giving me trouble; my goal is to create an octree. Actually, it's very cheap (but it's nearly enough for what I want to do with that octree). My problem is that my std::vector> is filled with…
Raph Schim
  • 528
  • 7
  • 30
0
votes
1 answer

Point indices for a given voxel

I need to partition my data into voxels using octree data structure of PCL. I think I managed to create the octree and voxels. However, I have two questions about octree structure of PCL. My first question is about resolution of the octree. I…
mozendi
  • 85
  • 1
  • 11
0
votes
3 answers

Creating a simple octree structure in Neo4j using Cypher

I would like to create an octree structure in Neo4j using Cypher. I would like to create something similar to the illustration below: Any ideas on how this could be implemented without having to create each node and relationship "manually"?
edwpea
  • 1
  • 1
0
votes
0 answers

Minimizing overhead for large trees in java

I need to implement a large octree in Java. The tree will be very large so I will need to use a paging mechanism and split the tree into many small files for long-term storage. My concern is that Java objects have a very high space overhead. If I…
Nathan Owen
  • 155
  • 10
0
votes
1 answer

How to find a octree node's neighbors when the tree is ordered by Morton code

I have an octree that I want to use to perform pathfinding in 3D space. I'm using Morton codes to order the nodes with the intention of being able to easily find the nodes nearby any given node. It appears to work great; any subset of the nodes I…
user1265215
  • 33
  • 2
  • 8
0
votes
0 answers

Reduce the colors in an image when we already have the palette, using OpenCV

Having an image I want to reduce it to x colors and save it in a png file. I choose to do this using k-means (which is already available in OpenCV). On a full resolution image it takes more then a minute so I resize the image to something much…
Adi
  • 321
  • 1
  • 17
0
votes
1 answer

Copy constructor and destructor octree c++

I have created an Octree data structure but it's not perfect yet. I'm struggled with the copy constructor and the destructor. Here is my header file: class Octree { public: static int lastbranch; static bool utolsoelotti; struct node { int…
T.dog
  • 91
  • 1
  • 12
0
votes
0 answers

How to delete a node of an octree c++ ( node was 0x4.)

I have an Octree and I have to delete a node searched by it's branch. The program can find the node but I'm struggled with delete it. When I create an object of my Octree and I create some nodes but I don't delete them, then the destructor is delete…
T.dog
  • 91
  • 1
  • 12
0
votes
0 answers

Clipping a triangle mesh with an AABB that is part of an octree

I have an application in which I am using an octree to store a volume mesh of axis-aligned bounding boxes (AABBs). Given a water-tight triangle mesh, I need to: find if an AABB is intersected by or completely inside/outside of the surface…
gnzlbg
  • 7,135
  • 5
  • 53
  • 106
0
votes
1 answer

Saving vertices of Octree leaf nodes in separate Data Structure

I'm trying to implement my own Octree class for spatial decomposition algorithms. What I would like to do, is to traverse the tree and save the vertices of the leaf nodes in a vector. So far, I implemented the octree in this way (it is in 2D for…
Federico Nardi
  • 510
  • 7
  • 19
0
votes
1 answer

how to convert from octree to a linear array with cache?

I have a 3d Grid (sparse octree) where each leaf (deepest node) stores a 3d point with color. I would like to convert the whole octree to a linear array of 3d points (vertex buffer), which can be uploaded to OpenGL directly. In a naiive way, I can…
mojovski
  • 581
  • 7
  • 21