Ask Your Question
0

Error parsing XML: unbound prefix Android

asked 2013-03-11 11:42:21 -0600

MysticBE gravatar image

updated 2013-03-11 11:54:00 -0600

I get an error in my XML code when I add the opencv:show_fps="true" to my XML code (cause i want to be able to see the FPS on the screen)

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >

    <org.opencv.android.JavaCameraView
        android:id="@+id/java_surface_view"
        android:layout_width="0dp"
        android:layout_height="fill_parent"
        android:layout_weight="0.80"
        opencv:show_fps="true" />

    <Button
        android:id="@+id/button2"
        android:layout_width="wrap_content"
        android:layout_height="match_parent" 
        androi*emphasized text*d:drawableLeft="@drawable/camera"
        android:gravity="left|center_vertical"/>

</LinearLayout>

When I delete the line, the error also disappears, but I couldn't find another good alternative to read out the FPS. What am I doing wrong here?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
3

answered 2013-03-12 01:49:04 -0600

updated 2013-03-12 02:21:43 -0600

Andrey Pavlenko gravatar image

You missed the OpenCV properties inclusion string: xmlns:opencv="http://schemas.android.com/apk/res-auto" in your root xml tag (LinearLayout). See tutorial-1 layout.xml file from OpenCV4Android SDK 2.4.4 as an example.

edit flag offensive delete link more

Comments

I added that part and the error goes away, but on my screen I don't get the FPS like in the example. Something else i'm missing here? The org.opencv.android.JavaCameraView has been changed to be.artesis.findmymovie.AndroidCameraView, does that have anything to do with it? If I change it to org.opencv.android.JavaCameraView, I get several errors when I want to retrieve the .getResolutionList().

MysticBE gravatar imageMysticBE ( 2013-03-12 08:59:20 -0600 )edit

FPS Meter shows fps message after several captured frames. You need to wait it, if your application has low fps. Also, do not forget to move FpsMeter class to your java package and fix import section.

Alexander Smorkalov gravatar imageAlexander Smorkalov ( 2013-03-12 11:39:26 -0600 )edit

Oke thank you, I made it work in a completely different way (added a piece of code from Barry Thomas his application which did the job for me).

MysticBE gravatar imageMysticBE ( 2013-03-13 05:54:03 -0600 )edit

Question Tools

Stats

Asked: 2013-03-11 11:42:21 -0600

Seen: 6,184 times

Last updated: Mar 12 '13