Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9d55bda

Browse files
authored
[bugfix] Fix edge detect design bug introduced recently (#2739)
1 parenta81f682 commit9d55bda

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

‎programming_examples/vision/edge_detect/edge_detect.py‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,22 @@ def rgba2gray_fn(of_in, of_out, rgba2gray_line):
9696
)
9797
)
9898

99+
v0=0
100+
v1=4096
101+
v_minus4=-16384
102+
initial_value=np.array(
103+
[[v0,v1,v0], [v1,v_minus4,v1], [v0,v1,v0]],dtype=np.int16
104+
)
99105
filter_kernel_buff=Buffer(
100106
np.ndarray[(3,3),np.dtype[np.int16]],
101107
name="kernel",
102-
initial_value=np.array(
103-
[[v0,v1,v0], [v1,v_minus4,v1], [v0,v1,v0]],dtype=np.int16
104-
),
108+
initial_value=initial_value,
105109
)
106110

107111
# Task for the core to perform
108112
deffilter_fn(of_in,of_out,kernel,filter2d_line):
109113
# OF_2to3 -> intermediates[0]
110114
# OF_3to4 -> intermediates[1]
111-
v0=0
112-
v1=4096
113-
v_minus4=-16384
114115

115116
for_inrange_(sys.maxsize):
116117
# Preamble : Top Border
@@ -162,6 +163,7 @@ def filter_fn(of_in, of_out, kernel, filter2d_line):
162163
[
163164
of_intermediates[0].cons(),
164165
of_intermediates[1].prod(),
166+
filter_kernel_buff,
165167
filter2d_line_kernel,
166168
],
167169
while_true=False,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp