help-octave
[Top][All Lists]
Advanced

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

Re: Help-octave Digest, Vol 133, Issue 25


From: James Sherman Jr.
Subject: Re: Help-octave Digest, Vol 133, Issue 25
Date: Tue, 18 Apr 2017 11:04:03 -0400

On Mon, Apr 17, 2017 at 9:23 PM, Supreet Singh
<address@hidden> wrote:
> See what I'm trying to do is......
> frizzy = imread('frizzy.png');
> frizzy_gray=rgb2gray(frizzy);
> edges=edge(frizzy_gray,'canny');
> [accum theta rho]=houghtf(edges);
> imagesc(accum, 'XData', theta,'YData',rho);
>
>
> Supreet Singh
>
> On Tue, Apr 18, 2017 at 1:12 AM, James Sherman Jr. <address@hidden>
> wrote:
>>
>> On Mon, Apr 17, 2017 at 2:46 PM, Supreet Singh
>> <address@hidden> wrote:
>> > See firstly houghtf function is not accepting the 3rd parameter and also
>> > immaximas isn't working and also facing some problems in 1-D
>> > transformation
>> >
>> > Supreet Singh
>> >
>> > On Tue, Apr 18, 2017 at 12:12 AM, Supreet Singh
>> > <address@hidden>
>> > wrote:
>> >>
>> >> I'm using MAC OS with octave 4.2.0
>>
>> You really need to be more specific, and give a minimal working
>> example (https://en.wikipedia.org/wiki/Minimal_Working_Example) of
>> what your problem is.  For example, just testing the Hough transform
>> function, from the example given in the documentation:
>>
>> im = rand(16,16);
>> bw = edge(im);
>> H = houghtf(bw, "circle", [3, 7]);
>>
>> and to find some maximums:
>> [ R, C ] = immaximas(H(:,:,1), 1);
>>
>> gives no errors and produces a seemingly reasonable result.  Are you
>> possibly using an old version of the image package?
>>
>> Hope this helps,
>>
>> James Sherman Jr.
>
>

Hi Supreet,

Please keep replies sent to the mailing list in case others have the
same problem or have better insight into a solution to your problem.
Also, please bottom post as it makes the conversation easier to follow
for those reading along.  Also, to aid in others helping you, a
minimal working example is one that people can run themselves (for
example, I do not have the frizzy.png image you used in your example),
and you should describe what about your example doesn't work the way
you think it should, so modifying your code slightly, I ran this:

im = rand(16);
edges=edge(im,'canny');
[accum theta rho]=houghtf(edges);

Which caused the error:

error: element number 3 undefined in return list
error: called from
    foo at line 3 column 17

So, looking at the documentation for houghtf:

 -- Function File: H = houghtf (BW)
 -- Function File: H = houghtf (BW, METHOD)
 -- Function File: H = houghtf (BW, METHOD, ARG)

It doesn't seem that houghtf is defined or has a second or third
output  (is there somewhere that implies that there is?  or is this a
MATLAB compatibility issue?).  From your variable names, I think
you're looking for the R described in the documentation, and is
actually the second output (though undocumented) so a call like this,
I think, is what you're looking for:

[accum, rho]=houghtf(edges);

And to find the angles of the lines, from the documentation:

     These can be set through the third input argument ARG.  This must
be a vector of real numbers, and is
     by default 'pi*(-90:90)/180'.

So, unless you specify it in ARG, theta would always be:
theta = pi*(-90:90)/180;

Its been a long time since I dealt with the Hough transform, so make
sure to check that those values of rho match what you would expect
them to be.

Hope this helps,

James Sherman Jr.



reply via email to

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