0

I'm trying to figure out how i can detect parts of an image based on color and/or shape.

Ideally what i want to achieve is that:

  • given a lot of pictures which are similar in some way
  • they always contain several identical but a non-trivial shape (e.g. variations of finger nails, not just simple squares or circles)
  • figure out these interesting areas somehow, so i can detect the color of these areas

Example:

Assume that i have a lot of these images of fingers, i would like to detect which color the nails have. This is a nice example of how finger nails are "quite the same shape" and are "quite similar in color". In the end i should be able to figure out these interesting areas such that i only get the blue nails (== shape) in a picture and nothing else.

Example

What would be the best way to do this?

I thought of the following things which might help me, however i'm unsure on how to do this properly.

  • edge detection
  • detect colors in a given image using color quantization
  • cut out some nail shapes and match them to the picture (but too intensive and too many variations to collect?!)

imagemagick is a tool i can use which supports everything i need for this (i think) Preferrably i would like to do this using node.js

Captain Obvious
  • 745
  • 3
  • 17
  • 39
  • 1
    I would start with: **HSV + SIFT/SURF + feature point cloud matching(cluster analysis)** If you still want to go for polygons instead then **HSV + segmentation + polygonize + shape comparison/matching** – Spektre Nov 13 '15 at 15:22
  • Thanks for the information, but can you please give me some more details on whether i can do this via node.js/imagemagick, and what exactly do i have to give as input to these algorithms? Examples are welcome :) – Captain Obvious Nov 13 '15 at 17:52
  • 1
    apart the **HSV** part is each topic very broad (you can fill entire books with each). first you need to specify your task more closer (one image with vague suggestion is hardly a solution constraint) usually you have some database of knonw object images in one side and tested input image on the other side. You compute set of feature points (SIFT or SURF or any other) and then compare if your found features does match to any of your known images. if yes pick the closest match and you know what is in your image and where. That is in a nutshell but the knowledge and programming behind is huge. – Spektre Nov 13 '15 at 19:06
  • 1
    What lib/tool to use is up to you I go for mine own **C++ DIP/CV** tools as I have them at my disposal and I am familiar with them. But most people use **C++ & OpenCV** or **Matlab** for this kind of tasks. If you are not familiar with DIP and CV you should start learning if you really want to go through this. do not expect that you will find some magical lib you just call for this because most CV tasks are not reliable for arbitrary input. All must be carefully fitted to the input you have. – Spektre Nov 13 '15 at 19:11
  • Thanks, i've tried segmentation and it might work :) The part i didn't really understand is how i can build a database of known object images? Let's say i have pictures of different poses like the one above, what should i do with it them? – Captain Obvious Nov 14 '15 at 15:57
  • 1
    That depends on what you want to achieve. If you do not have the database and want to create one on the fly then you need to apply **machine learning** and some user assistance telling what is what (exactly like you learn a child by answering all the annoying questions like `what is that?` ....) Without user input you can fake this by enumerating each new object by some number or string ID instead of its name (its own language instead of english ...). beware machine learning is also tough if not tougher then CV. – Spektre Nov 15 '15 at 09:19
  • 1
    As you can see this is very broad topic ... so read about this some bit ... decide which way you want to go and then post specific question to specific part of the puzzle if you got stuck ... – Spektre Nov 15 '15 at 09:22
  • 1
    I recommend you to find some book on CV ... or google here first hit on some [CV summary](https://www.google.sk/url?sa=t&rct=j&q=&esrc=s&source=web&cd=7&cad=rja&uact=8&sqi=2&ved=0CEQQFjAGahUKEwi105bcjpLJAhWJtBoKHfaXDDo&url=https%3A%2F%2Fcourses.cs.washington.edu%2Fcourses%2Fcse455%2F09wi%2FLects%2Flect1.pdf&usg=AFQjCNH1eQvHk6LRHvw4uBiY_zr2H_Bofg&bvm=bv.107467506,d.d2s) with links so you know what is doable and what not – Spektre Nov 15 '15 at 09:34
  • Thank you spektre, i will do that for sure. As a computer science student i know these arent trivial questions so i will look into it further. You've been a great help already. – Captain Obvious Nov 15 '15 at 10:15

0 Answers0