NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

Industrial Imaging Demo 1.0 Guide

From Texas Instruments Wiki
Jump to: navigation, search

TIBanner.png


Users Manual

Industrial Imaging Demo

Version 1.0.0


Last updated: 10/11/2013



noframe



The following link provides the latest online version of this document: http://processors.wiki.ti.com/index.php/Industrial_Imaging_Demo_1.0_Guide


Introduction[edit]

The Industrial Imaging Demo is an image processing demo developed for the Keystone family of DSPs designed to highlight those architectural features that make this family of DSPs appealing for image processing centric applications. The demo focuses on the natural ability to parallelize image processing algorithms, and the ease with which this may be facilitated by employing open-source packages such as OpenMP (Open Mult-Processor) and OpenCV (Open Computer Vision).

The demo illustrates the viability of applying a Keystone device to a specific industrial imaging application. The specific application is automated object identification for sorting. In our scenario, a conveyor belt carrying various types of fruit passes below an imaging device. The device captures periodic image frames, each of which contains a single piece of fruit, and classifies the fruit into one of N pre-defined categories. In a real-time system, this decision could be passed to solenoids further down the belt to separate the fruit into categorized bins.

NoteNote: This demonstration is not meant to function in an industrial setting, but rather to illustrate the viability of such an approach.


Overview[edit]

As stated above, the intention of the Industrial Imaging Demo is to perform automated classification of image frames, echo of which contains a photo of a single piece of fruit on a white background. While this is not the most robust implementation, it does provide insight into how a more complex approach could be implemented. Furthermore, it illustrates the use of Open Source libraries to achieve reasonable performance quickly and decrease overall time to market.

Functional Summary[edit]

The approach we take to this problem, identifying a piece of fruit within a single image frame, is to treat it as a classical image processing object identification problem. We implemented a relatively simple solution using OpenCV API routines.

  1. Identify properties that differ between the fruit and methods to measure them
    • Color: Histogram (cvCalcHist)
    • Shape: Contour (cvFindContours)
  2. Define methods to compare each property and evaluate as a metric
    • Color: Histogram Correlation (cvCompareHist)
    • Shape: Hu Moments (cvMatchShapes)
  3. Classify by evaluating image metrics with respect to each template

We chose to classify each image as containing one of four objects (fruit):

  1. Red Apple
  2. Lemon
  3. Orange
  4. Green Apple

For each fruit category listed above we provide a single template/training image. These images provide standard color (histogram) and shape (contour) properties for each category above. Classification is accomplished by comparing the histogram and contour of any test image with those of each template and evaluating the best match. Note that we implemented the algorithm such that a certain minimum threshold must be met by each metric for classification. When no metrics meet these minimal thresholds the object is classified as none

NoteNote: A none classification will result in a large question mark being displayed in the PC client application.

Functional Diagram[edit]


Algorithm.PNG

The figure above displays a functional block diagram of the processing performed in the Industrial Imaging Demo and described above. The figure displays two large grey boxes; one to the left that represents the PC or laptop, and a larger one to the right that represents the C6678 EVM. The PC contains two processes; a TFTP Server to transfer images and data between the PC and EVM, and a Display App to display the results and statistics of the demo in a meaningful manner. All TFTP Ethernet traffic between the PC and EVM is represented by the thick blue lines and either originates from or ends at the TFTP server on the PC.

NoteNote: The PC and EVM are actually connected through an Ethernet switch (as discussed below). This has been removed from this diagram for simplicity.

EVM processing is illustrated using two types of blocks; those that execute on the master core (yellow) and those that execute across more than one core (green). Note that the EVM processing is split horizontally by a dotted line. This line illustrates a break between initialization processing and steady-state processing. The block-process above this line is processing that occurs as part of initialization. Specifically, for each template image defined in the templates.cfg configuration file:

  1. The template image is requested and received by the DSP
  2. The exterior contour of the image is determined (1st yellow block)
    • Image is converted from RGB to greyscale (cvCvtColor)
    • Greyscale image is binary thresholded (cvThreshold)
    • Largest contour extracted from binary image (cvFindContours)
  3. Bounding rectangle is determined (2nd yellow block)
    • Based on smallest rectangle containing the contour (cvBoundingRect)
  4. The HSV histogram is calculated (3rd yellow block)
    • Limited to bounding rectangle
    • Uses original RGB image (black line)
    • Image is converted from RGB to HSV (cvCvtColor)
    • Hue (H) channel is extracted (cvMixChannels)
    • Histogram calculated (cvCalcHist)
  5. Histogram and Contour saved (Metrics Container)

