Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
opencv_example.cpp
Go to the documentation of this file.
1/*
2 * Copyright (C) C. De Wagter
3 *
4 * This file is part of paparazzi
5 *
6 * paparazzi is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * paparazzi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with paparazzi; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
19 */
27#include "opencv_example.h"
28
29
30
31using namespace std;
32#include <opencv2/core/core.hpp>
33#include <opencv2/imgproc/imgproc.hpp>
34using namespace cv;
36
37
38int opencv_example(char *img, int width, int height)
39{
40 // Create a new image, using the original bebop image.
41 Mat M(height, width, CV_8UC2, img);
42 Mat image;
43
44#if OPENCVDEMO_GRAYSCALE
45 // Grayscale image example
47 // Canny edges, only works with grayscale image
48 int edgeThresh = 35;
50 // Convert back to YUV422, and put it in place of the original image
51 grayscale_opencv_to_yuv422(image, img, width, height);
52#else // OPENCVDEMO_GRAYSCALE
53 // Color image example
54 // Convert the image to an OpenCV Mat
56 // Blur it, because we can
57 blur(image, image, Size(5, 5));
58 // Convert back to YUV422 and put it in place of the original image
59 colorbgr_opencv_to_yuv422(image, img, width, height);
60#endif // OPENCVDEMO_GRAYSCALE
61
62 return 0;
63}
uint16_t foo
Definition main_demo5.c:58
int opencv_example(char *img, int width, int height)
void grayscale_opencv_to_yuv422(Mat image, char *img, int width, int height)
void colorbgr_opencv_to_yuv422(Mat image, char *img, int width, int height)
A small library with functions to convert between the Paparazzi used YUV422 arrays and the opencv ima...