taking information from camera - java

My function must take picture from camera at the current time I will call him , and keeps it in my buffer , non anywhere else . I don't need to open camera , to push it's "capture" button , I need to do all this automatically. user must not see , that camera is working , and after taking the image , it must copy it only in my buffer . Don't suggest to use camera.start() and after copying video or picture , delete it from Gallery please. Can anybody helps me? and Sorry for English :)

This is the solution to your problem. Just edit it a little. You can store the bitmaps in an ArrayList for example.
But you know that this is bad for performance as it'll flood the memory? Writing it to the sd is probably a better idea than using the internal memory.
Edit: When using the API, you have to show a preview. You can, however, make this preview 1x1px or hide it behind some other view. And you can modify the code a little bit to not have the capture start on a buttonclick, but on whatever you want. I take it you can do that.
This can also help a lot

As far as i know, You will not be able to capture the image opening the camera application without the knowledge of the user.

Related

Android Capture touches coordinates in whole device

I want to capture the pointer locations in whole android device by providing a service to develop something like Pointer Location in Developer options .
First I have tried addingoverlay view which is always on top to capture the coordinates . but this method didn't let me to get touch events in move actions .
So I decided to try another way . At last I found that for rooted devices , we can get touch events but I don't know how . Could you please give some suggestions ?
thanks in advance
I have been looking for this answer as well. Can you specify how you did the overlay view and captured the coordinates?
I was able to do the overlay as well, with some other answers from here on stackOverFlow, but if I capture the Overlay coordinates, it renders the background/OS useless. Its one or the other, not an actual service in the background running or an overlay recording coords. Its one, or the other.
I have read that this goes against the Android security framework, since it would be a really big flaw when exploited. Although, everything that I have read is from 2012 at the earliest. This is the newest post in 3 years. Any insight?

How to bring pictures to the front, and send pictures to the back - Java

I have a few pictures piled on top of each other.
I need a way for the user to be able to bring certain images to the front, to view, when they want, and send them back when they want. Is there a simple code for this? Any help would be appreciated.
I am using Java.awt.applet.
The closest and easiest thing I can think of is a JLayeredPane

Metaio, showing multiple content on camera view

I'm trying to add multiple views when detecting QR code. I need to show one button, one image and one text when QR code is recognized. I use metaio SDK-Template project and for now I'm only able to show one thing at a time.
Can someone please point me in right direction?
when you use metaio for detecting QR codes you're lossing the concept of augmented reality because you are scanning for a QR code and you wont be able to set a 3d model into your target or make visible and enable view components on the UI, if you have concerns about the objective about augmented reality foundamentals check the metaio documentation and examples at dev.metaio.com. Regards

Getting pixel position of a text in an image

I am working on a research project.The scenario is this.
I am taking the screenshot of my desktop and then I process it using an API to get the position of a certain text on my Desktop.e.g , say I have the browser open on my desktop and I am on stackoverflow.Now I want to search the position of the logo stackoverflow on the screenshot taken.Then I want to simulate a click on it.I am using Java platform.
Now I have 2 questions:
1)Is there any free API(OCR) which I can use to process the screenshot to fetch text position (or can be done by some trick) and gives good results.
Or Any way you can suggest that I can use (instead of taking screenshot and processing it) to get the position of any text on the screen.
2)How can I simulate the click on the screen using the code by a background program running(I mean I have done it in Swing and other language UIs but this time its different as Now I want to click on the screen.
If I understood you right you want to move your mouse and click on the screen. That not that hard you could use the robot class from Java!
For example:
Robot rob = new Robot();
rob.keyPress( KeyEvent.VK_ENTER );
or what ever, there are so much bottons and movements you could with it. A list of all methods you find here.
And your other question I can't answer. I think there is no API that is able to search a text and give you the position. But what I know is that the robot class is able to capture the screen and put it into a BufferedImage. With it you could compare two pictures.
Maybe you could get use of this but I don't know if it is what you search.

Using java Robot class

I want to write an address in the address bar of a browser as well as click on a link using java Robot class. How can I track the different objects in a certain window?
Just giving a look at the API http://docs.oracle.com/javase/7/docs/api/java/awt/Robot.html, anyone who do this should know that via Robot Class there is no "trackComponent(Component specificComponent)" method, you got 2 things that may help you:
1-getPixelColor (more than help, seems useless for you by now, maybe i'm wrong).
2-createScreenCapture.
the second method is maybe the answer for your problem, you could take a picture of the screen and with some image processor (javaCV could help you on this: https://code.google.com/p/javacv/) you could then track the components on the screen you took (for instance: from pixels xxx to pixels yyy is the Address bar of browser), of course you need to read some documentation about javaCV (OpenCV) for get this done, after that just use the method for move cursor and enter keys for fill the components, hope someone give a simpler way to do this, but i think this way you learn a bit of JavaCV a really powerful tool.

Categories

Resources