Once the properties of all templates have been calculated and stored, and all initialization completed, the algorithm moves to the main processing loop. This is represented by the EVM processing blocks in the diagram above that lay below the horizontal dotted line. Here, test images are requested, one-by-one, and classified via application of the approach described above. Note that this process performs parallelization across DSP cores, as indicated by the green processing blocks.

  1. An image is requested and received by the DSP
  2. The exterior contour of the image is determined (1st block, green)
    • Image is converted from RGB to greyscale (iidemo_omp_cvtColor)
    • Greyscale image is binary thresholded (iidemo_omp_cvThreshold)
    • Largest contour extracted from binary image (iidemo_omp_extractEdges, iidemo_mergeContours)
  3. Bounding rectangle is determined (2nd block, yellow)
    • Based on smallest rectangle containing the contour (cvBoundingRect)
  4. The HSV histogram is calculated (3rd block, green)
    • Limited to bounding rectangle
    • Uses original RGB image (black line)
    • Image is converted from RGB to HSV (cvCvtColor)
    • Hue (H) channel is extracted (cvMixChannels)
    • Histogram calculated (iidemo_omp_cvCalcHist)

The process, as this point, has calculated the properties required for classification. The green processing blocks in this part of the process are performed in parallel across N cores (where N varies based on configuration in the init.cfg file). We chose to implement data parallelization since many image processing algorithms exhibit spatial independence - either completely or to a high degree.


Split img.PNG

Our data parallelization approach, as illustrated in the figure above, is to divide the image into N equal horizontal slices and allow each of the N cores to process a single slice in parallel. This approach comes as an natural extension of the OpenCV image format in which the raw pixel values are stored row-wise. This permits an image to be sliced through pointer arithmetic alone. Each slice is subsequently passed, in parallel, to a unique DSP core to process the particular algorithm or routine. This passing is achieved through simple OpenMP pragmas provided as part of the TI OpenMP package (ti.omp). The example above illustrates our data parallelization approach for the default image size - 640 by 480 pixels - and parallelization over four cores.

The final processing step is classification, as represented by the large green block to the far right. This step performs all metric calculations for contour and histogram matching with each of the pre-calculated template data. This step exploits OpenMP's ability to perform task parallelization. Each comparison is treated as a task; eight tasks (four templates x two properties). The tasks are provided to OpenMP for task parallelization over the N cores.

NoteNote: In some cases the image dimensions prevent the image from being divided into N equal slices. In this case, we divide it into N slices that are all within one pixel in height.


Getting Started[edit]

Installation[edit]

The Industrial Imaging Demo is distributed as an executable installation package and can be downloaded from http://software-dl.ti.com/sdoemb/sdoemb_public_sw/iidemo/latest/index_FDS.html. Installation is simple, just follow the directions provided by the installer.


Physical Setup[edit]

The Industrial Imaging Demo requires three physical components:

  • Windows PC (or laptop)
  • C6678 EVM
  • Gigabit Ethernet switch

The PC and EVM are both connected to the Ethernet switch as illustrated below. This connection permits the EVM and PC to exchange image frames and output classification information including performance statistics.

IIDemo Setup.PNG


PC Preparation[edit]

Keystone Emulation Pack[edit]

These instructions require the Keystone Emulation Pack has been installed.  If it has not been installed yet, it can be found here: http://software-dl.ti.com/sdoemb/sdoemb_public_sw/bios_mcsdk/latest/index_FDS.html, as ti_emupack_keystone1_setup_n.n.n.n.exe, under 'Dependencies'.

More details about the installation process and the BIOS-MCSDK can be found here: processors.wiki.ti.com/index.php/BIOS_MCSDK_2.0_Getting_Started_Guide#Installing_Latest_Emulation_Package


TFTP Server[edit]

The Industrial Imaging Demo requires a TFTP server to facilitate communication between the PC and EVM. A freeware TFTP server can be downloaded from tftpd32.jounin.net. We suggest downloading and installing the 32-bit standard edition, Version 4.0.0. Our instructions will assume that this TFTP server is installed on the demo PC.

