본문 바로가기

전체 글

(424)
Aracade Intro #15 AddBorder, Codefights, CodeSignal, 코드파이트, 코드시그널, c++ java c# scalar Aracade Intro #15 AddBorder, Codefights, CodeSignal Q. Given a rectangular matrix of characters, add a border of asterisks(*) to it. 주어진 글자 매트릭스에다가, 외곽에 * 테두리를 추가하라 e.g. Input -> picture = ["abc", "ded"] Output -> addBorder(picture) = ["*****", "*abc*", "*ded*", "*****"] Input -> ["aa", "**", "zz"] Output ->["****", "*aa*", "****", "*zz*", "****"] 테투리에 * 을 만듦. for 문 2개로 조건문을 만들어서 할까 했는데,1개씩 써서 순..
Aracade Intro #14 AlternatingSums, Codefights, CodeSignal Aracade Intro #14 AlternatingSums, Codefights, CodeSignal 코드파이트, 코드시그널 Q. You are given an array of positive integers - the weights of the people. Return an array of two integers, where the first element is the total weight of team 1, and the second element is the total weight of team 2 after the division is complete. 양의 정수 배열을 입력받고(사람들 몸무게), 두개의 정수를 반환하는데..홀수번째 배열의 합(첫번째팀), 짝수번째 사람들 무게의 합(두번째팀)..
Design pattern - Prototype (디자인패턴 - 프로토타입) / Java C++ C# Design pattern - Prototype (디자인패턴 - 프로토타입) / Java C++ C# 디자인 패턴 두번째 포스팅으로.. 좀 큼직한걸 시간들여서 쓰고 싶었으나.. 귀찮아서 일단 작은거부터 쓰는 중 Prototype 패턴이라하면.. 자바에서는 모든 객체의 상위 클래스인 Object 클래스에 기본으로 들어가 있는, clone() 함수로 이 패턴이 쓰인다. 자기 자신 클래스를 복사해서 반환형으로 똑같은 값들을 가진 같은 클래스를 내보낸다. 뭐 얕은복사, 깊은복사 이런 소리가 있는데.. -> 얕은복사는 보통 heap에 할당된 객체(list) 등을 대표주소값만 복사하여 같은 객체나 값을 공유하고 각기 서로 다른 주소값만 갖고 있는 경우가 된다. -> 깊은복사는 할당된 객체(list) 등이 갖고 있는..
Aracade Intro #13 ReverseParentheses, Codefights, CodeSignal, 코드파이트, 알고리즘, algorithm Aracade Intro #13 ReverseParentheses, Codefights, CodeSignal, 코드파이트, 알고리즘, algorithm 이거 진짜 재귀로 풀기 젼나 빡쎘슴.. It was hella hard to solve using recursive.. Q. You have a string s that consists of English letters, punctuation marks, whitespace characters, and brackets. It is guaranteed that the parentheses in s form a regular bracket sequence. Your task is to reverse the strings contained in each pai..
What is eps in Matlab, Matlab 에서 eps What is eps in Matlab, Matlab 에서 eps 부동소수점(Floating Point) 상대 정확도(Relative Accuracy) 대략 이정도 표기됨 -> 2.2204e-16 2 의 -52 제곱 2^-52 Matlab official page 오피셜페이지가 젤 정확함~ http://kr.mathworks.com/help/matlab/ref/eps.html 왜 검색유입이 자꾸 다음에서 벤츠 E class 이딴거 밖에 없는지 모르겠지.. 하.. ㅗ나.... something else.. 2018/10/17 - [Programming/Image Processing] - OpenCV - CV_Type (Mat datatype) 오픈cv 매트릭스 데이터타입 2018/10/16 - [Progr..
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..