2014년 1월 4일 토요일
setup android app development enviroment
1. Install JDK
Download JDK and install latest version
http://www.oracle.com/technetwork/java/javase/downloads/index.html
2. Install ADT (Android Development toolkit)
Download ADT and unzip , it does not need to install
http://developer.android.com/sdk/index.html
3. Run SDK Manager under ADT installed directory and install SW pacakges what you need
In my case, it located C:\adt-bundle-windows-x86-20131030\SDK Manager.exe and Android 4.3(API18) is installed
4. After installing package, run eclipse.
In my case, it loacated C:\adt-bundle-windows-x86-20131030\eclipse\eclipse.exe
5. Set up virtual device for debugging
Select menu > windows > android SDK manager then tools > manageADVs on android SDK manager dialog and create virtual device. If your PC is not good enough, vitual device can not run. In this case, select lpw option of vitual device
6. Make sample project
Select file > new > android application project.
Now just setup project name and use default others (just click next)
7. Build project
Right click Project name on Project ecplorer, then select debug as > android application
then application runs on ADV
8. Create APK If you want to install on the phone, you must create APK file
Right click Project name on Project ecplorer, then Android tools > export signed application package
There is unsigned application package, if you create unsigned package , it can not be intalled so you shoud be better install signed package
For creating signed package, you need keystore. If you already have keystore, select "use existing keystore", if not, select "Create new keystore"
9. Phone test
Copy Created APK file to youer phone and run
2013년 12월 8일 일요일
sobel filter by using 2D image interface opencl
I made a simple image sobel filter application using 2D interfacing example.
Firt add sobel filter kernel into imagecpy.cl file and create sobel filter kernel instead of image2d_copier.
__kernel void sobel_rgb(read_only image2d_t src, write_only image2d_t dst, sampler_t sampler)
{
int x = (int)get_global_id(0); int y = (int)get_global_id(1);
float4 p00 = read_imagef(src, sampler, (int2)(x - 1, y-1));
float4 p10 = read_imagef(src, sampler, (int2)(x, y-1));
float4 p20 = read_imagef(src, sampler, (int2)(x + 1, y-1));
float4 p01 = read_imagef(src, sampler, (int2)(x - 1, y));
float4 p21 = read_imagef(src, sampler, (int2)(x + 1, y));
float4 p02 = read_imagef(src, sampler, (int2)(x - 1, y+1));
float4 p12 = read_imagef(src, sampler, (int2)(x, y+1));
float4 p22 = read_imagef(src, sampler, (int2)(x + 1, y + 1));
float3 gx = -p00.xyz + p20.xyz + 2.0f * (p21.xyz - p01.xyz) - p02.xyz + p22.xyz;
float3 gy = -p00.xyz - p20.xyz + 2.0f * (p12.xyz - p10.xyz) + p02.xyz + p22.xyz;
float3 norm = gx * gx + gy * gy;
float3 g = native_sqrt(norm.x+norm.y+norm.z);
write_imagef(dst, (int2)(x, y), (float4)(g.x, g.y, g.z, 1.0f));
}
I got the result as below
참 쉽죠~~
2013년 11월 30일 토요일
opencl 2D image interfacing example
This progame is using opencl load image from the host source image and copy to host destination image buffer. It is helpful to understand 2D image interface of opencl.
I used opencv for loading and showing images.
opencl_image_copy_example
2013년 10월 4일 금요일
opencl helloworld
I made sample opencl program under VS2010
It just do squre float values.
I refered "opencl programming guide" sample for reading cl source from file.
It is more simple and easier to beginner.
dwonload vs2010 project here
2013년 8월 26일 월요일
openCL VS2010 Project
1. Add CUDA include directory
Project properties > General > C/C++ > General > Additional Include Directory > Edit
then add
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\include
2. Add OpenCL Libs
Project properties > linker > input > addtional dependency
then add
OpenCL.lib
3. 4. Add OpenCL Lib Path
Project properties > linker > general > additional library directory
then add
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\lib\Win32
In CUDA toolkit, opecCL path is same with CUDA path
When you write include header in source, add just CL path
For example
#include <CL/cl.h>
2013년 8월 25일 일요일
CUDA VS2010 project setup
After new VS 2010 project ,
It needs to add CUDA related enviroment setup
1. ADD CUTA in specifying custom build tools
Right Click project file then select "specifying custom build tools"
Check CUDA 5.0 , Press OK
2. Add CUDA include directory
Project properties > General > C/C++ > General > Additional Include Directory > Edit
then add
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\include
3. Add CUDA Libs
Project properties > linker > input > addtional dependency
then add
cuda.lib;cudart.lib
4. Add CUDA Lib Path
Project properties > linker > general > additional library directory
then add
$(CudaToolkitLibDir)
Now We can write down basic CUDA API in program.
2013년 7월 7일 일요일
install opencv on windows
------------------------------------------------------
opencv officail home
------------------------------------------------------
http://opencv.org/
------------------------------------------------------
download
------------------------------------------------------
http://opencv.org/downloads.html
1. extract donwload opencv package where do you want to install
- I used opencv 2.4.6
- My installation DIR is C:\opencv_2.4.6
- I test it under VC10
2. set opencv enviroment variable and add path
- open console then enter below command
$ setx -m OPENCV_DIR C:\opencv_2.4.6\build\x86\vc10
- add path
%OPENCV_DIR%\bin
3. create sample project in VS

4. select property manager(?) tab and right click Debug | Win32 then add new project propery

6. right click the create property sheet, then select propery
7. move c/c++ then add additional include directory C:\opencv_2.4.6\build\include

8. move link, then add additional library directory C:\opencv_2.4.6\build\x86\vc10\lib

8. move link, input directory then add additional dependency and add below libs
opencv_core246d.lib
opencv_imgproc246d.lib
opencv_highgui246d.lib
opencv_ml246d.lib
opencv_video246d.lib
opencv_features2d246d.lib
opencv_calib3d246d.lib
opencv_objdetect246d.lib
opencv_contrib246d.lib
opencv_legacy246d.lib
opencv_flann246d.lib
opencv_imgproc246d.lib
opencv_highgui246d.lib
opencv_ml246d.lib
opencv_video246d.lib
opencv_features2d246d.lib
opencv_calib3d246d.lib
opencv_objdetect246d.lib
opencv_contrib246d.lib
opencv_legacy246d.lib
opencv_flann246d.lib
9 .make main functin as like below
#include "stdafx.h"
#include <opencv\cv.h>
#include <opencv\highgui.h>
#include <opencv\highgui.h>
int _tmain(int argc, _TCHAR* argv[])
{
IplImage * image = cvLoadImage("C:\\Hydrangeas.jpg", 1);
cvShowImage("test image", image);
cvWaitKey(0);
cvWaitKey(0);
cvReleaseImage(&image);
return 0;
}
}
then build and run
피드 구독하기:
글 (Atom)