본문 바로가기

class

(33)
Aracade Intro #17 ArrayChange, Codefights, CodeSignal, 코드파이트, 코드시그널, c++ java c# scalar Aracade Intro #17 ArrayChange, Codefights, CodeSignal, 코드파이트, 코드시그널, c++ java c# scalar Q. You are given an array of integers. On each move you are allowed to increase exactly one of its element by one. Find the minimal number of moves required to obtain a strictly increasing sequence from the input. 정수 배열을 입력받고, 인덱스 순서로 따라올라가는데.. 한 행동에 한개의 숫자 1씩을 증가시킬수 있다. 전부 오름차순이 되도록 해야된다. 전부 오름차순이 되는데 움직인 개수..
Aracade Intro #16 AreSimilar?, Codefights, CodeSignal, 코드파이트, 코드시그널, c++ java c# scalar Aracade Intro #16 AreSimilar?, Codefights, CodeSignal, 코드파이트, 코드시그널, c++ java c# scalar Q. Two arrays are called similar if one can be obtained from another by swapping at most one pair of elements in one of the arrays. Given two arrays a and b, check whether they are similar. 입력받은 두개의 배열 (a, b) 중에서, 어느 한개의 배열에서 한 쌍의 요소들 자리만 바꿔서 (위치는 서로 떨어져 있어도 상관없음) a, b 배열이 같아지면, 비슷하다는 것이 true 이다. e.g. Input -..
OpenCV - CvType (Mat datatype) 오픈cv 매트릭스 데이터타입 OpenCV - CV_Type (Mat datatype) 오픈cv - CV_Type 매트릭스 데이터타입 Mat 으로 반환되는 함수의 경우는 바로 Mat 에 변수명으로 받아도 되지만..가끔 Mat 자체를 정해진 사이즈로 미리 만들어놓고 수정해가며 사용하는 경우가 많다. Mat.ones or Mat.zeros 를 쳐보면 뒤에 Size 객체를 넣는 함수와, 가로세로 길이를 직접 입력하는 두가지가 있다. 난 가로세로 직접 넣는게 편한 듯.e.g.Mat.ones(rows, cols, datatype); // rows * cols 사이즈의 matrix를 만들고 1로 채워준다. 들어가는 데이터타입은 CvType.CV_${해당비트} 로 정한다.Mat.zeros(rows, cols, datatype);// rows * ..
OpenCV (Java) How to change Mat to Image, and save 2 (OpenCV Mat 에서 Image 변환, 저장) 2 OpenCV (Java) How to change Mat to Image, and save 2 (OpenCV Mat 에서 Image 변환, 저장) 2 Fourier transter 이후에 shift 까지 마쳤던 것들을 다시 inverse transfer 한 후에돌아온 Mat을 저장해서 확인해보려고 하니 계속 오류가 났다.돌아온 Mat은 데이터 타입이 CV_16F (double) 형이었고,오류나는 메시지로는 CV_8UC 등 밖에 안맞는다고.. 아무튼 8비트 까지만 된다고.. 해답은 돌아온 Mat을 Core의 split 을 이용하여 잘라내주고,잘라낸 값을 정규화해서 해당 mat을 image로 만들면 잘 된다. I got some errors when I need to make and save image fi..
OpenCV (Java) How to change Mat to Image, and save (OpenCV Mat 에서 Image 변환, 저장) OpenCV (Java) How to change Mat to Image, and save (OpenCV Mat 에서 Image 변환, 저장) 일반적인 Mat 타입을 Image (JavaFx)로 변환하는 순서를 보면.. 2가지 종류가 있는데 1. Mat Byte 버퍼를 만든다. 2. PNG 포맷으로 mat을 encoding 하면서 버퍼에 넣는다. 3. 버퍼를 배열로 만들면서 inputstream을 붙여서 읽은 값을 Image로 만든다 or 1. Mat 을 BufferedImage로 변환한다. 2. BufferedImage 를 Image (fx) 로 변환한다. It's the general order of converting Mat type to Image (javaFx), there are two way..
Java enum class 자바 이넘 클래스 (Singleton design pattern 처럼 사용방법) 앞에서 자바 싱글턴 디자인패턴을 썼는데.. ( 여 기 ) 이어서 자바 enum 자료형 클래스에 대한 내용을 쓴다.. enum 자료형을 잘 써서 이런저런 경우에 대입하는 경우가 많은데, 일단은 이펙티브 자바에서 나온 싱글턴을 대체하는 enum 클래스 예제만 보자? I posted Java singleton pattern ( here ) Continue to post this enum class in Java.. There are many usage to use enum datatype in Java, for the first, Imma write enum class for singleton in effective java book. Let's get started? 특이사항으로는.. 클래스 입구에 TEST..
티스토리 (구글/네이버 검색 노출) 사이트맵 생성 - How to make sitemap xml file 티스토리 (구글/네이버 노출) 사이트맵 생성 - How to make sitemap xml file Online XML Sitemap Generator접속한다. http://www.web-site-map.com/ 오른쪽 상단에 url 입력하는 부분에 본인 블로그 주소를 입력하고 -> Get free XML Sitemap 버튼을 누른다. -> 내용 입력 ->-> 1. url 은 입력되어서 들어온다. ->-> 2. 보안코드를 보고 똑같이 입력한다. ->-> 3. 다른 곳은 건드리지 않아도 되고, 맨 아래에 체크박스에 체크를 해준다. (아래) Include sub-domains (all subdomains must be added in Google Webmaster Tools as well) ->-> 4. C..
Design pattern - Singleton (디자인패턴 - 싱글턴) Design pattern - Singleton (디자인패턴 - 싱글턴) It's used alot because it's easy to use. Example would be written in Java or C++, maybe in Java. And it's simple if you understand the whole context. If you wonder the classdiagram, then just search. Important things.. 1. It's the only instance using specific class, in heap memory 2. This class has a self instance as a attribute(static) 3. Private constru..