From d16c6987896797eb2b36ee4271a2025bd3108fa9 Mon Sep 17 00:00:00 2001 From: chunyexixiaoyu <834670833@qq.com> Date: Thu, 19 Aug 2021 09:57:19 +0800 Subject: [PATCH] APP_Framework/Framework/:complete ordinary mean_filter --- .../filter/mean_filter/ordinary_mean_filter.c | 17 ++++++++++++++++- .../filter/mean_filter/ordinary_mean_filter.h | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/APP_Framework/Framework/knowing/filter/mean_filter/ordinary_mean_filter.c b/APP_Framework/Framework/knowing/filter/mean_filter/ordinary_mean_filter.c index e78fd643..33b4b449 100644 --- a/APP_Framework/Framework/knowing/filter/mean_filter/ordinary_mean_filter.c +++ b/APP_Framework/Framework/knowing/filter/mean_filter/ordinary_mean_filter.c @@ -1 +1,16 @@ -#include \ No newline at end of file +#include +/** + * @description: + * @param {int *} hander array address + * @param {int} len array length + * @return {*} + */ +int OrdinaryMeanFilter(int * hander,int len) +{ + int sum = 0; + for(int i = 0;i < len ;i++) + { + sum = sum + *(hander +i); + } + return (int)(sum/len); +} \ No newline at end of file diff --git a/APP_Framework/Framework/knowing/filter/mean_filter/ordinary_mean_filter.h b/APP_Framework/Framework/knowing/filter/mean_filter/ordinary_mean_filter.h index 5ead554e..bf5bba52 100644 --- a/APP_Framework/Framework/knowing/filter/mean_filter/ordinary_mean_filter.h +++ b/APP_Framework/Framework/knowing/filter/mean_filter/ordinary_mean_filter.h @@ -1,4 +1,4 @@ #ifndef _ORDINARY_MEAN_FILTER_H #define _ORDINARY_MEAN_FILTER_H - +int OrdinaryMeanFilter(int * hander,int len); #endif \ No newline at end of file