Profile¶
Profile Sampling¶
A profile is a series of pixel values sampled along a line, a path or a contour in an image.
EasyImage::ImageToLineSegment.NET Python copies the pixel values along a given line segment (arbitrarily oriented and wholly contained within the image) to a vector. The vector length is adjusted automatically. This function supports flexible masks.A
path(EPathVector.NET Python) is a series ofpixel coordinates(EPath.NET Python) stored in a vector.
EasyImage::ImageToPath.NET Python copies the corresponding pixel values to the vector. This function supports flexible masks.A contour is a closed or not (connected) path, forming the boundary of an object.
EasyImage::Contour.NET Python follows the contour of an object, and stores its constituent pixels values inside a profile vector.
Profile Analysis¶
The profile can be processed to find peaks or transitions:
A transition corresponds to an object edge (black to white or white to black). It can be detected by taking the first derivative of the signal (which transforms transitions (edges) into peaks) and looking for peaks in it.
EasyImage::ProfileDerivative.NET Python computes the first derivative of a profile extracted from a gray-level image.
TheEBW8.NET Python data type only handles unsigned values, so the derivative is shifted up by 128. Values under [above] 128 correspond to negative [positive] derivative (decreasing [increasing] slope).A
peak(EPeak.NET Python) is the portion of the signal that is above [or below] a given threshold - the maximum or minimum of the signal. This may correspond to the crossing of a white or black line or thin feature. It is defined by its:EPeak::Amplitude.NET Python: difference between the threshold value and the max [or min] signal value.EasyImage::Area.NET: surface between the signal curve and the horizontal line at the given threshold.
EasyImage::GetProfilePeaks .NET Python detects max and min peaks in a gray-level profile. To eliminate false peaks due to noise, two selection criteria are used. The result is stored in a peaks vector (EPeakVector .NET Python).
Profile Insertion Into an Image¶
EasyImage::LineSegmentToImage .NET Python copies the pixel values from a vector or constant to the pixels of a given line segment (arbitrarily oriented and wholly contained within the image).
EasyImage::PathToImage .NET Python copies the pixel values from a vector or a constant to the pixels of a given path.