How to make graphic overlay elements responsiveness in live preview Camera? - java

Currently I'm developing a project that implements Object detection / tracking but now I need to add a new functionality that when user want to chose an element that is detected using Live Camera Preview may be possible to select it touching the reticle element in the center of their bounding box.
This is how it currently looks my app.
Nowadays I am able to draw a customized bounding box and a customized reticle that fit in the center of the bounding box, Im also able to show many bounding box as needed with mutliple object detection. So far that's what I can do. I see that on presentation on 2019 of the ML Kit a video they use another method using live preview camera, their pipeline consist on hold camera a couple of seconds to make a search. I want to do a similar thing but instead of hold camera an wait a couple of seconds, I want to give the chance to the app user to chose the element.
I use
ML Kit Vision Quickstart Sample App and ML Kit Showcase App with Material Design as base of my project, I was able to implement succesfully different stuff of both projects.
I currently use kotlin but I can also work with Java code, so no problem. Also, if anyone thinks it's necessary, I can add code.

If you're also using a single custom view to draw all these bounding boxes and reticles like MLKit Samples do (e.g. GraphicOverlay in the MLKit Showcase App), then you can override its #onToucheEvent method to simulate a click event on reticle element (touching point is inside the reticle area) and do whatever what you want after it's triggered.

Related

How to recognize the box using ARCore?

I want to recognize a certain box (like tissue box) using ARCore, ViroCore (or OpenGL) and OpenCV, and display the width, depth, and height of the box.
Use OpenCV to detect the edge through the sobel filter.
Use OpenCV to recognize the edge detected box and acquire coordinates.
Use ARCore to calculate width, depth, height from acquired coordinates.
Use ARCore and ViroCore (or OpenGL) to display the calculated length.
I can not imagine how to implement No. 2.
Is it possible to recognize the box automatically?
If it is possible, how should it be implemented?
[Development environment]
Android Studio 3.0.1(Not Unity!)
Kotlin(or Java)
Samsung Galaxy S8+
I have a feeling that you didn't do any research. ARCore is not a image recognition tool. So it has nothing to do with your problem. You need to use an image/object recognition tool like OpenCV.
About your questions. Yes, it is possible. How to do it? I suggest to read examples, OpenCV has a big library of ready examples like car shape recognition. To recognize a box you can use an edge tracking algorithm
It's not abundantly clear what your intent is, so let me know if this is not what you're looking for. It seems like this tutorial on putting bounding boxes around contours would contain an example of how to fetch the coordinates of the edges.

Need assistance on HTML5 japplet or canvas

So basically I am building a GUI type interface for my website that needs to have multiple requirements.
Image to interact with i.e draw straight lines on it, curved lines, circles etc (different color lines too)
The image will need to have the option to "save" the current state and access it later
The image will have different objects on it that will have different "states" i.e active or not active etc.
What is the best way to accomplish this? I have looked into GUI builder and Canvas for HTML5 but have not found a solid guide to satisfy my needs. Any further assistance will be much appreciated!
You should be able to do that with the 2dContext provided by the canvas. This url gives you a list of all the methods
https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D
That gives you options to draw circles, rectangles etc and you can set up click events and hit tests on those objects.
You can also save the canvas output to an image or an array.

Java Screen Capture OpenGL and DirectX fullscreen Applications

I am trying to design a program in java to periodically (every 100 milliseconds or so) take screenshots of my display and compute the average pixel rgb values of the entire screen. I need this to be able to work with video games and iTunes/Quicktime videos. However I have tried using JNA and robot to capture the screen and it only works when I am not capturing a video game in full screen or an iTunes video. For instance I tested my code by saving an image to examine and see what is happening. When I am in a video game I only see a screenshot of a blank window. I think this is because games use directx or openGL and communicate with the hardware differently than your typical app.
If I use this this method for capturing a screenshot instead of robot or JNA will this solve my problem? It looks like it is copying over data from the openGL screen buffer. What about DirectX applications?
I basically just want to be able to get the perceived pixel data on the screen at all times. Regardless of whether or not its a fullscreen DirectX or OpenGL application or not. Thanks in advance for your help.
I'm going to guess this is for a homebrew version of the amBX lighting system. Even if it's not, the following page may help you; it contains both the java code and arduino code for a DIY ambient lighting setup, which needs to accomplish the same thing:
http://siliconrepublic.blogspot.com/2011/02/arduino-based-pc-ambient-lighting.html
Things to consider:
1. For processing speed reasons, that sample of code purposely ignores some of the pixels on the screen
2. Depending on what you're displaying (racing games vs. first-person shooters vs. top-down-view strategy or MOBA games vs. movies) you may want to purposely segment the display into separate sectors. For example, for a racing game you may want both the left and right sides to be more independent and very responsive to rapid changes, whereas for general film viewing you may want a more general output because you're dealing with a wider variety of ways the camera can move.

How to make a drag and drop LineChart using JavaFX?

I need to create a line graph to allow me to drag it in different coordinate axes, when dragged backward the graph should show data that have already been painted.
"Currently I have some graphs showing real-time data, I receive this data via sockets, then I want to be able to pause the graph and dragging back to see the data that have already been shown."
I'm not experienced with Javafx, so I apologise if this misses the mark.
I have made something similar in the past using my own component and a JScrollPane. You can make a "scrolling savvy" client, allowing you to render the history as the user drags the graph backwards. If you make your client Scrollable, you have full control on how it responds. While this isn't javafx specific, there is a javafx panel, so I can't see a reason this wouldn't work, assuming comparability with light weight swing components.
Oracle introduce it here: http://docs.oracle.com/javase/tutorial/uiswing/components/scrollpane.html#scrollable

OpenGL Zoom in / Zoom out with Mouse/Keyboard

I am currently working on a project with both using awt and Java OpenGL. (separately)
Firstly, here is the related topic
Adding Text to Screen with OpenGL
I perfectly added zoom ability with using awt. I want to add zoom in/ zoom out ability(mouse position zoom or key, doesnt matter) to this program in OpenGL(JOGL) too. Currently, I can perfectly show degrees, add images and texts to anywhere I want, however couldn't figure out how to add zoom. I have gone through lots of web sites but couldn't even find useful-basic source code to study. Could you lead me to the right direction or at least share some sample code for the basics?
I use java.
Personally I always liked the NeHe tutorials, many different examples are available with source code in many programming languages. The tutorial is in C but the code can be downloaded in other languages and method names are very similar usually.
http://nehe.gamedev.net/
Regarding your zooming, try to translate your model coordinates into(closer to) the screen taking into account the point your zooming to (or from) (can be cursor location or just the center of the model). Another way might be to adjust the viewport but I recommend translating the model.

Categories

Resources