annotate src/of-image-1-fixes.patch @ 4357:74c7af6a36c0

* of-image-1-fixes.patch: New file.
author John W. Eaton <jwe@octave.org>
date Fri, 10 Mar 2017 11:37:08 -0500
parents
children a3af3be14136
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4357
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1 diff -uNr a/src/strel.cc b/src/strel.cc
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
2 --- a/src/strel.cc 2016-10-21 10:19:56.258205086 -0400
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
3 +++ b/src/strel.cc 2017-03-10 11:12:46.682214821 -0500
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
4 @@ -49,13 +49,13 @@
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
5 strel_args(0) = "arbitrary";
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
6 strel_args(1) = se;
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
7 // We are leaving the input check up to @strel
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
8 - se = feval ("strel", strel_args)(0);
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
9 + se = octave::feval ("strel", strel_args)(0);
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
10 if (error_state)
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
11 return;
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
12 }
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
13
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
14 - nhood = feval ("getnhood", se)(0).bool_array_value ();
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
15 - height = feval ("getheight", se)(0).array_value ();
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
16 + nhood = octave::feval ("getnhood", se)(0).bool_array_value ();
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
17 + height = octave::feval ("getheight", se)(0).array_value ();
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
18
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
19 // Maybe we should handle this better but how? This makes imerode
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
20 // and imdilate work with a [] strel
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
21 @@ -68,8 +68,8 @@
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
22 ini_ctor ();
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
23 origin = default_origin ();
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
24
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25 - const octave_value se_seq = feval ("getsequence", se)(0);
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
26 - const octave_idx_type seq_numel = feval ("numel", se_seq)(0).idx_type_value ();
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
27 + const octave_value se_seq = octave::feval ("getsequence", se)(0);
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28 + const octave_idx_type seq_numel = octave::feval ("numel", se_seq)(0).idx_type_value ();
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
30 // This is to emulate the strel_obj(idx) syntax in function form
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31 static const char *fields[] = {"type", "subs", 0};
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32 @@ -86,10 +86,10 @@
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33 ref.setfield ("subs", Cell (octave_value (subs+1)));
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 subsref_args(1) = ref;
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35 // Equivalent to "selem = strel_obj(subs)"
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
36 - const octave_value_list elem = feval ("subsref", subsref_args)(0);
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
37 + const octave_value_list elem = octave::feval ("subsref", subsref_args)(0);
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
38
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
39 - const boolNDArray elem_nhood = feval ("getnhood", elem)(0).bool_array_value ();
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
40 - const NDArray elem_height = feval ("getheight", elem)(0).array_value ();
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
41 + const boolNDArray elem_nhood = octave::feval ("getnhood", elem)(0).bool_array_value ();
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
42 + const NDArray elem_height = octave::feval ("getheight", elem)(0).array_value ();
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
43
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
44 decomposition.push_back (strel (elem_nhood, elem_height));
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
45 }
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
46 diff -uNr a/src/watershed.cc b/src/watershed.cc
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
47 --- a/src/watershed.cc 2016-10-21 10:19:56.258205086 -0400
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
48 +++ b/src/watershed.cc 2017-03-10 11:13:10.433094696 -0500
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
49 @@ -57,7 +57,7 @@
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
50 args(0) = im;
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
51 args(1) = conn.mask;
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
52 args(2) = conn.mask;
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
53 - const octave_value gradient = feval ("mmgradm", args)(0);
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
54 + const octave_value gradient = octave::feval ("mmgradm", args)(0);
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
55 return ov2T<T> (gradient);
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
56 }
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
57
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
58 @@ -68,7 +68,7 @@
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
59 octave_value_list args (2);
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
60 args(0) = im;
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
61 args(1) = conn.mask;
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
62 - const octave_value regional_min = feval ("imregionalmin", args)(0);
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
63 + const octave_value regional_min = octave::feval ("imregionalmin", args)(0);
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
64 return regional_min.bool_array_value ();
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
65 }
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
66
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
67 @@ -78,7 +78,7 @@
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
68 octave_value_list args (2);
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
69 args(0) = bw;
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
70 args(1) = conn.mask;
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
71 - const octave_value label = feval ("bwlabeln", args)(0);
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
72 + const octave_value label = octave::feval ("bwlabeln", args)(0);
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
73 return label.array_value ();
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
74 }
74c7af6a36c0 * of-image-1-fixes.patch: New file.
John W. Eaton <jwe@octave.org>
parents:
diff changeset
75