Skip to content
Snippets Groups Projects
Commit 5baee1b6 authored by Nicolas Furquez's avatar Nicolas Furquez
Browse files

aplicacion que solo muestra el contenido de la camara

parent ada1375d
No related branches found
No related tags found
No related merge requests found
......@@ -3,15 +3,51 @@
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="10" />
<!-- <application -->
<!-- android:allowBackup="true" -->
<!-- android:icon="@drawable/ic_launcher" -->
<!-- android:label="@string/app_name" -->
<!-- android:theme="@style/AppTheme" > -->
<!-- </application> -->
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:allowBackup="true"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:icon="@drawable/ic_launcher"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
<activity android:name="ChessTrackActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:configChanges="keyboardHidden|orientation">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<supports-screens android:resizeable="true"
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:anyDensity="true" />
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="10" />
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
<uses-feature android:name="android.hardware.camera.front" android:required="false"/>
<uses-feature android:name="android.hardware.camera.front.autofocus" android:required="false"/>
</manifest>
......@@ -3,15 +3,51 @@
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="10" />
<!-- <application -->
<!-- android:allowBackup="true" -->
<!-- android:icon="@drawable/ic_launcher" -->
<!-- android:label="@string/app_name" -->
<!-- android:theme="@style/AppTheme" > -->
<!-- </application> -->
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:allowBackup="true"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:icon="@drawable/ic_launcher"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
<activity android:name="ChessTrackActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:configChanges="keyboardHidden|orientation">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<supports-screens android:resizeable="true"
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:anyDensity="true" />
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="10" />
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
<uses-feature android:name="android.hardware.camera.front" android:required="false"/>
<uses-feature android:name="android.hardware.camera.front.autofocus" android:required="false"/>
</manifest>
......@@ -9,12 +9,49 @@ package uy.edu.fing.chesstrack;
public final class R {
public static final class attr {
/** <p>May be an integer value, such as "<code>100</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>May be one of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>any</code></td><td>-1</td><td></td></tr>
<tr><td><code>back</code></td><td>99</td><td></td></tr>
<tr><td><code>front</code></td><td>98</td><td></td></tr>
</table>
*/
public static final int camera_id=0x7f010001;
/** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
*/
public static final int show_fps=0x7f010000;
}
public static final class drawable {
public static final int ic_launcher=0x7f020000;
}
public static final class id {
public static final int any=0x7f040000;
public static final int back=0x7f040001;
public static final int chess_track_layout=0x7f040003;
public static final int front=0x7f040002;
}
public static final class layout {
public static final int chess_track_layout=0x7f030000;
}
public static final class string {
public static final int app_name=0x7f030000;
public static final int app_name=0x7f050000;
public static final int menu_start_new_game=0x7f050002;
public static final int menu_toggle_tile_numbers=0x7f050001;
}
public static final class style {
/**
......@@ -27,10 +64,65 @@ public final class R {
backward-compatibility can go here.
*/
public static final int AppBaseTheme=0x7f040000;
public static final int AppBaseTheme=0x7f060000;
/** Application theme.
All customizations that are NOT specific to a particular API-level can go here.
*/
public static final int AppTheme=0x7f040001;
public static final int AppTheme=0x7f060001;
}
public static final class styleable {
/** Attributes that can be used with a CameraBridgeViewBase.
<p>Includes the following attributes:</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>{@link #CameraBridgeViewBase_camera_id uy.edu.fing.chesstrack:camera_id}</code></td><td></td></tr>
<tr><td><code>{@link #CameraBridgeViewBase_show_fps uy.edu.fing.chesstrack:show_fps}</code></td><td></td></tr>
</table>
@see #CameraBridgeViewBase_camera_id
@see #CameraBridgeViewBase_show_fps
*/
public static final int[] CameraBridgeViewBase = {
0x7f010000, 0x7f010001
};
/**
<p>This symbol is the offset where the {@link uy.edu.fing.chesstrack.R.attr#camera_id}
attribute's value can be found in the {@link #CameraBridgeViewBase} array.
<p>May be an integer value, such as "<code>100</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
<p>May be one of the following constant values.</p>
<table>
<colgroup align="left" />
<colgroup align="left" />
<colgroup align="left" />
<tr><th>Constant</th><th>Value</th><th>Description</th></tr>
<tr><td><code>any</code></td><td>-1</td><td></td></tr>
<tr><td><code>back</code></td><td>99</td><td></td></tr>
<tr><td><code>front</code></td><td>98</td><td></td></tr>
</table>
@attr name uy.edu.fing.chesstrack:camera_id
*/
public static final int CameraBridgeViewBase_camera_id = 1;
/**
<p>This symbol is the offset where the {@link uy.edu.fing.chesstrack.R.attr#show_fps}
attribute's value can be found in the {@link #CameraBridgeViewBase} array.
<p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>".
<p>This may also be a reference to a resource (in the form
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
theme attribute (in the form
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
containing a value of this type.
@attr name uy.edu.fing.chesstrack:show_fps
*/
public static final int CameraBridgeViewBase_show_fps = 0;
};
}
<?xml version="1.0" encoding="UTF-8"?>
<lint>
</lint>
\ No newline at end of file
......@@ -12,3 +12,5 @@
# Project target.
target=android-10
android.library=false
android.library.reference.1=../../../../Android/OpenCV4Android/OpenCV-2.4.9-android-sdk/sdk/java
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:opencv="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<org.opencv.android.JavaCameraView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:visibility="gone"
android:id="@+id/chess_track_layout"
opencv:show_fps="true"
opencv:camera_id="any" />
</LinearLayout>
\ No newline at end of file
<resources>
<string name="app_name">ChessTrack</string>
<string name="menu_toggle_tile_numbers">Show/hide tile numbers</string>
<string name="menu_start_new_game">Start new game</string>
</resources>
package uy.edu.fing.chesstrack;
import org.opencv.android.BaseLoaderCallback;
import org.opencv.android.CameraBridgeViewBase;
import org.opencv.android.CameraBridgeViewBase.CvCameraViewFrame;
import org.opencv.android.CameraBridgeViewBase.CvCameraViewListener;
import org.opencv.android.LoaderCallbackInterface;
import org.opencv.android.OpenCVLoader;
import org.opencv.core.Mat;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.SurfaceView;
import android.view.WindowManager;
public class ChessTrackActivity extends Activity implements CvCameraViewListener {
private static final String TAG = "CHESSTRACK::Activity";
private CameraBridgeViewBase mOpenCvCameraView;
private final BaseLoaderCallback mLoaderCallback = new BaseLoaderCallback(this) {
@Override
public void onManagerConnected(int status) {
switch (status) {
case LoaderCallbackInterface.SUCCESS:
{
Log.i(TAG, "OpenCV loaded successfully");
mOpenCvCameraView.enableView();
} break;
default:
{
super.onManagerConnected(status);
} break;
}
}
};
@Override
public void onResume()
{
super.onResume();
OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_9, this, mLoaderCallback);
}
@Override
public void onCreate(Bundle savedInstanceState) {
Log.i(TAG, "called onCreate");
super.onCreate(savedInstanceState);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
setContentView(R.layout.chess_track_layout);
mOpenCvCameraView = (CameraBridgeViewBase) findViewById(R.id.chess_track_layout);
mOpenCvCameraView.setVisibility(SurfaceView.VISIBLE);
mOpenCvCameraView.setCvCameraViewListener(this);
}
@Override
public void onPause()
{
super.onPause();
if (mOpenCvCameraView != null) {
mOpenCvCameraView.disableView();
}
}
@Override
public void onDestroy() {
super.onDestroy();
if (mOpenCvCameraView != null) {
mOpenCvCameraView.disableView();
}
}
@Override
public void onCameraViewStarted(int width, int height) {
}
@Override
public void onCameraViewStopped() {
}
public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
return inputFrame.rgba();
}
@Override
public Mat onCameraFrame(Mat inputFrame) {
// TODO Auto-generated method stub
return null;
}
}
package uy.edu.fing.chesstrack.modulovision;
public class Adquisicion {
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment