ImageEn, unit ievision

TIEVisionWatershed.setMarkers

TIEVisionWatershed.setMarkers


Declaration

procedure setMarkers(labelValue: int32_t); overload; safecall;
procedure setMarkers(selectionMask: IIEMask; labelValue: int32_t); overload; safecall;
procedure setMarkers(image: TIEVisionImage); overload; safecall;


Description

Set the markers bitmap with the specified value, selection mask or image content.

Here is an example Watershed image:



Which generates the following selection:



Parameter Description
labelValue Label value. -1 = background, 0 = unknown, N... region N
selectionMask Only selected pixels are set
image Each color found in the image represents a marker (label). Each marker is build using following formula: B or (G shl 8) or (R shl 16). Only ie24RGB pixel format is supported


Videos

Demo  youtu.be/Zp4snU4p9qQ
Demo  youtu.be/bu9GPE7pxSI
Demo  youtu.be/XWtoaljsfkE


Demo

Demo  Demos\IEVision\WatershedSelection\WatershedSelection.dpr


Example

// sets currently selected pixels as region 1
ws.setMarkers(ImageEnView1.SelectionMask, 1);

// sets labels with the colors found in ImageEnView1.IEBitmap
ws.setMarkers(0);
ws.setMarkers(ImageEnView1.IEBitmap.GetIEVisionImage());