๊ธฐ๋ณธ ์ฝ˜ํ…์ธ ๋กœ ๊ฑด๋„ˆ๋›ฐ๊ธฐ

๊ธ€

BGR vs RGB, Wavelength

http://en.wikipedia.org/wiki/Wavelength
์ตœ๊ทผ ๊ธ€

Data Conversions

Data Conversions By VGirish  | 28 Jun 2002 These are a few samples of data conversions which you can use for a quick reference Introduction Here are a few data conversions with small examples :- Decimal Conversions Decimal To Hex  Collapse // Use _itoa( ) function and set radix to 16. char hexstring[ 10 ]; int number = 30 ; itoa( number, hexstring, 16 ); // In hexstring is 1e. Hex To Decimal  Collapse // You can use strtol function and you can specify base. char * hexstring= " ABCDEF" ; char * p; int number = strtol(hexstring, &p, 16 ); // A function that does this bool HexToDecimal ( char * HexNumber, int& Number) { char * pStopString; Number = strtol (HexNumber, &pStopString, 16 ); return ( bool )(Number != LONG_MAX); } Decimal to time  Collapse char *DecToTime( float fTime, char *szTime) { int nHrs, nMin, nSec; fTime *= 3600 ; nHrs = ( int )fTime / 3600 ; nMin = ( int )(fTime - nHrs * 3600 ) / 60...

[OpenCV] OpenCV 2.1 Cheat Sheet C++

OpenCV_CheatSheet.pdf [OpenCV] OpenCV 2.1 Cheat Sheet C++

[MATLAB]Polynomial curve fitting - polyfit

