Skip to content
This repository was archived by the owner on Jun 3, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions include/bearing.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,15 @@
#include "points.h"
#include "marker.h"

#ifdef __cplusplus
extern "C" {
#endif

koki_bearing_t koki_bearing_estimate_point(koki_point3Df_t point);

void koki_bearing_estimate(koki_marker_t *marker);

#ifdef __cplusplus
}
#endif
#endif /* _KOKI_BEARING_H_ */
6 changes: 6 additions & 0 deletions include/camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@

#include "points.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief a structure for camera related parameters
Expand All @@ -38,5 +41,8 @@ typedef struct {
koki_point2Di_t size; /**< the dimensions of the image */
} koki_camera_params_t;

#ifdef __cplusplus
}
#endif

#endif /* _KOKI_CAMERA_H_ */
7 changes: 6 additions & 1 deletion include/code_grid.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
#define KOKI_CODE_GRID_WIDTH 6
#define KOKI_MARKER_GRID_WIDTH 10


#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief a structure for counting and averaging an image of a marker into
* a grid
Expand Down Expand Up @@ -65,4 +67,7 @@ int16_t koki_code_recover_from_grid(koki_grid_t *grid, float *rotation_offset);

int16_t koki_code_translation(int code);

#ifdef __cplusplus
}
#endif
#endif /* _KOKI_CODE_GRID_H_ */
9 changes: 8 additions & 1 deletion include/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@
*/

#include <glib.h>

#include "logger.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief a libkoki context structure
*/
Expand All @@ -44,4 +47,8 @@ void koki_log( koki_t* koki, const char* text, IplImage* img );

gboolean koki_is_logging( koki_t* koki );

#ifdef __cplusplus
}
#endif

#endif /* _CONTEXT_H_ */
8 changes: 8 additions & 0 deletions include/contour.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,19 @@

#include "labelling.h"

#ifdef __cplusplus
extern "C" {
#endif

GSList* koki_contour_find(koki_labelled_image_t *labelled_image,
label_t region);

void koki_contour_free(GSList *contour);

void koki_contour_draw(IplImage *frame, GSList *contour);

#ifdef __cplusplus
}
#endif

#endif /* _KOKI_CONTOUR_H_ */
8 changes: 8 additions & 0 deletions include/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@

#include <stdio.h>

#ifdef __cplusplus
extern "C" {
#endif

#define KOKI_DEBUG_NONE 0
#define KOKI_DEBUG_SEVERE 1
#define KOKI_DEBUG_ERROR 2
Expand Down Expand Up @@ -55,4 +59,8 @@
fprintf(KOKI_DEBUG_OUTPUT, __VA_ARGS__); \
}

#ifdef __cplusplus
}
#endif

#endif /* _KOKI_DEBUG_H_ */
7 changes: 7 additions & 0 deletions include/html-logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@

#include "logger.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
char* dpath; /**< the path of the directory we're logging to */

Expand All @@ -42,4 +46,7 @@ void koki_html_logger_destroy( koki_html_logger_t* hlog );

extern const logger_callbacks_t koki_html_logger_callbacks;

#ifdef __cplusplus
}
#endif
#endif /* _HTML_LOGGER_H_ */
6 changes: 6 additions & 0 deletions include/labelling.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
#include "context.h"
#include "points.h"

#ifdef __cplusplus
extern "C" {
#endif

#define R 0
#define G 1
Expand Down Expand Up @@ -150,4 +153,7 @@ koki_labelled_image_t* koki_label_adaptive( koki_t *koki,
uint16_t window_size,
int16_t thresh_margin );

#ifdef __cplusplus
}
#endif
#endif /* _KOKI_LABELLING_H_ */
6 changes: 6 additions & 0 deletions include/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@

#include <cv.h>

#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief a structure to contain function pointers for a logger
*/
Expand All @@ -38,4 +41,7 @@ typedef struct {

extern const logger_callbacks_t koki_null_logger;

#ifdef __cplusplus
}
#endif
#endif /* _LOGGER_H_ */
8 changes: 6 additions & 2 deletions include/marker.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@

#include "quad.h"