Open the TFTP server and configure as instructed below.


  1. Select the "GLOBAL" tab of the "Settings" dialog.
    • Ensure the "TFTP Server" and "TFTP Client" are the only checkboxes selected.
  2. Select the "TFTP" tab of the "Settings" dialog.
    • Set the TFTP directory by concatenating "demo\tftp" to the Industrial Imaging Demo root installation directory.
    • Increase the TFTP timeout to 20 seconds or greater.
    • Deselect the "Show Progress bar" checkbox.

Tftp 01.PNG     Tftp 02.PNG

IP Address[edit]

The PC and EVM should be connected to the Ethernet switch such that they, alone, form a private network. As such, the PC's Ethernet adapter must be connected directly to the switch and configured to use the static IP address 192.168.1.100. Follow the steps below to configure the PC to use a static IP address.

  1. Determine names of available Ethernet interfaces
     >> netsh interface show interface

    Netsh 03.PNG

  2. Select an Ethernet interface and set its static IP address and netmask
     >> netsh interface ip set address name="Private LAN" static 192.168.1.100 255.255.255.0

    Netsh 01.PNG

  3. Check the IP address and netmask
     >> netsh interface ip show config name="Private LAN"

    Netsh 02.PNG


ARP Address[edit]

To ensure proper IP to MAC address resolution of the EVM we need to add an entry to the ARP table on the PC. This address will allow the PC to properly route TFTP packets to the EVM.

  1. Add the ARP table entry
     >> arp -s 192.168.1.101 00-11-22-33-44-55
  2. Check the ARP entry
     >> arp -a

    Arp 01.PNG

Helpful tips image.jpg

Useful Tip

We specify IP addresses 192.168.1.100 and 192.168.1.101 since these are the default in the init.cfg configuration file. MAC address 00-11-22-33-44-55 is associated with the EVM for the same reason. Any other valid IP address or MAC address may be used as long as they are in the same subnet and don't conflict. Note that the MAC address must have a valid OUI (last bit of the first octet is 0). The only address that we don't have the liberty to change is the MAC address of the PC, as we will see later.


EVM Preparation[edit]

The Industrial Imaging Demo runs on the TMDXEVM6678L Evaluation Module (EVM). Please follow the guidelines at TMDXEVM6678L EVM Hardware Setup for EVM configuration.

Hardware Setup[edit]

The TMDXEVM6678L EVM should have the following connections:

  1. Connect the Ethernet cable from the EVM to the Gigabit Ethernet switch
  2. Connect the JTAG interface to the PC
  3. Connect power to the EVM


Configuration[edit]

The dip switches on the TMDXEVM6678L EVM should be set to provide the following configuration.

  1. Configure the EVM for Little-Endian mode (SW3)
  2. Configure the EVM for No-Boot mode (SW3-SW6)


Running the Demo[edit]

The Industrial Imaging Demo comes with all binary images built and ready to be run out-of-the-box. Before attempting to run the Industrial Imaging Demo, follow the Getting Started instructions above to ensure the PC and EVM are properly configured. At this point, the following steps have been taken.

  • Industrial Imaging Demo downloaded and installed
  • Proper physical connections between the PC, EVM and Gigabit Ethernet switch
  • Download, installation and configuration of the TFTP server
  • PC configured for proper static IP address
  • ARP entry for EVM IP/MAC address in PC's ARP table
  • EVM configured for Little-Endian mode
  • EVM configured for No-Boot mode


Load Demo Image[edit]

Helpful tips image.jpg

Useful Tip

1. The following discussion assumes a working knowledge of Eclipse-based versions of Code Composer Studio - specifically versions 5.1 and above. Please review CCSv5 Getting Started Guide if you are not comfortable working within the CCSV5 environment.
2. The Industrial Imaging Demo requires that Code Composer Studio (CCS) version 5.1 or above be installed. If you do not already have CCS 5.1 or above installed, follow the CCS installation instructions for the Video MCSDK.


NoteNote: If the Keystone Emulation Pack was freshly installed, launch CCS and give the software a moment to detect the new plugin (a progress bar will appear in the lower-right of the CCS window indicating detection is taking place).


Perform the following steps to load the DSP image for the Industrial Imaging Demo.

  1. Launch CCS and create a new CCS Project
    1. Give the new project a name (e.g., "iiDemo")
    2. Select the C6000 device family and TMS320C6678 variant
    3. Select the emulator connection (e.g., Blackhawk XDS560v2-USB Mezzanine Emulator)
    4. Under "Project templates and examples", select "Empty Project" and press Finish

      IiDemo new project.png

  2. Specify the initialization script
    1. Expand the project (iiDemo here) from within the Project Explorer tab (View->Project Explorer if missing)
    2. Double-click the TMS320C6678.ccxml target configuration file to open the Target Configuration panel
    3. Select the Advanced tab (bottom of panel)
    4. Expand the tree in the All Connections window (if necessary) until C66xx_0 is visible as shown
    5. Select this core and specify its initialization script (GEL file)
    6. Browse to to: <CCS_BASE>\ccsv5\ccs_base\emulation\boards\evmc6678l\gel and select evmc6678l.gel, where <CCS_BASE> is the root of the CCS installation.
    7. Save the Target Configuration

      Iidemo gel.png

  3. Launch the Debugger
    1. Open the Target Configurations Window (View->Target Configurations)
    2. Expand the Projects tree to reveal the TMS320C6678.ccxml file
      NoteNote: Before proceeding ensure the EVM is powered and the emulator is ready (amber and red LEDs on the Mezzanine board will be illuminated)
    3. Right-click on the TMS320C6678.ccxml file and select Launch Selected Configuration. This will connect the XDS560v2-USB Mezzanine emulator, but not any cores
    4. Allow CCS to change to the debug perspective if prompted

      Launch selected configuration.png

  4. Connect and Load the DSP Image
    1. From the Debug perspective, right-click on core 0 and select Connect Target
    2. Load the demo's DSP image (Run->Load->Load Program). Browse to the \iiDemo\bin\dsp folder and select iidemo.out
    3. Do not execute the program yet - follow the remaining instructions to ensure the entire system is ready

      Core 0 connect target.png


NoteNote: Though we only connect and load the Demo image on the first core (C66xx_0), all cores are used. OpenMP automatically initializes the remaining cores and passes execution as specified within the source code.

Open PC Client Application[edit]

The Industrial Imaging Demo comes with an executable PC client application. This application runs on the PC or laptop connected to the Gigabit Ethernet switch and interprets the output from the EVM for display on the local screen.

Perform the following steps to open PC client application.

  1. Open a Windows command prompt.
  2. Change directory to the ./bin/win32 directory of the demo installation.
  3. Execute the setenv.bat batch file. This will add required paths for DLLs used by the application.
  4. Run the application iiDemo.exe.


Helpful tips image.jpg

Useful Tip

The PC client application is a Microsoft Visual C++ 2010 Win32 console application. As such, it will require VCREDIST_X86.EXE if the PC does not have Visual C++ 2010 installed.


Run the Demo[edit]

If the TFTP Server, installed and configured in Getting Started above, has not been started - do so now. The Industrial Imaging Demo is now ready for execution. Start the demo by selecting Resume (F8) from within the CCS environment.

Once the Demo has been started, the CCS console window will display information for each frame as it executes - where frame refers to a particular test image executing on a specific number of cores (e.g., image test.bmp using four cores). This information includes:

  • Frame Beginning and End markers
  • The number of cores used for parallel regions of code
  • The name of the Bitmap (.bmp) image file
  • The resulting fruit classification


Ccs console 01.PNG

Visualization[edit]

The Industrial Imaging Demo PC client application is a multi-threaded executeable that performs initialization necessary for demo execution, then waits for TFTP packets from the EVM for interpretation and display. The PC client application opens as a single window, partitioned into three primary areas; a title bar across the top, a display frame to the left and a statistics & information frame to the right (see illustration below).


Pcapp 01.PNG



Display Frame[edit]

The primary Display Frame provides several methods to view the data and results. The buttons at the bottom of the frame control what is viewed (as illustrated below).


  1. Title View: Default view at start
    Display title.PNG

  2. Image View: Displays the current image under test
    Display image.PNG

  3. Graph View: Displays a dynamic graph of overall processing time versus the number of cores applied
    Display graph.PNG

  4. Metrics View: Displays a visualization of the Histogram and Contour for the image, together with the decision metrics with respect to each template
    Display metrics.PNG



Statistics & Information Frame[edit]

The Statistics & Information Frame is partitioned into three sub-frames; current classification at the top, processing statistics in the middle and additional information regarding configuration and processing at the bottom (see illustration below).


