Skip to content

Commit

Permalink
[detect_window]
Browse files Browse the repository at this point in the history
  • Loading branch information
dewagter committed Sep 17, 2015
1 parent 8f873a9 commit b65b2cf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
27 changes: 15 additions & 12 deletions sw/airborne/modules/computer_vision/cv_blob_locator.c
Expand Up @@ -95,20 +95,23 @@ bool_t cv_window_func(struct image_t *img) {
int px = coordinate[0] & 0xFFFe;
int py = coordinate[1] & 0xFFFe;

for (int y = 0; y < img->h-1; y++) {
Img(px, y) = 65;
Img(px+1, y) = 255;
}
for (int x = 0; x < img->w-1; x+=2) {
Img(x, py) = 65;
Img(x+1, py) = 255;
}
if (response < 92) {

for (int y = 0; y < img->h-1; y++) {
Img(px, y) = 65;
Img(px+1, y) = 255;
}
for (int x = 0; x < img->w-1; x+=2) {
Img(x, py) = 65;
Img(x+1, py) = 255;
}

uint32_t temp = coordinate[0];
temp = temp << 16;
temp += coordinate[1];
blob_locator = temp;
uint32_t temp = coordinate[0];
temp = temp << 16;
temp += coordinate[1];
blob_locator = temp;

}

return FALSE;
}
Expand Down
2 changes: 1 addition & 1 deletion sw/airborne/modules/computer_vision/detect_window.c
Expand Up @@ -267,7 +267,7 @@ uint16_t get_window_response(uint16_t x, uint16_t y, uint16_t feature_size, uint
resp = RES;
}
} else { //if(MODE == MODE_BRIGHT)
if (inner_area > 0) {
if (inner_area > 0 && (inner_area / px_inner) > 0) {
resp = (RES * (whole_area - inner_area) / px_border) / (inner_area / px_inner);
//printf("%u: %u %u %u %u\n",resp,(RES*RES*(whole_area - inner_area)/px_border), (inner_area/px_inner), px_inner, px_border);
} else {
Expand Down

0 comments on commit b65b2cf

Please sign in to comment.