This provides a simple Perl 6 object-oriented NativeCall wrapper for the OpenCV library.
use v6;
use OpenCV;
# Read the image from the disk
my $image = imread( "sample.png" );
# Show the image in a window
namedWindow( "Sample", 1 );
imshow( "Sample", $image );
# Wait for a key press to exit
waitKey;
For more examples, please see the examples folder.
Please follow the instructions below based on your platform:
$ sudo apt-get install libopencv-dev g++
$ brew update
$ brew tap homebrew/science
$ brew install opencv
A precompiled 64-bit windows DLL binary is already provided so it should work on 64-bit windows operating systems.
To install it using zef (a module management tool bundled with Rakudo Star):
$ zef install OpenCV
$ prove -ve "perl6 -Ilib"
$ zef install Test::META
$ AUTHOR_TESTING=1 prove -ve "perl6 -Ilib"
If you need to change the C++ to C library wrapper without doing a
zef install .
, please run:
$ zef build .
Ahmad M. Zawawi, azawawi on #perl6, https://github.com/azawawi/
MIT License