http://blog.naver.com/eotls4387/30033016323

vector는 배열과 비슷한데, 사이즈를 자유자재로 바꿀 수 있고, 정렬도 가능

vector를 사용하기 위해 아래가 필수..

#include <vector>
using namespace std; // 요걸 반드시 써줘야함..

Posted by 우주여행가
,
간혹 c로 작성된 소스의 특정 함수내에서 어떤 변수가 어떤 값을 갖는지 궁금할 때가 있다.

어떻게 확인하느냐는 스타일 나름인데.. 난 디버깅보다는 Afxmessagebox() 사용을 선호한다. 
(breakpoint 잡기의 귀차니즘으로..)

하지만 cpp가 아닌 c로 작성된 소스에서는 Afxmessagebox()를 쓸 수 없으므로

Messagebox()를 사용하면 된다.

MessageBox를 사용하기 위해서는

#include <windows.h> 를 추가

int MessageBox(HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType)


첫번째 인수 hWnd는 메시지 박스를 소유한 윈도우, 이 윈도우의 중앙에 메시지 박스가 나타난다.
특별한 이유 없다면 NULL을 쓰면 된다.

두번째 인수 lpText : 출력할 문자열

세번째 인수 lpCaption : 메시지박스의 이름 (아무거나 해도 무방)

네번째 인수 uType : 아이콘, 버튼 등을 선택 , MB_OK 로 하면 OK버튼이 나온다... 

헉.. 근데..MB.... OK ??????????


중요한것은 두번째 인수인데..


예를 들어 MFC 기반의 c++ 이라면 


double v 의 값을 알고 싶다면..


CString chk;

chk.Format("v = %lf", v);

AfxMessageBox(chk)를 통해 v의 값을 알아낼 수 있다.



MessageBox의 경우라면..


char *gcvt(double value, int ndec, char *buf); 이 함수를 이용하면 된다.

 첫번째 인자는 변환할 double형 값입니다.
두번째 인자는 전체 몇자리를 문자열로 바꿀것인가를 지정합니다.
세번째는 바꾼 문자열이 저장될 버퍼입니다.
리턴값은 buf로 주어진 버퍼의 포인터입니다.

출처 : 

http://kin.naver.com/qna/detail.nhn?d1id=1&dirId=1040101&docId=68359592&qb=TFBDVFNUUiBkb3VibGU=&enc=utf8&section=kin&rank=2&search_sort=0&spq=0&pid=gnHU/doi5U4ssuvk4c4sss--153210&sid=TP5SvPNL-kwAADRVEI4



char buf[256];
gcvt(v, 10, buf);

MessageBox (NULL, buf, "title", MB_OK);


이런식..




Posted by 우주여행가
,
CWinAppEx VS2008 Sp1설치 후 
MFC project를 생성하면 Wizard가 생성하는 code중 약간 바뀐 부분이 있습니다.

App는 CWinAppEx(기존에는 CWinApp를 상속)를 상속받고
stdafx.h에 #include <afxcontrolbars.h>가 추가됩니다.

그런데 문제는 VS2008 sp1에서 생성한 project를
VS2008 sp1이 설치되지 않은 computer에서 compile할 경우
Error가 발생한다는 점입니다.
stxafx.h에 afxcontrolbars.h를 찾을 수 없어 Compile Error가 발생합니다.

이 때는 간단히 수정할 수 있습니다.
1. CWinAppEx를 CWinApp로 고치고
2. #include <afxcontrolbars.h>를 삭제해줍니다.

그런데 의문이 드는 것은
MSDN에서 CWinAppEx를 찾아보니 afxwinappex.h를 필요로 하고 있습니다.
왜 VS2008가 afxcontrolbars.h를 include했는지 궁금하네요

한번 찾아봐야겠네요

Posted by 우주여행가
,
Rob Hess의 SIFT open source를 보다가..

kdtree.c 에

함수 static struct kd_node* explore_to_leaf( struct kd_node* kd_node, struct feature* feat,
struct min_pq* min_pq )

에서 오류를 발견하였다.

이 함수에 아래와 같은 라인이 있는데..
if( minpq_insert( min_pq, unexpl, ABS( kv - feat->descr[ki] ) ) ) 

여기서 Rob Hess가 사용하고 있는 utils.h에서 ABS의 정의는 

#ifndef ABS
#define ABS(x) ( ( x < 0 )? -x : x )
#endif

사실 올바른 정의는 

#ifndef ABS
#define ABS(x) ( ( x < 0 )? -1*(x) : x )
#endif

이다.


이런식으로 정의를 안했기에..