Stats info.PNG


The Processing Statistics sub-frame displays average processing requirements for each parallel portion of the imaging algorithm over the number of cores used for parallelization. Since only four columns are available, each column has a toggle button at the top to step through each number of cores configured in the init.cfg file. This is helpful in the case that, for example, the demo is configured for parallelization over eight different numbers of cores (1, 2, 3, ... 8). In this case, any four could be chosen for visualization at any time. Additionally, a Reset button is provided to reset all running statistics such that the averaging starts fresh.


Additional Configuration[edit]

The Industrial Imaging Demo employs three configuration files. These files allow the Industrial Imaging Demo to use different image files, test templates and other parameters each time it executes. These files are read by both the DSP code as well as the PC client application. As such, the DSP and PC code is kept in sync with respect to file names, timing and other operating parameters.

All configuration files are installed to the ./demo/config directory and have the .cfg extension. Each configuration file serves a specific purpose - the files and their purposes are described in detail below.


Initialization (init.cfg)[edit]

This configuration file provides initialization and operational information for the demo. Each specification in this file has the form:

parameterName = <value>

Where, in the above, the value can take on many forms and depends specifically on the parameter (parameterName). All expected parameters and their respective formats are listed below. Read the comments for parameter descriptions.

NoteNote: All parameters below must be specified in this file.

NoteNote: The # character is used for comments. This character and anything after it, up to and including the newline character, are ignored.

NoteNote: Whitespace between the parameter name, the = character and the assigned value is ignored.

localIpAddress    = <IP_ADDRESS>    # EVM IP Address 
localMacAddress   = <MAC_ADDRESS>   # EVM MAC Address 
serverIpAddress   = <IP_ADDRESS>    # PC IP Address 
serverMacAddress  = <MAC_ADDRESS>   # PC MAC address 
imageDirectory    = <REL_PATH>      # Path to TFTP directory
nCores            = <DECIMAL_SET>   # Cores for parallel ops
imageDelay        = <DECIMAL>       # Delay (s) between frames
imageWidth        = <DECIMAL>       # Image width (px) 
imageHeight       = <DECIMAL>       # Image height (px) 
imagePlanes       = <DECIMAL>       # Image color planes 
imageDepth        = <DECIMAL>       # Image pixel depth (bits)

The formats above are defined as:

<IP_ADDRESS>:    W.X.Y.Z            (W,X,Y,Z in {0-255})
<MAC_ADDRESS>:   AA-BB-CC-DD-EE-FF  (AA-FF are hex octets)
<REL_PATH>:      String representation of path
<INTEGER_SET>:   Comma-delimited digits within brackets []
<INTEGER>:       Single integer value


Image File Set (images.cfg)[edit]

This configuration file defines the set of images that the demo will use for classification. Each image is assumed to reside in the ./demo/images/test directory (with respect to the package installation) and must be in Windows bitmap (.bmp) format. Each line of the file, with the exception of the last non-empty line, holds the name of one image file. The last line must contain the keyword LOOP.


Template File Set (templates.cfg)[edit]

This configuration file defines the set of images that the demo will use as templates for classification. Each template image is assumed to reside in the ./demo/images/template directory (with respect to the package installation) and must be in Windows bitmap (.bmp) format. This file will contain three lines for every template file to be used, as illustrated below.

template_file1.bmp  
fruitName1            
enumeration1          
template_file2.bmp  
fruitName2            
enumeration2
...          

Where, in the above, template_file1.bmp and template_file2.bmp are names of image files, fruitName1 and fruitName2 are strings to be associated with the templates, and enumeration1 and enumeration2 are integer enumerations to be associated with the template as well. An example template file could be as displayed below.

pear_file.bmp  
Pear            
1
kiwi_file.bmp  
Kiwi
2


Helpful tips image.jpg

Useful Tip

Though it appears simple to change demo templates via the configuration file templates.cfg, it actually requires significant changes to the PC client application.

br>


Demo Output[edit]

Every time the Industrial Imaging Demo is executed, all data used by the demo and all demo output is captured and stored to a unique directory. All output directories are created in the ./demo/output directory (relative to the demo installation). The sub-directories follow the naming convention iidemoOut_ followed by date and time timestamps. For example, a sub-directory named iidemoOut_20130108_160507 will be created for a demo run executed on January 8, 2013 at 4:05pm (and seven seconds).

