Multi-byte | Unicode |
char | TCHAR |
strcat_s() | _tcscaft_s() |
strcpy_s() | _tcscpy_s() |
strncpy_s() | _tcsncpy_s() |
strien() | _tcsien() |
sprinif_s() | _stprintf_s() |
Wednesday, June 10, 2020
Multi-byte vs. Unicode
Friday, May 29, 2020
How to get paths defined in the system environment
char path[_MAX_PATH];
const char* varName = "[system environment variable name]";size_t len;
getenv_s(&len, path, 80, varName);
Print out a (decimal) number as a hexadecimal number
int decNum = 123456;
char hexNum[16];
// decimal number to hexadecimal number
sprintf_s(hexNum, 16, "%X", decNum);
printf("%d -> %s \n", decNum, hexNum);
// hexadecimal number to decimal number
sprintf_s(hexNum, 16, "FF");
decNum = (int)strtol(hexNum, nullptr, 16);
printf(" %s -> %d \n", hexNum, decNum);
char hexNum[16];
// decimal number to hexadecimal number
sprintf_s(hexNum, 16, "%X", decNum);
printf("%d -> %s \n", decNum, hexNum);
// hexadecimal number to decimal number
sprintf_s(hexNum, 16, "FF");
decNum = (int)strtol(hexNum, nullptr, 16);
printf(" %s -> %d \n", hexNum, decNum);
Wednesday, April 1, 2020
Monday, January 27, 2020
Reduced normal matrix for solving fast photogrammetric bundle adjustment
Reduced normatrix for photogrammetric bundle adjustment based on the collinearity equations
Note: There are m1 photos and m2 object points, and the number of EOPs is 6. If 6*m1 is less than 3*m2, solve unknowns related with EOPs. If not, solve object points coordinates, first. This post shows only the first case, 3*m2 > 6*m1.[Fig. Normal matrix sample]
(N1N12NT12N2)(X1X2)=(C1C2) N1X1+N12X2=C1 NT12X1+N2X2=C2 In case 6m1<3m2, let's slove X1 first.X2=N−12C2−N−12NT12X1, therefore
(N1−N12N−12NT12)X1=C1−N12N−12C2 X1=(N1−N12N−12NT12)−1(C1−N12N−12C2) And
X2=N−12(C2−NT12X1) For X2, we can avoid solving the inverse matrix of 3m×3m .
For ith point,
X2i=N−12i(C2i−NT12iX1)
Subscribe to:
Posts (Atom)
-
3 vertices and cross product If 3 vertices' coordinates are given, the size of the cross product of the two vectors is same to two ...
-
char path[_MAX_PATH]; const char* varName = "[system environment variable name]"; size_t len; getenv_s(&len, path, 80, varName...