ABS( kv - feat->descr[ki]) 에서 
kv - feat->descr[ki] 가 음수일경우

-kv + feat->descr[ki] 로 양수값으로 key가 들어가지 않고

-kv - feat->descr[ki] 로 음수의 key값이 들어간다. 

ABS의 정의를 고치던..


ABS( kv - feat->descr[ki] )를  ABS( (kv - feat->descr[ki]) )

로 고쳐야한다..

사실 BBF의 NN 탐색회수가 KDTREE_BBF_MAX_NN_CHKS = 200 으로 default 값으로 
define 되어있어서 영상에 feature points가 많지 않다면 성능에 크게 지장은 없다.

하지만 minimizing priority queue에서 key (항상 양수) 값을 기준으로 정렬하는데,

여기 음수인 key값이 들어간다면 BBF를 이용한 matching 과정에서 

실제로 가깝지 않은 node들이 가깝다고 판단되어 탐색하게 되는 비효율성이 발생하게 된다.

이 경우, KDTREE_BBF_MAX_NN_CHKS  를 낮게 설정하였거나

영상의 전체 feature points 갯수가 충분히 많다면 성능에 큰 영향을 끼칠 수도 있다.


- Rob Hess의 답장



- Update된 SIFT


- Change log
12/7일 ABS() bug 고쳤다고..


Posted by 우주여행가
,

Computer Vision Open Source Algorithm Implementations
http://www.cnblogs.com/seacode/archive/2010/05/08/1730599.html
Participate in Reproducible Research
WARNING: this page is not and will never be exhaustive but only try to gather robust implementations of Computer Vision state of the art


(back to computer vision resource) 
If you have additions or changes, send an e-mail (remove the "nospam").

Changelog 

RSS feed. If you have any issue please send an e-mail (remove the "nospam"). 
This material is presented to ensure timely dissemination of computer vision algorithms. Copyright and all rights therein are retained by authors or by other copyright holders. All persons copying this information are expected to adhere to the terms and constraints invoked by each authors copyright. 

