'2015/10'에 해당되는 글 78건

  1. 2015.10.21 gcc 초기화 관련
  2. 2015.10.21 다배장 정수?
  3. 2015.10.20 휴 모멘트?
  4. 2015.10.20 gimp fisheye correction
  5. 2015.10.20 hugin fisheye correction
  6. 2015.10.20 opencv 카메라 왜곡 수정
  7. 2015.10.20 opencv sift surf
  8. 2015.10.20 DMOS?
  9. 2015.10.19 삼각측량 소스코드...
  10. 2015.10.19 synology DS213j SVN server 설치
프로그램 사용/gcc2015. 10. 21. 11:33

C99 관련추가 내용인가?

일단은 GCC-2.5 이후 부터 지원하는 기능으로 보인다.

2009/05/28 - [Programming/C / Win32 / MFC] - C99 구조체 초기화 하기


5.22 Designated Initializers


Standard C89 requires the elements of an initializer to appear in a fixed order, the same as the order of the elements in the array or structure being initialized.


In ISO C99 you can give the elements in any order, specifying the array indices or structure field names they apply to, and GNU C allows this as an extension in C89 mode as well. This extension is not implemented in GNU C++.


To specify an array index, write `[index] =' before the element value. For example,


 

int a[6] = { [4] = 29, [2] = 15 };


is equivalent to


 

int a[6] = { 0, 0, 15, 0, 29, 0 };


The index values must be constant expressions, even if the array being initialized is automatic.


An alternative syntax for this which has been obsolete since GCC 2.5 but GCC still accepts is to write `[index]' before the element value, with no `='.


To initialize a range of elements to the same value, write `[first ... last] = value'. This is a GNU extension. For example,


 

int widths[] = { [0 ... 9] = 1, [10 ... 99] = 2, [100] = 3 };


If the value in it has side-effects, the side-effects will happen only once, not for each initialized field by the range initializer.


Note that the length of the array is the highest value specified plus one.


In a structure initializer, specify the name of a field to initialize with `.fieldname =' before the element value. For example, given the following structure,


 

struct point { int x, y; };


the following initialization


 

struct point p = { .y = yvalue, .x = xvalue };


is equivalent to


 

struct point p = { xvalue, yvalue };


Another syntax which has the same meaning, obsolete since GCC 2.5, is `fieldname:', as shown here:


 

struct point p = { y: yvalue, x: xvalue };


The `[index]' or `.fieldname' is known as a designator. You can also use a designator (or the obsolete colon syntax) when initializing a union, to specify which element of the union should be used. For example,


 

union foo { int i; double d; };


union foo f = { .d = 4 };


will convert 4 to a double to store it in the union using the second element. By contrast, casting 4 to type union foo would store it into the union as the integer i, since it is an integer. (See section 5.24 Cast to a Union Type.)


You can combine this technique of naming elements with ordinary C initialization of successive elements. Each initializer element that does not have a designator applies to the next consecutive element of the array or structure. For example,


 

int a[6] = { [1] = v1, v2, [4] = v4 };


is equivalent to


 

int a[6] = { 0, v1, v2, 0, v4, 0 };


Labeling the elements of an array initializer is especially useful when the indices are characters or belong to an enum type. For example:


 

int whitespace[256]

  = { [' '] = 1, ['\t'] = 1, ['\h'] = 1,

      ['\f'] = 1, ['\n'] = 1, ['\r'] = 1 };


