plotPixel
Short Description
The plotPixel
function visualizes the effect of multi-class OTSU thresholding on an image,
highlighting the positive regions determined by the threshold. he result is a side-by-side plot
of the original and highlighted images, with a quantitative display of the positive pixels'
percentage.
Function¶
plotPixel(imagePath, num_classes=2)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image_path |
str
|
The path to the image file to be processed. Supports formats readable by tifffile, such as TIFF. |
required |
num_classes |
int
|
The number of classes to divide the pixel intensity range into using OTSU thresholding. Default is 2. |
2
|
Returns:
Name | Type | Description |
---|---|---|
Plot |
matplotlib
|
Returns a plot comparing original image with the regions identified to be positive for signal. |
Example
# Plot the results for image.tif
pp.plotPixel(image_path='/path/to/image.tif', num_classes=3)
Source code in pixelpartitioner/plotPixel.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
|