영상 획득 영상 저장 카메라 파라메터 커스텀 이미지

Slides:



Advertisements
Similar presentations
The Practice of Micro-processor Yonam Institute of Digital Technology 06. LCD Control.
Advertisements

FND, Keypad 사용 계산기 설계 박민호.
Ch 7. Spring EL (Spring Framework 3.0 M3) 백기선
6장 리눅스 쉘 정보보안 연구실 김동민.
RefWorks 15 분 완성. 순서 1) 계정 만들기 2) 레퍼런스 가져오기 3) 새 폴더 만들기 4) 폴더에 레코드 구성하기 5) 텍스트 파일반입 방식 6) 참고문헌 가져오기 7)Write-N-Cite III 을 사용하여 본문 내 인용 및 참고문헌 만들기.
강성재 Developer Evangelist Microsoft Korea D&PE 개발자 관점에서 바라본 SQL Server 2005 (2)
콘솔 케이블을 이용한 NESPOT AP 개통절차 엠엠씨 - 통합형 MW-3000AP Nespot 개통기량 향상을 위한 길라잡이.
XML Query Processing Data Warehousing Lab. M.S. 2 Hyeyoung Cho.
 Universal Serial Bus 컴퓨터와 주변기기를 연결하는 데 쓰이는 입출력 표준 가운데 하나 (USB 1.0, 1.1, 2.0, 3.0 등 )
