perlin simplex worley noise libraries for tiling in javascript or HTML5 in general? - tiles

I am curious if there are libraries already developed for creating these noises in javascript?
I have searched the web for about two hours looking for libraries in javascripts. I have seen this implementation for the simplex noise:
https://gist.github.com/304522
but I have not seen any libraries made up specifically for javascript.
If no one knows of any libraries then link suggestions on how to develop these functions would be great as well. I am currently doing Google searches for everything I have asked here I just figured better to have multiple web crawlers helping me out concurrently :) Also if someone on stack overflow has already found a quality site then even better.
Thanks guys!

Here you can find a thoroughly explanation of the algorithm, also the original code from Worley (explained in Texturing and modelling. A procedural approach) ported to Processing.
At the moment I'm working deploying to Javascript.

For the tiling part of your question: if you have a Perlin or Simplex noise function you don't really need a library to create tiling images because the math is really not that difficult. What is difficult is understanding how it works. For instance: a spherical noise map is way easier than simple 2D tiling image because you need to work with four dimensions for the latter.
I once wrote a blog post explaining in detail how to create tiling noise (including Javascript code examples).
It shows you how to tile in linear, cylindrical, planar and spherically (including cubical panorama).

I've made a javascript app that renders perlin/simplex noise to an html5 canvas, you can find it here: http://lencinhaus.github.com/canvas-noise
Well it's not a proper library, but the javascript code contains implementations of value noise, perlin noise (both in classic and improved versions) and simplex noise, all derived from the original Perlin's C implementations (or a more optimized java version for simplex noise, see the references in the code). You can tweak the noise parameters visually and immediately see the results in the browser, so maybe it can be useful for you.
hope that helps!

Related

Extracting trees from image without picking up background vegetation?

