[java] javaCV 에서 IplImage 를 byte 로 변환하자 JavaCV 에서 IplImage 의 char *imageData 를 JavaCV 에서 double[] 형태로 변형하자. 설명은 귀찮으니깐, 소스로 대처함 IplImage Loadimage = cvLoadImage("u_accelerometer.jpg", 0 ); // gray 로 read image_double image = new image_double( _image.width(), _image.height() );; byte[] ary = new byte[_image.width()*_image.height()]; Byte[] Bary = new Byte[_image.width()*_image.height()]; _image.ge..
function 에 참조로 파라미터를 넘기자. import java.util.ArrayList; import java.util.List; public class test { public static void main(String[] args) { int a[] = new int[1]; a[0] = 1; Integer b=1; System.out.println( "a =" + a[0] + ", b = " + b ); fun( a, b ); System.out.println( "a =" + a[0] + ", b = " + b ); } public static void fun( int a1[], Integer b1 ) { a1[0] = 3; b1 = 5; } } 왜 ? Integer 로 넘기면 안되는건가? 출..
자바에서는 클래스 배열을 만들기위해서 다음과 같이 하면 오류가 발생한다. coorlist cl[] = new coorlist[10]; 그래서...다음과 같이 하면 해결된다. (왠지...C/C++ 에 비해서 무식한 방법 같다.) coorlist clnew[]; for( int i=0; i
java 를 사용하면서 HashMap 을 사용합니다. 사용하고자 하는 실제 코드에서는 new 로 생성한 부분이 function 이 끝이 나고나면 값이 제대로 들어가 있지 않아서 아래와 같은 소스를 작성하여보았습니다. import java.util.ArrayList; import java.util.List; class coorlist { public int x; public int y; } public class test { final static int C_COUNT = 50; public static void main(String[] args) { int i,j; int count = 0; // World List - 'List' 를 담고 있다. List wList = new ArrayList< Lis..
[java] List Collection Framework 자바 잼있네요! import java.util.ArrayList; import java.util.List; class coorlist { public int x; public int y; } public class test { public static void main(String[] args) { int i,j; int count = 0; // List wlist = new ArrayList (10); // ------------------------------------------------------- // input // --------------------------------------------------..
안녕하세요~^^ 오늘은 arraylist 의 사용방법에 대해서 알아봅시다. 소스만 남기고 도망갑니다. import java.util.ArrayList; import java.util.HashMap; import java.util.List; public class test { public static void main(String[] args) { HashMap hm = new HashMap(); List al = new ArrayList(); hm.put("name", "길동"); hm.put("nick", "또리"); al.add( hm ); hm = new HashMap(); hm.put("name", "청수"); hm.put("nick", "수리"); al.add( hm ); HashMap getH..