Project Name: median.dpj Project Group Name: median.dpg Project Type: ADSP-BF533 [ ] ADSP-BF537 [ ] ADSP-BF561 [X] Hardware Used: ADSP-BF561 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-BF561 EZ-KIT Lite) =========================================================== 1) Load project group "median.dpg". 2) Select "Project->Rebuild Project" 3) Click OK in the "Load Multiprocessor Confirmation" window to load p0.dxe and p1.dxe. 4) Select "Debug->Multiprocessor Run". 5) 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 "./median.dpg" - project group file "corea/corea.dpj" - Core A project file "../../src/t_median.c" - Core A source file "../../src/median.asm" - Core A source file "../../../../BFinUtils/ADSP-BF561/SDK-cycle_count.asm" - Core A source file "../../include/median.h" - Core A include file "../../../../Include/SDK-cycle_count.h" - Core A include file "coreb/coreb.dpj" - Core B project file "../../../../BFinUtils/ADSP-BF561/SDK-coreb_idle.c - Core B source file "sml2/sml2.dpj" - Shared Memory L2 project file "../../../../BFinUtils/ADSP-BF561/SDK-dummy.c - Shared Memory L2 source file "sml3/sml3.dpj" - Shared Memory L3 project file "../../../../BFinUtils/ADSP-BF561/SDK-dummy.c - Shared Memory L3 source file