| 51 | | |
| 52 | | /* |
| 53 | | * Limits on pixel values, used for threshnold stuff |
| 54 | | * |
| 55 | | * For a pixel to be classified as beloging to `target' it must be inbetween |
| 56 | | * min and max. We use HSV for this because it allows us to cluster things more |
| 57 | | * effectively than BGR. |
| 58 | | */ |
| 59 | | typedef struct { |
| 60 | | uint8_t hue_min; uint8_t hue_max; |
| 61 | | uint8_t sat_min; uint8_t sat_max; |
| 62 | | uint8_t val_min; uint8_t val_max; |
| 63 | | px_t target; |
| 64 | | } px_params_t; |
| 65 | | |
| 66 | | /* |
| 67 | | * Callback function tyep for classifying pixels |
| 68 | | * |
| 69 | | * Actual callback functions should be named get_<what> where what represents |
| 70 | | * the thing that thye classify. |
| 71 | | * |
| 72 | | * \param in Raw input imaged (check this) |
| 73 | | * \param out Image as it has been clasified so far (check this) |
| 74 | | * \param x X value of the pixle to look at |
| 75 | | * \param y Y value of the pixle to look at |
| 76 | | * \param px_params Parameters to classify based on |
| 77 | | * \retval A PX_??? that represents how pixle (x,y) should be classified |
| 78 | | */ |
| 79 | | typedef px_t (*get_type_cb_t)(const IplImage *, IplImage *, int, int, |
| 80 | | px_params_t); |