General Image Processing
OpenCV 
(C/C++ code, BSD lic) Image manipulation, matrix manipulation, transforms 
Torch3Vision 
(C/C++ code, BSD lic) Basic image processing, matrix manipulation and feature extraction algorithms: rotation, flip, photometric normalisations (Histogram Equalization, Multiscale Retinex, Self-Quotient Image or Gross-Brajovic), edge detection, 2D DCT, 2D FFT, 2D Gabor, PCA to do Eigen-Faces, LDA to do Fisher-Faces. Various metrics (Euclidean, Mahanalobis, ChiSquare, NormalizeCorrelation, TangentDistance, ...) 
GradientShop 
(C/C++ code, GPL lic) GradientShop: A Gradient-Domain Optimization Framework for Image and Video Filtering 
ImLab 
(C/C++ code, MIT lic) A Free Experimental System for Image Processing (loading, transforms, filters, histogram, morphology, ...) 
CIMG 
(C/C++ code, GPL and LGPL lic) CImg Library is an open source C++ toolkit for image processing 
Generic Image Library (GIL) - boost integration 
(C/C++ code, MIT lic) Adobe open source C++ Generic Image Library (GIL) 
Image Acquisition, Decoding & encoding 
FFMPEG 
(C/C++ code, LGPL or GPL lic) Record, convert and stream audio and video (lot of codec) 
OpenCV 
(C/C++ code, BSD lic) PNG, JPEG,... images, avi video files, USB webcam,... 
Torch3Vision 
(C/C++ code, BSD lic) Video file decoding/encoding (ffmpeg integration), image capture from a frame grabber or from USB, Sony pan/tilt/zoom camera control using VISCA interface 
lib VLC 
(C/C++ code, GPL lic) Used by VLC player: record, convert and stream audio and video 
Live555 
(C/C++ code, LGPL lic) RTSP streams 
ImageMagick 
(C/C++ code, GPL lic) Loading & saving DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, TIFF, and more 
DevIL 
(C/C++ code, LGPL lic) Loading & saving various image format 
FreeImage 
(C/C++ code, GPL & FPL lic) PNG, BMP, JPEG, TIFF loading 
Segmentation
OpenCV 
(C/C++ code, BSD lic) Pyramid image segmentation 
Branch-and-Mincut 
(C/C++ code, Microsoft Research Lic) Branch-and-Mincut Algorithm for Image Segmentation 
Efficiently solving multi-label MRFs (Readme) 
(C/C++ code) Segmentation, object category labelling, stereo 
Machine Learning
Torch 
(C/C++ code, BSD lic) Gradient machines ( multi-layered perceptrons, radial basis functions, mixtures of experts, convolutional networks and even time-delay neural networks), Support vector machines, Ensemble models (bagging, adaboost), Non-parametric models (K-nearest-neighbors, Parzen regression and Parzen density estimator), distributions (Kmeans, Gaussian mixture models, hidden Markov models, input-output hidden Markov models, and Bayes classifier), speech recognition tools 
Object Detection
OpenCV 
(C/C++ code, BSD lic) Viola-jones face detection (Haar features) 
Torch3Vision 
(C/C++ code, BSD lic) MLP & cascade of Haar-like classifiers face detection 
Hough Forests 
(C/C++ code, Microsoft Research Lic) Class-Specific Hough Forests for Object Detection 
Efficient Subwindow Object Detection 
(C/C++ code, Apache Lic) Christoph Lampert "Efficient Subwindow" algorithms for Object Detection 
Object Category Labelling
Efficiently solving multi-label MRFs (Readme) 
(C/C++ code) Segmentation, object category labelling, stereo 
Optical flow
OpenCV 
(C/C++ code, BSD lic) Horn & Schunck algorithm, Lucas & Kanade algorithm, Lucas-Kanade optical flow in pyramids, block matching 
GPU-KLT+FLOW 
(C/C++/OpenGL/Cg code, LGPL) Gain-Adaptive KLT Tracking and TV-L1 optical flow on the GPU 
Features Extraction & Matching
SIFT by R. Hess 
(C/C++ code, GPL lic) SIFT feature extraction & RANSAC matching 
OpenSURF 
(C/C++ code) SURF feature extraction algorihtm (kind of fast SIFT) 
ASIFT (from IPOL) 
(C/C++ code, Ecole Polytechnique and ENS Cachan for commercial Lic) Affine SIFT (ASIFT) 
VLFeat (formely Sift++) 
(C/C++ code) SIFT, MSER, k-means, hierarchical k-means, agglomerative information bottleneck, and quick shift 
SiftGPU 
A GPU Implementation of Scale Invariant Feature Transform (SIFT) 
Groupsac 
(C/C++ code, GPL lic) An enhance version of RANSAC that considers the correlation between data points 
Nearest Neighbors matching
FLANN 
(C/C++ code, BSD lic) Approximate Nearest Neighbors (Fast Approximate Nearest Neighbors with Automatic Algorithm Configuration) 
ANN 
(C/C++ code, LGPL lic) Approximate Nearest Neighbor Searching 
Tracking
OpenCV 
(C/C++ code, BSD lic) Kalman, Condensation, CAMSHIFT, Mean shift, Snakes 
KLT: An Implementation of the Kanade-Lucas-Tomasi Feature Tracker 
(C/C++ code, public domain) Kanade-Lucas-Tomasi Feature Tracker 
GPU_KLT 
(C/C++/OpenGL/Cg code, ) A GPU-based Implementation of the Kanade-Lucas-Tomasi Feature Tracker 
GPU-KLT+FLOW 
(C/C++/OpenGL/Cg code, LGPL) Gain-Adaptive KLT Tracking and TV-L1 optical flow on the GPU 
Simultaneous localization and mapping
Real-Time SLAM - SceneLib 
(C/C++ code, LGPL lic) Real-time vision-based SLAM with a single camera 
PTAM 
(C/C++ code, Isis Innovation Limited lic) Parallel Tracking and Mapping for Small AR Workspaces 
Camera Calibration & constraint
OpenCV 
(C/C++ code, BSD lic) Chessboard calibration, calibration with rig or pattern 
Geometric camera constraint - Minimal Problems in Computer Vision 
Minimal problems in computer vision arise when computing geometrical models from image data. They often lead to solving systems of algebraic equations. 
Camera Calibration Toolbox for Matlab 
(Matlab toolbox) Camera Calibration Toolbox for Matlab by Jean-Yves Bouguet (C implementation in OpenCV) 
Multi-View Reconstruction
Bundle Adjustment - SBA 
(C/C++ code, GPL lic) A Generic Sparse Bundle Adjustment Package Based on the Levenberg-Marquardt Algorithm 
Bundle Adjustment - SSBA 
(C/C++ code, LGPL lic) Simple Sparse Bundle Adjustment (SSBA) 
Stereo
Efficiently solving multi-label MRFs (Readme) 
(C/C++ code) Segmentation, object category labelling, stereo 
Structure from motion
Bundler 
(C/C++ code, GPL lic) A structure-from-motion system for unordered image collections 
Patch-based Multi-view Stereo Software (Windows version) 
(C/C++ code, GPL lic) A multi-view stereo software that takes a set of images and camera parameters, then reconstructs 3D structure of an object or a scene visible in the images 
libmv - work in progress 
(C/C++ code, MIT lic) A structure from motion library 

