Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #3921
| From | Sönmezer, D. <d.sonmezer@student.tue.nl> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Code is not working... |
| Date | 2011-07-22 23:57 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <j0d2oh$s3r$1@smc.vnet.net> (permalink) |
Hello,
I am in trouble with below codes:
I run this code but Program is not finsh evertime It is running and running...
Could you possible help me.
dim = Dimensions[image]
r = 1;
k = 1;
n = 10;
cost = Function[{positionValues, neighborValues},
First[neighborValues] == 1];
(* Image that only contains the value zero *)
imageNew = Table[0, {i, 1, dim[[1]]}, {j, 1, dim[[2]]}];
(* Walk through the rows of the image *)
While[r < dim[[1]],
(* Walk through the columns of the image*)
k = 1;
While[k < dim[[2]],
(* Find a white pixel*)
If[imgfilter[[r, k]] == 1,
(* Proceed RegionGrowing and give them a identical value by \
multiplying it with n *)
region = RegionGrowing[{imgfilter}, {{r, k}}, 1, cost]*n;
(* Add the identical cell to imageNew *)
imageNew = imageNew + region;
(* Change n, so each cell has a different value *)
n = n + 2;
(* Take the cell out of the original image,
so he will stop when there is no white pixel anymore *)
imageFilled = imgfilter - region;
];
k++;
];
r++;
];
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Code is not working... Sönmezer, D. <d.sonmezer@student.tue.nl> - 2011-07-22 23:57 +0000
csiph-web