You can also write a series of `.fieldname' and `[index]' designators before an `=' to specify a nested subobject to initialize; the list is taken relative to the subobject corresponding to the closest surrounding brace pair. For example, with the `struct point' declaration above:


 

struct point ptarray[10] = { [2].y = yv2, [2].x = xv2, [0].x = xv0 };


If the same field is initialized multiple times, it will have value from the last initialization. If any such overridden initialization has side-effect, it is unspecified whether the side-effect happens or not. Currently, gcc will discard them and issue a warning.


[링크 : https://gcc.gnu.org/onlinedocs/gcc-3.0.1/gcc_5.html]

'프로그램 사용 > gcc' 카테고리의 다른 글

gcc dependency .d 파일?  (0) 2016.03.28
gcc -M -MM  (0) 2015.12.17
precompiled header on GCC (라즈베리로 테스트)  (2) 2015.07.30
gcc에서 precompiled header 사용하기  (0) 2015.07.29
gcc 64bit 변수 선언하기  (0) 2015.07.14
Posted by 구차니
Programming2015. 10. 21. 10:52

먼가해서 찾아봐도.. 일본식 조어인가?

多倍長整数

多 (많을 다)

倍 (곱 배, 등질 패)

長 (길 장, 어른 장)

整 (가지런할 정)

数 (셈 수, 자주 삭, 촘촘할 촉)


[링크 : https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic] >> 일본어 판으로


gmp 라는 녀석으로 gnu 라이브러리 존재

[링크 : https://gmplib.org/]

'Programming' 카테고리의 다른 글

swift 문법(함수/변수)  (0) 2014.06.08
apple 차세대 언어 swift  (0) 2014.06.03
ARToolKit / openVRML  (0) 2012.12.25
윤년 계산하기  (2) 2012.05.21
TBB/IPP  (2) 2012.02.12
Posted by 구차니
Programming/openCV2015. 10. 20. 17:21

hue moment로

hue의 유사값을 찾는것으로 생각된다..



모멘트를 계산하는 효과적인 방법 중 하나는 휴모멘트를 이용하는 것인데

1. 먼저 cvFindContours() 로 contours를 구하고

2. cvContourMoments()로 CvMoments구조체를 만든 후 

3. cvGetHuMoments()로 cvHuMoments구조체를 만든다. 

4. 그리고 cvHuMoments.hu1(hu2...) 식으로 접근하여 휴 모멘트를 구한다.


double cvMatchShapes(

 const void* object1,                       //그레이 스케일 영상 || contours

 const void* object2,                       //그레이 스케일 영상 || contours

 int method,

 double parameter=0;                       //무조건 0 (사용X)

);

[링크 : http://blog.naver.com/cyber3208/60163282137]

[링크 : http://lueseypid.tistory.com/88]


+

[링크 : http://docs.opencv.org/2.4.10/doc/tutorials/imgproc/shapedescriptors/moments/moments.html]

[링크 : http://docs.opencv.org/master/d0/d49/tutorial_moments.html]

'Programming > openCV' 카테고리의 다른 글

openMP + openCV 실패한 이유가..  (0) 2015.11.27
openMP + openCV 미스테리..  (0) 2015.11.09
opencv 카메라 왜곡 수정  (0) 2015.10.20
opencv sift surf  (0) 2015.10.20
시야각 내 각도 계산  (0) 2015.10.14
Posted by 구차니
프로그램 사용/GIMP2015. 10. 20. 17:10

hugin 꺼 찾다 보니 gimp도 나오네


[링크 : http://docs.gimp.org/en/plug-in-lens-distortion.html]

Posted by 구차니
프로그램 사용/hugin2015. 10. 20. 17:10

뜬금없지만.. hugin에서 특징점 뽑는거.. 일종의 SIFT나 SURF 일려나?


[링크 : http://hugin.sourceforge.net/tutorials/perspective/en.shtml]

+ [링크 : http://docs.gimp.org/en/plug-in-lens-distortion.html]




+

Panomatic


From PanoTools.org Wiki

panomatic by Anael Orlinski is a tool for automatically creating control points for groups of overlapping photographs.


pan-o-matic is very similar in purpose to autopano-sift or autopano-sift-C and can be used from within hugin (and potentially other GUI front-ends[*]) as an optional control point generator.


pan-o-matic is Open Source and uses the SURF algorithm.

[링크 : http://hugin.sourceforge.net/docs/manual/Panomatic.html]

'프로그램 사용 > hugin' 카테고리의 다른 글

hugin 업그레이드~  (0) 2012.08.10
hugin - 2010.4.0 버전  (0) 2011.04.30
hugin - 광각 파노라마 합성  (4) 2010.08.20
hugin 방향이 다른 이미지 합성하기  (4) 2010.08.20
Hugin - Panorama photo stitcher  (4) 2010.08.19
Posted by 구차니
Programming/openCV2015. 10. 20. 16:47

이전 라즈베리 파이에서 클릭한 위치로 한방에 못가는게

각도의 오차냐.. 아니면 카메라에 의한 오차냐라는게 확실치는 않지만

학습을 넣어서 클릭시 그 지점으로 가는 거리 오차를 줄여야 겠다고 생각은 했지만..


다시 생각해보니 카메라의 왜곡에 의한 문제로 생각이 된다.

이걸 학습으로 커버할 것이냐.. 아니면 영상을 복원해서 오차를 줄일것이냐 고민이로다....

(그래봤자 결국은 학습은 들어가야 하나...)


[링크 : http://darkpgmr.tistory.com/31]

[링크 : http://darkpgmr.tistory.com/32]

[링크 : http://darkpgmr.tistory.com/37]


[링크 : http://docs.opencv.org/doc/tutorials/calib3d/camera_calibration/camera_calibration.html]

    [링크 : http://docs.opencv.org/_downloads/pattern.png] 캘리브레이션 체크보드 패턴

    [링크 : http://docs.opencv.org/_downloads/acircles_pattern.png캘리브레이션 원형 패턴


---

음.. 옆으로는 크랍한거 같은데..

아무튼 수직 방향에 대해서는 저런식으로 왜곡된걸 보정하면 된다~ 라는 느낌?


[링크 : http://www.rcgroups.com/forums/attachment.php?attachmentid=6517867]


프로그램 사용해서 이렇게 만든 듯

원래대로 왜곡 되지 않은 어안렌즈라면 사각형의 검은색이 되겠지


[링크 : http://www.fredmiranda.com/forum/topic/1071605]

    [링크 : http://img831.imageshack.us/img831/4378/img4414rp.jpg] 기하 조정?

    [링크 : http://img585.imageshack.us/img585/259/img4414rc2krr.jpg] 크랍?


'Programming > openCV' 카테고리의 다른 글

openMP + openCV 미스테리..  (0) 2015.11.09
휴 모멘트?  (0) 2015.10.20
opencv sift surf  (0) 2015.10.20
시야각 내 각도 계산  (0) 2015.10.14
openCV + openMP 합치는게 잘 안되네?  (0) 2015.10.11
Posted by 구차니
Programming/openCV2015. 10. 20. 16:37

SIFT (Scale-invariant feature transform)

PCA-SIFT (Principle Component Analysis)

SURF (Speeded Up Robust Features)

FLANN (Fast Library for Approximate Nearest Neighbors)

---

opencv 3.0.0 문서중 sift 관련

[링크 : http://docs.opencv.org/master/da/df5/tutorial_py_sift_intro.html]


FLANN stands for Fast Library for Approximate Nearest Neighbors

[링크 : http://docs.opencv.org/master/dc/dc3/tutorial_py_matcher.html]


sift 예제

[링크 : http://thinkpiece.tistory.com/246]


nonfree에 속해있는 모듈이다..

[링크 : http://docs.opencv.org/2.4.1/modules/nonfree/doc/feature_detection.html]

[링크 : http://docs.opencv.org/2.4.1/modules/nonfree/doc/nonfree.html]


SIFT(Scale-invariant feature transform), Lowe, 2004

PCA-SIFT(Principle Component Analysis), Page on y.ke, 2004

SURF(Speeded Up Robust Features), Bay, 2006

[링크 : https://www.quora.com/.../Difference-between-SURF-and-SIFT-where-and-when-to-use-this-algo]

[링크 : http://stackoverflow.com/questions/11172408/surf-vs-sift-is-surf-really-faster]


SIFT는 기본적으로 특징점 주변의 로컬한 gradient 분포특성(밝기 변화의 방향 및 밝기 변화의 급격한 정도)을 표현하는 feature이다. SIFT를 포함한 SURF, ORB 등의 local feature들은 대상의 크기변화, 형태변화, 방향(회전)변화에 강인하면서도 구분력이 뛰어난 어찌보면 서로 상충되는 목표를 동시에 만족시키고자 개발된 것들로서 통상적으로 원래 물체의 기하학적 정보는 무시하고 특징점 단위로 혹은 코드북(code book) 단위로 매칭을 수행한다.

[링크 : http://darkpgmr.tistory.com/116]


surf 예제

[링크 : http://www.haenaki.com/141]

'Programming > openCV' 카테고리의 다른 글

휴 모멘트?  (0) 2015.10.20
opencv 카메라 왜곡 수정  (0) 2015.10.20
시야각 내 각도 계산  (0) 2015.10.14
openCV + openMP 합치는게 잘 안되네?  (0) 2015.10.11
opencv 마우스 이벤트와 빠르게 그리기  (0) 2015.10.05
Posted by 구차니
이론 관련/전기 전자2015. 10. 20. 16:06

programmable DMOS slw rate라는 용어가 나와서

DMOS를 검색..

power mosfet 문서에서나 나오는 걸로 봐서는..

power management ic쪽인 듯?


MOS - metal–oxide–semiconductor

CMOS - Complementary metal–oxide–semiconductor

FET - field-effect transistor 

MOSFET - metal–oxide–semiconductor field-effect transistor 

VDMOS - Vertical Diffused MOS

DMOS - double-diffused MOS


[링크 : https://en.wikipedia.org/wiki/CMOS]

[링크 : https://en.wikipedia.org/wiki/Field-effect_transistor]

[링크 : https://en.wikipedia.org/wiki/Power_MOSFET]

'이론 관련 > 전기 전자' 카테고리의 다른 글

solid state  (0) 2016.01.17
디지털 서보(?)  (0) 2015.11.24
PID 제어 (Proportional Integral Differential)  (0) 2015.10.13
전류제어  (0) 2015.09.11
디지털 필터 - FIR / IIR  (0) 2015.01.23
Posted by 구차니

대충 위키보고 짜고 성능은 나중에 생각하지 머..

국문위키에서 공식대로 따라가야 하는데

순서를 바꾸거나 생략할 수 있는 묘안이 없으려나?


$ ./a.out

alpha : 43.2

beta : 78.1

dist : 10

MC : 8.27144 


$ cat tri.c

#include <iostream>
#include <math.h>

using namespace std;

const double PI = 3.1415926535;

double SIN(double val)
{
        return sin(PI * val / 180.0);
}

double COS(double val)
{
        return cos(PI * val / 180.0);
}

int main(int argc, char** argv)
{
double alpha; // servo angle (left)
double beta; // servo angle (right)
double gamma = 0.0;
double AB; // distance of eye(10cm)
double AC = 0.0;
double BC = 0.0;
double RC = 0.0;
double MR = 0.0;
double MC = 0.0; // result

//alpha = 54;
//beta = 54;
//AB = 10;//

cout << "alpha : ";
cin >> alpha;
cout << "beta : ";
cin >> beta;
cout << "dist : ";
cin >> AB;

gamma = 180 - (alpha + beta);
AC = AB * SIN(beta) / SIN(gamma);
BC = AB * SIN(beta) / SIN(gamma);
RC =  AC * SIN(alpha);

MR = (AB / 2) - (BC * COS(beta));
MC = sqrt((MR * MR) + (RC * RC));

cout << "MC : " << MC << endl;
}


[링크 : https://en.wikipedia.org/wiki/Triangulation]

[링크 : http://linux.die.net/man/3/sin] 항상 그렇지만.. 라디안 값

[링크 : http://enter.tistory.com/60]

'이론 관련 > 사진 광학 관련' 카테고리의 다른 글

포칼 리듀서 / 스피드 부스터  (0) 2016.04.26
안구 해부도?  (0) 2015.11.01
카메라의 원리  (0) 2015.09.09
스테레오 카메라 - 에피폴라 제한조건  (0) 2015.08.25
샤프니스 계산  (0) 2015.05.28
Posted by 구차니
하드웨어/Storage2015. 10. 19. 09:50

svn://으로 접속하게 하네...

일단 집에가서 3690번 포트 열어줘야 할 듯..









'하드웨어 > Storage' 카테고리의 다른 글

synology undelete 시도 T.T  (0) 2015.12.27
synology port  (0) 2015.12.22
microSD 슬롯 락 관련  (2) 2015.08.06
xpenology  (0) 2015.06.30
DS213j 하이버네이트 정상작동중!  (0) 2015.06.25
Posted by 구차니