http://msdn.microsoft.com/ko-kr/library/s8e39b8h.aspx


생성자 안에서는 아직 상속관계가 형성되지 않아

자식 클래스의 추상 함수가 호출되지 않고 현재 생성자의 추상 함수가 호출된다.



by 고민고민하지마~* 2014. 11. 22. 16:02

mkdir 쉘 커맨드 사용.

ex)

bool MakePathIter(string path)

{

#ifdef _WIN32

system((string("mkdir ") + path).c_str());

#endif

return true;

}


by 고민고민하지마~* 2014. 8. 18. 22:07

일반 용도 : (/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 2

mkdir 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

by 고민고민하지마~* 2014. 8. 13. 13:42

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;

}

by 고민고민하지마~* 2014. 7. 18. 12:43
by 고민고민하지마~* 2013. 12. 11. 14:29

end 부분에 들어가는 것은 1 base Index이다 .. (2.6.4현재 수정 안됨)

 

관련 Link

https://code.ros.org/trac/opencv/ticket/1272

by 고민고민하지마~* 2013. 8. 26. 13:23

vpa 함수 사용
Variable-precision arithmetic

이하는 도움말 긁붙

 


vpa


Variable-precision arithmetic

Syntax


R = vpa(A)
R = vpa(A,d)

 


Description

R = vpa(A) usesvariable-precision arithmetic (VPA) to compute each element of A toat least d decimal digits of accuracy, where d isthe current setting of digits.

R = vpa(A,d) usesat least d significant (nonzero) digits, insteadof the current setting of digits.

 

Input Arguments


A

Symbolic object, string, or numeric expression.


d

Integer greater than 1 and smaller than .

 

Output Arguments


R

Symbolic object representing a floating-point number

Suppose you convert a number to a symbolic object, and thenperform VPA operations on that object. The results can depend on theconversion technique that you used to convert a floating-point numberto a symbolic object. The sym function lets youchoose the conversion technique by specifying the optional secondargument, which can be 'r', 'f','d' or 'e'. The default is 'r'.For example, convert the constant π=3.141592653589793... toa symbolic object:
r = sym(pi)
f = sym(pi, 'f')
d = sym(pi, 'd')
e = sym(pi, 'e')
r =
pi
 
f =
884279719003555/281474976710656
 
d =
3.1415926535897931159979634685442
 
e =
pi - (198*eps)/359

Compute these numbers with the 4 digits VPA precision. Threeof the four numeric approximations give the same result:
vpa(r, 4)
vpa(f, 4)
vpa(d, 4)
vpa(e, 4)
ans =
3.142
 
ans =
3.142
 
ans =
3.142
 
ans =
3.142 - 0.5515*eps

Now, increase the VPA precision to 40 digits. The numeric approximationof 1/10 depends on the technique that you used to convert 1/10 tothe symbolic object:
vpa(r, 40)
vpa(f, 40)
vpa(d, 40)
vpa(e, 40)
ans =
3.141592653589793238462643383279502884197
 
ans =
3.141592653589793115997963468544185161591
 
ans =
3.1415926535897931159979634685442
 
ans =
3.141592653589793238462643383279502884197 -...
0.5515320334261838440111420612813370473538*eps

by 고민고민하지마~* 2013. 8. 23. 20:52

*현상 : Verilog으로 HDL생성시 Fixed Signed Multiplication이 시뮬레이션에서 제대로 나오지 않는다.

*원인 : Multi가 구현된 부분을 보면 아래와 같아서 unsigned 곱셈이 일어난다.

  assign
    t_12 = (t_13 >>> 16);
  assign
    t_13 = (t_14 * t_15) + 48'h 8000;

*해결 : 아래와 같이 수정하면 해결되지만, 크고 무거운 알고리즘이라면 생성할 때마다 수정해줄 수 없으니 가능하면 VHDL로 생성하기를 권장한다.

  assign
    t_12 = (t_13 >>> 16);
  assign
    t_13 = (t_14 * t_15) + 48'sh 8000;

 

