8/30/2011

Make Fibonacci sequence function. / 피보나치 수열 함수 만들기

Below condition is Fibonacci sequence.


Fibonacci sequence start from 0, 1 and then next number is sum of previous two Fibonacci value.
ex) 011235813213455891442333776109871597, 2584, 4181, 6765, 10946...

Make Fibonacci function~
ex) F(0) = 0, F(1)=1, F(7)=13

----------------------------------------------------

피보나치 수는 0과 1로 시작하며, 다음 피보나치 수는 바로 앞의 두 피보나치 수의 합이 된다. 
ex) 011235813213455891442333776109871597, 2584, 4181, 6765, 10946...
피보나치 함수를 만들어라
ex) F(0) = 0, F(1)=1, F(7)=13

OpenCV Function Test - (cvCanny, cvGoodFeaturesToTrack) / C++ source

Created Date : 2008.11
Language : C++
Tool : Visual C++ 6.0
Library & Utilized : OpenCV 1.0
Reference :  Learning OpenCV Book
etc. : -




This code is to test OpenCV functions those are cvCanny, cvGoodFeaturesToTrack.
It is simple and easy. But the method of function use is easy to forget in long time past. And It is useful to OpenCV Beginner.

You can download source <here>

If you have good idea or advanced opinion, please reply me. Thank you
(Please understand my bad english ability. If you point out my mistake, I would correct pleasurably. Thank you!!)------------------------------------------------------------

OpenCV 에 있는 cvCanny, cvGoodFeaturesToTrack 함수를 사용한 소스입니다.
결과는 위 그림과 같습니다.
이 함수를 사용하시는 분 참고하시면 빠르게 적용할 수 있을거라 생각합니다. <here>




좋은 의견 어떤 글이든 답변 남겨주세요

감사합니다.


8/29/2011

Hough Transform (Line, Circle) / C++ source (OpenCV) / 허프변환(선, 원)


Created Date : 2007.7
Language : C++
Tool : Visual C++ 6.0
Library & Utilized : OpenCV 1.0(for image saving)
Reference :  Hough Transform reference
etc. : -






This is Hough Transform program.
We can progress two type Hough Transform. One is Line Hough Transform, Second is Circle Hough Transform.
After processing, Hough Transform result, Edge Image and Parameter Space(txt) files save in your directory.

You can download source code <here>.

If you have good idea or advanced opinion, please reply me. Thank you
(Please understand my bad english ability. If you point out my mistake, I would correct pleasurably. Thank you!!)
-------------------------------------------------------------------------------

▣ 허프변환 프로그램 결과
<실험 1>
1. 입력 데이터
2. 에지 영상
3. Line 검출 결과
4. Parameter Space voting 영상

▣ 소스 코드 설명
1. Line 검출
①voting 부분
theta를 0~180까지 증가시키면서 rho를 구하고 그 값을 [theta][rho]의 2차원 배열에 Voting한다.

②Sorting 부분
voting된 Parameter를 정렬한다. 정렬은 STL을 사용함.

③Line 그리는 부분
정렬된 theta와 rho값을 이용하여 직선의 방정식의 기울기와 절편을 구하고 OpenCV에 Line Draw함수를 이용하여 라인을 그린다. 그려진 라인은 OpenCV의 IplImage에 저장된다.
라인을 그릴 때는 voting이 가장 많이 된 것의 선색을 255, 가장 voting이 안된 것의 선 색을 0으로, Voting된 것의 정도를 색으로 나타내었다.

2. Circle 검출
①voting 부분
반지름을 <10>에서 <이미지 대각방향의 픽셀 길이 빼기 10>까지 증가시키면서 theta를 0~360까지 증가시키며, 원의 중심 위치 Cx, Cy에 대하여 voting을 한다. voting된 결과는 를 담을 수 있는 Vector에 저장된다.

②Sorting 부분
의 정보를 갖고 있는 Vector에서 Voring 값으로 정렬을 한다.

