|
Pandore - A library of image processing operators
|
How to program new applications?
This tutorial presents the steps followed to build a new application.
An application is a sequence of Pandore operators.
The example provided in this tutorial is an image segmentation by
binary thresholding. The threshold value is the one that maximizes
the variance between the two classes of pixels: background and objects
(Otsu algorithm):
There is three ways to create a Pandore application:
- as a commands script (Shell or batch);
- as a C++ program;
- with a visual programming interface Ariane.
All the files below are available in the 'example' folder
of the Pandore folder.
1. Example with UNIX / Linux / Mac OS X / CYGWIN
a. Programming an application as a Shell script
- Get the following file: example1.sh
- Set the execution right to the file example1.sh: chmod u+x example1.sh
- Get the following sample image: tangram.pan
- Launch the command: ./example1.sh tangram.pan sortie.pan
- Check the result: pvisu sortie.pan
b. Programming an application as a C++ file
- Get the following file: example2.cpp
- Get the file Makefile.unix : Makefile.unix (or Makefile.sun for Solaris)
- Compile the program: make -f Makefile.unix example2
- Get the sample image: tangram.pan
- Launch the program: ./example2 tangram.pan sortie.pan
- Check the result: pvisu sortie.pan
c. Programming an application as a C++ file with interactive display of the intermediate results
- Get the following file: viewer_example.cpp
- Get the file Makefile.unix : Makefile.unix (or Makefile.sun for Solaris)
- Compile the program: make -f Makefile.unix viewer_example
- Launch the the command: ./viewer_example
2. Example with Windows
a. Programming an application as a batch file
- Get the following file: example1.bat
- Get the sample image: tangram.pan
- Launch the command: example1 tangram.pan sortie.pan
- Check the result: pvisu sortie.pan
b. Programming sous la forme d'un programme C++
- Get the file: example2.cpp
- Get the file Makefile.msdos : Makefile.msdos
- Rename Makefile.msdos to Makefile: ren Makefile.msdos Makefile
- Compile the program: nmake example2.exe
- Get the sample image: tangram.pan
- Launch the command: example2 tangram.pan sortie.pan
- Check the result: pvisu sortie.pan
c. Programming an application as a C++ file with interactive display of the intermediate results
- Get the following file : viewer_example.cpp
- Get the file Makefile.msdos : Makefile.msdos
- Rename Makefile.msdos to Makefile: ren Makefile.msdos Makefile
- Compile the program with: nmake viewer_example.exe
- Launch the program: viewer_example
d. Create a Visual C++ project
- Copy the folder Pandore/examples/visual in the target folder
- Set the tools::options menu, select the tab Directories
- select the menu: Include Files
- add the Pandore include folder.
- add the Pandore src\operatorsP0 folder.
- select the menu: Library Files
- add the Pandore lib folder.
- Build the project