*현상 : Timing Simulation에서 값이 XXXXX나 특정비트가 X로 뜬다.

*원인 : 모듈안에서 변수 선언시 초기화 하지 않는 경우에 일부 발생

*해결 : "모든" 변수는 무조건 초기화값을 넣어준다.

 

*현상 : Timing Simulation에서 128버스가 제대로 동작하지 않는다.

*원인 : 미상

*해결 : 미상

 

*현상 : Timing Simulation에서 CO_FXCONST를 사용한 초기화 값이 제대로 들어가지 않거나 일부 비트가 X로 뜬다.

*원인 : 항상 그렇지는 않지만 종종 발생하는 "버그"이다. Behavior Simulation는 제대로 나온다.

*해결 : 고정값이라면 VS에서 값을 확인하여 아래와 같이 할당하도록 하고 위와 같은 초기화는 피한다.

int32 Temp = 0x123;

 

*현상 : #pragma CO INLINE를 사용한 함수를 호출시에 입력 Parameter와 Variant의 형이 일치하지 않으면 Simulation 값이 제대로 나오지 않는다.

*원인 : 예) Parameter Type은 int32 입력 Type은 int16인 경우

*해결 : 두가지의 형을 맞춰준다. 고정된 코드라면 가급적 함수를 풀어서 모듈에 넣도록 하는게 최선이다.

 

*현상 : Simulation시에 입력 변수의 크기가 배열의 크기를 넘었다는 에러가 나온다. (버그라기 보단 팁)

*원인 : 아래와 같이 조건식 내부더라도 Addr버스의 경우 직접 연결되어 있으므로 입력변수가 버퍼크기보다 커질 수 있다면 발생한다. 또는 루프안에서 씌이는 경우 Loop Iteration은 항상 조건+1의 크기를 가지므로 발생할 수 있다.

int BUF[MAX];
 for(i=0;i<MAX;i++)
 {if(i<100)
  {if(BUF[i&0x7F]!=0)
        diff++;
   }
 }

*해결 : FEATURE_BUF[i&0x7F];와 같이 MASK를 씌우거나 버퍼의 크기를 여유있게 할당한다.

 

*현상 : StageMasterExplorer에서 나눗셈에서 걸리는 Rate(Cycle/Result)와 시뮬레이션에서의 결과가 다르다

*원인 : StageMaster에서는 Rate2로 나오지만 실제로는 Fixed_32/Fixed_32의 경우 32(정확하지 않음) Clock을 필요로 한다.

*해결 : Resource에 적합하게 병렬이나 파이프라인 구조로 놓아서 Rate를 줄이자

 

*현상 : Float형을 입력 Param으로 받는 함수를 사용하는 모듈의 Synthesis가 제대로 이루어지지 않는다.

*원인 : Float형의 Param이 들어가는 함수의 경우 "종종" 제대로 생성하지 못한다.

*해결 : Float형을 사용하지 않던지 함수를 사용하지 않던지 한다.

 

*현상 : StageMaster에서 추천하는 Delay로 PipeLine시켰는데 Behavior Simulation에서 결과가 제대로 나오지 않는다.

*원인 : 정확히 파악 안됨.

*해결 : 가장 Performance가 높게 나온 Delay는 32였지만 Delay를 64로 높이니 결과가 잘 나온다.

낮은 Delay에서는 어느정도 margin을 가져가야 하지 않나 싶은데 StageMaster도 100% 신뢰하지 말자..

 

*현상 : 모듈 안에서 함수를 INLINE하여 사용하고 Simulation하였을 때에 결과가 제대로 나오지 않는다.

*원인 : Const한 상수값을 인수로 넣어 주었는데 StageMaster로 해당 모듈을 보았을 때에 제대로 INLINE 구현이 되어 있지 않았다. (마지막 결과 출력이 빠져있었다.)

*해결 : 리소스가 충분하다면 Generate 옵션에서 Enable constant propagation을 해제해준다.

by 고민고민하지마~* 2012. 9. 20. 09:51
| 1 |