# Getting Started¶

There are 3 main ways of accessing the software.

1. Library Access

The image processing and statistics functions can be accessed by importing ih. Within your script you create objects out of individual plant images and process them directly. Ex:

# import ih
import ih.imgproc
plant = ih.imgproc.Image("/home/user/image.png", outputdir = "/home/user/")
# execute processing functions, in this simple case,
# the image is converted to grayscale, then thresholded.
plant.convertColor("bgr", "gray")
plant.threshold(127)
# write the output
plant.write("threshold.png")


This method is good for testing and adjusting your image processing workflow, but does not scale well for large sets of images.

2. Command Line Access

ih comes with dozens of micro-scripts providing individual access to each function. Each script takes an input image, and writes an output image. The previous example would be done with two commands as follows:

#!/bin/bash
ih-convert-color --input "/home/user/image.png" --output "/home/user/gray.png" --intype "bgr" --outtype "gray"
ih-threshold --input "/home/user/gray.png" --output "/home/user/threshold.png" --thresh 127


This method is slightly different than the previous one in a few aspects. The names of the command line scripts will not exactly match the names of the functions. Because each script takes an image and writes an image, it is important to chain the output of one command into the input of the next command. This method can also be used to test your workflow. Super computer workflows use this method for processing, so familiarity with command-line arguments are helpful, and ensure your large-scale runs process correctly.

3. Workflow Generation

Super computer workflow generation and submission is complicated enough that there isn’t a simple starter script, but it can be broken down into three major steps. Each step is handled by user defined json template files.