1# $Id$
2package IPA;
3use strict;
4use Prima;
5require Exporter;
6require DynaLoader;
7
8use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $__import);
9@ISA = qw(Exporter DynaLoader);
10
11sub dl_load_flags { 0x01 };
12
13$VERSION = '1.08';
14@EXPORT = qw();
15@EXPORT_OK = qw();
16%EXPORT_TAGS = ();
17
18bootstrap IPA $VERSION;
19
20use constant combineMaxAbs       => 1;
21use constant combineSumAbs       => 2;
22use constant combineSum          => 3;
23use constant combineSqrt         => 4;
24use constant combineSignedMaxAbs => 5;
25use constant combineMultiply     => 6;
26
27use constant conversionTruncAbs  => 1;
28use constant conversionTrunc     => 2;
29use constant conversionScale     => 3;
30use constant conversionScaleAbs  => 4;
31
32sub import
33{
34   my $self = shift;
35   my @modules = ( 1 == @_ && lc($_[0]) eq 'all') ?
36      qw(Point Local Global Geometry Morphology Misc Region)
37      : @_;
38   for ( @modules) {
39       eval "use IPA::$_ ();";
40       die $@ if $@;
41       Exporter::export_to_level( "IPA::$_", 1, undef, '/./')
42          if UNIVERSAL::isa("IPA::$_", 'Exporter');
43   }
44}
45
461;
47
48__END__
49
50=pod
51
52=head1 NAME
53
54IPA - Image Processing Algorithms
55
56=head1 DESCRIPTION
57
58IPA stands for Image Processing Algorithms and represents the library of image
59processing operators and functions.  IPA is based on the Prima toolkit (
60http://www.prima.eu.org ), which in turn is a perl-based graphic library. IPA
61is designed for solving image analysis and object recognition tasks in perl.
62
63=head1 USAGE
64
65IPA works mostly with grayscale images, which can be loaded or created by means
66of Prima toolkit. See L<Prima::Image> for the information about C<Prima::Image>
67class functionality.  IPA methods are grouped in several modules, that contain
68the specific functions. The functions usually accept one or more images and
69optional parameter hash. Each function has its own set of parameters. If error
70occurs, the functions call C<die>, so it is advisable to use C<eval> blocks
71around the calls.
72
73The modules namespaces can be used directly, e.g. C<use IPA::Local qw(/./)>,
74C<use IPA::Point qw(/./)> etc, with each module defining its own set of
75exportable names. In case when all names are to be exported, it is possible to
76use C<IPA.pm> exporter by using C<use IPA qw(Local Point)> syntax, which is
77equivalent to two separate C<'use'> calls above. Moreover, if all modules are
78to be loaded and namespace exported, special syntax C<use IPA 'all'> is
79available.
80
81For example, a code that produces a binary thresholded image out of a 8-bit
82grayscale image:
83
84   use Prima;
85   use IPA qw(Point);
86   my $i = Prima::Image-> load('8-bit-grayscale.gif');
87   die "Cannot load:$@\n" if $@;
88   my $binary = threshold( $i, minvalue => 128);
89
90The abbreviations for pixel types are used, derived from
91the C<im::XXX> image type constants, as follows:
92
93   im::Byte     - 8-bit unsigned integer
94   im::Short    - 16-bit signed integer
95   im::Long     - 32-bit signed integer
96   im::Float    - float
97   im::Double   - double
98   im::Complex  - complex float
99   im::DComplex - complex double
100
101Each function returns the newly created image object with the result of the operation,
102unless stated otherwise in L<API>.
103
104=head1 MODULES
105
106L<IPA::Geometry> - mapping pixels from one location to another
107
108L<IPA::Point> - single pixel transformations and image arithmetic
109
110L<IPA::Local> - methods that produce images where every pixel is a function of pixels in the neighborhood
111
112L<IPA::Global> - methods that produce images where every pixel is a function of all pixels in the source image
113
114L<IPA::Region> - region data structures
115
116L<IPA::Morphology> - morphological operators
117
118L<IPA::Misc> - miscellaneous uncategorized routines
119
120=head1 REFERENCES
121
122=over
123
124=item *
125
126M.D. Levine. Vision in Man and Machine.  McGraw-Hill, 1985.
127
128=item *
129
130R. Deriche. Using Canny's criteria to derive a recursively implemented optimal edge detector.
131International Journal on Computer Vision, pages 167-187, 1987.
132
133=item *
134
135R. Boyle and R. Thomas Computer Vision. A First Course,
136Blackwell Scientific Publications, 1988, pp 32 - 34.
137
138=item *
139
140Image Processing Learning Resources.
141L<http://www.dai.ed.ac.uk/HIPR2/hipr_top.htm>
142
143=item *
144
145William K. Pratt.  Digital Image Processing.
146John Wiley, New York, 2nd edition, 1991
147
148=item *
149
150John C. Russ. The Image Processing Handbook.
151CRC Press Inc., 2nd Edition, 1995
152
153=item *
154
155L. Vincent & P. Soille.  Watersheds in digital
156spaces:  an efficient algorithm based on immersion
157simulations.  IEEE Trans. Patt. Anal. and Mach.
158Intell., vol. 13, no. 6, pp. 583-598, 1991
159
160=item *
161
162L. Vincent. Morphological Grayscale Reconstruction in Image Analysis:
163Applications and Efficient Algorithms.
164IEEE Transactions on Image Processing, vol. 2, no. 2, April 1993, pp. 176-201.
165
166=item *
167
168J. Canny, "A computational approach to edge detection, " IEEE Transactions on
169Pattern Analysis and Machine Intelligence, vol. 8, pp. 679--698, 1986. 18 Weber
170and Malik
171
172=item *
173
174Tony Lindeberg .  "Edge Detection and Ridge Detection with Automatic Scale Selection ".
175International Journal of Computer Vision, vol. 30, n. 2, pp. 77--116, 1996.
176
177=back
178
179=head1 SEE ALSO
180
181L<Prima>, L<iterm>,
182
183
184=head2 COPYRIGHT AND LICENSE
185
186(c) 1997-2002 The Protein Laboratory, University of Copenhagen
187(c) 2003-2007 Dmitry Karasik
188
189This library is free software; you can redistribute it and/or modify it
190under the same terms as Perl itself.
191
192=head1 AUTHORS
193
194Anton Berezin E<lt>tobez@tobez.orgE<gt>,
195Vadim Belman E<lt>voland@lflat.orgE<gt>,
196Dmitry Karasik E<lt>dmitry@karasik.eu.orgE<gt>
197
198=cut
199