검색결과 리스트
프로그래밍 언어 공부/C랑 C++에 해당되는 글 5건
- 2014.11.22 생성자 내에서 추상 함수 (Virtual Function) 호출
- 2014.08.18 Windows에서 반복 폴더 생성(Iterative Folder Making) 쉽게 하기
- 2014.08.13 Boost library 컴파일
- 2014.07.18 Matlab -> OpenCV 알고리즘 변환 노트
- 2013.12.11 C++ 11
http://msdn.microsoft.com/ko-kr/library/s8e39b8h.aspx
생성자 안에서는 아직 상속관계가 형성되지 않아
자식 클래스의 추상 함수가 호출되지 않고 현재 생성자의 추상 함수가 호출된다.
Windows에서 반복 폴더 생성(Iterative Folder Making) 쉽게 하기 (0) | 2014.08.18 |
---|---|
Boost library 컴파일 (0) | 2014.08.13 |
Matlab -> OpenCV 알고리즘 변환 노트 (0) | 2014.07.18 |
C++ 11 (0) | 2013.12.11 |
mkdir 쉘 커맨드 사용.
ex)
bool MakePathIter(string path)
{
#ifdef _WIN32
system((string("mkdir ") + path).c_str());
#endif
return true;
}
생성자 내에서 추상 함수 (Virtual Function) 호출 (0) | 2014.11.22 |
---|---|
Boost library 컴파일 (0) | 2014.08.13 |
Matlab -> OpenCV 알고리즘 변환 노트 (0) | 2014.07.18 |
C++ 11 (0) | 2013.12.11 |
일반 용도 : (/MD 옵션)
mkdir build\amd64\v110
bjam --toolset=msvc-11.0 architecture=x86 address-model=64 link=static runtime-link=static variant=release,debug --without=mpi --without=python --stagedir=build/amd64/v110 stage -j 2mkdir build\x86\v110
bjam --toolset=msvc-11.0 architecture=x86 address-model=32 link=static runtime-link=static variant=release,debug --without=mpi --without=python --stagedir=build/x86/v110 stage -j 2
mkdir build\amd64\v100
bjam --toolset=msvc-10.0 architecture=x86 address-model=64 link=static runtime-link=static variant=release,debug --without=mpi --without=python --stagedir=build/amd64/v100 stage -j 2
mkdir build\x86\v100
bjam --toolset=msvc-10.0 architecture=x86 address-model=32 link=static runtime-link=static variant=release,debug --without=mpi --without=python --stagedir=build/x86/v100 stage -j 2
Matlab 용도 : (/MT 옵션을 사용해야한다?)
mkdir build_mt\amd64\v100
bjam --toolset=msvc-10.0 architecture=x86 address-model=64 link=static runtime-link=shared variant=release,debug --without=mpi --without=python --stagedir=build_mt/amd64/v100 stage -j 2
mkdir build_mt\x86\v100
bjam --toolset=msvc-10.0 architecture=x86 address-model=32 link=static runtime-link=shared variant=release,debug --without=mpi --without=python --stagedir=build_mt/x86/v100 stage -j 2
문제 사항 : bootstrap 실행 안됨
해결 : 환경변수에 visual studio 경로 설정 안 되었음
C:\Windows\system32;C:\Windows;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\amd64;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64;
참고 : http://anster.egloos.com/2157882
생성자 내에서 추상 함수 (Virtual Function) 호출 (0) | 2014.11.22 |
---|---|
Windows에서 반복 폴더 생성(Iterative Folder Making) 쉽게 하기 (0) | 2014.08.18 |
Matlab -> OpenCV 알고리즘 변환 노트 (0) | 2014.07.18 |
C++ 11 (0) | 2013.12.11 |
1. Mask 사용
CopyTo를 이용
ex)
cv::Mat MaskClone(cv::Mat &_Src, const cv::Mat &_Mask, cv::Scalar Def)
{
Mat NewMat(_Src.size(), _Src.type(), Def);
_Src.copyTo(NewMat, _Mask);
return NewMat;
}
2. Mat 내부 벡터 초기화
Mat_ 초기화 사용
ex)
m_CameraMatrix = (Mat_<float>(4, 4) <<
_fu, 0, _cu, 0,
0, _fv, _cv, 0,
0, 0, 0, _fu*_base,
0, 0, 1, 0);
3. Vector to Mat, Mat to Vector
Mat a(Vector<Point2f>)로 초기화시에 생성되는 Mat의 크기는 cols = 1 rows = vector.size
ex)
cv::Mat CvtKeyPoints2PosMat(vector<KeyPoint> &_Src)
{
vector<Point2f> Src_Vector;
KeyPoint::convert(_Src, Src_Vector);
Mat Src_Channel[2];
split(Mat(Src_Vector).t(), Src_Channel);
return JMU::VCat(Src_Channel[0], Src_Channel[1]);
}
4. Reshape (Vector -> Mat)
5. Reshape (Mat -> Vector)
6. Unique
딱히 Uniqe 함수는 없으며 std의 unique를 사용해야한다. (General하게 Mat을 받는 것은 차후에)
ex) unique한 mask를 생성
template<typename _Ty>
cv::Mat HUniq_PosMat(const cv::Mat &_Src)
{
assert(_Src.rows == 2);
Mat Temp = VCat(_Src, MakeSeq<_Ty>(Size(_Src.cols, 1)));
Temp = Temp.reshape(3, 1);
vector<Point3_<_Ty>> VecTemp(Temp.begin<Point3_<_Ty>>(), Temp.end<Point3_<_Ty>>());
std::unique(VecTemp.begin(), VecTemp.end(),
[](const Point3_<_Ty> &a, const Point3_<_Ty> &b)
{
return a.x==b.x && a.y==b.y;
});
Mat Mask = Mat::zeros(1, _Src.cols, CV_8UC1);
unsigned char *pMask = Mask.data;
for(int i=0; i<VecTemp.size(); i++)
{
pMask[int(VecTemp[i].z)] = 1;
}
return Mask;
}
생성자 내에서 추상 함수 (Virtual Function) 호출 (0) | 2014.11.22 |
---|---|
Windows에서 반복 폴더 생성(Iterative Folder Making) 쉽게 하기 (0) | 2014.08.18 |
Boost library 컴파일 (0) | 2014.08.13 |
C++ 11 (0) | 2013.12.11 |
http://blogs.microsoft.co.il/alon/2013/03/21/the-c-11-standard-amp-visual-studio-introduction/
1. Lambda Expression Syntax & Enclosing Function
참고 링크 :
http://stackoverflow.com/questions/16310238/map-function-in-opencv-c
std::for_each(M.begin<double>(), M.end<double>(), [](double& e) { /* do something with e */ });
요런게 가능, 구버전에선 컴파일 에러
생성자 내에서 추상 함수 (Virtual Function) 호출 (0) | 2014.11.22 |
---|---|
Windows에서 반복 폴더 생성(Iterative Folder Making) 쉽게 하기 (0) | 2014.08.18 |
Boost library 컴파일 (0) | 2014.08.13 |
Matlab -> OpenCV 알고리즘 변환 노트 (0) | 2014.07.18 |
RECENT COMMENT