#include <Python.h>
#include <math.h>
+/* TODO delete or document this
+ *
+ */
static PyObject* py_combine(PyObject* self, PyObject* args)
{
const unsigned char *im_bg;
return Py_BuildValue("d", ((double) sum) / area);
}
+/* Hough transform
+ *
+ * Takes dimentions of the image, the image, initial angle and TODO dt is what?.
+ * Computes Hough transform of the image. TODO size etc.
+ *
+ */
static PyObject* py_hough(PyObject* self, PyObject* args)
{
const unsigned char *image;
PyObject *result;
if (!PyArg_ParseTuple(args, "(ii)s#dd", &x, &y, &image, &size, &init_angle, &dt)) return NULL;
+ // x and y are width and height of the image as ints
+ // Python sends image as (byte)string and since it is not null-terminated, must send its size
+ // init_angle and dt are doubles
matrix = (int*) malloc(size * sizeof(int));
return result;
}
+/* Edge detection
+ *
+ * Takes image size, the image, and the size of TODO what?
+ */
static PyObject* py_edge(PyObject* self, PyObject* args)
{
const unsigned char *image;
PyObject *result;
if (!PyArg_ParseTuple(args, "(ii)s#", &x, &y, &image, &size)) return NULL;
+ // x and y are width and height of the image as ints
+ // Python sends image as (byte)string and since it is not null-terminated, must send its size
n_image = (char*) malloc(size);
for (i=0; i < 2 * x; i++) {