영상신호처리 : HW5 Moment Invariant Function
- 최초 등록일
- 2015.11.09
- 최종 저작일
- 2015.04
- 12페이지/ 한컴오피스
- 가격 1,500원
목차
1) MIF 버튼 생성하기
2) 주어진 영상 읽기
3) M2, M3 구하기
4) Moment_ALL 함수 작성
5) 특징공간에서의 12개 점 표시하기 (이론)
6) 특징공간에서의 12개 점 표시하기 (실습)
7) Principal axis 각도를 계산하고 회전하여 수평으로 보상된 영상 display 하기
8) DISCUSSION
본문내용
1) MIF 버튼 생성하기
첫 번째 과제를 하기 위한 MIF 버튼 생성은 과제에서 주어진 Mif cpp 파일을 그대로 사용하였다. Mif.cpp 는 아래와 같다.
void CHomework::OnClickedMif()
{
CMainFrame *pMainFrame=(CMainFrame *)AfxGetMainWnd();
CChildFrame *pChildFrame=(CChildFrame *)pMainFrame->MDIGetActive(NULL);
CImageProcessingView *pView = (CImageProcessingView *)pChildFrame->GetActiveView();
CDC *dc = pView->GetDC();
int x0, y0, w, h;
BYTE **img;
double M2, M3, theta;
char msg[128];
GetCurrentImageInfo(&w, &h, &x0, &y0);
img = cmatrix(h, w);
GetCurrentImageGray(img);
Compute_Moment_Invariant_Function(img, w, h, &M2, &M3, &theta);
sprintf(msg, "%9.3f, %9.3f ", M2, M3);
dc->TextOut(x0, y0+h+10, msg, strlen(msg));
free_cmatrix(img, h, w);
pView->ReleaseDC(dc);
}
<중 략>
4) Moment_ALL 함수 작성
void CHomework::OnClickedMifAll()
{
CMainFrame *pMainFrame=(CMainFrame *)AfxGetMainWnd();
CChildFrame *pChildFrame=(CChildFrame *)pMainFrame->MDIGetActive(NULL);
CImageProcessingView *pView = (CImageProcessingView *)pChildFrame->GetActiveView();
CDC *dc = pView->GetDC();
참고 자료
영상처리를 위한 C++ 프로그래밍 / 이대호, 박영태 저 / 인터비젼 / MIF P.302 ~
Digital Image Processing / 2nd Ed / R.C. Gonzalez and R.E. Woods
수업자료 / Digital Image Processing / 컴퓨터비젼 연구실 / P.137~