arcore_plugin 0.0.1+3

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new56

arcore_plugin #

A Flutter plugin for Android allowing to recongize images via ARCore

Features #

[x] Displaying live ARCamera Feed

[x] Recognizing images via ARCore (for more information see: https://developers.google.com/ar/develop/c/augmented-images/)

[ ] Placing Objects

[ ] In-App training of the imgdb file

Installation #

Android #

  • For Setup make sure you migrated your App to AndroidX
  • in app/build.gradle set minSdkVersion to 24 and compileSdkVersion 28
 defaultConfig {
        ...     
        minSdkVersion 24    
        ...
    }
and
android {
    compileSdkVersion 28
    ...
}

Very important! #

* AS FOR NOW THE PLUGIN DOES NOT SUPPORT IN APP TRAINING OF THE IMGDB FILE
* The IMGDB File has to be PRETRAINED and saved in a Temp Directory before the ArCoreView is created 
* The IMGDB File name hast to be image_database.imgdb
 * you can find a pretained imgdb file under example/assets. The images that the imgdb file is trained with are found under example/assets/tester_images
* for more info about ARCore imgdb files see : https://developers.google.com/ar/develop/c/augmented-images/arcoreimg

Getting Started #

  • For the given Example you have to have a pretrained imgdb saved in your assets folder and added as an asset in your pubspec.yaml file !
import 'dart:io';
import 'package:flutter/services.dart' show rootBundle;
import 'package:arcore_plugin/arcore_plugin.dart';
import 'package:flutter/material.dart';

void main() async {
  final Directory systemTempDir = Directory.systemTemp;
  final File tempFile = File('${systemTempDir.path}/image_database.imgdb');

  // create tempfile
  await tempFile.create();

  rootBundle.load("assets/image_database.imgdb").then((data) {
    tempFile.writeAsBytesSync(
        data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes));

    runApp(MaterialApp(home: TextViewExample()));
  }).catchError((error) {
    throw Exception(error);
  });
}

class TextViewExample extends StatefulWidget {
  @override
  _TextViewExampleState createState() => _TextViewExampleState();
}

class _TextViewExampleState extends State<TextViewExample> {
  String recongizedImage;
  ArCoreViewController arCoreViewController;

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    Size screenSize = MediaQuery.of(context).size;
    return Scaffold(
        backgroundColor: Colors.blue,
        appBar: AppBar(
          title: const Text('ArCoreViewExample'),
          backgroundColor: Colors.black,
          centerTitle: true,
        ),
        body: Center(
            child: Container(
                width: screenSize.width,
                height: screenSize.height,
                child: ArCoreView(
                  onImageRecognized: _onImageRecognized,
                  onArCoreViewCreated: _onTextViewCreated,
                ))));
  }

  void _onTextViewCreated(ArCoreViewController controller) {
    arCoreViewController = controller;
    controller.getArCoreView();
  }

  void _onImageRecognized(String recImgName) {
    print("image recongized: $recImgName");

    // you can pause the image recognition via arCoreViewController.pauseImageRecognition();
    // resume it via arCoreViewController.resumeImageRecognition();
  }
}

Note: This plugin is still under development, and some APIs might not be available yet. Feedback welcome and Pull Requests are most welcome!

0.0.1 #

  • First Release

0.0.1+1 #

  • Added more information in README file

0.0.1+2 #

  • Added better control over Image Recognition. User can pause and resume image recognition via ArCoreViewController
  • Added example on how to save the imgdb file in the App --> see main function in example
  • Added pretrained imgdb file and tester images as asset for example
  • updated README.md

example/README.md

arcore_plugin_example #

Demonstrates how to use the arcore_plugin plugin.

Getting Started #

For help getting started with Flutter, view our online documentation.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  arcore_plugin: ^0.0.1+3

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:arcore_plugin/arcore_plugin.dart';
  
Version Uploaded Documentation Archive
0.0.1+3 Mar 17, 2019 Go to the documentation of arcore_plugin 0.0.1+3 Download arcore_plugin 0.0.1+3 archive
0.0.1+2 Mar 17, 2019 Go to the documentation of arcore_plugin 0.0.1+2 Download arcore_plugin 0.0.1+2 archive
0.0.1+1 Mar 16, 2019 Go to the documentation of arcore_plugin 0.0.1+1 Download arcore_plugin 0.0.1+1 archive
0.0.1 Mar 16, 2019 Go to the documentation of arcore_plugin 0.0.1 Download arcore_plugin 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
17
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
56
Learn more about scoring.

We analyzed this package on Mar 17, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14
  • Flutter: 1.3.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8