Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
imageProcessing
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ecole
imageProcessing
Commits
3399a593
Commit
3399a593
authored
Feb 20, 2018
by
Théophile BORNON
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Borders handling in filters
parent
72afd0b3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
MyImage.cs
S04_Projet/MyImage.cs
+11
-9
Program.cs
S04_Projet/Program.cs
+1
-1
No files found.
S04_Projet/MyImage.cs
View file @
3399a593
...
@@ -348,8 +348,11 @@ namespace S04_Projet
...
@@ -348,8 +348,11 @@ namespace S04_Projet
int
x
=
x0
+
(
i
%
size
)
-
((
size
-
1
)
/
2
);
int
x
=
x0
+
(
i
%
size
)
-
((
size
-
1
)
/
2
);
int
y
=
y0
+
(
i
/
size
)
-
((
size
-
1
)
/
2
);
int
y
=
y0
+
(
i
/
size
)
-
((
size
-
1
)
/
2
);
if
(
x
>=
0
&&
x
<
opt
.
width
&&
y
>=
0
&&
y
<
opt
.
height
)
if
(
x
<
0
)
x
=
0
;
{
else
if
(
x
>=
opt
.
width
)
x
=
opt
.
width
-
1
;
if
(
y
<
0
)
y
=
0
;
else
if
(
y
>=
opt
.
height
)
y
=
opt
.
height
-
1
;
if
(
rgb
==
RGB
.
R
)
if
(
rgb
==
RGB
.
R
)
matrix
[(
i
%
size
),
(
i
/
size
)]
=
Pixels
[
x
,
y
].
r
;
matrix
[(
i
%
size
),
(
i
/
size
)]
=
Pixels
[
x
,
y
].
r
;
else
if
(
rgb
==
RGB
.
G
)
else
if
(
rgb
==
RGB
.
G
)
...
@@ -357,7 +360,6 @@ namespace S04_Projet
...
@@ -357,7 +360,6 @@ namespace S04_Projet
else
if
(
rgb
==
RGB
.
B
)
else
if
(
rgb
==
RGB
.
B
)
matrix
[(
i
%
size
),
(
i
/
size
)]
=
Pixels
[
x
,
y
].
b
;
matrix
[(
i
%
size
),
(
i
/
size
)]
=
Pixels
[
x
,
y
].
b
;
}
}
}
return
matrix
;
return
matrix
;
}
}
...
...
S04_Projet/Program.cs
View file @
3399a593
...
@@ -54,7 +54,7 @@ namespace S04_Projet
...
@@ -54,7 +54,7 @@ namespace S04_Projet
{
0
,
-
1
,
0
}
{
0
,
-
1
,
0
}
};
};
MyImage
imgg
=
new
MyImage
(
"img/
coco
.bmp"
);
MyImage
imgg
=
new
MyImage
(
"img/
flocon
.bmp"
);
imgg
.
ApplyConvFilter
(
identityFilter
,
1
).
Save
(
"id.bmp"
);
imgg
.
ApplyConvFilter
(
identityFilter
,
1
).
Save
(
"id.bmp"
);
imgg
.
ApplyConvFilter
(
edgeDetect1Filter
,
1
).
Save
(
"edge1.bmp"
);
imgg
.
ApplyConvFilter
(
edgeDetect1Filter
,
1
).
Save
(
"edge1.bmp"
);
imgg
.
ApplyConvFilter
(
edgeDetect2Filter
,
1
).
Save
(
"edge2.bmp"
);
imgg
.
ApplyConvFilter
(
edgeDetect2Filter
,
1
).
Save
(
"edge2.bmp"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment