Process Controller Camera Configuration

Process Controller has the ability to acquire data from a variety of sensors and meters. The rapid evolution of digital cameras presented an opportunity to add cameras as a data source for process controller. Cameras have become cheaper than any of the other sensors used by Process Controller. A challenge with cameras is that they produce a 2 dimensional array of data for each image collected and that data structure is incompatible with the data handling ability of Process Controller which assumes that a sensor or an external function returns a single data value. Camera configuration also is significantly more complex than calibration of most sensors.

To solve those challenges and integrate cameras into Process Controller a separate application was created to configure the Camera. The Camera Configure software is installed along with the rest of the ProCoDA application suite that now includes

  • Process Controller
  • EasyData
  • pH meter
  • Camera Configure

Process Controller now includes a new external function called Floc water interface.vi that can be accessed from the Rule Editor. The expectation is that as cameras are integrated into our labs that more external functions will be added with the capability to do different types of image analysis.

To set up a camera it is necessary to make sure that the camera is only being used by one application at a time. Thus if Process Controller is configured to be using the Camera it is absolutely necessary to first disable that external function by setting it to constant intead of to variable or simply quit Process Controller. Then open Camera Configure.exe from the ProCoDA folder in program folder.

The Configure Camera application allows you to select which camera to use, to configure the video rate and image size, and depending on the camera to configure other camera settings. First select the camera that you want to use for data acquisition using the drop down menu called Camera Name. The software automatically recognizes all available cameras. For many of our applications high resolution images will not be needed. I recommend using 480x640 images at 30 frames per second to detect a floc water interface. You can change the video setting on the camera by browsing in the attribute window until you find the video mode. Select video mode and then you will be able to choose from a drop down menu of available video modes.

The next step is to configure the interface recognition software. You can do this "live" with images from the camera by clicking on the Test Settings button. Select a region of interest in the image that you want to analyze by using the rectangle tool that is located to the left of the image. The interface recognition software has only been tested using the vertically oriented rectangle to define the region of interest. The image must be oriented in the default direction (480 high and 640 wide).
Use a measuring tape to assign an elevation to the top of the field of view and to measure the height of the field of view.
If you would like Process Controller to save images during the experiment you can set the image frequency and the file path to the folder that will contain the images. The image file names are appended with the state number and then the image number separated by a space. If Process Controller cycles through states then a new folder is created for each iteration through the states. The application Camera Config.exe does NOT save images. The configuration is simple passed to the Floc water interface.vi in Process Controller so that Process Controller can save images.
When saving images be careful to use excessive storage space. The images are saved as jpg and the file size is 31 kb for a 640x480 image. If images are saved every second that is 2.7 Mb per day.

Image Processing Algorithm

  • The interface recognition algorithm takes the average of each of the rows of pixels in the region of interest to using the color band(s) that are selected to produce a single array of light intensities.
  • A running average over the length set by Smooth Length is used to filter out some of the noise in the image.
  • Numerical derivative is taken
  • The minimum value of the derivative is an indication of the location where the image transitions from light to dark in the direction of top to bottom. This direction definition is used because images are defined with the top left corner being zero, zero.
  • The pixel location of the minimum value of the derivative is converted into physical space given the location of the field of view.
  • If the absolute value of the minimum value of the derivative isn't greater than the minimum derivative magnitude, then the interface is assigned to be at the bottom of the region of interest.

Saving the Configuration for use by Process Controller

The camera configuration information is saved in a file in C:\Users\username\AppData\Local\ProCoDA\CameraName.txt. The settings for image analysis are saved in C:\Users\username\AppData\Local\ProCoDA\ProCoDA.ini. These settings are then used by Process Controller.

  • No labels