Each demo sub-directory will contain the following:

  • All test image files
  • All template image files
  • All three configuration files
  • All output data files

Each output data file will follow the naming convention <image_file>.out.r<X>.f<Y>.c<Z>. Where,

  • <image_file> is the image file for this test iteration
  • f<Y> represents the running frame count (i.e., f22)
  • c<Z> represents the number of cores used for this test iteration
  • r<X> represents the number of times the statistics have been reset (resulting in a running frame count reset)

These directories are useful for debugging if code changes are implemented or for storing results for passing to the PC client application and viewing later. Note that the PC client application would require changes beyond the scope of this discussion to accept input in this manner.


Helpful tips image.jpg

Useful Tip

1. It is a good idea to check and flush the results in the output directory periodically to prevent unnecessary hard-drive usage.
2. The output data is actually a binary representation of the Industrial Imaging Demo shared data structure iidemoClassify_t. See ./src/common/iidemo_api.h for structure definition.



Building the Demo[edit]

The Industrial Imaging Demo is delivered with full DSP and PC client application source code. This permits experimentation with the source code to observe the results. We describe below the steps required to rebuild each code base and which source files are relevant for tinkering.

Required Packages[edit]

The following packages and tools are required to build the DSP demo Image. All packages are available from the Industrial Imaging Demo download page. The BIOS MCSDK installer will offer check boxes to select specific components for installation - use the table below as a guide. Please refer to the MCSDK Video 2.0 Getting Started Guide if you encounter any difficulty installing any of the components or packages.


MCSDK Windows Installer Version 2.1.2.5
Package Version
IPC 1.24.03.32
EDMA3 LLD 02.11.05.02
Sys BIOS 6.33.06.50
OpenMP 1.01.03.02
C6678 PDK 1.1.2.5
C6000 CGT 7.4.0
XDC Tools 3.23.04.60
Industrial Imaging Demo Download
Package Version
Framework Components 3.22.00.05
XDAIS 7.20.00.07
MinGW Installer N/A (follow link)
Active Perl N/A (follow link)


DSP Image[edit]

The DSP image source code is installed to the ./src/dsp directory. The source code is separated into two primary directories; an opencv directory where the (altered) Open CV Version 1.0 source is located and a modules directory where the demo framework code resides.

OpenCV DSP Source[edit]

