Suppose that I detect a text of interest from a video feed (e.g., the temperature in a video of a thermostat). Is there a way to track this number if, for example, the camera tilts or pans and the number is in a different position in the frame?
MLKit is only able to track a few objects by default, so wondering what would I need to do to track the numbers in this case.
Related
I'm currently working on a UI based game where you have a "world map" containing a grid with zones (squares).
The zones are loaded through a json file coming from a database (MySQL) and are presented in a Grid Layout Group. Each zone has a zoneID in the database which is set in a local variable on the zone prefab.
When the player (you) are clicking on a zone, you will get a "Travel to"-button.
When the "Travel to" button is pressed, the idea is to "move" the player to that zone, coloring the image frame of the zone in yellow to highlight where you are. There is no actual player moving around, just UI and Text displaying the information.
My problem(s):
What would be a good and simple way to let the system know in which zone you are?
I'm thinking about a bool or something like (bool playerInZone), but how do I set it to true/false on other zones?
How do I reset the color when player leaves a zone and enters another? Currently I have no problem setting the color when pressing the button, but I can't seem to figure out how to reset the previous zone.
I can't seem to wrap my head around this...
I'm not sure if code is needed, I just need tips for how to think in this case.
Edit after understanding the question better:
I think I understand where your confusion comes from. You probably think that game-objects should manifest in the game view/physics in some way, where in fact many game-objects are just invisible units carrying game-logic related code.
I think a good solution would be to keep a manager game object that keeps track on the current location of the player. When you intercept a UI input that moves the player you'll do it through the manager, and the manager will be responsible to remove the highlighting from the current zone and apply it to the new zone.
It's probably a good idea to keep the "zones" as child objects of the said manager. Read about how to find game objects from parent game objects. I'm not sure which object intercepts the mouse click, but assuming that it's the zones themselves, than the manager can subscribe to events on the zones that will fire upon being clicked, or simply refactor to have a single object (perhaps the manager) handle the UI inputs.
Hope this is more helpful. Let me know if you need any clarification.
Previous comment
Use a collider trigger.
You can use the OnTriggerEnter and OnTriggerExit to set a bool whenever the player is in the zone. If you want coordination between different triggers and different zones you'll need a manager of some sort to handle this.
I'm creating a mobile web application (HTML5/JavaScript/CSS only) that allows a user to take a picture. The picture from the camera is then loaded into a canvas HTML element. The user may rotate their phone when taking a photo so ultimately I want to rotate the output appropriately. Is there a way in a web page only to determine which degree a user has rotated when taking a picture? I'm not simply talking about whether they are in landscape mode. I'm meaning if you hold your phone straight up in portrait mode face it down at your desk (its now parallel with your desk) and then rotate it to landscape. This will not trigger an orientation change, but you will now be holding your phone in a "landscape" position if that makes sense. This will be a common way users will be taking the photos. I want to be able to rotate the image appropriately when uploading it.
Thank you
Is there a way in a web page only to determine which degree a user has rotated when taking a picture?
Yes there is! When photos are taken, they contain metadata - information about the image. This is called EXIF data.
It tells you things like the make of camera, whether the flash went off, and - usefully for you - the orientation of the camera.
If you are using JavaScript to draw the image onto the canvas, I can recommend BlueImp's JavaScript Load Image Library
Once you have loaded the image, you'll be able to do a call like:
var orientation = data.exif.get('Orientation');
That will tell you which way the camera was held when the photo was taken. Depending on the phone, you may also get rotation data, GPS data, compass heading, etc.
I’m new to libgdx and I'm trying to create a simple dots and boxes game. I have sat up the board and drawline method using batch.draw()
batch.draw(lineH, Xpoints[2]+16, Ypoints[2], (screenW-16), lineH.getHeight());
of course that’s according to where the user clicks
"if that’s oh any help each dot has to lines coming out of it(one is horizontal and the other is vertical)"
now I want to find a way to store the drawn lines so the player clicks the same line it tells him that its an illegal move. also I want to use that later to calculate the scores. So how can I do that?!
I have created a composition in after effects with a video layer and 4 different shape layers. The shapes all move around tracking objects on the video. I want to be able to turn the visible property of these shapes on and off at will during playback.
I have converted their key frames to cue points, and then exported the flv. The shapes have key frames at the same time throughout the video resulting in multiple cue points at the exact same time.
In flash I am only able to listen to the cue point that is dispatched from the lowest layer of my after effects composition. So for example on frame 10, layer 1 and 3 both have a key frame changing the position of the shape. Using the script in after effects I've converted these to cue points. So I now have 2 cue points on frame 10. My program in flash will only hear the cue point dispatched by layer 1, and seemingly ignore the cue point from layer 3.
Is there anyway for me to listen to multiple cue points at the same time? Or am I going to have to go about this another way entirely?
I can't find any information that multiple simultaneous cue points isn't supported but trying to add two cue point at the same time code in Adobe Media Encoder gives an error – indicating that you should probably avoid it.
Another solution would be to collect all the transformations for a given keyframe and collect them in the parameter list for a single cue point. An example could be:
layerChangeCue
layer1 : "x:123;y:456;s:0.78"
⋮
layer4 : "x:123;y:456;s:0.78"
I have a Flixel project with multiple FlxCamera's. One of them is the main play area, and another is the radar display within the HUD to the right of the main area. I want to add a layer (FlxGroup) to just the radar camera, and I also want to exclude my other layers from the radar camera so they don't randomly show up in the radar's area.
My question is, how do I tell the cameras to only show objects in certain FlxGroup's?
Figured this out on my own. Each object needs to be given a reference to an Array containing references to the FlxCamera objects you want it shown on, and this needs to happen (usually) when the object is first made. The first time a FlxObject calls update(), if its cameras is null, it assigns FlxG.cameras as a default, which means all of the active cameras will display the object.
I did this by making a few static Array's in my Main class, one for each camera group, and then in the constructor for my various classes, I would set their cameras variable to point to the corresponding Array.
The biggest frustration: Currently FlxGroup does not pass its cameras on to its members. Hopefully this will be added into future versions of Flixel so that FlxGroup's can be assigned a camera group and have all their children also automatically assigned the same camera group.