EXIF lat/long from image in Unity - c#

I need a c# script for unity that can read the EXIF lat/long data from a photo. i would like to place a posTransform at that location. not sure if this is possible within Unity. i would like to load my images into unity and have a script read the EXIF: 1-GPS lat/long, 2-rotation, 3-timestamp from photographs. i haven't found any info that says this can be done within unity, however, i've read about exiflib github project and other ways outside of unity.
THANKS in advance for help

I maintain a project for extracting metadata from images that will give you what you need.
https://github.com/drewnoakes/metadata-extractor-dotnet
The library supports .NET 3.5 so should work under Unity, though I haven't tested it before.
With it, you would write:
var directories = ImageMetadataReader.ReadMetadata(filePath);
var gpsDirectory = directories.OfType<GpsDirectory>().FirstOrDefault();
if (gpsDirectory != null)
{
var location = gpsDirectory.GetGeoLocation();
Console.WriteLine($"Photo was taken at {location.Latitude},{location.Longitude}");
}

The answer from Drew Noakes doesn't work because it has dependencies on .NET that Unity doesn't support.
In my opinion, the best option right now, after a few days of research, is this project:
https://www.codeproject.com/Articles/5251929/CompactExifLib-Access-to-EXIF-Tags-in-JPEG-TIFF-an
This is a simple one-file project that you can drag in your unity project and that has no external dependencies. And it can read and update EXIF tags for JPG, PNG and TIFF files.

Related

Import a .step filein unity with C# code?

I would like to import a file ".step" to use it with unity 2018.3.1f1 but I don't know how to do it
I didn't found any topic.
Any one could help me please ?
.step is a cad file, right? This isn't supported by unity out of the box. You may need to buy an asset store plugin to open cad files, or roll your own importer. You would need to read up on the file format and build a new mesh based on interpretation of the file format.
Documentation on building a mesh from scratch: https://docs.unity3d.com/Manual/GeneratingMeshGeometryProcedurally.html

Generate skeleton from depthmap file

I have been working on a school project for the last few months, where I have been automatically generating skeleton files from depthmap files, taken by an XBox Kinect. I would like to compare my accuracy with other algorithms, but I am struggling to find algorithms that don't use a physical Kinect device, and instead just a depthmap file. Does anyone know of a software that does this? Links appreciated!
Not a skeleton, but a bounding box can be generated with this project. I'm still very much open to suggestions.

Information flow for Hololens data visualisation task

I'm currently trying to work with a Microsoft Hololens and I want to basically pull some data from a database, copy it into a form that I can use and then, using Unity, visualize it and have that go into the Hololens.
I have pretty limited coding experience and am looking to improve, but any resources and help you can give would be greatly appreciated!
So my basic understanding of how to go about this task is to:
Find the form of the data and put it into a .csv file
Draw data from the .csv file and use it to create a graph in Unity. I don't have a graphing asset to hand so if you can recommend one (free if possible!) let me know.
Using Unity's ability to display to the Hololens to show this as UI element
If this all works I also want to incorporate a system by which the image processing can be used to look at something and therefore generate this graph - I was thinking QR codes or something similar.
Do you guys have any advice, pitfalls and/or resources that could help me?
Thank you!
As said in the comments, the questions is very wide.
But, here you can get some points to start:
You can get the data (or the file) from a WebAPI or any REST service.
You can process as that dataset as you need in Unity.
You can search any graph asset in the Unity Asset Store and send the data to it and display in the hololens.
You can use the ZXing library to read the QR code generated to display the graph as well.
Hope this helps.

Import any 3d file at runtime in WPF

I asked a similair question earilier, but it was not generic enough, so here's another attempt.
I currently have a whole bunch of 3d .obj and .jpg files which I want to display in my WPF application. However, I want to do this at runtime, so converting them using Blend is not an option.
I don't mind having to convert to other types of 3d files, as long as this can be done at runtime (either programmaticly or by using a command line tool).
So I guess my question is: Is there any way to import a 3d file in WPF at runtime?
Thanks!
I don't think there's a built in way. You'll most likely have to write an importer for your own specific needs. You can find some file format information here> http://en.wikipedia.org/wiki/Wavefront_.obj_file
Thanks to #MattDavey
I managed to get The HelixToolkit (http://helixtoolkit.codeplex.com/) to work and got what I wanted using the ModelImporter.Load method.

XNA Text Drawing from a DLL

I am planning on building a 2D game library for XNA, and one of the components I want to include is a simple text drawer for debug purposes. Now, to draw text with SpriteBatch you need a .spritefont file, which is an xml format file, and these seem to need to compile into a separate folder. I would prefer not to have to copy that around with the dll, so here is my question:
can i build some sort of text renderer for XNA that
A: does not require me to carry around external files with the dll (if you can embed the sprite font into a dll then that works) and
B: does not force me to rewrite a fair amount of underlying (is it managed directx? a different part of xna?) code that makes the SpriteBatch.DrawString code work.
Could you not just require that a SpriteFont be passed into your library, so that whoever is using the library has to supply that component? That would seem to be the best solution, since then they could use whatever font they wanted. Or you could write in a component that generates the spritefont xml file based on a given font name, because it's not all that complicated of a file. Disregard. I forgot that XNA compiles its resources.
You can precompile the project and then grab the xnb file for the spritefont. Then add the file to the project Content folder as a content file. It should then be deployed together with the library. However u will need to build a separate xnb file for each platform you wish to support (xbox360, windows, zune) and deploy the correct file.
Or why don't u just create a XNA Content Library project?

Categories

Resources