3

I am very new to android. I want to compare two images and ignore the light effects in comparison.

To do that i came to know that i can generate the edge image and then compare the images.

what should i do in that case? How to do that in android and if any any library is available how to use that?

I have searched a lot and came to know about Jmagick and Imagemagick but i don't know how to use them in my application.

I have to give a motion detecting feature to my application. A tablet will be connected to a wall and it will basically collect reviews from the user and ads will be displayed as a slide show. The front camera will take the picture every 10 seconds and the image that was previously taken and the current image will be compared to see if anything changed(i.e. at least someone is watching the ads or not). Based on the results if no motion is detected for 20 mins i want to turn my tablet screen off.

Please help me out.

Andrea
  • 11,801
  • 17
  • 65
  • 72
Sanober Malik
  • 2,765
  • 23
  • 30
  • This depends a lot on what images you are comparing. If you go the route of comparison by edge (which alone will easily generate bad results), you are also ignoring all the color information you have. So, what kind of images are you comparing ? Include representative examples and what kind of result you expect. – mmgp Feb 16 '13 at 04:24
  • @mmgp thank you for your reply! I have edited the post if you need any further information please ask me. – Sanober Malik Feb 16 '13 at 04:40
  • There are lots of questions around here based on the same requirement. Have you read any of them ? – mmgp Feb 16 '13 at 04:42
  • yes many but still not getting how to use them. I tried to use Jmagick but it gives me exceptions which i am unable to solve probably because i don't understand how to use them. – Sanober Malik Feb 16 '13 at 04:44
  • 2
    Then first you have to learn how to use it. But, it looks like you are after ready functions. In that case, OpenCV will be way more useful than Jmagick for this kind of task. – mmgp Feb 16 '13 at 04:46
  • openCV can that be used in android? I mean to say that i don't want to install anything other than my application apk file to my tablet. So openCV can be used in that case without installing anything extra? – Sanober Malik Feb 16 '13 at 04:50
  • ok i will search regarding that. If you have any start guide that please do Inform me thanks. – Sanober Malik Feb 16 '13 at 05:04
  • 1
    Yes opencv has a version for android and is the best tool for what you describe. – Rui Marques Feb 16 '13 at 12:18

1 Answers1

0

If you are going forward with OpenCV, your implementation should depend on how much motion is allowed. An approach using optical flow can tell you if the camera is moving at all. You could take the sum of the magnitude of the motion as a threshold. If you want the camera to be able to move a little bit without triggering motion detection, I would recommend a feature-based approach like SURF. You can use the number of matches to the original image as a threshold for movement. Either way, take a look at matcher_simple.cpp and simpleflow_demo.cpp for start guides.

Radford Parker
  • 731
  • 4
  • 14
  • Thank you Radford Parker for your reply. I am using openCV in android. But i need to install openCV manager in my android device. So is it necessary to install that? and if it is necessary then how can i make it install along with my application app file? i don't want it to be installed separately. – Sanober Malik Feb 21 '13 at 04:24
  • Oh i Got it its with static initialization as mentioned in OpenCV documentation. – Sanober Malik Feb 21 '13 at 05:42