CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2005
    Posts
    2

    Hilditch algorithm

    Hello everybody

    I'm in need for implementation of Hilditch algorithm, I tried to implement it by myself but I've got uncorrect results. I found an implementation in the Internet but using C language, and I need in java language. I failed in transfer the code to java, could any one help me on that please?

    Here is the code I found in C.
    http://cis.k.hosei.ac.jp/~wakahara/Hilditch.c

    Thanks in advance for any help

  2. #2
    Join Date
    Apr 2003
    Location
    Los Angeles area
    Posts
    776

    Re: Hilditch algorithm

    What do you have so far? That code looks about 90% java compatible already.
    "The Chicken and Rice MRE is not a personal lubricant."

  3. #3
    Join Date
    Dec 2005
    Posts
    2

    Re: Hilditch algorithm

    Hello Joe Nellis,

    The problem is in this part:


    int func_nc8(int *b)
    /* connectivity detection for each point */
    {
    int n_odd[4] = { 1, 3, 5, 7 }; /* odd-number neighbors */
    int i, j, sum, d[10]; /* control variable */

    for (i = 0; i <= 9; i++) {
    j = i;
    if (i == 9) j = 1;
    if (abs(*(b + j)) == 1) {
    d[i] = 1;
    } else {
    d[i] = 0;
    }
    }
    sum = 0;
    for (i = 0; i < 4; i++) {
    j = n_odd[i];
    sum = sum + d[j] - d[j] * d[j + 1] * d[j + 2];
    }
    return (sum);
    }


    Which use pointer and in java I think there is no pointer!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured