資源簡介
基礎的圖像處理算法C語言源碼,很方便移植到各種arm處理器使用

代碼片段和文件信息
#include?
#include?
#include?“imlib.h“
#include?“xalloc.h“
#include?“fb_alloc.h“
#include?“gc.h“
#define?MAX_ROW?????????(480)
#define?MAX_CORNERS?????(2000)
#define?Compare(X?Y)?((X)>=(Y))
typedef?struct?{
????uint16_t?x;
????uint16_t?y;
????uint16_t?score;
}?corner_t;
static?int?s_width=-1;
static?int_fast16_t?s_offset0;
static?int_fast16_t?s_offset1;
static?int_fast16_t?s_offset2;
static?int_fast16_t?s_offset3;
static?int_fast16_t?s_offset4;
static?int_fast16_t?s_offset5;
static?int_fast16_t?s_offset6;
static?int_fast16_t?s_offset7;
static?corner_t?*agast58_detect(image_t?*img?int?b?int*?num_corners?rectangle_t?*roi);
static?int?agast58_score(const?unsigned?char*?p?int?bstart);
static?void?nonmax_suppression(corner_t?*corners?int?num_corners?array_t?*keypoints);
static?kp_t?*alloc_keypoint(uint16_t?x?uint16_t?y?uint16_t?score)
{
????//?Note?must?set?keypoint?descriptor?to?zeros
????kp_t?*kpt?=?xalloc0(sizeof*kpt);
????kpt->x?=?x;
????kpt->y?=?y;
????kpt->score?=?score;
????return?kpt;
}
static?void?init5_8_pattern(int?image_width)
{
if(image_width==s_width)
return;
s_width=image_width;
s_offset0=(-1)+(0)*s_width;
s_offset1=(-1)+(-1)*s_width;
s_offset2=(0)+(-1)*s_width;
s_offset3=(1)+(-1)*s_width;
s_offset4=(1)+(0)*s_width;
s_offset5=(1)+(1)*s_width;
s_offset6=(0)+(1)*s_width;
s_offset7=(-1)+(1)*s_width;
}
void?agast_detect(image_t?*image?array_t?*keypoints?int?threshold?rectangle_t?*roi)
{
????int?num_corners=0;
init5_8_pattern(image->w);
????//?Find?corners
????corner_t?*corners?=?agast58_detect(image?threshold?&num_corners?roi);
????if?(num_corners)?{
????????//?Score?corners
????????for(int?i=0;?i ????????????corners[i].score?=?agast58_score(image->pixels?+?(corners[i].y*image->w?+?corners[i].x)?threshold);
????????}
????????//?Non-max?suppression
????????nonmax_suppression(corners?num_corners?keypoints);
????}
????//?Free?corners;
????fb_free();
}
static?void?nonmax_suppression(corner_t?*corners?int?num_corners?array_t?*keypoints)
{
????gc_info_t?info;
int?last_row;
int16_t?row_start[MAX_ROW+1];
const?int?sz?=?num_corners;
/*?Point?above?points?(roughly)?to?the?pixel?above
???????the?one?of?interest?if?there?is?a?feature?there.*/
int?point_above?=?0;
int?point_below?=?0;
/*?Find?where?each?row?begins?(the?corners?are?output?in?raster?scan?order).
???????A?beginning?of?-1?signifies?that?there?are?no?corners?on?that?row.?*/
last_row??=?corners[sz-1].y;
for(int?i=0;?i row_start[i]?=?-1;
????}
????for?(int?i=0?prev_row=-1;?i ????????corner_t?*c?=?&corners[i];
????????if?(c->y?!=?prev_row)?{
????????????row_start[c->y]?=?i;
????????????prev_row?=?c->y;
????????}
????}
????for(int?i=0;?i ????????corner_t?pos?=?corners[i];
????????uint16_t?score?=?pos.score;
????????/*Check?left?*/
????????if?(i?>?0)?{
????????????if?(corners[i-1].x?==?pos.x-1?&&?corners[i-1].y?==?pos.y?&&?Compare(corners[i-1].score?sco
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????32434??2018-12-10?11:20??img\agast.c
?????文件?????371793??2018-12-10?11:20??img\apriltag.c
?????文件??????35475??2018-12-10?11:20??img\binary.c
?????文件??????48970??2018-12-10?11:20??img\blob.c
?????文件???????9698??2018-12-10?11:20??img\bmp.c
?????文件?????215433??2018-12-10?11:20??img\cascade.h
?????文件??????20811??2018-12-10?11:20??img\clahe.c
?????文件??????10600??2018-12-10?11:20??img\collections.c
?????文件???????3342??2018-12-10?11:20??img\collections.h
?????文件?????194820??2018-12-10?11:20??img\dmtx.c
?????文件??????13132??2018-12-10?11:20??img\draw.c
?????文件???????5043??2018-12-10?11:20??img\edge.c
?????文件???????4222??2018-12-10?11:20??img\eye.c
?????文件?????205469??2018-12-10?11:20??img\fast.c
?????文件??????35735??2018-12-10?11:20??img\fft.c
?????文件???????1873??2018-12-10?11:20??img\fft.h
?????文件??????69042??2018-12-10?11:20??img\filter.c
?????文件???????4031??2018-12-10?11:20??img\fmath.c
?????文件????????697??2018-12-10?11:20??img\fmath.h
?????文件??????11334??2018-12-10?11:20??img\font.c
?????文件????????406??2018-12-10?11:20??img\font.h
?????文件???????7950??2018-12-10?11:20??img\fsort.c
?????文件????????349??2018-12-10?11:20??img\fsort.h
?????文件???????3700??2018-12-10?11:20??img\gif.c
?????文件??????11016??2018-12-10?11:20??img\haar.c
?????文件???????4295??2018-12-10?11:20??img\hog.c
?????文件??????36078??2018-12-10?11:20??img\hough.c
?????文件??????30502??2018-12-10?11:20??img\imlib.c
?????文件??????52985??2018-12-10?11:20??img\imlib.h
?????文件???????3233??2018-12-10?11:20??img\integral.c
............此處省略32個文件信息
評論
共有 條評論