|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
32 #ifndef BLOB_LOCATOR_FPS
33 #define BLOB_LOCATOR_FPS 0
79 #define Img(X,Y)(((uint8_t*)img->buf)[(Y)*img->w*2+(X)*2])
105 int px = coordinate[0] & 0xFFFe;
106 int py = coordinate[1] & 0xFFFe;
110 for (
int y = 0; y < img->
h - 1; y++) {
112 Img(px + 1, y) = 255;
114 for (
int x = 0; x < img->
w - 1; x += 2) {
116 Img(x + 1, py) = 255;
121 temp += coordinate[1];
163 int largest_size = 0;
166 for (
int i = 0; i < labels_count; i++) {
169 if (labels[i].
pixel_cnt > largest_size) {
176 if (largest_id >= 0) {
179 for (
int y = 0; y < dst.
h; y++) {
180 for (
int x = 0; x < dst.
w / 2; x++) {
181 if (l[y * dst.
w + x] != 0xffff) {
183 if (l[y * dst.
w + x] == largest_id) {
186 p[y * dst.
w * 2 + x * 4] =
c;
187 p[y * dst.
w * 2 + x * 4 + 1] = 0x80;
188 p[y * dst.
w * 2 + x * 4 + 2] =
c;
189 p[y * dst.
w * 2 + x * 4 + 3] = 0x80;
198 if ((cgx > 1) && (cgx < (dst.
w - 2)) &&
199 (cgy > 1) && (cgy < (dst.
h - 2))
201 p[cgy * dst.
w * 2 + cgx * 2 - 4] = 0xff;
202 p[cgy * dst.
w * 2 + cgx * 2 - 2] = 0x00;
203 p[cgy * dst.
w * 2 + cgx * 2] = 0xff;
204 p[cgy * dst.
w * 2 + cgx * 2 + 2] = 0x00;
205 p[cgy * dst.
w * 2 + cgx * 2 + 4] = 0xff;
206 p[cgy * dst.
w * 2 + cgx * 2 + 6] = 0x00;
207 p[(cgy - 1)*dst.
w * 2 + cgx * 2] = 0xff;
208 p[(cgy - 1)*dst.
w * 2 + cgx * 2 + 2] = 0x00;
209 p[(cgy + 1)*dst.
w * 2 + cgx * 2] = 0xff;
210 p[(cgy + 1)*dst.
w * 2 + cgx * 2 + 2] = 0x00;
226 #include "generated/flight_plan.h"
297 printf(
"Found %d %d \n", x, y);
uint8_t filter
Which filter triggered this blob.
VIC slots used for the LPC2148 define name e g gps UART1_VIC_SLOT e g modem SPI1_VIC_SLOT SPI1 in mcu_periph spi_arch c or spi_slave_hs_arch c(and some others not using the SPI peripheral yet..) I2C0_VIC_SLOT 8 mcu_periph/i2c_arch.c I2C1_VIC_SLOT 9 mcu_periph/i2c_arch.c USB_VIC_SLOT 10 usb
void image_create(struct image_t *img, uint16_t width, uint16_t height, enum image_type type)
Create a new image.
uint8_t cv_blob_locator_type
volatile bool blob_enabled
void cv_blob_locator_init(void)
void image_labeling(struct image_t *input, struct image_t *output, struct image_filter_t *filters, uint8_t filters_cnt, struct image_label_t *labels, uint16_t *labels_count)
struct image_t * cv_marker_func(struct image_t *img, uint8_t camera_id)
struct video_listener * cv_add_to_device(struct video_config_t *device, cv_function func, uint16_t fps, uint8_t id)
void georeference_filter(bool kalman, int wp, int length)
void georeference_init(void)
void image_free(struct image_t *img)
Free the image.
volatile bool window_enabled
uint32_t pixel_cnt
Number of pixels in the blob.
int32_t px
Target pixel coordinate (left = 0)
@ IMAGE_GRAYSCALE
Grayscale image with only the Y part (uint8 per pixel)
uint16_t detect_window_sizes(uint8_t *in, uint32_t image_width, uint32_t image_height, uint16_t *coordinate, uint32_t *integral_image, uint8_t MODE)
uint8_t cv_blob_locator_reset
struct marker_deviation_t marker(struct image_t *input, uint8_t M)
void image_to_grayscale(struct image_t *input, struct image_t *output)
Convert an image to grayscale.
int32_t py
Target pixel coordinate (top = 0)
volatile uint32_t blob_locator
struct image_t * cv_blob_locator_func(struct image_t *img, uint8_t camera_id)
void cv_blob_locator_start(void)
void start_vision_land(void)
void cv_blob_locator_event(void)
volatile bool marker_enabled
int32_t w
Frame width [px].
void georeference_project(struct camera_frame_t *tar, int wp)
void cv_blob_locator_stop(void)
int32_t f
Camera Focal length in [px].
void cv_blob_locator_periodic(void)
uint8_t y_min
YUV color filter.
void * buf
Image buffer (depending on the image_type)
int32_t h
Frame height [px].
struct image_t * cv_window_func(struct image_t *img, uint8_t camera_id)
@ IMAGE_GRADIENT
An image gradient (int16 per pixel)
#define BLOB_LOCATOR_FPS
Default FPS (zero means run at camera fps)
uint32_t x_sum
Sum of all x coordinates (used to find center of gravity)