'연구관련' 카테고리의 다른 글

내 논문이 흥미롭다는 외국인의 메일 ㅋㅋㅋ  (1) 2011.02.24
SiftGPU  (0) 2011.01.17
각종 자료구조 알고리즘 정리  (0) 2010.11.22
JPEG EXIF Orientation 경우의 수  (0) 2010.11.16
SIFT 오픈소스 해석  (0) 2010.11.15
Posted by 우주여행가
,
Dictionary of Algorithms and Data Structures



'연구관련' 카테고리의 다른 글

SiftGPU  (0) 2011.01.17
Computer Vision Open Source Algorithm Implementations  (0) 2010.12.03
JPEG EXIF Orientation 경우의 수  (0) 2010.11.16
SIFT 오픈소스 해석  (0) 2010.11.15
Open CV Reference  (0) 2010.11.11
Posted by 우주여행가
,
Dialog 형식의 프로그램 기준으로

CXXXXXXApp::Initlnstance(() 내부에

AfxInitRichEdit2();

이 함수를 추가해주면 해결된다.
Posted by 우주여행가
,
Tip] gdi+ error, about min, max | OpenCV 2.x
2009.10.22 00:09

2.0 설치하고 기존 프로젝트를 빌드하는중 gdi+ 관련 에러가 나는데....

 

1>c:\program files\microsoft sdks\windows\v6.1\include\gdiplustypes.h(470) : error C3861: 'min': identifier not found
1>c:\program files\microsoft sdks\windows\v6.1\include\gdiplustypes.h(471) : error C3861: 'min': identifier not found

 

기존

#include <cv.h>
#include <highgui.h>
#include <cxcore.h>
#include <GdiPlus.h>

 

 

가 아래 내려와 있으면 min, max 매크로를 openCV 것으로 대체해서 에러가 나더군요.

 

그래서

#include <GdiPlus.h>

#include <cv.h>
#include <highgui.h>
#include <cxcore.h>

 

이런식으로 뒤집으면 됩니다. -_-a

 

너무 간단한거라 -_-;;


출처 : 오픈cv 네이버 카페

Posted by 우주여행가
,
Orientation
The image orientation viewed in terms of rows and columns.
Tag = 274 (112.H)
Type = SHORT
Count = 1
Default = 1
1 = The 0th row is at the visual top of the image, and the 0th column is the visual left-hand side.
2 = The 0th row is at the visual top of the image, and the 0th column is the visual right-hand side.
3 = The 0th row is at the visual bottom of the image, and the 0th column is the visual right-hand
side.
4 = The 0th row is at the visual bottom of the image, and the 0th column is the visual left-hand
side.
5 = The 0th row is the visual left-hand side of of the image, and the 0th column is the visual top.
6 = The 0th row is the visual right -hand side of of the image, and the 0th column is the visual top.
7 = The 0th row is the visual right -hand side of of the image, and the 0th column is the visual
bottom.
8 = The 0th row is the visual left-hand side of of the image, and the 0th column is the visual
bottom.
Other = reserved

음.. 몇가지는 일어날 수 없는 경우네..

'연구관련' 카테고리의 다른 글

Computer Vision Open Source Algorithm Implementations  (0) 2010.12.03
각종 자료구조 알고리즘 정리  (0) 2010.11.22
SIFT 오픈소스 해석  (0) 2010.11.15
Open CV Reference  (0) 2010.11.11
Virtual Pit (가짜 구덩이)  (0) 2010.10.19
Posted by 우주여행가
,
fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?

c소스를 추가 시켰더니 이런 에러가 뜬다..

c소스 상단에 #include "stdafx.h" 를 추가했더니 또 cpp에서만 쓸 수 있는 거라 뭐라뭐라..

그래서 그냥 깔끔하게 아래와 같이 함 

빌드 시 에러

"~~~ fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?"

VC++외의 컴파일러에서 빌드하였거나 다른 스타일(obj c같은 경우?)로 작성된 라이브러리를 링크하면 위와 같은 건방지고 친절한(?) 에러가 발생하는 경우가 있다.

빠른 빌드를 위한 PCH (precompiled header)가 없어서 난다는데,

안내문대로 "stdafx.h"를 include 해주거나

project property -> Configuration Properties -> C/C++ -> Precompiled headers -> Create/Use Precompiled header 를
Not Using Precompiled Headers로 바꿔주면 된다.
(그전에는 아마 Use Precompiled Header (/Yu) 로 되어있을 것이다.)

Posted by 우주여행가
,