Structure of Program:



Quick Start Guide for Image Processing Programs v0.1

Structure of Program:

This program consists of a graphical user interface, developed in Visual Basic 6.0, which deals with opening, displaying, and saving BMP files. This interface delegates the image processing onto a DLL, which is developed in C++ 6.0. This separation of code allows for students to write image processing routines without the need to manipulate BMP files directly.

Prerequisites to Installation of Project Files:

The project files require Visual Studio 6.0 to be installed in the computer where the code is going to be developed.

DLL Project: Requires Visual C++ 6.0 for development

Graphics Shell: Requires Visual Basic 6.0 for running and development

Optional Visual Basic 6.0 runtime for running on other computers

The full installation of Visual Studio 6.0 is the best approach for maximum capabilities.

Downloading the distribution files:

The distribution files are available on the Internet at:



• First download the DLL project files, as well as the Demo executables.

• Create a folder in your computer named ImageProc in the root of the drive.

• i.e.: create H:\ImageProc in the EIC Labs or C:\ImageProc at home.

• Unzip all files you will download to that folder, the zip files will create the necessary subfolders

The DLL project files will reside in the ImageProc\CImgProc_ST folder

The file to open in Visual C++ 6.0 is CimgProc.dsw

The demo files will reside in the ImageProc\Demo folder

Execute the ImagerMT.exe file to see the results of sample transforms.

Downloading sample image files:

Sample images have been provided for your convenience, they are divided into Black and White Images, Geometric Shapes, and Color Images. Download the zip files as needed and unzip them to the ImageProc folder.

Developing Custom Image Processing Routines:

The steps for developing your own image processing routines are as follows:

Open DLL Project and locate C++ code file

• Launch Visual C++ 6.0

• Click on File->Open Workspace->ImageProc\CImgProc_ST\CimgProc.dsw

• On the left panel, in the FileView tab, double click on the CImageProc.cpp file, this is the file that will hold your image transform code.

Personalize the DLL file

• Locate the function void __stdcall GetDLLInfo

• Replace with your name

• Replace with the DLL version number, like: 0.1

Personalize the DLL with the supported transforms

• Locate the function void __stdcall Interrogate(...

• Add the necessary cases to populate the transform list. Follow the comments in the code.

• Locate the function void __stdcall EntryPoint(...

• Modify this function to execute your transform when the Imager Shell calls it. Follow comments in the code.

Guidelines for writing a transform

• For a sample transform, see the function void FlipImageY(...

• The image must be split into three character arrays using StringToArrays(...

• The image processing is done on those three character arrays, storing intermediate results in other arrays, perhaps of type double.

• The resulting arrays are combined into an image using ArraysToString(...

Compiling and executing the transformations:

To execute your transformations, the C code must be converted into a DLL. This is done automatically by building the project. The functions in this DLL are then called by the Imager Shell ImagerMT.exe. For the Imager shell to use the DLL, both files must be present in the same folder, or the folder containing the DLL be present in the system path. This folder changes according to the currently selected project configuration.

Project Configurations:

The DLL project is set by default to DEBUG mode. This mode can be changed by going to Build -> Set Active Configuration, select the desired configuration and click OK.

The advantages of selecting each configuration are as follows:

DEBUG: Choose this configuration while the development of the DLL is not finished. This configuration will allow you to do source code debugging. The resulting DLL file contains debugging information which increases its size significantly.

RELEASE: Choose this configuration when the development of the DLL is finished. You will not be able to do source code debugging in this configuration. The resulting DLL file is stripped of all debugging information, which results in a smaller file being produced.

Optimizations might affect the way code executes. To change the optimization setting, go to: Project -> Settings. The project settings will be shown for the currently active project. Select the release project from the drop down menu, and ensure the project name is selected instead of any file. To change the optimization setting, go to the C++ tab, and select one from the Optimizations dropdown.

Configuration file structure:

According to the configuration selected, the DLL file for the project will be built in a separate folder, immediately under the project folder. For the Win 32 Debug configuration the folder name will be called Debug. The files for the Win 32 Release configuration will be created in a folder called Release.

A copy of ImagerMT.exe must be placed in the adequate folder for the currently active configuration. This will allow for the Imager shell to use the image transformation functions included in the DLL.

Building the code:

To build the DLL, go to Build -> Build ..., or press F7. The Clean, and Rebuild All selections are useful to compile a fresh copy of the DLL.

To build the DLL, the ImagerMT.exe program must not be running.

Debugging the transformation code:

            When the time comes when your routine does not work, you will debug it using Visual C++. To debug your DLL file, Visual C++ must know the location of the executable that uses your library. This should be already pointing to Imager.exe. You can verify this setting by going to Project->Settings or pressing Alt+F7. Once the dialog opens, click on the debug tab and make sure that the Executable for Debug Session box contains the correct location for Imager.exe.

 

            To start the debugging, first place a breakpoint on a line containing code to debug of the function you want debugged. To place a breakpoint, click on the line and press F9. Then go to Build->Start Debug->Go, or press F5. Visual C++ will now execute Imager.exe and will wait for the breakpoint to be hit. You can hit the breakpoint by executing the transform from the Image menu in Imager.exe. Once the breakpoint is hit, you will be taken to Visual C++ where you will be able to place another breakpoints, watch the content of variables, and trace your code.

Power User Tip:

To automate the process of debugging, scripting capabilities have been added to the Imager Shell. To automatically load a file and apply a transform upon program startup, create a file named OnLoadP.txt in the same folder where the Shell program resides. For the syntax of the valid commands, you can refer to the Demo.zip distribution file, or the scripting section in the users guide.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download