15
$\begingroup$

I recently find this puzzle where you have to find the panda from a group of snowmen. Having a horrible eyesight I have to take help of mathematica to find it.

I start with assumption that all snowmen have orange nose (carrots), so find them out and eliminate them.

img = Import[
    "http://i1.tribune.com.pk/wp-content/uploads/2015/12/947083_718818741553374_3000781901216554446_n.jpg"];
img = ImageResize[img, 500];

pts = ImageValuePositions[img, Orange, .2];
img1 = Show[img, Epilog -> {Gray, Disk[#, 12] & /@ pts}]

Grid[{Show[#, ImageSize -> {400, 400}] & /@ {img, img1}}]

enter image description here

It is now a bit easier to spot the panda. But the method will fail if the panda has any orange patch in its face.

Is it possible to define facial pattern (in this case black eyes with long orange nose, that is number of orange pixel higher than a threshold) along with the colour to spot the snowmen?

A closely related post

As pointed out by march, this post (How do I find Waldo with Mathematica?) is close to what I am trying to do. The difference is Here I know the pattern to eliminate (the carrot nose) and all the noses does not follow the same structure. So I don't think a single ImageCorrelate can find all the noses.

Find the cat

I found another puzzle by the same author where you have to find the cat from a group of owls.

Again, I pick the (yellow) beak, and it make the job much easier.

img = Import["http://laughingsquid.com/wp-content/uploads/2015/12/Find-the-Cat.png?w=750"];
img = ImageResize[img, 500];
pts = ImageValuePositions[img, Yellow, .2];
img1 = Show[img, Epilog -> {Brown, Disk[#, 30] & /@ pts}];

Grid[{Show[#, ImageSize -> 400] & /@ {img, img1}}]

enter image description here

It works well for this image, but sometimes it fails for other images (by other images I mean same image from different sources suggested by google search) where the colours are not very prominent. One owl actually survived here also (top right corner). So I am still looking for a way to combine a small range of colour with a pattern to spot the 'not'.

$\endgroup$
  • $\begingroup$ Have you seen this? $\endgroup$ – march Mar 19 '16 at 14:39
  • $\begingroup$ Thanks @march for pointing that. But you will still have the same problem. You see there are several structures of noses, so a single ImageCorrelate would not be able to capture them all. $\endgroup$ – Sumit Mar 19 '16 at 15:20
  • 7
    $\begingroup$ Ummm, I have a question (raises hand). If the panda is spotted, doesn't that mean it's, like, maybe a leopard? $\endgroup$ – Daniel Lichtblau Mar 19 '16 at 20:31
  • $\begingroup$ hmmm @DanielLichtblau, in that case we have to ImageIdentify to make sure it is a panda, not a leopard (or a bear in disguise) ;) $\endgroup$ – Sumit Mar 19 '16 at 20:45
  • 6
    $\begingroup$ I think Danny's question is along the lines of "How could the tiger escape the zoo without being spotted? $\endgroup$ – Craig Carter Mar 22 '16 at 21:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.