Code Monkey home page Code Monkey logo

android_cv_bridge's People

Contributors

talregev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

android_cv_bridge's Issues

Getting Started

First I want to apologise if this not the right place to raise this query.

I am developing an android app. to show a video stream from a camera on a robot. I have done this successfully using ROSImageView linked to a ROS compressedImage topic using ROSJava.

Now I want to try the same approach used by the cv_bridgeCompressedImage app. adapting the code for my Android app. I still don't understand github nor how to get from this code to a dependency in my build.gradle in my app. Is there a step-by-step set of instructions for beginners that you can refer me to?

I open a project in Android Studio but I am unsure what to do next. I run 'Make Project' and get this error: 'SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.'

Again, I am sorry if this is not an 'issue', I cam trying to get somewhere but I'm frustrated by coming up to 'brick walls'.

android_cv_bridge_tutorial not running

I am trying to run your tutorial on android_cv_bridge but it is throwing following error.
I am subscribing the image topic(/camera/rgb/image_color) from kinect in android phone. I ahve made my laptop as master and android phone as client.

org.ros.android.android_tutorial_cv_bridge E/roid_tutorial_cv_bridge﹕ cv_bridge exception: Unrecognized image encoding [bgr8]
org.ros.android.android_tutorial_cv_bridge E/art﹕ No implementation found for void org.opencv.core.Mat.n_delete(long) (tried Java_org_opencv_core_Mat_n_1delete and Java_org_opencv_core_Mat_n_1delete__J)
org.ros.android.android_tutorial_cv_bridge E/System﹕ Uncaught exception thrown by finalizer
org.ros.android.android_tutorial_cv_bridge E/System﹕ java.lang.UnsatisfiedLinkError: No implementation found for void org.opencv.core.Mat.n_delete(long) (tried Java_org_opencv_core_Mat_n_1delete and Java_org_opencv_core_Mat_n_1delete__J)
at org.opencv.core.Mat.n_delete(Native Method)
at org.opencv.core.Mat.finalize(Mat.java:2475)
at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:191)
at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:174)
at java.lang.Thread.run(Thread.java:818)

Is it possible to transport a local image (from SD card) to ROS in android_cv_bridge way?

Hi, @talregev ! I'm new to ros and, recently I need transport a local image(from SD card) to ROS in android. I know I should transport it by the cv_bridge, and I had import the OpenCV-for-Android package in my Android Studio. However, I don't know how to make a local image transformed into CvImage by OpenCV, and finally make it to sensor_msgs.Image/CompressedImage messages. Do you have a good suggestion to make this possible?

My idea is something like this:

        filePath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).toString() + "xxx.jpg";
        try {
            fileInputStream = new FileInputStream(filePath);
        }
        catch (IOException e) {
            e.printStackTrace();
        }

        bmp = BitmapFactory.decodeStream(fileInputStream);

        // compress
        byteArrayOutputStream = new ByteArrayOutputStream();
        bmp.compress(Bitmap.CompressFormat.JPEG, 200, byteArrayOutputStream);

        int quality = 200;
        while (byteArrayOutputStream.toByteArray().length / 1024 > 200) {
            byteArrayOutputStream.reset();
            bmp.compress(Bitmap.CompressFormat.JPEG, quality, byteArrayOutputStream);
            quality -= 10;
        }

        byteArrayInputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
        bmp = BitmapFactory.decodeStream(byteArrayInputStream, null, null);
        channelBufferOutputStream.buffer().writeBytes(byteArrayOutputStream.toByteArray());

        // bmp to mat
        mat_image = new Mat();
        Bitmap copyBmp = bmp.copy(Bitmap.Config.ARGB_8888, false);
        Utils.bitmapToMat(copyBmp, mat_image);

What about the next to deal with the mat_image (or other way) ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.