Project Name: skeleton.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 skeleton function preserves the orientation of a shape, removing excess information. It is the way to decompose an object into a set of unique characteristics or features that can be used to identify the object. The skeleton function performs the skeleton operation on an input binary image. Skeletonization is achieved by repeating the erosion and the opening operation, and finding the difference. The nth order difference between the eroded image and the opening of the eroded image is defined by: Kn(A)=En(A)-open(En(A),B). The skeleton of object A becomes the union of all N terms of Kn(A), implemented until the nth erosion of A by nB yields the NULL set. The structured elements used are demonstrated below. | 0 1 0 | | 1 1 1 | | 0 1 0 | Only the basic operation is implemented in this routine. The erosion and opening operation on an object A is performed, and the difference between the two is calculated, to produce a partial result. The Union of these partial results is the final result. The user calls this routine such that the eroded result becomes the input for next iteration. The user passes the previous partial output as the output array, because the OR operation is done on the present result, and the previous results. The result of the opening operation is stored on the stack, before calculating the difference. For this function to work, the number of columns in the input image must be an even number, aligned to a word or half word boundary. The output buffer must be cleared for the first time calling this function. After that it contains the previous results, which must also be aligned to word or half word boundary. Prototype: void _skeleton(unsigned char* in, int row, int col, unsigned char * erode_res, unsigned char *out ); Arguments: in - pointer to the input image. row - number of rows of input image. col - number of columns of input image. erode_res - pointer to temp where output of erosion is stored. out - pointer the output buffer. Registers used : A0, A1, R0-R7, I0, I2, I3, M0-M2, P0-P5, LC0, LC1. RUNNING THE APPLICATION (on the ADSP-BF533 EZ-KIT Lite) =========================================================== 1) Load project "skeleton.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: "./skeleton.ldf" - linker description file "./skeleton.dpj" - project file "../../src/t_skeleton.c" - source file "../../src/skeleton.asm" - source file "../../include/skeleton.h" - include file "../../../../BFinUtils/ADSP-BF533/SDK-cycle_count.asm" - source file "../../../../Include/SDK-cycle_count.h" - include file