I need to build a network of nodes and edges for a hierarchical data set. I really liked the wine and cheese sample in cytoscape.js and I am looking to implement my view in a similar fashion. I noticed that graph gets it's data from a remote api call which has the positions for each node pre-defined. Can anyone point me to some sample code which I could use to generate the positions in a similar manner?
Related
I am facing a problem on 3D reconstruction since I am a new to this filed. I have some different views' depth map(point clouds), I want to use them to reconstruct the scene to get the effect like using the kinect fusion. Is there any paper of source code to settle this problem. Or any ideas on this problem.
PS:the point cloud is stored as a file with (x,y,z), you can check here to get the data.
Thank you very much.
As you have stated that you are new to this field, I shall attempt to keep this high level. Please do comment if there is something that is not clear.
The pipeline you refer to has three key stages:
Integration
Rendering
Pose Estimation
The Integration stage takes the unprojected points from a Depth Map (Kinect image) under the current pose and "integrates" them into a spatial data structure (a Voxel Volume such as a Signed Distance Function or a hierarchical structure like an Octree), often by maintaining per Voxel running averages.
The Rendering stage takes the inverse pose for the current frame and produces an image of the visible parts of the model currently in view. For the common volumetric representations this is achieved by Raycasting. The output of this stage provides the points of the model to which the next live frame is registered (the next stage).
The Pose Estimation stage registers the previously extracted model points to those of the live frame. This is commonly achieved by the Iterative Closest Point algorithm.
With regards to pertinent literature, I would advise the following papers as a starting point.
KinectFusion: Real-Time Dense Surface Mapping and Tracking
Real-time 3D Reconstruction at Scale using Voxel Hashing
Very High Frame Rate Volumetric Integration of Depth Images on
Mobile Devices
I used Cytoscape for biological network visualization before using Cytoscape.js.
Cytoscape is able to create an automatic layout from our network file using its internal placement algorithm. The layout placement is very reasonable--- nodes that are connected to each other are placed nearby, and nodes are spread out nicely with the central nodes placed in the center of each group of nodes, which is really good for biological networks since there are so many nodes and so many connections among nodes.
Now I am using Cytoscape.js. I want Cytoscape.js to automatically create a layout like what Cytoscape creates. I tried to use all different layout options (“random”, “grid”, “cose”, “circle”, “breadthfirst”), but none of them creates a layout like what Cytoscape creates.
I don’t what to write our own layout placement algorithm for biological networks (which is a big deal).
But we need to use Cytoscape.js instead of Cytoscape since we need to put our molecular network workflow on the website (and visualize the network result on the website).
So my question is: how can we let Cytoscape.js automatically create a layout like what Cytoscape creates?
Thank you very much in advance!
Cytoscape desktop can make a lot of assumptions that a library can't --- or shouldn't. If you use a library like Cytoscape.js, you need to set explicit options for things that Cytoscape desktop can make assumptions about.
Look into the force-directed layouts. They're described in the docs, but I'll give an overview here:
cose : Built-in, very fast, small impact on file size, but need to set options fairly precisely for good results (e.g.)
cose-bilkent : A version of the CoSE algorithm with more enhancements, optimised to work well for bio networks, a bit slower, larger file size, gives nice results without much or any tinkering (e.g.)
cola : Works well for most graphs (e.g.)
spread : Fast, clustering cases don't want the second phase enabled
springy and arbor : Basic, usually lots of tinkering needed, even with tinkering results can be poor
Most layouts are not built-in, as Cytoscape.js is a lib. (It wouldn't be fair to force everyone to include large files when not everyone needs them.)
For more info, see
http://js.cytoscape.org/#layouts
http://js.cytoscape.org/#extensions/layout-extensions
I've been using GraphViz to relationships between software components, and getting some fairly decent results. On the web, I would prefer something like cytoscape because the user experience is better, and it would give me potential for a richer experience where a user could manipulate the graph by adding nodes, etc.
Given this graph, rendered by GraphViz, is it possible to achieve a similar layout with Cytoscape. It is choosing fairly optimal node layout and edge routing to avoid or minimize any overlaps and still retain readability, using an auto layout directed graph. The only constraint that was applied to the graph was to rank all components that have an "installed" relationship to them at the bottom.
Is this possible to achieve with Cytoscape?
The Dagre layout organises trees well.
For more information, please refer to the Dagre project itself.
I have a project where I have to recognize an entire room so I can calculate the distances between objects (like big ones eg. bed, table, etc.) and a person in that room. It is possible something like that using Microsoft Kinect?
Thank you!
Kinect provides you following
Depth Stream
Color Stream
Skeleton information
Its up to you how you use this data.
To answer your question - Official Micorosft Kinect SDK doesnt provides shape detection out of the box. But it does provide you skeleton data/face tracking with which you can detect distance of user from kinect.
Also with mapping color stream to depth stream you can detect how far a particular pixel is from kinect. In your implementation if you have unique characteristics of different objects like color,shape and size you can probably detect them and also detect the distance.
OpenCV is one of the library that i use for computer vision etc.
Again its up to you how you use this data.
Kinect camera provides depth and consequently 3D information (point cloud) about matte objects in the range 0.5-10 meters. With this information it is possible to segment out the floor (by fitting a plane) of the room and possibly walls and the ceiling. This step is important since these surfaces often connect separate objects making them a one big object.
The remaining parts of point cloud can be segmented by depth if they don't touch each other physically. Using color one can separate the objects even further. Note that we implicitly define an object as 3D dense and color consistent entity while other definitions are also possible.
As soon as you have your objects segmented you can measure the distances between your segments, analyse their shape, recognize artifacts or humans, etc. To the best of my knowledge however a Skeleton library can recognize humans after they moved for a few seconds. Below is a simple depth map that was broken on a few segments using depth but not color information.
We currently have a dynamically updated network graph with around 1,500 nodes and 2,000 edges. It's ever-growing. Our current layout engine uses Prefuse - the force directed layout in particular - and it takes about 10 minutes with a hefty server to get a nice, stable layout.
I've looked a little GraphViz's sfpd algorithm, but haven't tested it yet...
Are there faster alternatives I should look at?
I don't care about the visual appearance of the nodes and edges - we process that separately - just putting x, y on the nodes.
We do need to be able to tinker with the layout properties for specific parts of the graph, for instance, applying special tighter or looser springs for certain nodes.
Thanks in advance, and please comment if you need more specific information to answer!
EDIT: I'm particularly looking for speed comparisons between the layout engine options. Benchmarks, specific examples, or just personal experience would suffice!
I wrote a JavaScript-based graph drawing library VivaGraph.js.
It calculates layout and renders graph with 2K+ vertices, 8.5K edges in ~10-15 seconds. If you don't need rendering part it should be even faster.
Here is a video demonstrating it in action: WebGL Graph Rendering With VivaGraphJS.
Online demo is available here. WebGL is required to view the demo but is not needed to calculate graphs layouts. The library also works under node.js, thus could be used as a service.
Example of API usage (layout only):
var graph = Viva.Graph.graph(),
layout = Viva.Graph.Layout.forceDirected(graph);
graph.addLink(1, 2);
layout.run(50); // runs 50 iterations of graph layout
// print results:
graph.forEachNode(function(node) { console.log(node.position); })
Hope this helps :)
I would have a look at OGDF, specifically http://www.ogdf.net/doku.php/tech:howto:frcl
I have not used OGDF, but I do know that Fast Multipole Multilevel is a good performant algorithm and when you're dealing with the types of runtimes involved with force directed layout with the number of nodes you want, that matters a lot.
Why, among other reasons, that algorithm is awesome: Fast Multipole method. The fast multipole method is a matrix multiplication approximation which reduces the O() runtime of matrix multiplication for approximation to a small degree. Ideally, you'd have code from something like this: http://mgarland.org/files/papers/layoutgpu.pdf but I can't find it anywhere; maybe a CUDA solution isn't up your alley anyways.
Good luck.
The Gephi Toolkit might be what you need: some layouts are very fast yet with a good quality: http://gephi.org/toolkit/
30 secondes to 2 minutes are enough to layout such a graph, depending on your machine.
You can use the ForAtlas layout, or the Yifan Hu Multilevel layout.
For very large graphs (+50K nodes and 500K links), the OpenOrd layout wil
In a commercial scenario, you might also want to look at the family of yFiles graph layout and visualization libraries.
Even the JavaScript version of it can perform layouts for thousands of nodes and edges using different arrangement styles. The "organic" layout style is an implementation of a force directed layout algorithm similar in nature to the one used in Neo4j's browser application. But there are a lot more layout algorithms available that can give better visualizations for certain types of graph structures and diagrams. Depending on the settings and structure of the problem, some of the algorithms take only seconds, while more complex implementations can also bring your JavaScript engine to its knees. The Java and .net based variants still perform quite a bit better, as of today, but the JavaScript engines are catching up.
You can play with these algorithms and settings in this online demo.
Disclaimer: I work for yWorks, which is the maker of these libraries, but I do not represent my employer on SO.
I would take a look at http://neo4j.org/ its open source which is beneficial in your case so you can customize it to your needs. The github account can be found here.