forked from freudenreichan/info2Praktikum-NeuronalesNetz
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
355fd11e2a |
No files matched your search
@@ -7,39 +7,11 @@
|
|||||||
#define FILE_HEADER_STRING "__info2_image_file_format__"
|
#define FILE_HEADER_STRING "__info2_image_file_format__"
|
||||||
|
|
||||||
// TODO Implementieren Sie geeignete Hilfsfunktionen für das Lesen der Bildserie aus einer Datei
|
// TODO Implementieren Sie geeignete Hilfsfunktionen für das Lesen der Bildserie aus einer Datei
|
||||||
int readHeader(File *file)
|
|
||||||
{
|
|
||||||
char fileHeader[32];
|
|
||||||
|
|
||||||
fread(fileHeader, sizeof(char), strlen(FILE_HEADER_STRING), file);
|
|
||||||
|
|
||||||
if(strncmp(FILE_HEADER_STRING, fileHeader, strlen(FILE_HEADER_STRING))){
|
|
||||||
return -1;
|
|
||||||
} else{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int readIntOfFile(FILE *file){
|
|
||||||
int number = 0;
|
|
||||||
|
|
||||||
fread(number, sizeof(int), 1, file);
|
|
||||||
return number;
|
|
||||||
}
|
|
||||||
|
|
||||||
int readOneImage(GrayScaleImageSeries *series, File *file){
|
|
||||||
unsigned int height, width;
|
|
||||||
unsigned char label;
|
|
||||||
|
|
||||||
fread()
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO Vervollständigen Sie die Funktion readImages unter Benutzung Ihrer Hilfsfunktionen
|
// TODO Vervollständigen Sie die Funktion readImages unter Benutzung Ihrer Hilfsfunktionen
|
||||||
GrayScaleImageSeries *readImages(const char *path)
|
GrayScaleImageSeries *readImages(const char *path)
|
||||||
{
|
{
|
||||||
GrayScaleImageSeries *series = NULL;
|
GrayScaleImageSeries *series = NULL;
|
||||||
int col, row;
|
|
||||||
|
|
||||||
return series;
|
return series;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,14 @@ typedef float MatrixType;
|
|||||||
|
|
||||||
// TODO Matrixtyp definieren
|
// TODO Matrixtyp definieren
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
int anzahlZeilen;
|
||||||
|
int anzahlSpalten;
|
||||||
|
int speicher[][];
|
||||||
|
|
||||||
|
} Matrix;
|
||||||
|
|
||||||
|
|
||||||
Matrix createMatrix(unsigned int rows, unsigned int cols);
|
Matrix createMatrix(unsigned int rows, unsigned int cols);
|
||||||
void clearMatrix(Matrix *matrix);
|
void clearMatrix(Matrix *matrix);
|
||||||
|
|||||||
Reference in new issue
Block a user