③Circle 그리는 부분
정렬된 원중에서 상위 1%만 드로잉한다.
드로잉할 때는 라인을 그릴때와 마찬가지로 제일 많이 voting된 것을 255색, 제일 적게 voting된것을 0색으로 그려서 voting정도를 표시한다.

▣ 인터페이스 설명
실행 파일을 실행하여 파일명을 입력하고, Line을 검출하려면 1을 입력 Circle을 검출하려면 2를 입력한다.
검출이 끝나면 실행 시간이 나온다.


전체 소소는 여기서 다운 받을 수 있습니다. <here>

좋은 의견 어떤 글이든 답변 남겨주세요
감사합니다.





OpenGL Test - Lighting Position, Ambient, Diffuse, Specular, Shineness (Sphere, Cone, Tetrahedron, Teapot) - C++(MFC) Source / OpenGL을 이용한 광원의 위치와 주변광, 확산광, 반사광, 물체의 재질 테스트

Created Date : 2006.10
Language : C++(MFC)
Tool : Visual C++ 6.0
Library & Utilized : OpenGL
Reference :  OpenGL reference
etc. : -

This program is made for testing OpenGL properties.
The code test Light Position, Ambient, Diffuse, Specular and Surface Roughness.
I have made the program form view style interface.
We can adjust values by slide bar.
You can download entitle source code. < Here >


If you have good idea or advanced opinion, please reply me. Thank you
(Please understand my bad english ability. If you point out my mistake, I would correct pleasurably. Thank you!!)
Lighting Position Test

Ambient, Diffuse, Specular, Shininess Test

-------------------------------------------------------

OpenGL을 이용하여 광원의 위치와 주변광, 확산광, 반사광, 물체의 재질을 테스트 해 볼수 있는 프로그램입니다.
전체 소소는 여기서 받을 수 있습니다.


좋은 의견 어떤 글이든 답변 남겨주세요

감사합니다.

f(N) counts number of '1'. For example f(13) = 6. So f(1)=1. What next number do satisfy the rule?



f(N) counts number of '1'. For example f(13) = 6. So f(1)=1. What next number do satisfy the rule?


---------------------------------------------------


양수 n에 대해서 1과 n 사이에 1이 나오는 횟수를 나타내는 함수를 f(n)이라고 한다. 예를 들어 f(13)=6이다. f(n)=n이 되는 첫번째 양수는 1이다. 두번째 양수는 무엇인가?


8/25/2011

Shape from Shading Matlab and C++(MFC) source

Created Date : 2007.8
Language : Matlab / C++(MFC)
Tool : Matlab / Visual C++ 6.0
Library & Utilized : - / OpenGL
Reference :  Shape from Shading, Photometric Stereo reference
etc. : -

Shading Source Images

Depth Image                            Normal Vector

Shading Source Images

Depth Image                            Normal Vector


Shading Source Images

Depth Image                            Normal Vector


This program make 3D shape using several different source of light.
The result is normal vector figure and 3D depth image.
This method is alternatively called as Photometric stereo.


You can download entire source code.
here -> https://github.com/MareArts/ShapeFromShading




If you have good idea or advanced opinion, please reply me. Thank you
(Please understand my bad english ability. If you point out my mistake, I would correct pleasurably. Thank you!!)



---------------------------------------------------------------------------

6개의 광원과 모델을 이용하여 3D 형상으로 복원하는 프로그램
3D 형상은 각 픽셀의 depth와 normal 방향을 계산하여 드로잉한다.
Photometric stereo 기법 이라고도 함.

여기서 전체 소스를 다운 받을 수 있습니다. <Matlab> < C++(MFC) >


좋은 의견 어떤 글이든 답변 남겨주세요

감사합니다.

8/24/2011

Canny Edge C++ source / 캐니 에지 프로그램 소스

Created Date : 2007.9
Language : C++
Tool : Visual Studio C++ 6.0
Library & Utilized : -
Reference :  Canny Edge's Paper and Reference tutorial
etc. : -







1. Input
First, enter the file name of bmp format.
And input parameters. (sigma value, Hysteresis low, high value. Default values are 1.0, 20, 80 respectively).

