Project Name: median.dpj Project Type: ADSP-BF533 [X] ADSP-BF537 [ ] ADSP-BF561 [ ] Hardware Used: ADSP-BF533 EZ-Kit VisualDSP++ Emulator System Services Components Used: None OVERVIEW ======== In the median function, each pixel is replaced by median of gray levels in a neighbourhood of that pixel. Border of the output image is same as input image. The median M of a set of values is such that half the values in the set are less than M and half are greater than M. This filter removes the effect of extreme values from data. This routine is helpful in removing the effect of impulsive noise in images. The algorithm is implemented as follows: The 3x3 median filtering is used here. The 3 elements of each row are arranged in MAX,MED and MIN values. | MAX0 MED0 MIN0 | | MAX1 MED1 MIN1 | | MAX2 MED2 MIN2 | Later, the MIN of the first column, the median of the second column and the MAX of the third column are taken. The median of the three pixels is written as output. In the output image, the border pixels are the same as the input pixel. Prototype: void _median(unsigned char* in, int row, int col, unsigned char *out ); Arguments: in -> pointer to the input image. row -> number of rows of input image. col -> number of columns of input image. out -> pointer the output buffer. Registers used : R0-R7, I0, M0, P0-P5, LC0, LC1. RUNNING THE APPLICATION (on the ADSP-BF533 EZ-KIT Lite) ========================================================= 1) Load project "median.dpj". 2) Select "Project->Rebuild Project" 3) Select "Debug->Run". 4) Observe output on VisualDSP++ console window. Files in This Application ========================== This example consists of the following files: "./median.ldf" - linker description file "./median.dpj" - project file "../../src/t_median.c" - source file "../../src/median.asm" - source file "../../include/median.h" - include file "../../../../BFinUtils/ADSP-BF533/SDK-cycle_count.asm" - source file "../../../../Include/SDK-cycle_count.asm" - source file