The Open CV source code is delivered for the two Open CV libraries used by the Industrial Imaging Demo. Namely, the cv and the cxcore libraries. Each library is delivered with the following (directories are relative to ./src/dsp/opencv:

  • Full library source in ./<lib>/src
  • Required headers in ./<lib>/include
  • Compiled libraries in ./<lib>/lib
  • CCS Project to rebuild library (if source changed) in ./<lib>/pjt


NoteNote: In the above <lib> above refers to either of the included libraries - cv or cxcore.


Helpful tips image.jpg

Useful Tip

The CCS Projects can build either a Debug or Release configuration. If the Debug configuration is built, the resulting library name will be <lib>d.lib. Whichever configuration is built, the compiled library will automatically be moved to the ./<lib>/lib directory and will replace the previous library.


DSP Image Source[edit]

The DSP image source code is delivered in the form of several framework modules. Each module serves a particular purpose in the overall operation of the Industrial Imaging Demo. As such, most of these modules are of no particular interest other than academic curiosity. For those interested in experimenting with the core demo source code, only a handful of directories are of interest.

All but one source file of the Industrial Imaging Demo resides in the ./src/dsp/modules/siu/iidemo directory. The lone exception being the source file siuVctRun.c, which resides in the ./src/dsp/modules/siu/vct directory. Four source files make up the majority of the demo:

  1. siuVctRun.c: Contains the Industrial Imaging Demo processing task
    • siuVctRunTask()
  2. iidemoMain.c: Contains the main processing routines for template and frame processing
    • iidemo_template_task()
    • iidemo_image_task()
  3. iidemoCVProc.c: Contains all low-level image processing calls (OpenCV) and code parallelization (OpenMP)
    • iidemo_omp_cvtColor()
    • iidemo_omp_cvThreshold()
    • iidemo_omp_extractEdges()
    • iidemo_getContour()
    • iidemo_omp_cvCalcHist()
    • iidemo_getHistogram()
    • iidemo_omp_classifyFruit()
  4. iidemoMem.c: Contains all static data declarations


If any of the source files for the demo are altered, a re-compile will be required for the changes to be observed when the demo executes. Following are the steps to re-compile the DSP image source.

  1. Validate Package Paths in ./src/dsp/modules/mkrel/setupenvMsys.sh file. These should match the path to the package directory.
    MINGW_RUNPATH=
    TOOLSBASE1=
    TOOLSBASE2=
    PERL_RUNPATH=
    XDC_SRCPATH=
    BIOS6_RUNPATH=
    IPC_RUNPATH=
    EDMA3_LLD_RUNPATH=
    C6XCGEN_RUNPATH=
    FC_RUNPATH=
    XDAIS_RUNPATH=
    BIOS_MCSDK_PDK6678_RUNPATH=
    OMP_RUNPATH=
  2. Validate Package Versions in ./src/dsp/modules/mkrel/setupenvMsys.sh file. These should match the name of the package directory.
    MINGW_VERSION=
    PERL_VERSION=
    XDC_VERSION=
    BIOS6_VERSION=
    IPC_VERSION=
    EDMA3_LLD_VERSION=
    C6XCGEN_VERSION=
    FC_VERSION=
    XDAIS_VERSION=
    BIOS_MCSDK_PDK6678_VERSION=
    OMP_VERSION=
  3. Ensure the PERL executable is in the Windows path
  4. Open a Window Command prompt and change directory to ./src/dsp/modules/mkrel
  5. Call the setupenvMsys.bat batch file with the argument "bypass"
    • Extracts components to ./packages directory
    • Opens a Bash shell for build commands

      Build 01.PNG

  6. Enter make iidemo to compile
    • The BINIT warning during link may be safely ignored
    • The new DSP demo image will be automatically copied to the ./bin/dsp directory

      Bld complete.PNG


Helpful tips image.jpg

Useful Tip

Once the DSP image has been built, subsequent changes to the Industrial Imaging Demo source code may be re-compiled faster by adding the following flags to the command line after "make iidemo":

RTSCBYPASS=YES
BIOSCFGPKGBYPASS=YES
OPENCVBYPASS=YES


PC Client Application[edit]

The Industrial Imaging Demo's PC client application is delivered with all source code for the application. Source code for the OpenCV (version 2.3.1) and QT (version 4.0) libraries and DLL's can be downloaded individually from the Industrial Imaging Demo download site. All code required to build the PC client application is installed to one of four sub-directories under ./src/Win32:

  • OpenCV libraries, DLL's and headers are in ./src/Win32/opencv
  • QT DLL's are in ./src/Win32/qt
  • Images used within the application are in ./src/Win32/imgs
  • Source code and Visual C++ Project and Solution files are in ./src/Win32/iidemo

The source code for the PC client application is provided to make alterations to the code possible for those interested. This code, however, is not the focus of the demo since it serves merely to allow visualization of the multi-core DSP algorithm. As such, users are encouraged to navigate the code if interested, but cautioned to proceed at ones own risk.

The PC client application is provided as a Microsoft Visual C++ project/solution. Accordingly, either the iiDemo.sln or the iiDemo.vcxproj file in the ./src/Win32/iidemo directory may be opened within the Visual C++ environment for editing and compilation.


Frequently Asked Questions[edit]

Q: Can I run the Industrial Imaging Demo PC client application on a Windows 7 PC?[edit]

The Industrial Imaging Demo PC client application has been tested, and will execute, on both Windows XP and Windows 7 PCs. Re-building the executable files on a Windows 7 PC has not been verified.

Related Links[edit]


Technical Support[edit]

For technical discussions and issues, please visit

NoteNote: When asking for help in the forum you should tag your posts with “IIDemo”.


Industrial Imaging Demo Download[edit]


E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article Industrial Imaging Demo 1.0 Guide here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article Industrial Imaging Demo 1.0 Guide here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article Industrial Imaging Demo 1.0 Guide here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article Industrial Imaging Demo 1.0 Guide here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article Industrial Imaging Demo 1.0 Guide here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Industrial Imaging Demo 1.0 Guide here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Industrial Imaging Demo 1.0 Guide here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article Industrial Imaging Demo 1.0 Guide here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article Industrial Imaging Demo 1.0 Guide here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity