The Machine Perception Toolbox

[Introduction]- [News]- [Download]- [Screenshots]- [Manual (pdf)]- [Forums]- [API Reference]- [Repository ]

 

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

LGN.cpp File Reference

#include <iostream.h>
#include <mpisearch.h>
#include <Magick++.h>

Include dependency graph for LGN.cpp:

Include dependency graph

Go to the source code of this file.

Namespaces

namespace  Magick
namespace  std

Classes

class  CenterSurround
 X cells in the cat and P cells in the monkey's retina and LGN behave like linear filters. More...

Functions

int main ()


Function Documentation

int main  ) 
 

Definition at line 374 of file LGN.cpp.

References img, MPISearchObjectDetector::initStream(), and CenterSurround::search().

00375 {
00376   // Load the image
00377    Image img("../../Media/ExampleImage.jpg");
00378   //  Image img("../../Media/spock.gif");
00379   // Write the word "Hello" on the image
00380   //   img.fontPointsize(100);
00381    //  Geometry(width, height, xoffset, yoffset)    
00382    //  img.annotate("Hello2", Geometry(400,400, 0, 220) );
00383 
00384   img.display();
00385 
00386 // Construct an RImage, which is expected by MPISearch
00387 // This constructor sets the member variables for width, height, and
00388 // number of pixels and allocates memory for the member variable
00389 // "array", which is a vector of size npixels
00390 
00391   RImage< float > pixels(img.columns(), img.rows()); 
00392 
00393   // Copy the pixels into an RImage, which is expected by MPISearch
00394   img.write(0,0, img.columns(), img.rows(), "I", FloatPixel, pixels.array); 
00395 // The 'I' tells ImageMagick to take the intensity channel.  I think
00396 // there are better ways to do this, but I haven't looked into them.
00397 
00398 
00399   CenterSurround CS;
00400 
00401   // stream is a data member of CenterSurround, of type
00402   // MPISearchStream MPISearchStream holds all the memory and caches
00403   // for the class MPISearchObjectDetector, which Provides an
00404   // architecture for performing operations on every sub-window of an
00405   // image at multiple scales.
00406 
00407   // CS.inistream calls stream.init(width,height,data,WINSHIFT)
00408   // were data is a data member of CenterSurround  of type FeatureData
00409   // stream.init 
00410 
00411 
00412 
00413   CS.initStream(pixels.width, pixels.height, 1.0f);
00414 
00415 // Now run over the image at multiple scales and compute the mean
00416 // pixel at that size
00417 
00418 
00419   CS.search(pixels);
00420   
00421   return 0;
00422 }

Here is the call graph for this function:


Generated on Mon Nov 8 17:08:09 2004 for MPT by  doxygen 1.3.9.1