This Tutorial explains how to Execute an ImageNet without the ImageNet Designer.

It is assumed that you went through the previous ImageNet Designer - Installation Tutorial

General Procedure Edit

Before Execution Edit


#include "CImageNetExecutor.h"

Create Object, Select an ImageNet and Fill the Inputs

ImageNets::CImageNetExecutor* m_pExecutorBlock = new ImageNets::CImageNetExecutor();

m_pExecutorBlock->setImageNetFile( "SubNets/Conversion/Color2HSV.imagenet" ); #relative to [ < ImageNets Bin Dir > ../etc/ImageNets ]

ImageNets::CImageNetExecutor::CImageNetExecutorInput* pFirstInput = m_pExecutorBlock->accessvpInput().at( 0 );
pFirstInput->setImage( cvLoadImage( "Images/Box_1/box_1_L.png" ), ImageNets::COLOR );

Execution Edit


After Execution Edit

Read out the output's image and show it in an OpenCV window.

ImageNets::CImageNetExecutor::CImageNetExecutorOutput* pFirstOutput = m_pExecutorBlock->accessvpOutput().at( 0 );
QString title = pFirstOutput->getProperties()["Help_Text"].m_Value.toString();
cvNamedWindow( title.toStdString().c_str(), 0 );
cvShowImage( title.toStdString().c_str(), pFirstOutput->accessIplImage() );
cvWaitKey( 0 );

Windows Edit

Run the ImageNetDesignerLoadTestApp from the Start Menu.

  1. Select an ImageNet (if you don't like the default one)
  2. Select Input Images (Click on a field of "Load Image Path")
  3. Click on the Preview Image of Input Variable 0
  4. Press "RUN"
  5. Click on the new Preview Image of the Output Variable 0


The loaded example net to convert a Color Image to an HSV Image looks like this:


Linux Edit

Graphical ImageNet Execution Program Edit

cd ~/imagenets/build/ImageNetLoadGUI/Linux
make -f *.mak all
cd ~/imagenets/bin

Command Line ImageNet Execution Program Edit

cd ~/imagenets/build/ImageNetLoadConsole
make all

cd ~/imagenets/bin
./ImageNetLoadConsole SubNets/Conversion/Color2HSV.imagenet Images/Box_1/box_1_L.png
./ImageNetLoadConsole SubNets/3D-Reconstruction/Color2Color3D.imagenet Images/Box_1/box_1_L.png Images/Box_1/box_1_R.png