Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'computervisionframework' Closes #1328
Conflicts: conf/airframes/BR/bebop_indi.xml sw/airborne/modules/computer_vision/viewvideo.c
- Loading branch information
Showing
20 changed files
with
577 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,5 @@ BOARD_CFG = \"boards/pc_sim.h\" | |
|
||
$(TARGET).ARCHDIR = $(ARCH) | ||
|
||
MODEM_HOST ?= 127.0.0.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<!DOCTYPE module SYSTEM "module.dtd"> | ||
|
||
<module name="video_thread" dir="computer_vision"> | ||
<doc> | ||
<description> | ||
Video streaming for Linux devices | ||
|
||
- Sends a RTP/UDP stream of the camera | ||
- Possibility to save an image(shot) on the internal memory (JPEG, full size, best quality) | ||
</description> | ||
<define name="video_thread_DEVICE" value="/dev/video1" description="The video device to capture from"/> | ||
<define name="video_thread_DEVICE_SIZE" value="1280,720" description="Video capture size (width, height)"/> | ||
<define name="video_thread_DEVICE_BUFFERS" value="10" description="Amount of V4L2 image buffers"/> | ||
<define name="video_thread_FPS" value="4" description="Video stream frame rate"/> | ||
<define name="video_thread_SHOT_PATH" value="/data/video/images" description="Path where the images should be saved"/> | ||
</doc> | ||
<settings> | ||
<dl_settings> | ||
<dl_settings name="video"> | ||
<dl_setting var="video_thread.take_shot" min="0" step="1" max="1" shortname="take_shot" module="computer_vision/video_thread" handler="take_shot"> | ||
<strip_button name="Shoot" icon="digital-camera.png" value="1" group="video"/> | ||
</dl_setting> | ||
</dl_settings> | ||
</dl_settings> | ||
</settings> | ||
|
||
<header> | ||
<file name="video_thread.h"/> | ||
</header> | ||
|
||
<init fun="video_thread_init()"/> | ||
<periodic fun="video_thread_periodic()" freq="1" start="video_thread_start()" stop="video_thread_stop()" autorun="TRUE"/> | ||
<makefile target="ap"> | ||
|
||
<file name="video_thread.c"/> | ||
<file name="cv.c"/> | ||
|
||
<!-- Include the needed Computer Vision files --> | ||
<define name="modules/computer_vision" type="include"/> | ||
<file name="image.c" dir="modules/computer_vision/lib/vision"/> | ||
<file name="v4l2.c" dir="modules/computer_vision/lib/v4l"/> | ||
<file name="jpeg.c" dir="modules/computer_vision/lib/encoding"/> | ||
|
||
<!-- Random flags --> | ||
<define name="__USE_GNU"/> | ||
<flag name="LDFLAGS" value="lrt"/> | ||
<flag name="LDFLAGS" value="static-libgcc"/> | ||
</makefile> | ||
<makefile target="nps"> | ||
<file name="video_thread_nps.c"/> | ||
<file name="cv.c"/> | ||
<file name="image.c" dir="modules/computer_vision/lib/vision"/> | ||
<file name="jpeg.c" dir="modules/computer_vision/lib/encoding"/> | ||
<flag name="LDFLAGS" value="lpthread"/> | ||
</makefile> | ||
</module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright (C) 2015 | ||
* | ||
* This file is part of Paparazzi. | ||
* | ||
* Paparazzi is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2, or (at your option) | ||
* any later version. | ||
* | ||
* Paparazzi is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with paparazzi; see the file COPYING. If not, see | ||
* <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
/** | ||
* @file modules/computer_vision/cv.c | ||
* | ||
* Computer vision framework for onboard processing | ||
*/ | ||
|
||
#include "cv.h" | ||
|
||
#define MAX_CV_FUNC 10 | ||
|
||
int cv_func_cnt = 0; | ||
cvFunction cv_func[MAX_CV_FUNC]; | ||
|
||
void cv_add(cvFunction func) | ||
{ | ||
if (cv_func_cnt < (MAX_CV_FUNC - 1)) { | ||
cv_func[cv_func_cnt] = func; | ||
cv_func_cnt++; | ||
} | ||
} | ||
|
||
void cv_run(struct image_t *img) | ||
{ | ||
for (int i = 0; i < cv_func_cnt; i++) { | ||
cv_func[i](img); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (C) 2015 | ||
* | ||
* This file is part of Paparazzi. | ||
* | ||
* Paparazzi is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2, or (at your option) | ||
* any later version. | ||
* | ||
* Paparazzi is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with paparazzi; see the file COPYING. If not, see | ||
* <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
/** | ||
* @file modules/computer_vision/cv.h | ||
* | ||
* Computer vision framework for onboard processing | ||
*/ | ||
|
||
|
||
#ifndef CV_H_ | ||
#define CV_H_ | ||
|
||
#include "std.h" | ||
#include "lib/vision/image.h" | ||
|
||
typedef bool_t (*cvFunction)(struct image_t *img); | ||
|
||
extern void cv_add(cvFunction func); | ||
extern void cv_run(struct image_t *img); | ||
|
||
#endif /* CV_H_ */ |
Oops, something went wrong.