Programming Examples - CRI JOLANTA
28Programming ExamplesBlob analysis (MIL example )This program counts the number of objects in an image and locates the center of gravity of each objects.#include < >#include < >/* Maximum number of blobs and minimum area of blobs. */#define MAX_BLOBS100L#define MIN_BLOB_AREA50L#define IMAGE_FILE" "#define THRESHOLD_VALUE24Lvoid main(void){MIL_ID MilApplication,/* Application identifier. */MilSystem,/* System identifier. */Millmage,/* Image buffer identifier. */BlobResult,/* Blob result buffer identifier. */FeatureList;/* Feature list identifier. */long TotalBlobs,/* Total number of blobs. */CogX[MAX_BLOBS],/* X coordinate of center of gravity. */CogY[MAX_BLOBS]/* Y coordinate of center of gravity. */n;/* Counter. *//* Allocate defaults. */MappAllocDefault(M_SETUP, &MilApplication, &MilSystem, M_NULL, M_NULL, &MilImage);/* Load source image into image buffer. */MbufLoad(IMAGE_FILE, Millmage);/* Binarize image.}
28 Programming Examples Blob analysis (MIL example) This program counts the number of objects in an image and locates the center of gravity of each objects.
Download Programming Examples - CRI JOLANTA
Information
Domain:
Source:
Link to this page:
Please notify us if you found a problem with this document: