I have following scenario:
I want to have a vector field simulation which shows the current of a fluid, lets say water. This current produces a certain noise, which can change when a solid object is submerged into the current.
Is there a way to somehow attach this noise/sound to the visuals of VTK?
I am not really experienced with VTK, so any point in the right direction is appreciated.
Thanks in advance!
This is a pretty general question on an esoteric topic. A good first step in these cases is to do a scientific journal review to see what researchers have attempted before, what tools they used and what success they had. After a quick search I found a few relevant journals that cover generating sound from simulations/data.
Sounding liquids: Automatic sound synthesis from fluid simulation
Visual to Sound: Generating Natural Sound for Videos in the Wild
Auditory Display and the VTK Sonification Toolkit
Listen to your data: Model-based sonification for data analysis
After reviewing these, you'll have a better idea of what's already been attempted and what's possible.
Related
I'm producing an ugv prototype. The goal is to perform the desired actions to the targets set within the maze. When I surf the Internet, the mere right to navigate in the labyrinth is usually made with a distance sensor. I want to consult more ideas than the question.
I want to navigate the labyrinth by analyzing the image from the 3d stereo camera. Is there a resource or successful method you can suggest for this? As a secondary problem, the car must start in front of the entrance of the labyrinth, see the entrance and go in, and then leave the labyrinth after it completes operations in the labyrinth.
I would be glad if you suggest a source for this problem. :)
The problem description is a bit vague, but i'll try to highlight some general ideas.
An useful assumption is that labyrinth is a 2D environment which you want to explore. You need to know, at every moment, which part of the map has been explored, which part of the map still needs exploring, and which part of the map is accessible in any way (in other words, where are the walls).
An easy initial data structure to help with this is a simple matrix, where each cell represents a square in the real world. Each cell can be then labelled according to its state, starting in an unexplored state. Then you start moving, and exploring. Based on the distances reported by the camera, you can estimate the state of each cell. The exploration can be guided by something such as A* or Q-learning.
Now, a rather subtle issue is that you will have to deal with uncertainty and noise. Sometimes you can ignore it, sometimes you don't. The finer the resolution you need, the bigger is the issue. A probabilistic framework is most likely the best solution.
There is an entire field of research of the so-called SLAM algorithms. SLAM stands for simultaneous localization and mapping. They build a map using some sort of input from various types of cameras or sensors, and they build a map. While building the map, they also solve the localization problem within the map. The algorithms are usually designed for 3d environments, and are more demanding than the simpler solution indicated above, but you can find ready to use implementations. For exploration, something like Q-learning still have to be used.
I'm neither an expert in OpenCV or python but after far too much messing around with poor c# implementations of cv libraries I decided to take the plunge.
Thus far I've got 'blob' (read-contour) tracking working the way I want - my problem now is occlusion, a problem which, as I (and myriad youtube videos) understand it, the Kalman filter can solve. The problem is, relevant examples in python don't seem to exist and the example code is largely devoid of comments, ergo how a red and yellow line running all over the shop solve my problem is a mystery to me.
What I want to achieve is something like this http://www.youtube.com/watch?v=lvmEE_LWPUc or this http://www.youtube.com/watch?v=sG-h5ONsj9s.
I'd be very grateful if someone could point me in the direction of (or provide) an example using actual images pulled from a webcam or video.
Thanks in Advance.
You can take a look at:
https://github.com/dajuric/accord-net-extensions
It implements Kalman filtering, particle filtering, Joint Probability Data Association Filter (for multi-object tracking) along with motion models.
Samples included!
I am searching for a lib that helps me to use many sound properties.
I mean, I need something to get each frequency of sounds, get the sound waves length and width, get the peak and trough (in a measurement way) of the sounds.
I need something that leads me as close as possible to manipulate and measure sounds waves in some ways, this is something that I need more for a scientific research than for an application.
It is hard to find something like that, If you could help me with some links or anything, would be a great help for me.
If you have something even in other languages, it could help me.
I will keep this question updated as I find answers as well.
Thanks in advance.
The Python wiki page PythonInMusic has a lot of links, some of which will probably be useful to you. It includes a whole range of projects to input and output sound in different formats. A quick glance shows a couple of more specialised projects that might also be helpful:
audiolab - bridges the gap between numpy and sound formats
musickit - support for signal processing, and apparently used in 'scientific experiments'
These will probably give you the tools to read sounds in and convert them into a useful form for analysis.
After that, it seems to me that what you are describing is more about signal/waveform analysis, than sound per se, so that may be a more helpful direction to search in. I'm not aware of any Python package that does exactly what you're looking for. Measurement of things like wavelength, peak and trough doesn't sound particularly difficult to me though - you could look at coding your own routines for this using SciPy.
I have a large number of GIS (latitude, longitude) coordinates, and I'd like to get the distance between them. Is there a service that will calculate the shortest path for me? I know about google maps, but I'd like something I can use from Python, and that can handle a large batch of requests at once.
I'm looking for the driving distance, so a straight distance won't do.
Thanks
So I take it based on your question and the answers posted that you are asking what program to use? If you can find a way to get a copy for free or cheap (like through work, school, etc) I'd recommend ArcGIS 9.x. It has its quirks, but it's highly supported by the user community and there are a lot of forums and help/training books available for it. Also, they have adopted Python as their official scripting language for the program (Sweeeet!).
Another option that is less expensive is GRASS. It's a free, open-source, well established, powerful and multiplatform GIS program. It might have a bit steeper learning-curve than ArcGIS, but I've heard very good things about it considering it's a free program.
This website lists info on free, open-source (FOS) GIS programs http://opensourcegis.org/ and could give you some good info on your other choices.
I couldn't tell if you were asking a question about how to measure the distance between two points and finding shortest travel distances in a GIS program or if you were just mentioning that's the kind of stuff you would need to do. Either way, ArcGIS is well suited for those tasks. Some of the tools in ArcGIS's ArcToolbox already have commands to help you find optimal transportation routes. This link lets you explore some of the tools available ArcToolbox Help. Most of the tools in ArcToolbox have a GUI batch processing option automatically included as well. Measuring point to point distances on an individual basis is easy in ArcGIS, and if you needed to measure a bunch of point to point pairs, you could write a quick Python script to easily do it for you.
I think I've answered all of your questions. Feel free to let me know if there is something I missed or that doesn't make sense. Hope this helps, buddy.
Check out OpenStreetMap. You can download their map data and have it lying around on your local system. http://wiki.openstreetmap.org/wiki/Routing discusses the various routing systems for their data.
You are aware that the traveling salesman problem is np-complete?
using Qgis:
Use the delimited text plugin to import the data
save the import as a shape file
Open the shape file
using the ftools plugin, calculate the matrix distance
If you have interconnections between the points you could use Dijkstra's algorithm for a 'shortest path from a single point' or Floyd's algorithm for an 'all pairs' shortest path computation.
Neither are particularly complicated, however they do assume you know the lengths of the roads between the points. You will need to have this data to compute a driving distance.
I would like to know similar, concrete simulations, as the simulation about watering a field here.
What is your favorite library/internet page for such simulations in Python?
I know little Simpy, Numpy and Pygame. I would like to get examples about them.
If you are looking for some game physics (collisions, deformations, gravity, etc.) which looks real and is reasonably fast consider re-using some physics engine libraries.
As a first reference, you may want to look into pymunk, a Python wrapper of Chipmunk 2D physics library. You can find a list of various Open Source physics engines (2D and 3D) in Wikipedia.
If you are looking for physically correct simulations, no matter what language you want to use, it will be much slower (almost never real-time), and you need to use some numerical analysis software (and probably to write something yourself). Exact answer depends on the problem you want to solve. It is a fairly complicated field (of math).
For example, if you need to do simulations in continuum mechanics or electromagnetism, you probably need Finite Difference, Finite Volume or Finite Element methods. For Python, there are some ready-to-use libraries, for example: FiPy (FVM), GetFem++ (FEM), FEniCS/DOLFIN (FEM), and some other.
Here is some simple astronomy related python. And here is a hardcore code from the same guy.
And Eagleclaw solves and plots various hyperbolic equations using some python. However, most of the code is written in Fortran to do the computations and python to plot the results. If you are studying physics though you may have to get used to this kind of Fortran wrapped code. It is a reality. But this isn't really what your looking for I guess. The good thing it that it is documented in a literate programming style so it should be understandable.
Maybe PyODE?
I've heard of PyBox2D, which is a port of the really nice Box2D. To quote the site:
Box2D is a feature rich 2d rigid body physics engine, written in C++ by Erin Catto. It has been used in many games, including Crayon Physics Deluxe, winner of the 2008 Independent Game Festival Grand Prize.