Hi, Use bwmorph function (images toolbox) options to detect borders and thin it. then find the the number of border pixels using nnz function. Joe BSTeX- Equation viewer for Matlab http://www.geocities.com/bstex2001 --- uestcgao <> wrote: > Dear all, > > Hi! I am doing some research about the steganography > in BPCS way created by a Japanese professor. BPCS > means Bit Plane Complexity Segementation.It needs > calculating the complexity of an image in advance. > The concept of Complexity is defined as the > following: ********************************************************************* > The length of black-and-white border in a binary > image is a good > measure for an image complexity. If the border is > long, the image is > complex, otherwise it is simple. The total length of > black-and-white > border equals to the summation of the number of > color-changes along > the rows and columns in an image. For example, a > single black pixel > surrounded by white background pixels has the > boarder length of 4. > We will define the image complexity by the > following. > = k/(The max possible B-W changes in the > image) > Where, k is the total length of black-and-white > border in the image. > So, the value ranges over: 0<=lt;=1 > Notice:B-W changes means black to white change > image format is BMP > ********************************************************************* > > > if we define "nccc" as the total number of color > change along row > and "nccc" as the total number of color change along > column and the > size for the BMP image is width*height,then we can > easily get the > complexity of an image as: > (nccc+nccr)/[ 2*width*height-(width+height)].I have > finished this > computation in C language.To continue this research > I have to > compute the complexities of local areas in an > image.Generally the > size of a local area means a 8*8 block of that > image. > > Instead of C language,I would like to use Matlab to > wtite this > program. Clearly I should use blkproc > function(B=blkproc(A,[8 > 8],fun)).However I am not familiar with Matlab and > do not know how > to write the fun here.Could you give me your help? > > Thanks all! > > Maya __________________________________ |