Blob Detection

src.blob_detection.analyse_image(path, model)

Loads images in path, apply different blob detection algorithms, classify detected blobs

Parameters
  • path (str) – path to images that should be analyzed

  • model – PyTorch model to use for classification

src.blob_detection.analyze_blobs(blobs, model, img)

Apply classification model to every blob

Parameters
  • blobs (np.ndarray) – [nx3] array with blobs [y, x, r]

  • model – model used for classification

  • img – full image to crop input from

Returns

list of labels

src.blob_detection.classify_cell_image(cell_image, model, anti_aliasing=False)

Feeds cell_image to model and returns prediction

Parameters
  • cell_image – image to be classified

  • model – PyTorch model used for classification

  • anti_aliasing (bool) – turn anti aliasing on

Returns

prediction

src.blob_detection.compare_blob_detection_algorithms(path, model)

Loads images in path, apply different blob detection algorithms, classify detected blobs

Parameters
  • path (str) – path to images that should be analyzed

  • model – PyTorch model to use for classification

src.blob_detection.create_blob_sequence(image)

Apply multiple blob detection algorithms to compare them

Parameters

image – image to be analysed

Returns

squenece containing the blobs, colors and titles

src.blob_detection.dog_blob_detection(image)

Difference of Gaussian Blob detection - Mere wrapper for profiler

Parameters

image (np.ndarray) – grayscale image to analyze

Returns

list of blobs [y, x, r]

src.blob_detection.get_cell_image(x, y, r, img)

Receives x, y and the respective radius of a a blob in an image, returns rectangular image with blob inside

Parameters
  • x (float) – x coordinate of blob

  • y (float) – y coordinate of blob

  • r (float) – radius of blob

  • img – image containing the blob

Returns

section of the image containing the blob

src.blob_detection.load_model(path, tracing=False, img_size=128)

function to load a network for classification

Parameters
  • path (str) – state dicts of previous training

  • tracing (bool) – turn tracing on or off

  • img_size (int) – input size needed for model initialization

Returns

model

src.blob_detection.main()

Demonstration of the combination of object detection and classification

src.blob_detection.profile_analyse_image()

Profile the analysis function