If you are trying to translate code from Matlab, you might want to take a look at PDL. There is even a guide for MATLAB users.

Using Prima, I was able to put together a simple app that loads and displays an image. When one clicks on the image, the coordinates are given in a popup message box. This code doesn't use PDL, but if you wanted to process the image in some way before displaying it you would likely find PDL to be useful (and Prima works well with PDL).

#!/usr/bin/env perl use strict; use warnings; use Prima qw(Application MsgBox ImageViewer); # Example image taken from the "Astronomy Picture of the Day Archive" # http://apod.nasa.gov/apod/archivepix.html # Picture of the day May 13, 2016 # http://apod.nasa.gov/apod/ap160513.html my $im = Prima::Image->load('mercury-transit-2016-50legaultc.jpg'); my $sf = 1.2; # scaling factor my $w = $im->width; # image width my $h = $im->height; # image height my $wDisplay = Prima::MainWindow->create( text => 'Image Viewer', size => [ $sf*$w, $sf*$h ], ); $wDisplay->insert( 'Prima::ImageViewer', size => [ $w, $h ], image => $im, autoZoom => 1, onMouseDown => sub { my ( $self, $button, $mod, $x, $y) = @_; message("You clicked me at: $x:$y!"); } ); run Prima;
When working with PDL and Prima, it can be a bit difficult to find the correct documentation for a give task (but searching usually pays off!). Here are some links that helped me piece together this code:

In reply to Re: How can I tranlate imread and imshow matlab function into perl by kevbot
in thread How can I tranlate imread and imshow matlab function into perl by meemee

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.