2. Results
3 files saved in your folder that direction is same with exe file location.
Origin Image

One is differential of Gaussian image and the others are NonMax Supression and Hysteresis image.

You can download entire source code.
< source code >




If you have good idea or advanced opinion, please reply me. Thank you
(Please understand my bad english ability. If you point out my mistake, I would correct pleasurably. Thank you!!)------------------------------------------------------

1. DOG 부분
마스크를 만든다.
마스크를 이미지에 회선하면서 컨볼루션한다. 한번 회선할 때 가로, 세로에 대하여 모두 연산함 2. NonMax Supression 부분
에지의 방향의 노말방향에 대하여 좌우 픽셀의 밝기보다 큰지 작은지를 조사한다.
∴단 기존의 방법으로 인접한 같은 픽셀값은 최대값을 찾지 못하고 손실되기 때문에, 인접한 픽셀값을 만났을 때는 자기 자신을 -1하여 값을 낮춘다.
예) 55 100 100 100 55 -> 55 99 100 100 55 -> 55 99 99 100 55 -> 0 0 0 100 0

3. Hysteresis Thresholding 부분
에지의 방향에 대하여 픽셀은 추적하면 에지의 방향과 픽셀의 위치가 다르기 때문에 끊어지는 현상이 자주 발생하므로 에지의 방향을 이용하지 않고 잔디에 불을 붙여 연결된 픽셀을 추적하는 GlassFire 방법을 사용하여 High값과 Low값의 개념을 그대로 적용하여 사용한다.
tempImg라는 임시 버퍼를 하나 만들어 방문했던 픽셀의 위치에 대하여 표시를 해둔다.
danji()함수는 재귀호출로 인접한 픽셀을 모두 검색해준다.
danji()함수는 8방향에 대하여 Low값보다 큰 픽셀에 대하여 불을 붙이듯 재귀호출을 하여 선을 이어간다.

▣ 인터페이스 설명
실행 파일을 실행하여 파일명, 시그마값, Hysteresis의 low, high값을 입력한다.
결과는 DOG.bmp, NonMax.bmp, Hysteresis.bmp 로 세 개의 이미지가 저장된다.

여기서 전체 파일을 받을 수 있습니다.
< source code >

좋은 의견 어떤 글이든 답변 남겨주세요


DOG

NonMax

Hysteresis



8/23/2011

AdaBoost Matlab source for understanding easy/ 아다부스트 알고리즘을 쉽게 이해할 수 있는 매트랩 소스


Created Date : 2006.7
Language : Matlab
Tool : Matlab
Library & Utilized : -
Reference :  {Paul Viola & Michael Jone}'s Paper
etc. : -




This source is made for AdaBoost algorithm understanding easy, when I prepared master's thesis.
First picture is the window for inputting data. If you click left button, positive(+1) data is inputted and right button is for inputting negative(-1) data.
After inputting all data, enter the any then boosting start.
Second image is the result of learning. All data(in this case, position is data) is determined as positive(+1) or negative(-1).

You can download this source <here>.

Plz reply your opinion.
Thank you.

(Please understand my bad english ability. If you point out my mistake, I would correct pleasurably. Thank you!!)


------------------------------------------------------

AdaBoost 작동 원리를 심플하게 파악할수 있는 매트랩 소스
AdaBoostMatlab 매트랩 파일을 열어서 - f5키 실행
Figure 새창이 떳을때 왼쪽 클릭(+1 클래스), 오른쪽 클릭 (-1 클래스)으로
평면에 학습 데이터 샘플을 지정해준다. 많이 해도 상관없음
학습데이터 샘플을 원하는 만큼 만든 다음 엔터키를 누르면 부스팅 시작
학습이 끝난다음 평면에서 모든 좌표에 대하여 +1 클래스인지 -1 클래스인지를 판단하여 색으로 표현한다. 이것이 학습에 대한 검출 끝.
AdaBoostMatlab.m 말고 다른 파일들은 그냥 만들면서 테스트한 파일들인데 참고하시고 아다부스트에 필요하지는 않습니다.

