help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Edge function error


From: Carnë Draug
Subject: Re: Edge function error
Date: Tue, 13 Aug 2013 18:55:25 +0100

On 13 Aug 2013 07:32:39 -0700, <address@hidden> wrote:
> Hi,
>
> This is my first time posting in this forum. I'm very new to Octave and have
> been having small arguments and then wins all day but this has got me
> stumped at the moment.
>
> I've got a rgb photo which I've converted to grayscale. Its a fairly complex
> image but it is basically made up of a rectangle with 3 rows of ~10 circles
> evenly spaced along it, on a background.
>
> My aim is to detect the edge of the rectangle so I can crop the photo to
> that edge - haven't yet planned how I'm going to do that bit but anyway.....
>
> So my basic code is:
> [img, map, alpha] = imread("white_dots.jpg");
> [x, map] = rgb2ind(img);
> y = ind2gray(x, map);
> y = uint8((255*y) / max(max(y)));
> imwrite(y, "grayscale_white_dots.jpg". "jpg", "Quality", 75);
> edgeim = edge(y, 'canny' [0.1 0.2], 1);
> figure(1), imshow(edgeim);
>
>
> but after the edgeim command I get this error:
> error: 'edge' undefined near line 26 column 10
>
> I've looked through the edge.m file to try and understand what's going
> wrong.
>
> I'd really appreciate some help on this please.

The edge function belongs to the image package. If you have the file,
then you should have it installed and that error message suggests you
need to load it. Try "pkg load image".

On a separate note, why are you using:

y = uint8((255*y) / max(max(y)));

You should probably be using im2uint8 (also from the image package).

Carnë


reply via email to

[Prev in Thread] Current Thread [Next in Thread]