Skip to content

bug (i guess) in contours2ucm.m #9

@legalup

Description

@legalup

i am on ubuntu 1404, using g++ 4.7.

git cloned, and did set up. was not able to run compile.m, but was able to compile mex from source.
when i ran 'example.m', i gave me an error that i was using 'rows' incorrectly. the code was this:

function [seg8] = to_8(seg4)

seg8 = seg4;
for i = 1 : rows(seg4)-1,
for j = 1 : columns(seg4)-1,
if (seg8(i,j) > 0 && seg8(i+1, j+1) > 0 && seg8(i,j+1) == 0 && seg8(i+1,j) == 0),
seg8(i,j+1) = ( seg8(i,j) + seg8(i+1,j+1) )/2;
end
end
end

and i changed it to:

function [seg8] = to_8(seg4)

seg8 = seg4;
[rs cs]=size(seg4);

for i = 1 : rs-1,
for j = 1 : cs-1,
if (seg8(i,j) > 0 && seg8(i+1, j+1) > 0 && seg8(i,j+1) == 0 && seg8(i+1,j) == 0),
seg8(i,j+1) = ( seg8(i,j) + seg8(i+1,j+1) )/2;
end
end
end

not sure where the previous 'rows' function was defined, but it is also defined the Database toolkit.

you may want to fix it!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions