Project Name: perimeter.dpj Project Type: ADSP-BF533 [X] ADSP-BF537 [ ] ADSP-BF561 [ ] Hardware Used: ADSP-BF533 EZ-Kit VisualDSP++ Emulator System Services Components Used: None OVERVIEW ======== The perimeter function produces the boundary of a binary image. The boundary is detected by examining the neighboring pixels. The pixels used for calculations are p_top p_left p_boundary p_right p_bottom if p_boundary ==1 and any of neighbor pixel under consideration is zero then output==1 else output==0; The function is demonstrated below by Equivalent C code. if (((p_top==0)|| (p_left==0) || (p_right==0) || (p_bottom==0) ) & (p_boundary==1)) output=1; else output=0; This is implemented using a mask | 0 1 0 | | 1 -4 1 | | 0 1 0 | and comparing the result for nonzero value. In output image, first row,last row, first column and last columns are same as input. This will work only if the number of columns in the input image is an even number and aligned to 4 byte or 2 byte boundary. Prototype: void _perimeter(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 : A0, A1, R0-R3, R5-R7, M0, M1, P0-P5, LC0, LC1. RUNNING THE APPLICATION (on the ADSP-BF533 EZ-KIT Lite) ======================================================= 1) Load project "perimeter.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: "./perimeter.ldf" - linker description file "./perimeter.dpj" - project file "../../src/t_perimeter.c" - source file "../../src/perimeter.asm" - source file "../../src/perimeter.h" - include file "../../../../BFinUtils/ADSP-BF561/SDK-cycle_count.asm" - source file "../../../../Include/SDK-cycle_count.h" - source file