I do not have a background in image recognition/feature extraction, but I am in need of a way to extract trees from an image without the background vegetation.
Seen above is a small example of the kind of imagery I'm working with. I have access to multi-spectral imagery as well (though I haven't seen it yet) including NDVI, NIR, Red-edge.
From researching the problem at hand, I am aware that feature extraction is an active area of research and it seems that often supervised and unsupervised machine learning is employed in combination with statistical voodoo such as "PCA". Being able to differentiate between trees and background vegetation has been noted as an area of difficulty in some papers I skimmed over in my research.
There are notable features about the imagery I am working with. First of all, the palm trees have a very distinctive shape. Not only this, but there are obvious differences in the texture of the trees vs the texture of the background vegetation.
I am not an academic, and as such I only have access to publicly available papers for my research. I am looking for relevant algorithms that could help me extract the features of interest to me (trees) that either have an implementation (ideally in C or bindings to C, though I'm aware that it is not a commonly used language in this field) or with publicly available papers/tutorials/sites/etc. detailing the algorithm so that I could implement it myself.
Thanks in advance for any help!
Look into OpenCV, It has a lot of options for supervised/semi supervised Learning methods. As you have mentioned there is a visible texture difference between the tress and background vegetation, a good place for you would be to start would be color based segmentation and evolving it to use textures as well. OpenCV ML tutorial is a good starting point. Moreover you can also combine the NDVI data to create a stronger feature set.

Simple morphing animation between two images

I'm looking to implement a simple morphing animation between two images.
Here's a simple demo of what I'm trying to create: http://i.imgur.com/7377yHr.gif
I'm pretty comfortable with Objective-C and JavaScript but since the concepts and algorithms are abstract, I'm more than willing to see examples in any language or framework.
I would like to know how hard it would be to tackle this -- it doesn't have to be exact but as long as it gives the impression of a morph I'll be satisfied.
Where would I start?
It seems like in your example is being used a combination of mesh wrap morphing and cross dissolve morphing. Mesh morphing can be tricky and as far as I know it requires a manual input (defining the mesh), so depending on what you want to do it might not be suitable for you.
If you are looking for a cheap technique (in terms of effort), probably just doing cross dissolve would work for you, since is very easy to implement. You just need to combine both images by increasing the alpha of the target image and decreasing the alpha on the origin image.
These articles give an overview of the techniques:
[PDF] http://css1a0.engr.ccny.cuny.edu/~wolberg/pub/vc98.pdf
[PDF] http://www.sorging.ro/en/member/serveFile/format/pdf/slug/image-morphing-techniques
[PDF] http://cs.haifa.ac.il/hagit/courses/ip/Lectures/Ip05_GeomOper.pdf
The last link comes from a comment in a similar question: Morphing, 3 algorithms, image processing

Inverse kinematic animation

I'm trying to find or create a working example of inverse kinematic posing in three.js. Ideally I would like to export human models from Makehuman via their Collada exporter, load them with THREE.ColladaLoader and set them into different poses in three.js programmatically or through some dat.GUI interface. A bit like an artist doll implementation - I don't need animation, but real-time feedback when tweaking the pose would be nice, and inverse kinematic style posing would be highly preferred.
I've been studying and searching information for days. This http://www.youtube.com/watch?v=6om9xy6rnc0 is very close, but I was unable to find any example code or downloads. The closest working example I've found is this: http://mrdoob.github.com/three.js/examples/webgl_animation_skinning.html However that appears to use predefined animation frames, which in turn appears to manipulate the bones in forward kinematics manner so that was not much help either.
I couldn't even find a model for testing, as I don't know what to look for when searching something with IK rigs/skinning/bones compatible with Three.js. Makehuman does seem to have plenty of rigging export options, I don't know if any of those are usable.
Is there a usable IK system in Three.js, and if so, are there any working examples, working human models, or any hints on which exact rigging system/workflow should study to accomplish this? If direct Collada support is not possible, creating the characters in Blender and exporting them is an option too..
EDIT: found this live demo http://www.akjava.com/demo/poseeditor/ but the code is totally unreadable.
I don’t feel competent enough to answer your question, but I’ll post three links which may put you on the right track.
wylieconlon/kinematics
– a great demo of 2D inverse kinematics animation. The code is totally readable.
https://www.khanacademy.org/computer-programming/inverse-kinematics/1191743453
– another demo, this time less flexible but more terse.
How to calculate inverse kinematics
– a rabbit hole of links. Just in case you’d want to dive right into the thing.
This seems promising.
Fullik : javascript fast iterative solver for Inverse Kinematics on three.js
is a conversion from java to Caliko 3D libs
Caliko library is an implementation of the FABRIK inverse kinematics (IK) algorithm
https://github.com/lo-th/fullik

Image processing ideas

Recently I've been messing about with algorithms on images, partly for fun and partly to keep my programming skills sharp.
I've just implemented a 'nearest-neighbour' algorithm that picks n random pixels in an image, and then converts the colour of each other pixel in the image to the colour of its nearest neighbour in the set of n chosen pixels. The result is a kind of "frosted glass" effect on the image, for a reasonably large value of n (if n is too small then the image gets blocky).
I'm just wondering if anyone has any other good/fun algorithms on images that might be interesting to implement?
Tom
This book, Digital Image Processing, is one of the most commonly used books in image processing classes, and it will teach you a lot of basic techniques that will help you understand other algorithms better, like the ones Ants Aasma suggested.
Try making an Andy Warhol print. It's pretty easy in Java. For more ideas, just look at the filters available in GIMP or a similar program.
Marching Squares is a computer vision algorithm. Try using that to convert black and white raster images to object based scenes.
Turns the image into a pizza
Take N images, relate them via an MC-Escher-style painting
"Explode" an image from the inside out
Convert the image into a single-color blocks (piet-style) based on all the colours within.
How about tie-dye algorithm?
Fun to toy with and easy to code filters are:
kaleidoscope
lens
twirl
There are a lot of other filters, but especially the kaleidoscope gives much bang for the bucks. I have made my own graphics editor with lots of filters and is also looking for inspiration.
Instead of coding image filters, I personally would love to code Diffusion Curves, but unfortunately have little time for fun.
If you want to try something more challenging look for SIGGRAPH papers on the web. There are some really nifty image algorithms presented at that conference. Seam carving is one cool example that is reasonably straightforward to implement.
If you want something more challenging try to complete the symmetry of broken objects

What kind of cool graphics algorithms can I implement?

I'm going to program a fancy (animated) about-box for an app I'm working on. Since this is where programmers are often allowed to shine and play with code, I'm eager to find out what kind of cool algorithms the community has implemented.
The algorithms can be animated fractals, sine blobs, flames, smoke, particle systems etc.
However, a few natural constraints come to mind: It should be possible to implement the algorithm in virtually any language. Thus advanced directx code or XNA code that utilizes libraries that aren't accessible in most languages should not be posted. 3D is most welcome, but it shouldn't rely on lots of extra installs.
If you could post an image along with your code effect, it would be awesome.
Here's an example of a cool about box with an animated 3D figure and some animated sine blobs on the titlebar:
And here's an image of the about box used in Winamp, complete with 3D animations:
I tested and ran the code on this page. It produces an old-school 2D flame effect. Even when I ran it on an N270 in HD fullscreen it seemed to work fine with no lag. The code and all source is posted on the given webpage.
Metaballs is another possibly interesting approach. They define an energy field around a blob and will melt two shapes together when they are close enough. A link to an article can be found here.
Something called a Wolfram Worm seems so be an awesome project to attempt. It would be easy to calculate random smooth movement by using movement along two connected bezier curves. Loads of awesome demos can be found on this page:
http://levitated.net/daily/index.html
(source: levitated.net)
I like a lot the Julia 4D quaternion fractal.
(source: macromedia.com)
Video: Julia 4D animation in F#

Resources