Developer World
Spresense SDK Library v3.2.0-ebc0364
edge_detection.h
Go to the documentation of this file.
1/****************************************************************************
2 * modules/include/digital_filter/edge_detection.h
3 *
4 * Copyright 2021 Sony Semiconductor Solutions Corporation
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
15 * distribution.
16 * 3. Neither the name of Sony Semiconductor Solutions Corporation nor
17 * the names of its contributors may be used to endorse or promote
18 * products derived from this software without specific prior written
19 * permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *
34 ****************************************************************************/
35
40#ifndef __INCLUDE_EDGE_DETECTION_H
41#define __INCLUDE_EDGE_DETECTION_H
42
50#include <nuttx/config.h>
51
52#include <stdint.h>
53
54#define EDGE_DETECT_TYPE_RISE (0)
55#define EDGE_DETECT_TYPE_FALL (1)
69 int type;
70 uint32_t prev_width;
71 uint32_t width;
72 float *boundary;
73 float *sub_buf;
74 float *remain_data;
75};
76
82typedef struct edge_detectf_s edge_detectf_t;
83
91 int type;
92 uint32_t prev_width;
93 uint32_t width;
94 int16_t *boundary;
95 int16_t *sub_buf;
96 int16_t *remain_data;
97};
98
104typedef struct edge_detects_s edge_detects_t;
105
108# ifdef __cplusplus
109# define EXTERN extern "C"
110extern "C"
111{
112# else
113# define EXTERN extern
114# endif
115
116/********************************************************************************
117 * Public Function Prototypes
118 ********************************************************************************/
119
137edge_detectf_t *edge_detection_createf(float *boundary_data, int datalen,
138 uint32_t keep_width, int type);
139
147
159int edge_detectf(edge_detectf_t *detector, float *input, uint32_t len);
160
171
184edge_detects_t *edge_detection_creates(int16_t *boundary_data, int datalen,
185 uint32_t keep_width, int type);
186
194
206int edge_detects(edge_detects_t *detector, int16_t *input, uint32_t len);
207
218
221# undef EXTERN
222# ifdef __cplusplus
223}
224# endif
225
228#endif /* __INCLUDE_EDGE_DETECTION_H */
int edge_detectf(edge_detectf_t *detector, float *input, uint32_t len)
void edge_detection_deletes(edge_detects_t *detector)
edge_detects_t * edge_detection_creates(int16_t *boundary_data, int datalen, uint32_t keep_width, int type)
edge_detectf_t * edge_detection_createf(float *boundary_data, int datalen, uint32_t keep_width, int type)
int edge_detection_resetf(edge_detectf_t *detector)
int edge_detects(edge_detects_t *detector, int16_t *input, uint32_t len)
void edge_detection_deletef(edge_detectf_t *detector)
int edge_detection_resets(edge_detects_t *detector)
Definition: edge_detection.h:68
Definition: edge_detection.h:90