Processing math: 100%

Wednesday, June 10, 2020

Multi-byte vs. Unicode

 Multi-byteUnicode
 char TCHAR
 strcat_s()_tcscaft_s()
 strcpy_s()_tcscpy_s()
 strncpy_s()_tcsncpy_s()
 strien()_tcsien()
 sprinif_s()_stprintf_s()

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);

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=N12C2N12NT12X1, therefore
(N1N12N12NT12)X1=C1N12N12C2 X1=(N1N12N12NT12)1(C1N12N12C2) And
X2=N12(C2NT12X1) For X2, we can avoid solving the inverse matrix of 3m×3m .
For ith point,
X2i=N12i(C2iNT12iX1)