[source] http://stackoverflow.com/questions/4090434/strtok-char-array-versus-char-pointer
char* string = "hello world";
는 사실은
const char literal_string[] = "hello world";
char* string = (char*) literal_string;
그러므로 변경을 하려고 하면 에러가 난다.
Thursday, March 31, 2011
Monday, March 28, 2011
record desktop in linux (ubuntu 10.04)
(1) use gtk-recordMyDesktop
this creates "*.ogv" file.
(2) you can convert ogv file to mp4 using vlc player (free)
(3) mp4 is more generally used in windows and can be convertible other format using camtasia.
this creates "*.ogv" file.
(2) you can convert ogv file to mp4 using vlc player (free)
(3) mp4 is more generally used in windows and can be convertible other format using camtasia.
Read from a file and create opencv matrix
파일에서숫자들을읽어서 opencv타입의 행렬로 만든다.
void artificialpt(CvMat* points1, CvMat* points2)
{
FILE * file1;
file1 = fopen("pt_2D_1.txt","r");
FILE * file2;
file2 = fopen("pt_2D_2.txt","r");
int rows = 37;
int columns =2;
float mat1[37][2]; float mat2[37][2];
char linebuf[256];
for (int i=0; i {
for (int j=0; j< columns; j++)
{
fscanf(file1,"%f",&mat1[i][j]);
fscanf(file2,"%f",&mat2[i][j]);
}
for (int j=0; j< columns; j++)
{
cvmSet(points1,i,j, mat1[i][1-j]);
cvmSet(points2,i,j, mat2[i][1-j]);
}
}
fclose(file1); fclose(file2);
}
void artificialpt(CvMat* points1, CvMat* points2)
{
FILE * file1;
file1 = fopen("pt_2D_1.txt","r");
FILE * file2;
file2 = fopen("pt_2D_2.txt","r");
int rows = 37;
int columns =2;
float mat1[37][2]; float mat2[37][2];
char linebuf[256];
for (int i=0; i
for (int j=0; j< columns; j++)
{
fscanf(file1,"%f",&mat1[i][j]);
fscanf(file2,"%f",&mat2[i][j]);
}
for (int j=0; j< columns; j++)
{
cvmSet(points1,i,j, mat1[i][1-j]);
cvmSet(points2,i,j, mat2[i][1-j]);
}
}
fclose(file1); fclose(file2);
}
Subscribe to:
Comments (Atom)