CreateEdgeOfParticle

Declaration: CreateEdgeOfParticle(PartIx: integer; PartData: TInt2DArray; var EdgePixels: TInt2DArray; var AnchorX, AnchorY: integer): integer;
The function CreateEdgeOfParticle detects the edge of a single particle. The particle is defined by the matrix PartData. All pixels belonging to the particle have the value PartIx, all other pixels are zero. The resulting edge is returned in the matrix EdgePixels. The edge pixels are 1, all other pixels are 0. The variable parameters AnchorX and AnchorY return the coordinates of a single pixel of the edge. This information can be used as an anchor for other processes.

The function returns the number of pixels along the found edge.

Hint: Please note that in the case of multiple particles contained in PartData the anchor coordinates will point to the left-most particle. If several particles have their left boundary at the same horizontal position [AnchorX,AnchorY] will point to the particle with the lowest y coordinate.