I would like to implement a multiple blob tracking algorithm,
I have a feed of bitmaps (30 bitmaps per second).
The first bitmap for example looks like this:
And the second image looks like that:
I want to be able to know that object #1 in the first image is object #1 in the second image, and so with object #2. In addition I want to want to be able the get the blob surrounding the object in the image.
The second step is very easy to implement with somthing like openCV, but to know that 2 blob are the same object is someting i couldn't succeed to implement.
My goal is to archive something like this:
Please advice,
Noam
Once you identified the blobs you can calculate each blob's moments - here is a link that shows you how using OpenCv. Then the vector of moments can be used as a descriptor for this blob. Different descriptors can then be compared (for instance by calculating the distance between them) to determine if they are similar enough to be the same object.
Related
I have a question about drawing lines/paths on my own.
I use a combination of C#/WPF/Cudafy for UI and some calculations (e.g. the paths). Now I have a Byte[] array that should be filled with 'colors'/values (array-length = 4 * width * height of the result image).
I got some startpoints for the lines and one endpoint (somewhere between the startpoints). First I calculated some paths from those startpoints to the endpoints and then want to 'draw' them to the array (that will be used to construct a WriteableBitmap). The point coordinates are present in a 'reduced environment' though (since calculation of the paths needed to run a Dijkstra algorithm).
My paths are now defined by Tuples holding the point-coordinates (reduced size) and a 'linewidth'.
Since some paths may 'overlap' I thought I will do the following steps to ensure a nice looking of the result:
Merge the paths:
For that I will take one path and just keep it. Then I take the second and check if the path-points are somewhere near a path already added (like a near-neighbor search). I want to do this because in the end, I want to widen the line-width where paths overlap (3rd Tuple value).
When finished, I want to 'interpolate' the paths:
I don't really know how I should do that, since every path has a point at every (reduced-size) pixel.
One possibility would be to clear out all those path-coortinates of the paths that 'lie on a line' (and are not really necessary) and then do something like a Bezier - Interpolation. But all these steps seem to be overkill to me.
Don't you think there might be a better way to do this? If so, please share your thoughts :)
Thank's for any help!
Here's a link to an image of how it looks right now: CPVL Application
I want to create tiles out of a equirectangular image. So I want the image to be split into 4 lateral faces+up and bottom. Does anyone know any library that I can import into my c# project and which is able to do something like this?
Depending on your original image format, System.Drawing.Bitmap.Clone(Rectangle, PixelFormat) should do the trick.
More information here.
EDIT:
First, let me say that this is not going to answer your question either (not even close), you're seeking a library that already exists for this purpose and I don't know of one personally.
Equirectangular projection is the same as plate carrée (wow, that's humbling), so it's a very simple projection to work with in code.
Here is an example of it's use in a GIS application. I don't know what your purposes are, but the math is the same.
One way to do it is to deproject each pixel then draw it on a new image, but understand that to do this you will still require some sort of projection because you're changing from 3 dimensions to 2 dimensions.
I wasn't able to find a good example, but an easier or faster way might be to first use a matrix transform (again, to change projections), then cut the image into the regions you need.
Like I said, this isn't an asnwer, but if nothing else it will give you more keywords to goggle for.
I have a source image like left picture and a set of elements like right picture: Source Image And Elements...
..and I need to generate a mosaic picture like this.
But until this moment I have not worked with images, аnd I do not know where I should start.
I worked several years with C#, but you can give examples in other similar languages.
The result image you gave is apparently a ministeck pattern - in 2011 they had a downloadable software that seemed to do what you want. (Which is not available anymore by ministeck directly, but it seems that pfci.de still provides a download).
So, if you're just looking to generate the patterns for ministeck out of a given image, use their software. If you're after an algorithm to achieve something different, this won't help.
EDIT
Ok, if you're after analyzing your image, you need to load it into an object like this:
using(Bitmap b = new Bitmap(yourFileName))
{
MessageBox.Show(string.Format("image size {0} by {1} pixels", b.Width, b.Height));
MessageBox.Show(string.Format("color of pixel (100,100) is {0}", b.GetPixel(100, 100).ToString()));
}
The Bitmap object has several properties and methods that will help you to analyze the image content. Try this to get started with analyzing your image, and don't forget to either dispose your bitmap afterwards or wrap it into a using statement as shown above ...
My requirement is something like this:
Lets take there is a Bitmap with a big letter 'A'.
The Bitmap is two colors (Either Black or White).
I need to skeletonize the big 'A'. (see: http://en.wikipedia.org/wiki/Topological_skeleton)
Using "Medial Axis Transforming" algorithm.
I tried my best in googling but i ended up being lost in finding a C#, C++ or at least pseudo code implementation of this algorithm.
I would like if someone could help me on this.
This page http://www.cs.sunysb.edu/~algorith/files/thinning.shtml has some sources you may wish to review.
The following two articles are the ones where the Medial Axis Transform was first proposed, so I think that you can find the algorithm to implement there. Do not expect a C++/C# implementation though.
A transformation for extracting new descriptors of shape
Shape description using weighted symmetric axis features
For the first one I was able to find a URL to a pdf. For the second one you will have to have access to ScienceDirect to download.
Another approach that you can use to extract the skeleton of a shape is by the Image Foresting Transform (IFT). It consists in representing the binary image as a graph. I made an implementation of the skeletonization by IFT in Matlab using the following article:
Multiscale skeletons by image foresting transform and its applications to neuromorphometry
I'm writing some map software for my smartphone and have hit a problem whereby I don't want to load all of the (large) image files into memory when only a portion will be displayed.
Is there a way to read only a subsection (the viewable portion) of a big image given that you know the x and y offsets and width? I know it's probably possibly to do it by reading the file a byte at a time but I'm not sure how to do this.
Thank you,
Nico
It's going to depend at least in part on what format(s) your images are saved in. If you have raw image files or bitmaps, it may be possible, but if your data is compressed in any manner, such as JPEG or PNG, it's going to be a lot more difficult to read just a subsection.
If you truly don't want to ever load the full data into memory, you'll have to write your own IO routine that reads the file. For anything more complex than BMP, your decompression algorithm could get complicated.
If it's a BMP file, it shouldn't be that hard.
First you read the header from the file, if I recall correctly it's 44 bytes, but you can find that out from searching the web for a specification.
The header contains information like how many bytes there are per pixel, total width and height, how many bytes per scan line. Normally the bitmap is stored upside down, so you would calculate where in the file the first pixel of the bottom line was and skip to that location. Then you read the pixels you want from that line and skip to the correct pixel on the next line.
The FileStream class has what you need; a Read method for reading and a Seek method to skip to a given position.
Couldn't you cut the image up into sections beforehand?
Splitting it into many 256x256 pixel images means you'd only have to load a couple of them and stitch them back together on the viewable canvas. To name one implementation - google maps uses this technique.
This is something I have done with bitmaps...
public BitmapCropBitmap(BitMap fullBitmap, Rectangle rectangle)
{
return proBitmap.clone(fullBitmap, rectangle, fullBitmap.PixelFormat);
}