4

Hi I have a color palette like this one, enter image description here

I have an image. the image contains a color palette like this. I need to detect this color palett from the image and crop the color palette from the image. Are their any libraries in java to do that. That is given a reference image are their any library that can use this as template and extract the image from the picture?

Here is an example, if the image is enter image description here

and my reference image is like the first image, I want to detect the first image within the second image and crop that portion to get the similar image image to the reference image. After cropping the second image I will get enter image description here

P basak
  • 4,874
  • 11
  • 40
  • 63
  • Can you give an example input image, and the expected cropped output? – Mark Byers Jul 06 '12 at 19:39
  • are you talkning about subimaging problem? If so, maybe [this](http://werner.yellowcouch.org/Papers/subimg/index.html) theory can be helpful – Pavel K. Jul 06 '12 at 19:43
  • @PavelK.Are there any java implementation of above example. – P basak Jul 06 '12 at 19:47
  • well, I don't know a direct implementation. Actually it depends on your goals. But if you need an implementation of FFT, you could take a look at [this](https://sites.google.com/site/piotrwendykier/software/jtransforms) one. – Pavel K. Jul 06 '12 at 19:52
  • Hi I do not know much about image processing. What should I do with the FFT? – P basak Jul 06 '12 at 20:04
  • 2
    Hi what about template matching using javacv?http://code.google.com/p/javacv/ – Abid Rahman K Jul 07 '12 at 09:11

2 Answers2

0

What you need is called "Template Matching". It is an image processing algorithm. Details here : http://en.wikipedia.org/wiki/Template_matching.

I am no expert in Java so am not aware of any implementation. It is a pretty simple algorithm. If this is what you are looking for you can code it your self.

mkuse
  • 2,250
  • 4
  • 32
  • 61
0

If we have a reference image already, then the below link solves your problem. https://stackoverflow.com/a/17516753/2421703 Here, all you need to do is instead of coloring the border, create a new image file with that content

Community
  • 1
  • 1
Harshal Voonna
  • 349
  • 2
  • 12