I have an input as a 3D binary image and the preferred output below:
Input:
Preferred Output:
What image processing methods should I look for if I am to have only the spiky object(s) remain, just like the preferred output above?
Well, first of all i'd try to remove zall those white line and get only the pattern.
You image seem way to erratic for me to work with.
If your pattern is quite regular (as it seems here), you can search for a template and use a correlation to extract interesting parts of the image.
After this, only the 4 big patterns should be left. I would perform some calculations (mainly shape based), some examples here :
http://opencv.willowgarage.com/documentation/cpp/imgproc_structural_analysis_and_shape_descriptors.html)
I'm sure there are some simple descriptors for this. I think of energy, perimeter, these kind of things.
Related
I am trying to composite the following images to produce an image that would demonstrate how the following swimwear would look in the attached patter material such that realism is key. While a strong java programmer with a CS background, and i have experience in other languages, like python, I have no idea where to start, I looked at JavaCV but it is just so complex and has so many functions i would not know which are relevant here.
Any guidance, or examples here would be greatly appreciated.
Anyway, i'm afraid there's no straightforward solution you can use since this can be a quite large project:
Extract the normal map of the swimsuit. This is needed to stick the pattern to the swimsuit, for example, the pattern should look bulged in the bra compared to other flatter areas.
You need to do texture synthesis (http://en.wikipedia.org/wiki/Texture_synthesis) since you need to resize the pattern to be larger.
Apply the synthesized pattern
For the realism, you also need to extract the shadow from the white swimsuit (if the swimsuits are white this will be easier). After applying the pattern, put back the shadow to the composite image.
You can refer to these papers:
http://maverick.inria.fr/Publications/2009/WOBT09/TextureDraping_EGSR_2009.pdf
and
http://graphics.cs.cmu.edu/projects/nrt/
I am looking for a library that would help scrape the information from the image below.
I need the current value so it would have to recognise the values on the left and then estimate the value of the bottom line.
Any ideas if there is a library out there that could do something like this? Language isn't really important but I guess Python would be preferable.
Thanks
I don't know of any "out of the box" solution for this and I doubt one exists. If all you have is the image, then you'll need to do some image processing. A simple binarization method (like Otsu binarization) would make it easier to process:
The binarization makes it easier because now the pixels are either "on" or "off."
The locations for the lines can be found by searching for some number of pixels that are all on horizontally (5 on in a row while iterating on the x axis?).
Then a possible solution would be to pass the image to an OCR engine to get the numbers (tesseractOCR is an open source OCR engine hosted at Google (C++): tesseractOCR). You'd still have to find out where the numbers are in the image by iterating through it.
Then, you'd have to find where the lines are relative to the keys on the left and do a little math and you can get your answer.
OpenCV is a beefy computer vision library that has things like the binarization. It is also a C++ library.
Hope that helps.
I made patterns: images with the "A" letter of different sizes (from 12 to 72: 12, 14, .., 72)
And I tested the method of pattern matching and it gave a good results.
One way to select text regions from image is to run that algorithm for all small and big letters and digits of different sizes. And fonts!
I don't like it. Instead of it I want to make something like a universal pattern or
better to say: scanning image with different window sizes and select those regions where some function (probability of that there is a character at that window) is more than some fixed value.
Do you know any methods or ideas to make that function?
It must work with original image (grayscale).
I suppose you are developing OCR, right?
You decided to go quite unusual way since everyone else do matching on bi-tonal images. This makes everything much simplier. Once you degradated it properly (which is very difficult task by itself), you do not have to deal with different brightness levels, take care about uneven background, etc. And sure, less computation resources needed. However, is doing everything in grayscale is actually your goal and you want to show other OCR scientists that it is actually doable - well, I wish you good luck then.
Approach of letters location you described is very-very-very computation intesive. You have to scan whole image (image_size^2), then match with pattern ( * pattern_size^2) and then do it for each pattens ( * pattern_num ). This will be incredibly slow.
Instead try to simplify your algorithm to break it to two stages. First should look for some features on picture (like connected dark regions, or split image on large squares and throw away all light ones) and only then perform pattern matching on small number of found areas. This is all at least N^2, and you could try to reduce complexity to working on rows or columns of image first (by creating histogram). So there is a lot of different simplification methods you can try to play with.
After you have located those objects on picture and going to match patterns on them, you actually know their size, so you don't have to store letter A in all sizes, you can just rescale original image of object to the size say 72, and match it.
As to fonts - you don't really have much choice here, you will need to match against all possible shapes of A to make sure you found A. But once you match against just one size of A - you have more computing power to try different A's.
I am new into Image Processing, and I have started simple project for recognizing text on images with complex background. I want to use stroke filter as first step, but I cannot find enough data about stroke filters to implement this.
I have only managed to find pure definition of Stroke Filters. So does anyone know something about Stroke filters that can be helpfull to me for my implementation.
I found one interesting article here, but it doesnt explain Stroke Filters in depth
http://www.google.com/url?sa=t&source=web&ct=res&cd=4&ved=0CBoQFjAD&url=http%3A%2F%2Fwww-video.eecs.berkeley.edu%2FProceedings%2FICIP2006%2Fpdfs%2F0001473.pdf&ei=qtxaS5ubEtHB4gbFj8HqBA&usg=AFQjCNEnXQCMAFnqPRHe2kNZ6JEidR1sQg&sig2=wpaIDIQmNn739aF0cYWbsg
"Stroke Filters" are not a standard idea in image-processing. Instead, this is a term created for the paper that you linked to, where they define what they mean by a stroke filter (sect. 2) and how you can implement one computationally (sect. 4).
Because of this, you are unlikely to find an implementation in a standard toolkit; though you might want to look around for someone who's posted an implementation, or contact the authors.
Basically, though, they are saying that you can identify text in an image based on typical properties of text, in particular, that text has many stroke-like structures with a specific spatial distribution.
I was wondering how would you print an image that's scaled three times its original size without making it look like crap? If you change the dpi to 300 and print it'll look like crap. Is there a way to convert it gracefully?
You may have the problem of trying to add detail that isn't there. Hopefully you're aware of this.
The best way to enlarge an image that I know of is to use bicubic interpolation. If it's any help, Photoshop recommends using 'bicubic smoother' for enlargement.
Also, be careful with DPI vs PPI.
This is called supersampling or interpolation. There's no 'perfect' algorithm, since that would imply generating new information where there was none ('between' the pixels); but some methods are better than others in fooling the eye/brain to fill the voids, or at least not making big square boxes.
Start with the wikipedia articles on Nearest-Neighbor, Bilinear and Bicubic interpolations (the three offered by PhotoShop). A few more Tricubic interpolation, Lanczos resampling could be of interest, also check the theory, and comparison links.
In short, this isn't a cut-and-clear issue; but an active investigation field, full of subjectivity and practical trade-offs.
You should vectorize your image, scale it, and if you wish you may convert it back to the original format (jpg, gif, png...). However this works best for simple images.
Do you know how to vectorize? There are some sites that do it online, just do some Google research and you'll find some.
Changing the DPI won't matter if you don't have enough pixels in your image for the size you are printing. In the biz it's called GIGO (Garbage In, Garbage Out).
If your image is in HTML then create a media="print" stylesheet and feed a high-res image that way.