8: Boar Sperm Analysis 1

Background:

In modern pig production a high birthrate from each dose of boar semen is wanted. Semen is therefore analyzed and various factors are extracted to categorize the boars’ ability to produce a large piglet output. Morphology of the semen is the first area we will look into. Head shape, head intensity variation, proximal and distal tail drop, tail length and tail curve are parameters that describes the semen fertility.

Aim:

Make a test system for analyzing boar semen morphology. Show original image and segmented image in separate images. We will reuse this interface for further analysis of the semen next time. Inspiration for interface:

Instructions:

First download an image from the selection of Sperm Images, or download them all at once here

  • Interface
    • Should run in a while loop
    • Place two VISION\’Image Display’ to show original image and segmented image
    • Place a path control to choose image directory(show Browse Button)
    • Use ‘List folder’ to list images in an array and let user choose which image to be analyzed
    • Make a button that starts a new test
    • Use ‘IMAQ Create’ to make new image reference and ‘IMAQ Readfile’ to read the choosen image. Use ‘IMAQ Copy’ to make a duplicate of the original image
    • Test that your interface works by showing original image in both image displays
  • Preprocess the image. The aim here is to remove the background, remove border elements, remove large elements and fill holes in remaining elements. This should produce a segmented binary image. All these steps should be done in a new subVI. The subVI should also have a TypDef that controls all the handles for your processing steps.
    • Make new subVI – ‘Preprocess.VI’
      • Inputs ‘IMAQ image control’ and ‘Error in’
      • Outputs ‘IMAQ image indicator’ ‘Error out’
      • Make a custom logo for your subVI   
  • The following steps will help you produce the wanted binary segmentation of the semen image (as shown in screen shot above). Each step has parameters given in the text below, but you are free to implement your own segmentation. Don’t do “Big Bang”-programming – check that each step is working, before moving to the next
    • Get image histograph data and subtract mean plus standard deviation from the image
    • Use ‘IMAQ Equalize’ to expand pixel range – [0 - 255]
    • Use ‘IMAQ Local Threshold’ Niblack method(deviation factor 0.2, window 50-by-50) to remove background
    • Use ‘IMAQ RemoveParticle’ to remove noise elements. Use 5 erosions
    • Use ‘IMAQ Rejectborder’ to remove border elements
    • Make a copy of your image before the next step
    • Use ‘IMAQ Morphology’ to dilate elements with a 5-by-5 structuring element 6 times
    • Use ‘IMAQ Particle Filter’ to keep elements with an area between 5000 and 15000
    • Use ‘IMAQ And’ to AND your filtered image with the undilated image. Use ‘IMAQ dispose’ remove the image copy from memory
    • Make a TypDef, ‘SegmentationControl.ctl’ to control all your image segmentation handles and make it as input to your subVI. Then you can change values from your interface. See if there are any improvements to be made on the segmentation by testing on the different images
Created by Samuel Thrysøe © 2013