72 #define Img(X,Y)(((uint8_t*)img->buf)[(Y)*img->w*2+(X)*2])
96 int px = coordinate[0] & 0xFFFe;
97 int py = coordinate[1] & 0xFFFe;
101 for (
int y = 0; y < img->
h-1; y++) {
105 for (
int x = 0; x < img->
w-1; x+=2) {
112 temp += coordinate[1];
152 int largest_size = 0;
155 for (
int i=0; i<labels_count; i++) {
158 if (labels[i].
pixel_cnt > largest_size) {
169 for (
int y=0;y<dst.
h;y++) {
170 for (
int x=0;x<dst.
w/2;x++) {
171 if (l[y*dst.
w+x] != 0xffff) {
173 if (l[y*dst.
w+x] == largest_id) {
177 p[y*dst.
w*2+x*4+1]=0x80;
178 p[y*dst.
w*2+x*4+2]=c;
179 p[y*dst.
w*2+x*4+3]=0x80;
188 if ((cgx > 1) && (cgx < (dst.
w-2)) &&
189 (cgy > 1) && (cgy < (dst.
h-2))
191 p[cgy*dst.
w*2+cgx*2-4] = 0xff;
192 p[cgy*dst.
w*2+cgx*2-2] = 0x00;
193 p[cgy*dst.
w*2+cgx*2] = 0xff;
194 p[cgy*dst.
w*2+cgx*2+2] = 0x00;
195 p[cgy*dst.
w*2+cgx*2+4] = 0xff;
196 p[cgy*dst.
w*2+cgx*2+6] = 0x00;
197 p[(cgy-1)*dst.
w*2+cgx*2] = 0xff;
198 p[(cgy-1)*dst.
w*2+cgx*2+2] = 0x00;
199 p[(cgy+1)*dst.
w*2+cgx*2] = 0xff;
200 p[(cgy+1)*dst.
w*2+cgx*2+2] = 0x00;
216 #include "generated/flight_plan.h"
287 printf(
"Found %d %d \n",x,y);
uint32_t x_sum
Sum of all x coordinates (used to find center of gravity)
int32_t px
Target pixel coordinate (left = 0)
void cv_blob_locator_init(void)
uint8_t cv_blob_locator_reset
uint8_t y_min
YUV color filter.
void cv_blob_locator_stop(void)
volatile bool_t window_enabled
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)
void image_free(struct image_t *img)
Free the image.
bool_t cv_marker_func(struct image_t *img)
void image_create(struct image_t *img, uint16_t width, uint16_t height, enum image_type type)
Create a new image.
void georeference_init(void)
bool_t cv_window_func(struct image_t *img)
uint16_t pixel_cnt
Number of pixels in the blob.
void georeference_project(struct camera_frame_t *tar, int wp)
void cv_blob_locator_periodic(void)
int32_t py
Target pixel coordinate (top = 0)
Computer vision framework for onboard processing.
uint8_t cv_blob_locator_type
void * buf
Image buffer (depending on the image_type)
volatile uint32_t blob_locator
Parse UYVY images and make a list of blobs of connected pixels.
void video_thread_take_shot(bool_t take)
Take a shot and save it This will only work when the streaming is enabled.
void cv_add(cvFunction func)
void image_to_grayscale(struct image_t *input, struct image_t *output)
Convert an image to grayscale.
void start_vision_land(void)
volatile bool_t marker_enabled
int32_t h
Frame height [px].
void cv_blob_locator_event(void)
int32_t f
Camera Focal length in [px].
int32_t w
Frame width [px].
Grayscale image with only the Y part (uint8 per pixel)
volatile bool_t blob_enabled
bool_t cv_blob_locator_func(struct image_t *img)
void cv_blob_locator_start(void)
An image gradient (int16 per pixel)
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 marker_deviation_t marker(struct image_t *input, uint8_t M)
Detect a bright region surrounded by dark or viceversa - sometimes this corresponds to a window...
void georeference_filter(bool_t kalman, int wp, int length)