projects
/
image-openalpr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6765bc3
)
Overload stringify in PlateResult.pm
author
Marius Gavrilescu
<marius@ieval.ro>
Sat, 16 Apr 2016 18:35:17 +0000
(21:35 +0300)
committer
Marius Gavrilescu
<marius@ieval.ro>
Sat, 16 Apr 2016 18:43:40 +0000
(21:43 +0300)
lib/Image/OpenALPR/PlateResult.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Image/OpenALPR/PlateResult.pm
b/lib/Image/OpenALPR/PlateResult.pm
index 3fcca2dd446cff530241c7b5354e80a55aaa01f6..e06a3e93d59149e6a33d959a713d0bc9b44f3fed 100644
(file)
--- a/
lib/Image/OpenALPR/PlateResult.pm
+++ b/
lib/Image/OpenALPR/PlateResult.pm
@@
-4,6
+4,7
@@
use 5.014000;
use strict;
use warnings;
use strict;
use warnings;
+use overload '""' => sub { shift->plate }, fallback => 1;
use parent qw/Class::Accessor::Fast/;
our $VERSION = '0.001';
use parent qw/Class::Accessor::Fast/;
our $VERSION = '0.001';
@@
-36,6
+37,7
@@
Image::OpenALPR::PlateResult - a license plate, as identified by OpenALPR
=head1 SYNOPSIS
my $plate = $alpr->recognise('t/example.jpg');
=head1 SYNOPSIS
my $plate = $alpr->recognise('t/example.jpg');
+ say $plate; # ZP36709
say $plate->plate; # ZP36709
say $plate->confidence; # 92.373634
my @coords = $plate->coordinates; # [306, 351], [476, 351], [476, 384], [306, 384]
say $plate->plate; # ZP36709
say $plate->confidence; # 92.373634
my @coords = $plate->coordinates; # [306, 351], [476, 351], [476, 384], [306, 384]
@@
-53,7
+55,8
@@
identified by OpenALPR. It offers the following methods:
=item $plate->B<plate>
The plate number that has the highest confidence value (likelihood of
=item $plate->B<plate>
The plate number that has the highest confidence value (likelihood of
-being correct).
+being correct). An object of this class will stringify to the return
+value of this method.
=item $plate->B<confidence>
=item $plate->B<confidence>
This page took
0.009982 seconds
and
4
git commands to generate.