polyfit - Polynomial curve fitting Syntax p = polyfit(x,y,n) [p,S] = polyfit(x,y,n) [p,S,mu] = polyfit(x,y,n) Description p = polyfit(x,y,n) finds the coefficients of a polynomial p(x) of degree n that fits the data, p(x(i)) to y(i) , in a least squares sense. The result p is a row vector of length n+1 containing the polynomial coefficients in descending powers: [p,S] = polyfit(x,y,n) returns the polynomial coefficients p and a structure S for use with polyval to obtain error estimates or predictions. Structure S contains fields R , df , and normr , for the triangular factor from a QR decomposition of the Vandermonde matrix of x , the degrees of freedom, and the norm of the residuals, respectively. If the data y are random, an estimate of the covariance matrix of p is (Rinv*Rinv')*normr^2/df , where Rinv is the inverse of R . If the errors in the data y are independent normal with constant variance, polyval produces error bounds that contain at least 50...

Pearson ์ƒ๊ด€๊ณ„์ˆ˜(sample correlation coefficient)

Pearson ์˜ ์ƒ๊ด€๊ณ„์ˆ˜(sample correlation coefficient)๋Š” ๊ณ„์‚ฐ์— ๊ฐ€์žฅ ํŽธ๋ฆฌํ•œ ๊ฒƒ ์ค‘์˜ ํ•˜๋‚˜๋กœ, ๋‘ ๋ณ€์ˆ˜ x, y ๊ฐ€ ์„ ํ˜•๊ด€๊ณ„๋ผ๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๊ณ„์‚ฐ๋œ๋‹ค. r ๊ฐ’์˜ ๋ฒ”์œ„ -1 ≤ r ≤ +1 ์ด๋ฉฐ, r=1 ์€ ๋‘ ๋ณ€์ˆ˜ ์‚ฌ์ด์— ์™„์ „ํ•œ ์ƒ๊ด€๊ด€๊ณ„์— ์žˆ๋Š” ๊ฒฝ์šฐ์ด๋‹ค. r ๊ฐ’์ด 0 ์ผ ๋•Œ(xy = 0 ์ผ๋•Œ ์ƒ๊ธด๋‹ค) ๋‘ ๋ณ€์ˆ˜๋Š” ์™„์ „ํžˆ ๋…๋ฆฝ์ด๋‹ค. ์ผ๋ฐ˜์ ์œผ๋กœ 0.90 ≤ r ≤ 0.95 : ๋ณดํ†ต 0.95 ≤ r ≤ 0.99 : ์–‘ํ˜ธ 0.99 ≤ r : ํ›Œ๋ฅญํ•œ ์ง์„ ์„ฑ์„ ๋‚˜ํƒ€๋ƒ„

[MFC]SHBrowseForFolder ํด๋”๋ฅผ ์„ ํƒ

[code cpp] BROWSEINFO bi; TCHAR szDir[MAX_PATH]; LPITEMIDLIST pidl; LPMALLOC pMalloc; if (SUCCEEDED(SHGetMalloc(&pMalloc))) { ZeroMemory(&bi,sizeof(bi)); bi.hwndOwner = this->m_hWnd; // GetDlgItem(IDC_MYGROUPBOX1)->m_hWnd; // bi.hwndOwner = NULL; bi.pszDisplayName = 0; bi.pidlRoot = 0; bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT; bi.lpfn = NULL;//BrowseCallbackProc; pidl = SHBrowseForFolder(&bi); if (pidl) { if (SHGetPathFromIDList(pidl,szDir)) { GetDlgItem(IDC_EDIT_FOLDER)->SetWindowText(szDir); // MessageBox(szDir,"Picked",MB_OK); } // In C++: pMalloc->Free(pidl); pMalloc->Release(); pMalloc->Free(pidl); pMalloc->Release(); } } [/code]

๊ฐ๋„ ๋‹จ์œ„ ๋ณ€ํ™˜

(1) ๊ฐ๋„์˜ ๊ธฐ๋ณธ ๋‹จ์œ„ ๊ฐ๋„๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ๋‹จ์œ„์ž…๋‹ˆ๋‹ค. 360๋ถ„๋ฒ• ์œผ๋กœ ํ‘œ์‹œํ•˜๋Š” 1๋„๋Š” ์‚ฌ๋ฐฉ์„ 360์œผ๋กœ ๋‚˜๋ˆˆ ํฌ๊ธฐ์ž…๋‹ˆ๋‹ค. 1๋ถ„์€ 1๋„๋ฅผ 60๋“ฑ๋ถ„ํ•œ ๊ฐ์ด๊ณ  1์ดˆ๋Š” 1๋ถ„์„ ๋‹ค์‹œ 60๋“ฑ๋ถ„ํ•œ ํฌ๊ธฐ์ž…๋‹ˆ๋‹ค. ๋ถ„(arcminute)๊ณผ ์ดˆ(arcsecond)๋Š” ์‹œ๊ฐ„์„ ๋‚˜ํƒ€๋‚ด๋Š” ๋‹จ์œ„์ธ ๋ถ„(minute), ์ดˆ(second)์™€ ๊ธฐํ˜ธ๊ฐ€ ๊ฐ™์€๋ฐ, ์ฒœ๋ฌธํ•™(์˜์–ด)์—์„œ๋Š” ๋‘˜์„ ๊ตฌ๋ถ„ํ•˜๊ธฐ ์œ„ํ•ด ๊ฐ๋„๋Š” ๋‚˜ํƒ€๋‚ด๋Š” ๋‹จ์œ„์—๋Š” ' arc- '๋ฅผ ๋ถ™์—ฌ ํ‘œ๊ธฐํ•ฉ๋‹ˆ๋‹ค. ๊ฐ๋„๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ๋‹ค๋ฅธ ๋ฐฉ๋ฒ•์œผ๋กœ ํ˜ธ๋„๋ฒ• ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ํ˜ธ๋„๋ฒ•์€ ๋ฐ˜์ง€๋ฆ„์— ๋Œ€ํ•œ ํ˜ธ์˜ ๊ธธ์ด ๋‹จ์œ„๋กœ ๊ฐ๋„๋ฅผ ํ‘œ์‹œํ•˜๋Š” ๋ฐฉ๋ฒ•์œผ๋กœ ์‚ฌ๋ฐฉ์€ ์›์ฃผ์œจ(ฯ€)์˜ 2๋ฐฐ ํฌ๊ธฐ๊ฐ€ ๋ฉ๋‹ˆ๋‹ค(360° = 2ฯ€ rad). ํ˜ธ๋„๋ฒ•์œผ๋กœ ๋‚˜ํƒ€๋‚ธ ๊ฐ๋„๋Š” ๋ผ๋””์•ˆ(radian)์œผ๋กœ ํ‘œ์‹œํ•˜๋ฉฐ, 360๋ถ„๋ฒ•์œผ๋กœ ๋‚˜ํƒ€๋‚ธ ๊ฐ๋„๋ฅผ ํ˜ธ๋„๋ฒ•์œผ๋กœ ๋‚˜ํƒ€๋‚ธ ๊ฐ๋„๋กœ ๋ฐ”๊พธ์–ด ์ฃผ๋ ค๋ฉด 360๋ถ„๋ฒ•์œผ๋กœ ๋‚˜ํƒ€๋‚ธ ๊ฐ๋„์— ฯ€/180์„ ๊ณฑํ•ด์ฃผ๋ฉด ๋ฉ๋‹ˆ๋‹ค. ์ปดํ“จํ„ฐ ํ”„๋กœ๊ทธ๋žจ ์–ธ์–ด์—์„œ ์‚ผ๊ฐํ•จ์ˆ˜๋ฅผ ๊ณ„์‚ฐํ•  ๋•Œ์—๋Š” ์ฃผ๋กœ ํ˜ธ๋„๋ฒ•์€ ์“ฐ๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. 1๋„(˚ , degree) : 1˚ = 60′ = 3600″ = ฯ€/180 rad 1๋ถ„(′, arcminute) : 1′ = 60″ = 1/60° 1์ดˆ(″, arcsecond) : 1″ = 1/60′ = 1/3600° 1๋ผ๋””์•ˆ(rad, radian) : 1 rad = 180/ฯ€° (ฯ€ = ์›์ฃผ์œจ = 3.1415926535897932384626433832795) (2) ์‹œ๊ฐ„์˜ ๊ธฐ๋ณธ ๋‹จ์œ„ ์‹œ๊ฐ„์˜ ๊ธฐ๋ณธ๋‹จ์œ„๋Š” ์ดˆ(second)์ž…๋‹ˆ๋‹ค. 1์ดˆ๋Š” ๊ตญ์ œ ํ‘œ์ค€์œผ๋กœ ์ •๋ฐ€ํ•˜๊ฒŒ ์ •์˜๋˜์–ด ์žˆ๋Š”๋ฐ, ์„ธ์Š˜ ์›์ž(์„ธ์Š˜-133)๊ฐ€ 9,192,631,770๋ฒˆ ์ง„๋™ํ•˜๋Š” ๋™์•ˆ์˜ ์‹œ๊ฐ„์œผ๋กœ ์ •์˜๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ๋ณธ๋ž˜ 1์ดˆ๋Š” 1 ํ‰๊ท  ํƒœ์–‘์ผ์˜ 1/86400๋กœ ์ •์˜๋˜์–ด ์žˆ์—ˆ์ง€๋งŒ ์ง€๊ตฌ์˜ ์ž์ „ ์ฃผ๊ธฐ๋Š” ๋‹ค์†Œ ๋ถˆ๊ทœ์น™ํ•˜๊ณ  ๋А๋ฆฌ๊ฒŒ ๋ฐ”๋€Œ๊ณ  ์žˆ์œผ๋ฏ€๋กœ ๊ท ์ผํ•œ ์‹œ๊ฐ„์„ ์ •์˜ํ•˜๊ธฐ์—๋Š” ๋ถ€์กฑํ•ฉ๋‹ˆ๋‹ค. ์ดํ›„ 1์ดˆ๋Š” ์ง€๊ตฌ์˜ ๊ณต์ „ ์ฃผ๊ธฐ๋ฅผ ๋ฐ”ํƒ•์œผ๋กœ ๋‹ค์‹œ ์ •์˜ ๋˜์—ˆ๋‹ค๊ฐ€ ์ง€๊ธˆ์€ ์„ธ์Š˜ ์›์ž์˜ ํŠน์„ฑ์„ ๊ธฐ๋ฐ˜์œผ๋กœ ์ƒˆ๋กญ๊ฒŒ ์ •์˜ํ•˜์—ฌ ...