I am looking into Renderscript capabilities and stuck with the A3D (Android 3d) file format. I can't find an easy way to convert a Collada file into an A3D format to store my blender model.
I was wondering if you guys have an idea I could try maybe?
Does anyone have a working code sample so that is can see what im doing wrong?
More info: http://developer.android.com/reference/android/renderscript/FileA3D.html
Edit: Not to be mistaken for the Asci3d file extention ( also *.a3d )
As of Ice Cream Sandwich (perhaps earlier) there is a tool in the Android source to convert between Collada and A3D.
The tool is called a3dconvert; you can browse the source online here (in the ICS branch): https://github.com/android/platform_development/tree/ics-mr1-release/tools/a3dconvert
Usage:
a3dconvert input_file a3d_output_file
Currently .obj and .dae (collada) input files are accepted.
This tool has been removed as of newer releases (Jelly Bean, it looks like). This probably because the graphics portion of Renderscript has been deprecated.
I'm not sure A3D is a good format but if you have to write a converter here is a description of both formats:
http://scorpion.tordivel.no/help/UsersGuide/General/ImageOperations/ImageFormats/ImageFormats_a3d.htm
http://en.wikipedia.org/wiki/COLLADA
And here is some sample code to read Collada:
http://sourceforge.net/projects/colladaloader/
If you're going from Blender to A3D, I would consider writing a Python script to go directly to A3D format from Blender. The A3D format seems rather simplistic and if you're only accessing the Mesh data, the Blender API isn't too hard to follow. Of course if you don't already know it, you'll have to pick up some Python syntax.
I knew nothing of Python when I first wanted to pull some information from Blender myself, and looking at existing .py scripts (like the OBJ export), the Blender API and learning some basic Python syntax I was able to write my first (rather simple) script in just a few hours or so.
http://colladablender.illusoft.com/cms/ is a project making a plugin for Blender to read Collada directly.
Also, Carrara could be used to convert your files to something Blender supports.
Related
I want to make an Android app which can convert .OBJ files into .GLB files.
I've researched this a fair bit but I haven't yet found any library that I'm confident I can use in an Android app for .OBJ to .GLB conversion. I had initially thought that the Assimp library was going to be the best bet: http://cms.assimp.org/index.php. Having looked more closely, however .GLB seems only to be listed as an import format and not as an export format: https://github.com/assimp/assimp So that presumably that means I can use Assimp to convert from .GLB to another format but not into .GLB from another format.
I'd be most grateful for any suggestions on alternative strategies that might be worth investigating. There must surely be some solution to this, but I can't immediately see what it could be!
You can use the Assimp-lib build for your android version ( shall work for 4.1.0 with android-cmake as far as I know ). Then you can use the functionalities to import an obj-file and export it as an glb-file. To write files there you will need to use th android-filesystem.
A short explanation cqn be found in our wiki how to build assimp for android ( check this here ). Or you can try our special build script, which is located here.
If you are facing any issues just create an issue report.
Read & Write shapefiles in android or java
How can i read and write shapefiles in Android or java?
.shp .shx and etc
i much searched but nothing
I want read file and edit information and write in same file or new file.
This is important i can write to file. i can read file but this isn't my problem
Thanks
Take Gdal for Android for a try.
Gdal
A translator library for raster and vector geospatial data formats that is released under an X/MIT style Open Source license by the Open Source Geospatial Foundation. As a library, it presents a single raster abstract data model and single vector abstract data model to the calling application for all supported formats. It also comes with a variety of useful command line utilities for data translation and processing. The NEWS page describes the January 2017 GDAL/OGR 2.1.3 release.
Read/Write API Tutorial
Building for Android on Linux
Either, Google for pre-compiled package
TensorFlow Android Camera Demo uses Inception5h model for live image recognition which delivers exceptional performance. Since I haven't had success retraining Inception5h I've gone with InceptionV3 model but it's not quite as snappy at image recognition. So I'm back at the beginning trying to retrain (or transfer learn) Inception5h model. I've tried modifying retrain.py but it's clearly written just for the v3 model. 5h model doesn't contain "pool_3/_reshape:0", "DecodeJpeg/contents:0" or "ResizeBilinear:0" tensors to begin with. There are other differences as well.
I'm a bit of a newbie at machine learning and TensorFlow so I'd greatly appreciate clear steps as to what I have to do.
Thank you!
It looks like the retrain.py script and tutorial was just updated to work with the mobilenet architecture.
So that solves the first part of your problem, it's not actually inception5h, but it runs well on mobile with much better accuracy than inception5h.
To actually get it to run in the android example you'll still need to update these settings.
I think you should be able to just copy the settings determined for the mobilenet you choose, from the retrain script and you might be okay.
If you wanted to use a different network, that didn't have the settings in retrain.py then the easiest way I can think of to determine them would be to explore the graph with TensorBoard.
So if you really wanted to use inception 5h, you could download and unzip it:
curl -O https://storage.googleapis.com/download.tensorflow.org/models/inception5h.zip
unzip -d inception5h inception5h.zip
Then grab this simple script, from the Tensorflow for Poets: 2 codelab repo, to convert the graph .pb file to something tensorboard can use:
curl -O https://raw.githubusercontent.com/googlecodelabs/tensorflow-for-poets-2/master/scripts/graph_pb2tb.py
And run it on your graph.pb:
mkdir tb_graph
python graph_pb2tb.py tb/inception5h inception5h/tensorflow_inception_graph.pb
And open it in tensorboard:
tensorboard --logdir tb_graph
Then it might be relatively simple to poke around in the graph and find the names of the nodes you need to fill up your own model_info dict.
I think this is the node you'd want to set as your bottleneck_tensor:
At the end of retrain.py script you can notice these lines:
output_graph_def = graph_util.convert_variables_to_constants(
sess, graph.as_graph_def(), [FLAGS.final_tensor_name])
with gfile.FastGFile(FLAGS.output_graph, 'wb') as f:
f.write(output_graph_def.SerializeToString())
Here all the variables are saved as constants in a protocol buffer (pb) file which is binary ('wb'). You should also save in a text file the names of the model's classes. Then as the android documentation mentions, you should save these 2 files in a folder named "assets" in the android path of tensorflow. Then there are some modifications that should be done to load the inception-v3 model which you can see here: https://github.com/tensorflow/tensorflow/issues/1269
I hope this will help!
I want to create an app that will display position on some floor plan. Navigation is implementing via WiFi in certain way, I've done it and so now I have a problem of displaying floor plan.
It might be in some vector format, after surfing internet for some time I've decided that it must be svg file.
I found some solutions, but it isn't working for me!
Library svg-android
There is opportunity to display .svg files, but only "simple" files. It works fine only for file in tutorial, but not for any other .svg file (for example, some other file, that you'll create with Inkscape).
So, I decided, that I'll parse .svg file, make DOM from it, somehow get objects and attributes and draw it via OpenGL ES.
Apache Batik
At first glance, very good solution, but there is a problem. Android has some "native" apache libraries and when I try to do something with batik, it throws NoClassDefFoundError, because it's searching not in batik libraries, but in "native" libraries.
Of course, we can add source code in our project, take only batik parser for .svg files and edit it in some way, but there is a lot of work, with same success we can write our own parser.
Tiny Line
There is no trial version, but if we'll see description of how it works for svg files and android, we'll see that there is only rasterization of such files and that's all.
Is there any solution better than writing own parser?
Did anyone come across this problem?
I would suggest using #1. Don't write your own parser. It's just going to be a huge headache.
How detailed does your floor plan have to be? android-svg supports SVG fairly well. It just doesn't have great support for filters or light sources. Your SVG isn't going to have those in them (I hope).
If you don't want to do that, look into quad trees. You can render out a huge image and break that down into a quadtree like format then only load the quads you require.
I have authored an SVG libaray for android the website is
http://www.vectoroid.com
the main thing missing is SVG arc support this is currently fixed and will be in a release in the near future.
I am looking for feedback on it, as i have been working on it for about a year. So if you have any please do tell ...
I've using yet another SVG for Android; seems it is relatively new.
GPLv3, CSS2 support, fonts, texts and spans, linear and radial gradients, SVG and SVGZ, initial filtering support, images from assets, from web and inline base64-encoded images. Fastest from all I've tried.
Of course filters support might be better, but except this it works well and even displays 20-megabytes SVG files.
Successfully tested these 2 libraries:
https://github.com/BigBadaboom/androidsvg - Apache License 2.0
https://scand.com/products/svgkit-android/ - needed tweaking to compile with modern SDK (suppress warnings, update gradle file); LGPL / commercial
androidsvg looks better so far.
Since PVR file format and PVRTexTool utility supports ETC compression -- I want to use it for my textures in the Android project.
Unfortunately I found no libs or samples how to load ETC1 OpenGL texture from PVR file.
One source I have is Objective-C PVR loader for iOS. But I need some example on C++ for Android NDK.
Unfortunately there doesn't seem to be much info on this out there, however there are a couple of things. http://www.brokenteapotstudios.com/android-game-development-blog/2011/05/loading-opengl-textures-in-c-and-etc1-texture-compression.html provides most of the info needed. If you want to use the header version, the header format is described here http://www.mhgames.org/2012/03/android-development-loading-etc1-textures-from-ndk/
Hopefully that's helpful :)
Read this first regarding compressed textures on android:
http://developer.android.com/guide/topics/graphics/opengl.html (scroll down to the "OpenGL Versions and Device Compatibility" chapter)
There's also the ETC1Util class (as referred from the link above) :
http://developer.android.com/reference/android/opengl/ETC1Util.html
Logical thing to do would be to use ETC1Util.isETC1Supported() to see if ETC1 is supported on your device and if not, provide a fallback option.
I also recommend you take a look (if you haven't done so already) at the PowerVR android sdk:
http://www.imgtec.com/powervr/insider/sdkdownloads/index.asp
I haven't taken a look at it myself, but I'm sure it's got what you are looking for.
So, I don't think there's any need for Objective-C...
Good luck!