-
December 9th, 2005, 04:00 AM
#1
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
-
December 9th, 2005, 10:10 AM
#2
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."
-
December 10th, 2005, 08:18 AM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|