June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
16
Task/Grayscale-image/Maple/grayscale-image.maple
Normal file
16
Task/Grayscale-image/Maple/grayscale-image.maple
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
with(ImageTools):
|
||||
#conversion forward
|
||||
dimensions:=[upperbound(img)];
|
||||
gray := Matrix(dimensions[1], dimensions[2]);
|
||||
for i from 1 to dimensions[1] do
|
||||
for j from 1 to dimensions[2] do
|
||||
gray[i,j] := 0.2126 * img[i,j,1] + 0.7152*img[i,j,2] + 0.0722*img[i,j,3]:
|
||||
end do:
|
||||
end do:
|
||||
#display the result
|
||||
Embed(Create(gray)):
|
||||
#conversion backward
|
||||
x:=Create(gray);
|
||||
ToRGB(x);
|
||||
#display the result
|
||||
Embed(x);
|
||||
Loading…
Add table
Add a link
Reference in a new issue