Lets suppose in R-Tree we can hold maximum 4 elements in a leaf. Does it makes impossible to index more than 4 objects having common overlapping part? See the picture: all the 5 objects share the region covered by object 5. In R+-Tree internal nodes cannot overlap, so 4-leafs-R+-tree cannot have such a node that covers object 5 correctly. Is that correct? How this is handled in real GIS systems where many objects may have massively intersecting MBRs (Minimum Bounding Rect)? (The simplest idea is to have enough leaf capacity).
Let bounding boxes overlap - that's the key idea of r-trees. If you do that everything works fine, but for some reason it bothers people.
Related
I have an image that looks like this:
This is for the game Settlers of Catan. I want to parse this image to gather 3 pieces of info about each tile. 1. What resource it is 2. What number is associated with it 3. What neighbors it has. For example, know that the first one is green (forrest) with a 6, the next is wheat with a 5, the next is ore with a 9, and so on... I'm not sure what to use in opencv. I was thinking templateMatch but sometimes the pieces are with a different orientation (rotated).
In this board, the spots outlined in black are rotated.
The board will always have a set number of tiles. Meaning there will always 4 forrests, 4 wheats, 3 ores, etc...
Any direction on what I should do will be greatly appreciated.
I hope you all can help with this. I'm working on app of a board game. I have hex shaped tiles which are called randomly and laid out at the start of the game. Each of these tiles has four sides with a value of 1 and the other two sides have values of 2 and 3.
Each tile is a SKSpriteNode with transparent rectangle Nodes on the edges. There are 5 different types of tiles and they need to be separate Sprites with child nodes because in addition to being randomly laid out they area also randomly rotated. So I need to know programmatically which tile edges are touching which edges of other tiles.
Like this:
https://app.box.com/s/nnym97st3xmrsx979zchowdq1qwsmpoo
(I tried to post an image of what I'm trying to accomplish, but apparently I don't have a high enough of a rating.) ;-)
For example: If a "2" is touching a "3", etc.
I first tried Collision detection, but of course that only works with dynamic, moving objects.
I tried an IF statement to compare if the other nodes were touching and then remembered that the coordinates where specific to the Parent Node, so that didn't work.
I then tried intersectsNode, but that seems to only work with nodes under the same parent.
I am currently working with convertPoint in order to get the coordinates to match the scene and thus be comparable. But I can't seem to get it work the way I need.
There must be something simple that I am not seeing. Any ideas?
Certainly not simple.
One solution would be to start all your shapes slightly spaced out from each other. Add invisible child nodes with physics bodies to all six sides and give each physics body an appropriate category based on their rating (1, 2 or 3).
When you start the game, move all the outer nodes into their proper position (sides touching) by using whatever movement method your prefer. This will give you contact messages as each hex side touches another. The contact messages will tell you what side number is touching its neighbor.
The exact coding of this idea depends on your current code, game play, etc...
I want to make two models appear over one marker in ARToolkit. The key is they much come from two separate WRL files. Is this possible?
I know this is an old question, but maybe it is useful for someone else.
The answer is yes, you can.
The way you do it is to have an empty object that is the parent of the other 2 objects and make that object trackable.
The other 2 objects can define an offset in any direction based on the position of the parent, so they will behave as a scene of sorts, keeping their relative positions.
I just have a simple problem that needs resolving and I am pretty new to actionscript, I am making a sideScroller game where enemy troops spawn in randomly on some y value and then go across the screen, but how do I make it to where if they are lower on the y-axis(higher up on the screen), they appear in front of the others? They are troops so it looks bad if their legs overlap other people below them when it is supposed to look as if they are behind them. I hope I am explaining this well.
Any help would be awesome!
thanks
Keep all your troops in an Vector. First, sort them based on the y value. Then, iterate through the vector, and if the depth of the element at i is lower than the element at i+1, you should swap the objects' depths. Hope this helps, if you need more details, let me know.
I'm currently trying to find a neat way of storing separate "branches" in a binary image. This little animation explains it:
As I go along the branches I need to collect the pixel indices that makes up a single-pixel wide branch. When I hit a junction point it should split up and store the new branches.
One way of going about it is maybe to create a 3x3 subregion, find out if there are white pixels inside it, move it accordingly, create a junction point if there is more than two. Always store the previous subregion so one can use it for making sure that we don't move to regions we already scanned.
It's a bit tricky to figure out how I would go about it though.
I basically need to reorder the pixels based on a "line/curve" hierarchy. Another part of the application will then redraw the figures, which internally works by creating lines between points hence the need to have them "ordered".
I don't know if you could apply it in your case but you should take a look at cv::findContour.
you will get a vector of points ordered.
http://docs.opencv.org/doc/tutorials/imgproc/shapedescriptors/find_contours/find_contours.html