프로그래밍 기초와 실습 Chapter 7 Enumeration Types and typedef.
Term Project Detail Design 2 Traffic Generator So Jung LEE Dpnm Lab. CSE POSTECH
Database Programming의 원리
KyungHee Univ. 1-0 문자열 입 · 출력 프로그램 작성 예. KyungHee Univ. 1-1  모니터에 문자열 출력 하는 프로그램 작성  표준 출력 장치에 문자를 출력 하는 함수 함수의 기본형 : void SCI_OutChar(letter)  문자를.
SAP Tuning 실무 교육
Computer Programming in C Chapter 년 가을학기 부산대학교 정보컴퓨터공학부.
Copyright Networking Laboratory C programming and Data Structures Overview T. H. Cormen, C. E. Leiserson and R. L. Rivest Introduction to Algorithms,
ISLab Flash Team Flash File System Ban,A US Patent 5,404,485 한국외국어대학교 컴퓨터및정보통신공학과 박 성 환.
C# 3.0 & LINQ 천호민 Visual C# MVP zmeun.tistory.com.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 실 습실 습 6 WEEK 1 - INTRODUCTION TO VOID FUNCTIONS (PROCEDURES)
The Knowledge Flow Interface 김개원 데이터베이스 연구실. 1. Overview.
HDFS -Hadoop Overview 유현정. Data Replication HDFS’s blocks in a file except the last block are the same size. The block size and replication.
2012 내장형 시스템 설계  Full Color LED 디바이스 구성  Full Color LED 디바이스 드라이버  Full Color LED JNI 라이브러리 작성  Full Color LED 안드로이드 App 구현  JNI 라이브러리.
5. Serial Communication 충북인력개발원 전자과 공학박사 강원찬.
School of Computer, Information and Communication Engineering
© 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5/e Starting Out with C++: Early Objects 5 th Edition Chapter 2 C++
Linux/UNIX Programming APUE (Introduction) 문양세 강원대학교 IT 대학 컴퓨터과학전공.
InfiniBand 를 통한 4K SDI data 전송 Framing (ver 0.5) ㈜ 스마트구루 ( 약칭 MP4RD)
Many-SC 아키텍처 기반 OpenCL 프레임워크상에서의 응용프로그램 구현 및 최적화
Kim, Sung-Ho School of Computer, Information and Communication Engineering Sangji Univ.
Database Programming. 2 Contents n Overview (Architecture) n Problems n DB 와의 연결 방식 n Middleware Architecture –ODBC, JDBC, Perl DB n Programming Examples.
HyperText Markup Language (HTML) Internet Computing KUT Youn-Hee Han.
IT CookBook, 초보자의 첫 번째 엑셀 2007 엑셀 2007 기초. 2 이 장에서 배울 내용  Section 01 엑셀 2007 기본 기능 익히기  Section 02 데이터 입력 및 편집  Section 03 워크시트 편집 및 관리  Section 04.
ARToolKit Settings The department of Computer Engineering Shin ho hwan.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 실 습실 습 3.
프로그래밍 기초와 실습 Chapter 6 The Fundamental Data Types.
Interrupt. incoming Lab. Interrupt an asynchronous signal indicating the need for attention hardware interrupt/software interrupt call “interrupt service.
1 Router 동작 mode (1/2) User Mode Router 동작 상태, Interface 의 상태, 현황등을 check 할 수 있는 command 사용 가능 Router Configuration 의 변경은 불가 Privileged Mode Router 의 Full.
9 주 실습강의 XML Visualization(1) 학기, 소프트웨어 설계 및 실험 ( Ⅰ )
개정번호개정장개정내역작성자시행일자 0.1 전체 시작강선영 Demux Part 추가 “ 개정이력 Jaram TS Reader 문서번호버전 0.1 쪽 1 작성자강선영최종수정일자 작업단계시스템 모듈.
C++ 0x 달려 BOA 요 ~ 아. 꿈. 사 비밀 모임 발표 : 김연기. 발표자 는 뉴규 ? 김연기 아. 꿈. 사 오후반 스터디 그룹 장소 예약 담당 (Pattern Oriented Software Architecture 2) ~ Microsoft Visual.
11장 LDS2000 임베디드 실습.
Kernel Programming Task Management ( 월 ) 이 병 희
CHAP 8. 고급 그래픽과 O PEN GL. © 2012 생능출판사 All rights reserved C ANVAS 클래스와 P AINT 클래스.
Ubiquitous Computing Practice - Part 4(RSSI) - Laboratory of Intelligent KUT ( Yong-hwan Kim Spring.
Real-Time Computing and Communications Lab., Hanyang University Real-Time Computing and Communications Lab., Hanyang University.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 실 습실 습 7 WEEK 1 – 구조체 (STRUCTURES)
Chap 11. Raster Graphics in OpenGL. Chap 11. Raster Graphic in OpenGL2 Content Draw bitmap image Use bitmap fonts Draw color images Read and copy color.
쉽게 풀어쓴 C언어 Express 제14장 포인터 활용 C Express.
Buffer Overflow 공격의 이해 송치현 제 11회 해킹캠프.
Multimedia Programming 04: 점, 선, 면
Go by Example Closures ~ Errors , Sam Jo.
Chapter 10. 구조체와 리스트 처리 10.1 자기참조 구조체
방명록 제작. 목차  기본 레이아웃  DB 구조  방명록 구조  코드 설명  화면 설명.
운영체제 실습 - Reader/Writer 문제 구현하기 -
Chapter 6 구조체. 구조체 struct Point { int x;// x좌표 int y;// y좌표 }; struct Customer { char name[10];// 이름 char phone[20];// 전화번호 char address[50];// 주소 int.
1 Visual C 영상처리 프로그램 (MDI) BMP 파일 불러오기 이미지 픽셀 다루기.
Chap.6.3 UART.
 Linux-2.6.x/drivers/input/touchscreen  드라이버를 변경하여 Mouse mode 에서 그림을 그리도록 하자.
May.28 1 Multimedia Lab  만나는 곳의 Junction 이 제대로 생겼는지 확인할 것.
신소재 이 준 호. (Program Process) 1. Fe-Si-C 각 원소 wt%  u-fraction 초기화 2. Diffusion coefficient, chemical potential 정의 3. Finite Differential Method.
모 바 일 임 작 한국 IT 전문학교 박재성 게 제. 7 장 Flying Owl 모 바 일 임 작 게 제.
Machine Vision The goal of Machine Vision is to create a model of the real world from images – A machine vision system recovers useful information about.
충북인력개발원 전자과 공학박사 강원찬 2. Interrupt & LCD. uP AVR (Atmega128) - 2 -
J2ME Programming. Java2 Micro edition Introduction 년 5 월 26 일 CLDC, MIDP 라이브러리 Reference :
CHAP 8. 그래픽. © 2012 생능출판사 All rights reserved 안드로이드에서의 그래픽 XML 파일로 그래픽이나 애니메이션을 정의한다. 그 리는 작업은 안드로이드 시스템이 담당한다. onDraw() 메소드 안에 draw...() 와 같은 메소드를 호.
C++ Lesson 1.
What are Range Images?.
Programming Language C Language.
Type compatibility and pointer operation
C++ Programming: review on C: Pointer and malloc
Presentation transcript:

영상 획득 영상 저장 카메라 파라메터 커스텀 이미지 Flycapture API 영상 획득 영상 저장 카메라 파라메터 커스텀 이미지 ㈜ 싸이로드 사업팀 기술지원

SW Requirements MS Visual C++ Version 6.0 Windows 2000 Service Pack 4 (Windows XP Service Pack 1 권장)

FC API Type Definitions FlycaptureContext FlycaptureImage

FC API Type Definitions FlycaptureContext PGRFlycapture Library를 위한 Context Pointer typedef void* FlycaptureContext

FC API Type Definitions FlycaptureImage 이미지의 정보를 저장하는 구조체 struct FlycaptureImage { int iRows; // 이미지의 세로 픽셀수 int iCols; // 이미지의 가로 픽셀수 int iRowInc; // 바이트수/가로 FlyCaptureVideoMode videoMode; // 캡쳐되었을때 비디오모드 FlyCaptureTimestamp timeStamp; // 이미지의 타임스탬프 unsigned char* pData; // 실제 이미지데이터를 가르키는 포인터 bool bStippled; FlyCapturePixelFormat pixelFormat; unsigned long ulReserved[6]; }

Flycapture API Functions Construction/Destruction flycaptureCreateContext : FlyCaptureContext를 생성 flycaptureDestroyContext : FlyCaptureContext를 Destroy flycaptureInitialize : 카메라와 FlyCaptureContext를 연결 flycaptureInitializePlus (External Function) : 카메라와 FlyCaptureContext를 연결 (버퍼의 크기와 수를 설정할 수 있음)

Flycapture API Functions Control Functions flycaptureStart : 그랩 프로세스 시작 flycaptureStop : 그랩 프로세스 종료

Flycapture API Functions Image Related Functions flycaptureGrabImage : 버퍼에서 가장 최근의 데이터를 획득 flycaptureGrabImage2 : 위의 함수와 같은 역할을 하지만 좀 더 쉽게 데이터를 획득 가능 flycaptureConvertImage : 임의의 이미지 포맷을 다른 포맷으로 변경 Other Functions flycaptureBusEmulationCamera : 1394 버스에 있는 카메라들의 정보를 획득.

동작절차 FlycaptureContext FlycaptureImage buffer flycaptureGetCamera Property, Register flycaptureSetCamera Property, Register flycaptureCreateContext flycaptureInitialize flycaptureStart flycaptureGrabImage flycaptureStop flycaptureDestroyContext 카메라로 부터 이미지 획득하는 프로세스 종료 Context 생성 Memory Context Destroy 카메라와 Context 연결 FlycaptureContext FlycaptureImage buffer Buffer에서 가장 최근 획득한 이미지를 FlyCaptureImage에 저장 IEEE 1394 BUS IEEE 1394 BUS 카메라로 부터 이미지 획득하는 프로세스 시작

간단한 Grab Program VC++ 설정 코드, 순서도

Visual C++ Setting 라이브러리 링크 Project->Settings->Link탭 -> Object/Library modules 에 pgrflycapture.lib pgrflycapturegui.lib 추가

Visual C++ Setting 헤더파일 추가 #include "pgrerror.h“ #include "pgrflycapture.h“ #include "pgrcameragui.h“ #include "pgrflycaptureplus.h"

VC++ Code, Diagram void CGrabDlg::On?????() { FlyCaptureContext fContext; FlyCaptureImage fImage; // initialize flycaptureCreateContext(&fContext); flycaptureInitialize(fContext,0); // start flycaptureStart(fContext,FLYCAPTURE_VIDEOMODE_ANY, FLYCAPTURE_FRAMERATE_ANY); // image grab flycaptureGrabImage2(fContext,&fImage); // image processing // stop flycaptureStop(fContext); // destroy flycaptureDestroyContext(fContext); }

Grab된 영상 출력 위의 코드에서 // image processing 부분에 아래와 같은 코드를 추가 FlyCaptureImage fImageRGB; // fImageRGB 변수 선언 fImageRGB.pixelFormat=FLYCAPTURE_BGR; // fImageRGB의 픽셀포맷을 BGR형으로 선언 fImageRGB.pData=new unsigned char[1024*768*3]; // 영상 저장 공간 확보 flycaptureConvertImage(fContext,&fImage.image,&fImageRGB); // 이전에 그랩된 영상을 fImageRGB의 // 픽셀 포맷 형태로 변환 StretchDIBits( // StretchDIBits 함수를 통해 영상을 화면에 출력 pdc->m_hDC, 0, 768, 1024, -768, cImg, (LPBITMAPINFO)bmp, DIB_RGB_COLORS, SRCCOPY);

Grab된 영상 저장 flycaptureSaveImage 함수 사용 flycaptureSaveImage(FlyCaptureContext context, const FlyCaptureImage * pImage, const char* pszPath, FlyCaptureImageFileFormat format) pszPath : 파일을 저장할 파일의 이름 format : 저장할 파일의 형식 FLYCAPTURE_FILEFORMAT_BMP - 비트맵 파일 FLYCAPTURE_FILEFORMAT_JPG - JPG 파일 FLYCAPTURE_FILEFORMAT_PGM - PGM 파일 FLYCAPTURE_FILEFORMAT_PNG -PNG 파일 FLYCAPTURE_FILEFORMAT_PPM - PPM 파일 FLYCAPTURE_FILEFORMAT_RAW - RAW 파일 ex) 이전 코드의 // image processing 부분에 아래와 같은 코드를 추가 flycaptureSaveImage(fContext,&fImage,"C:\\test.bmp",FLYCAPTURE_FILEFORMAT_BMP);

Camera Parameter 변경 flycaptureSetCameraProperty, flycaptureGetCameraProperty 함수 사용 flycaptureGetCameraProperty - 카메라 파라메터 값을 획득 flycaptureSetCameraProperty - 카메라 파라메터 값을 설정 카메라가 초기화된 후(flycaptureInitialize 함수가 수행된 후) 사용 가능 flycaptureGetCameraProperty(FlyCaptureContext context,FlyCaptureProperty cameraproperty, long* lValueA, long* lValueB, bool* bAuto); lValueA - 첫번째 인자값 lValueB - 두번째 인자값 bAuto - auto 모드 상태 (auto로 설정되어 있을 경우 카메라가 값을 자동으로 설정) cameraproperty – 획득할 카메라의 파라메터 FLYCAPTURE_GAIN FLYCAPTURE_SHUTTER FLYCAPTURE_BRIGHTNESS FLYCAPTURE_WHITE_BALANCE FLYCAPTURE_GAMMA 등

Camera Parameter 변경 ex) 위의 코드 //initialize 부분 끝에 다음과 같은 코드 추가 flycaptureSetCameraProperty(FlyCaptureContext context,FlyCaptureProperty cameraproperty, long lValueA, long lValueB, bool bAuto); lValueA - 첫번째 인자값 lValueB - 두번째 인자값 bAuto - auto 모드 상태 (auto로 설정되어 있을 경우 카메라가 값을 자동으로 설정) ex) 위의 코드 //initialize 부분 끝에 다음과 같은 코드 추가 long gainA=0; long gainB=0; bool gainAuto=0; flycaptureGetCameraProperty(m_flyCaptureContext,FLYCAPTURE_GAIN,&gainA,&gainB,&gainAuto); // 카메라에 설정된 Gain값을 획득 flycaptureSetCameraProperty(m_flyCaptureContext,FLYCAPTURE_GAIN,10,0,0); // Gain값을 10으로, Auto모드를 사용하지 않는것으로 설정

Custom Image Grab 프로세스를 시작할때, flycaptureStart함수 대신에 flycaptureStartCustomImage 함수를 사용하여 ROI, BINNING 기능 구현 flycaptureStartCustomImage(FlyCaptureContext context, unsigned int uiMode, unsigned int uiImagePosLeft, unsigned int uiImagePosTop, unsigned int uiWidth, unsigned int uiHeight float fBandWidth, FlyCapturePixelFormat format) uiMode - 카메라의 특정 모드(0: ROI, 1:BINNING) uiImagePosLeft, uiImagePosTop – 이미지의 왼쪽, 위의 위치 uiWidth, uiHeight – 이미지의 가로, 세로 fBandWidth – 전송하기위한 카메라의 최대 대역폭 fomat – 사용하려는 픽셀포맷 FLYCAPTURE_RAW8, FLYCAPTURE_RAW16 FLYCAPTURE_MONO8, FLYCAPTURE_MONO16 등

Custom Image ex) 위의 코드 //start 밑의 flycaptureStart() 함수를 아래와 같이 대체 flycaptureStartCustomImage(fContext,0,120,108,688,496,100,FLYCAPTURE_MONO8); // 이미지의 좌표(120,108)에서 가로 688, 세로 100의 영역을 ROI모드로 그랩. 픽셀포맷 MONO8