여기서 이 소스를 다운 받을 수 있습니다. <here>

좋은 의견이나 개선사항 어떤 글이든 답변 남겨주세요.
감사합니다.

8/22/2011

Mini PhotoShop / Image Processing Tool / C++ source (MFC) / 미니 포토샵, 이미지 프로세싱 툴


Created Date : 2003.3
Language : C/C++
Tool : Microsoft Visual C++ 6.0 (MFC)
Library & Utilized : -
Reference :  Simplified approach to image prcessing book -Randy Crane-
etc. : Bmp Image Files







Many ages ago, when I studied image processing firstly, I made this program for training programming skill and studying  image processing.

This program include variety image processing functions.
For example

Filter function - blur,highpass, median, embossing, edge gaussian noise, morphology, the window that support preview function and the value of mask.
Geometry function - flip, rotation, zoom in/out
Channel split - RGB, HSI, CMYK, YIQ, YUW, YUV, YCbCr, the window that support preview function.
Color adjustment - Contrast, Brightness, HSI, Gamma, Red-Green tint, Reference, colorfulness
Histogram - binary, logarithm, auto contrast strech, end in contrast stretch.
etc - undo,redo function, skin color detection, labeling

You can download entire source code -> <Here>

Plz reply your opinion.
Thank you.

(Please understand my bad english ability. If you point out my mistake, I would correct pleasurably. Thank you!!)


-----------------------------------------------------


처음 영상처리 공부를 시작했을 때 프로그래밍과 이미지 처리 방법을 공부하기 위해 만든 프로그램 입니다.

이 프로그램은  bmp 파일포맷을 자유롭게 다룰수 있는 클래스를 제작하여 다음과 같은 여러가지 이미지 처리 기능을 구현했습니다.
필터기능 - blur,highpass, median, embossing, edge gaussian noise, morphology.
필터결과와 마스크값을 미리보기 기능창.
이미지조작 - 플립, 반전, 회전, 확대, 축소
체널 분리 - RGB, HSI, CMYK, YIQ, YUW, YUV, YCbCr, 분리된 채널을 한눈으로 볼수있는 기능창.
색조절 - Contrast, Brightness, HSI, Gamma, Red-Green tint, Reference, colorfulness.
히스토그램 - 이진화, logarithm, auto contrast strech,end in contrast stretch.
기타 - undo,redo기능 살색추출, 라벨링.

이 프로그램은 여기에서 받을 수 있습니다. <Here>

개선 사항이나 좋은 의견 있으시면 답변 주세요.
감사합니다.


8/21/2011

Two Image mosaic (paranoma) based on SIFT / C++ source (OpenCV) / SIFT 특징 추출기를 이용한 두장의 영상을 모자익(파라노마) 영상으로 만들기

Created Date : 2011.2
Language : C/C++
Tool : Microsoft Visual C++ 2010
Library & Utilized : OpenCV 2.2
Reference : Interent Reference
etc. : 2 adjacent images


two adjacent iamges

Feature extraction by Surf(SIFT)

Feature matching

Mosaic (paranoma)

This program is conducted as follow process.
First, the program finds feature point in each image using SURF.
->cvExtractSURF
Second, feature points on each images is matched by similarity.
->FindMatchingPoints
Third, We get the Homography matrix.
->cvFindHomography
Last, we warp the image for attaching into one image.
->cvWarpPerspective

You can download source here.
If you have good idea or advanced opinion, please reply me.
Thank you.

-----------------------------------------------------------------------------

이웃된 두 장의 영상을 입력 받아 하나의 모자이크 영상(파라노마)으로 만든다.
특징 추출 및 비교 방법 : suft ->cvExtractSURF
특징 매칭 방법 : FindMatchingPoints
호모그라피 행렬 구하기 : cvFindHomography
영상 모자이크 방법 : warpping

전체 소스 코드는 여기서 받을 수 있습니다.
https://github.com/MareArts/Two-Image-mosaic-paranoma-based-on-SIFT
개선 사항이나 좋은 의견 있으시면 답변 주세요.
감사합니다.

< gist >

< /gist >