Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Let's say I have a very simple image with a few colours (white, black, grey). And I have a set of tiny images (lots of them). Is there any library that can help me rebuild the big image using all of the tiny images as building blocks? Like a mosaic.
Here's an example: http://d.pr/i/LJ0Z
P.S. I've tried to google a solution, but it seems I can't create correct search query because of my bad english. I only get software solutions for creating mosaics.
Just posting a solution to my problem here in case anyone will need in the future.
Let's say you have a simple image with a few colours. You need to re-create it with a set of smaller images (like a mosaic).
Split your image into cells (4x4, 8x8 or any other number) and assign corresponding colour for each cells (in other words "pixelate" your image), create array of cells for each color you have.
Implement listing #4 for Maximal Rectangle Problem from this article: http://www.drdobbs.com/database/the-maximal-rectangle-problem/184410529 (huge thanks to David Vandevoorde for such a great explanation!)
Now, for each small image you have (pieces of mosaic), determine its size as a rectangle. Then, using rectangle packing algorithm of your choice fill the max rectangles with these small images (I've been using this one for C#: http://kossovsky.net/index.php/2009/07/cshar-rectangle-packing/ again, huge thanks to the author for sharing!)
That's it. It's not very fast, but it gets the job done.
this search turns up various results:
andreamosaic
pixisnap
etc.
adding "python library" found osaic. repeat for whatever language you are using...
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I have recently taken up film photography. Part of the workflow is to scan the images using a flatbed scanner. Unfortunately this process is very slow. Using some software (Silverfast) you make a prescan, zoom in make a more detailed pre scan, click ad drag around a rectangle which highlights the frame, do this for 12 frames, then set the software to do the full res scans.
I want to automate this process. Rather than layout where each frame is, I want to scan the whole film strip, and then use ML.Net to find each frame (X,Y coordinates of the top left corner) which I will then pass to ImageMagick to extract the actual image.
I want to use ML.Net because I am a .Net developer and may have the opportunity to use this experience later. So although example using OpenCV would be welcome, ML.Net would be preferable.
I am a bit of noob when it comes to ML stuff. My first thought is to try train a neural net, inputting the scan image and outputting the X and Y values. However that seems naive (as the image is 100s of MB in size). I imagine the there are better tool then just a raw neural net.
My searching on 'ML object recognition' didn't seem to help as the examples I found were about finding the Dog or Person in an image not a 'frame'; which could be a dog or a person.
Even a pointer in the right direction, of the correct name for this problem would be a great help.
So, what are the type of tool/functions I should I be using to try and solve this type of problem using ML.net?
This is not so much a machine learning problem as it is an image processing problem. I would think ML.Net is quite overkill.
What you probably want is an image processing library and utilize some form of edge detection or "region of interest" detection.
For example, look at this question:
Detect display corners with Emgu
Maybe I misunderstand what you want to do and you actually would benefit from machine learning; then you probably should pre process your images with an image processing library before feeding them to your model.
Hope it helps.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
OK. Let's say that I have 2 images. The first is a set of lines that form a grid with a circle. The second is the same grid and circle DISTORTED. The second image is the distorted result of the first image when it is stretched over a 3D solid.
What I want to do is morph the circle in the second distorted image to where it would be in the first image before distortion. Stated differently, I want to predict what shape the circle needs to be before distortion so that when it is distorted it ends up looking like the perfect circle in the first image.
The grid is only there as an aid, I am really interested in the circle. The circle is just an idealized image. In real life the "circle" represents a graphic of some kind. The two images would be actual scans from the sheet before and after distortion. The distortion is also just idealized. In real life it is more complicated than this.
I am open to commercial software or using Matlab or other software to write something. I just have no idea where to start on this one. All ideas are appreciated.
BTW...here is a post that is somewhat similar in nature.
Original - Undistorted image:
After distortion:
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I have recently came across a great image processing algorithm called Seam Carving.
It uses graphs (Shortest Path algorithm) to do its job.
What other amazing algorithms are out there worth looking at?
I'm not talking about the majority of boring matrix based ones, rather something you could never think about before you came across it, just like this one.
Even though this is offtopic I'm going to answer ;)
In this page you can find algorithms which:
Depixelize an image
Color a black and white image
Restore a picture or make a HDR (whatever that means...)
Turn a photo into an hand-drawn like image
Seam carving
Remove objects
Compose a picture
Beautify a face
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Is there any library for converting a raster image to a vector one limiting the number of sampled colours to a specific set? Something like what is done in VectorMagic but giving a subset of colours to be used.
Imagetracer is a free and open source (Public Domain) library and application which might be useful. Disclaimer: I made these.
If you need a command line application, I recommend ImageTracer.jar from
https://github.com/jankovicsandras/imagetracerjava
with options like these
java -jar ImageTracer.jar input.png outfilename output.svg numberofcolors 4
to limit the number of colors to 4. If you call the library from a Java program, you can use custom palette, and there are many other options.
You can use the JavaScript version from the browser or with Node.js:
https://github.com/jankovicsandras/imagetracerjs
There is the opensource library/program potrace which performs a fine vectorization. The thing is it first converts the input image into a luminensce one, and then binarize it. This step is optional, made by a separate program, so you can use potrace but in a different manner, by constructing yourself several versions of binarized images. I think VectorMagic builds its contours based on the gradient/laplacian of the input image, that's why you cannot impose any set of colours.
If you have a subset of colours to be used as input, I advise you to folow the following algorithm:
for each colour of the input subset of colours, find the subspace of the colour space which is "nearest" from the selected colour than from any other colour. Something like an algorithm computing the Voronoi partition of the input subset would do the job quite well at once; use for example qhull for that.
for each subspace, binarize the input image, drawing every pixel white if inside the subspace and black otherwise. Then apply potrace's or VectorMagic's vectorization on it.
At the end, you will get a set of contours. Maybe the contours would not match exactly, but there would be sufficiently close to let you simplify them and delete properly doublons of contours.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I have a large tree. I want to be able to visualize it using a GUI tool. I want the ability to pan and zoom the tree image so that i can focus on part of the tree.
Is there an existing tool to achieve this?
If not i would like to write a small tool for myself to be able to do this. what is the simplest way of doing this? what computer language should i use?
the image should look something like
http://upload.wikimedia.org/wikipedia/commons/d/df/Binary_tree.png
I should be able to zoom and pan the image.
One idea is to use the NetworkX library for Python, coupled with its matplotlib visualization. NetworkX can render trees to matplotlib plots and matplotlib allows you to zoom and pan.
Depending on the actual sizes of your trees this may or may not be a complete solution. What's sure is that you can whip it up in a few minutes for rapid prototyping.