summaryrefslogtreecommitdiff
path: root/OASIS/c/src/ekd_cv.h
diff options
context:
space:
mode:
authorEric Dao <eric@erickhangdao.com>2023-05-12 14:09:07 -0400
committerEric Dao <eric@erickhangdao.com>2023-05-12 14:09:07 -0400
commit191e4bd8beae134295d481773823142d2fdc6a98 (patch)
treeaaca4e7f8e229f9bd551d9bb1583b8ecd7a59d4a /OASIS/c/src/ekd_cv.h
parent186daed7e179241377c117e9d208ccd301d4d712 (diff)
downloadura-master.tar.gz
ura-master.tar.bz2
ura-master.zip
refactored tool chain setup, able to debug and run from vscode nowHEADmaster
Diffstat (limited to 'OASIS/c/src/ekd_cv.h')
-rw-r--r--OASIS/c/src/ekd_cv.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/OASIS/c/src/ekd_cv.h b/OASIS/c/src/ekd_cv.h
new file mode 100644
index 0000000..146144c
--- /dev/null
+++ b/OASIS/c/src/ekd_cv.h
@@ -0,0 +1,45 @@
+#ifndef EKD_CV_H
+#define EKD_CV_H
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <dirent.h>
+#include <string.h>
+#include <time.h>
+
+#define NUM_DNEG_IMAGES 134
+#define NUM_DPOS_IMAGES 99
+#define NUM_IMAGES 233
+#define IMAGE_WIDTH 144
+#define IMAGE_HEIGHT 176
+#define FEATURE_VECTOR_SIZE 25344
+
+typedef struct {
+ uint16_t signature;
+ uint32_t file_size;
+ uint32_t reserved;
+ uint32_t data_offset;
+} bmp_header_t;
+
+typedef struct {
+ uint32_t size;
+ uint32_t width;
+ uint32_t height;
+ uint16_t planes;
+ uint16_t bit_depth;
+ uint32_t compression;
+ uint32_t image_size;
+ uint32_t x_pixels_per_meter;
+ uint32_t y_pixels_per_meter;
+ uint32_t colours_used;
+ uint32_t important_colours;
+} bmp_info_t;
+
+// Prototypes
+void read_bmp(char* filename, uint8_t** data_flatten);
+void read_dir(char* dneg_path, char* dpos_path, char** file_name_arr);
+void flatten_image(uint8_t** image, float* image_flattened);
+void shuffle_data_labels(float** data, int32_t* labels, uint8_t num_images);
+
+#endif /* EKD_CV_H */ \ No newline at end of file