#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief a structure representing a a single vertex, both in 2D and 3D space
*/
Expand Down Expand Up @@ -101,5 +103,7 @@ GPtrArray* koki_find_markers_fp( koki_t *koki,

void koki_markers_free(GPtrArray *markers);


#ifdef __cplusplus
}
#endif
#endif /* _KOKI_MARKER_H_ */
7 changes: 7 additions & 0 deletions include/points.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief A structure for an integer-valued point in 2D space.
*/
Expand Down Expand Up @@ -53,4 +57,7 @@ typedef struct {
float z; /**< the Z co-ordinate */
} koki_point3Df_t;

#ifdef __cplusplus
}
#endif
#endif /* _KOKI_POINTS_H_ */
7 changes: 7 additions & 0 deletions include/pose.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
#include "camera.h"
#include "marker.h"

#ifdef __cplusplus
extern "C" {
#endif

void koki_pose_estimate_arrays(koki_point2Df_t img[4],
koki_point3Df_t world[4],
float marker_width,
Expand All @@ -36,5 +40,8 @@ void koki_pose_estimate(koki_marker_t *marker,
float marker_width,
koki_camera_params_t *params);

#ifdef __cplusplus
}
#endif

#endif /* _KOKI_POSE_H_ */
7 changes: 7 additions & 0 deletions include/quad.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@

#include "points.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief a structure containing the links contour chain links and their
* respective points, for convinience.
Expand All @@ -49,4 +53,7 @@ void koki_quad_free(koki_quad_t *quad);

void koki_quad_draw(IplImage *frame, koki_quad_t *quad);

#ifdef __cplusplus
}
#endif
#endif /* _KOKI_QUAD_H_ */
6 changes: 6 additions & 0 deletions include/rotation.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,15 @@
#include "points.h"
#include "marker.h"

#ifdef __cplusplus
extern "C" {
#endif

koki_marker_rotation_t koki_rotation_estimate_array(koki_point3Df_t points[4]);

void koki_rotation_estimate(koki_marker_t *marker);

#ifdef __cplusplus
}
#endif
#endif /* _KOKI_ROTATION_H_ */
7 changes: 7 additions & 0 deletions include/text-logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@

#include "logger.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
FILE* f; /**< the file that we're logging to */
gboolean close_on_destroy; /**< whether to close the file descriptor upon destruction */
Expand All @@ -40,4 +44,7 @@ void koki_text_logger_destroy( koki_text_logger_t* tlog );

extern const logger_callbacks_t koki_text_logger_callbacks;

#ifdef __cplusplus
}
#endif
#endif /* _TEXT_LOGGER_H_ */
8 changes: 7 additions & 1 deletion include/threshold.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@

#include "integral-image.h"

#ifdef __cplusplus
extern "C" {
#endif

#define KOKI_ADAPTIVE_MEAN 1
#define KOKI_ADAPTIVE_MEDIAN 2


IplImage* koki_threshold_frame(IplImage *frame, uint16_t threshold);

uint16_t koki_threshold_global(IplImage *frame);
Expand All @@ -48,4 +51,7 @@ void koki_threshold_adaptive_calc_window( const IplImage *frame,
uint16_t width,
uint16_t x, uint16_t y );

#ifdef __cplusplus
}
#endif
#endif /* _KOKI_THRESHOLD_H_ */
7 changes: 6 additions & 1 deletion include/unwarp.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@
#include "koki.h"
#include "marker.h"

#ifdef __cplusplus
extern "C" {
#endif
IplImage* koki_unwarp_marker( koki_t* koki, koki_marker_t *marker, IplImage *frame,
uint16_t unwarped_width );


#ifdef __cplusplus
}
#endif
#endif /* _KOKI_UNWARP_H_ */
6 changes: 6 additions & 0 deletions include/v4l.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
#include <linux/videodev2.h>
#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief a structure for representing a memory-mapped buffer
*/
Expand Down Expand Up @@ -70,4 +73,7 @@ IplImage *koki_v4l_YUYV_frame_to_RGB_image(uint8_t *frame,
IplImage *koki_v4l_YUYV_frame_to_grayscale_image(uint8_t *frame,
uint16_t w, uint16_t h);

#ifdef __cplusplus
}
#endif
#endif /* _KOKI_V4L_H_ */
7 changes: 6 additions & 1 deletion include/yaml_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@

#include "camera.h"

#ifdef __cplusplus
extern "C" {
#endif

bool koki_cam_read_params(const char *filename, koki_camera_params_t *params);


#ifdef __cplusplus
}
#endif
#endif /* _KOKI_YAML_CONFIG_H_ */