Get Image dimension on click in Android using open cv and java? - java

I am new in android development and I have to make a module for android app which automatically detects the exact dimensions of an object being photographed by the user's camera.
I have stumbled upon many examples and the best one is:
http://www.pyimagesearch.com/2016/03/28/measuring-size-of-objects-in-an-image-with-opencv/
I have read this complete post. But I think there must be also a way to get the object's size without a reference object.
could someone suggest any way to achieve this. Or some API which might be providing this capability.

Used the pyimagesearch's way of calculating dimensions of the package. Right now this approach works fine for us. But the reference object concept is a bit non-satisfactory. But for now it's the only way I could think of.
please refer to this URL for the python solution to the problem.

Related

How to get a user's location in Android

I have been trying to get user location in a weather app I am building. Since I'm pretty new to android development this is quite tough and so I have tried finding sources on how to make this, though after trying many different things it always ends up being a way too outdated version that no longer works.
So my question is what is currently the best way the get a user's location.
Thanks in advance for anyone that can help me with this!
It's enough to start reading from official doc: https://developer.android.com/training/location
or from here ready solution https://www.geeksforgeeks.org/how-to-get-current-location-in-android/

Object Detection?

I need to detect objects from an image taken by the camera in Android, however, I cannot seem to figure out how to do so. Many of the tutorials I found online are about Face detection or use machine learning to detect objects of a certain shape, however, I need a method for general objects. Is it necessary to use OpenCV, and/or would ARCore be useful in this scenario? Or is there another API that could be used with Android for this?
You can implement with OpenCV much easier than other image processing libraries. There is no general method for all objects. However, you can start digging from the image segmentation to create your own custom image transformation algorithms.
https://opencv-java-tutorials.readthedocs.io/en/latest/07-image-segmentation.html
There are trained models for object detection. You can use one of them. I suggest exploring this. https://github.com/tensorflow/models/tree/master/research/object_detection
Best regards.

How to check if images in an android app are current?

I am in the middle of writing an android app while teaching myself java all at the same time and my project is a bit cumbersome for a first time app. NOTE:
I am not a newbie to programming, I know several languages with the exception of java and writing code for mobile devices. With this all said and done, I don't want to have to force my users to have to update the app every time there is a new image.
Is there a way, I am assuming there is, to check on startup if all the images are up to date and if not download the new ones to the drawable resource folder for use in the app?
I have searched and found ways to remotely fetch items but nothing specifically for updating app images. For example: Splash Screen Image, or background image etc.
Thanks for your time and apologize if this does not conform to stackoverflow form of asking a question.
Shawn Mulligan
Based on my knowledges, there is no way to do why you're asking for. Resources are static contents and there no way to modify or update them programatically.
To achieve a kind of feature that you describe, it should be through a distant server, eventually with a local cache of your images on disc, associate to a download date.
But you won't be able to use them in the exact same way that you can use drawable resources.
Also depends of what you really mean by "if images are up to date".

is there any inbuilt function for image recognition

i want to use a function for image recognition
i dont want to make an algorithm.
please suggest me a function where i could compare two images and tell whether these images belong to the same object.
please help me!.
Arbitrary image recognition is something that computers can't yet do (even for supercomputers). However, Google Goggles comes close, being able to recognize a wide range of objects. Read its limitations, and see if it suits your purpose.
Yes. There are definitely ways to do this but they all depend on what you are trying to do. If you are more specific about what you want to compare then it will be easier to give a more thorough answer.
There are some excellent libraries out there but it will require some effort on your part to learn and understand how to use them and how to use them on the iPhone.
The most famous algorithms so assist in finding images inside other images are called SIFT and SURF. Unfortunately both are patented and cannot be used commercially in an application.
Consider using OpenCV for most of your image operations.
Or you could use OpenFrameworks (google has tagged it as a phishing site for some reason, im sure theyll fix that soon)
You might also consider VXL which has started to become more popular.
Good luck!

Matching two images

How can we match two images using Java. I want to make a face recognition application, that will store face of people at some location and then later will check whether a person is a member or not. If the persons face will match a pic already in database, then the person will be authenticated else not. Is there a way to do so.
check this thread for java related face recognition software. You will need to use the Java Advanced Imaging library, which is a pain, but it's doable.
There is a way to do so. It is a well studied research problem. It is called face recognition in a gallery-probe setup. You should perhaps read this article.

Categories

Resources