Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added overview generating scripts in illusions and lightness
- Loading branch information
Showing
5 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import matplotlib.pyplot as plt | ||
import math | ||
|
||
import benary_cross | ||
import bullseye | ||
import checkerboard_contrast_contrast | ||
import checkerboard_sbc | ||
import cube | ||
import dungeon | ||
import grating | ||
import grating_induction | ||
import hermann | ||
import rings | ||
import sbc | ||
import todorovic | ||
import whites | ||
|
||
|
||
illusions = { | ||
"benary cross": benary_cross.benarys_cross(), | ||
"bullseye": bullseye.bullseye_illusion(), | ||
"checkerboard contrast\ncontrast effect": checkerboard_contrast_contrast.checkerboard_contrast_contrast_effect(), | ||
"checkerboard_sbc": checkerboard_sbc.checkerboard_contrast(), | ||
"cube": cube.cube_illusion(), | ||
"duneon": dungeon.dungeon_illusion(), | ||
"grating": grating.grating_illusion(), | ||
"grating induction": grating_induction.grating_induction(100, 20, 0.2), | ||
"hermann": hermann.hermann_grid(10, 2), | ||
"rings": rings.ring_pattern(), | ||
"sbc sbc": sbc.simultaneous_brightness_contrast(), | ||
"sbc simultaneous\ncontrast": sbc.simultaneous_contrast(100, 20), | ||
"todorovic": todorovic.todorovic_illusion() | ||
} | ||
|
||
|
||
|
||
white_illusions = { | ||
"white_illusion": whites.white_illusion(10, 3, 5), | ||
"zigzag_white": whites.zigzag_white(10, 4, 2), | ||
"wheel_of_fortune_white": whites.wheel_of_fortune_white(2, 0.3), | ||
"circular_white": whites.circular_white(4, 3), | ||
"SC_white": whites.SC_white(100, 20), | ||
"extended_white": whites.extended_white(100, 20), | ||
"checkered_white": whites.checkered_white(100), | ||
"squared_white": whites.squared_white(100, 10), | ||
"dotted_white": whites.dotted_white(100, 20, 5) | ||
} | ||
|
||
|
||
M = len(illusions) | ||
N = len(white_illusions) | ||
a = int(math.ceil(math.sqrt(M+N))) | ||
|
||
plt.figure(figsize=(20, 20)) | ||
|
||
for i, (name, img) in enumerate(white_illusions.items()): | ||
plt.subplot(a, a, M+i+1) | ||
plt.subplots_adjust(wspace=0.3, hspace=0.2) | ||
plt.xticks([]) | ||
plt.yticks([]) | ||
plt.title(name, fontsize=25) | ||
plt.imshow(img) | ||
|
||
for i, (name, img) in enumerate(illusions.items()): | ||
plt.subplot(a, a, i+1) | ||
plt.subplots_adjust(wspace=0.3, hspace=0.2) | ||
plt.xticks([]) | ||
plt.yticks([]) | ||
plt.title(name, fontsize=25) | ||
plt.imshow(img) | ||
|
||
|
||
plt.savefig("illusions_overview.png") | ||
plt.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import matplotlib.pyplot as plt | ||
import math | ||
|
||
import lightness | ||
|
||
shape=(15, 15) | ||
ppd=5 | ||
contrast=0.5 | ||
frequency = 0.4 | ||
|
||
illusions = { | ||
"cornsweet": lightness.cornsweet(size=shape, ppd=ppd, contrast=contrast), | ||
#"todorovic": lightness.todorovic() -> TODO: parameters need to be added here | ||
"square_wave": lightness.square_wave(shape=shape, ppd=ppd, contrast=contrast, frequency=frequency), | ||
"whites_illusion_bmcc": lightness.whites_illusion_bmcc(shape=shape, ppd=ppd, contrast=contrast, frequency=frequency), | ||
#"contours_white_bmmc": lightness.contours_white_bmmc(shape=shape, ppd=ppd, contrast=contrast, frequency=frequency), | ||
"whites illusion gil": lightness.whites_illusion_gil(shape=shape, ppd=ppd, contrast=contrast, frequency=frequency), | ||
"disc and ring": lightness.disc_and_ring(shape=shape, radii=(2,3,4), values=(6,9,3)) | ||
} | ||
|
||
|
||
|
||
M = len(illusions) | ||
a = int(math.ceil(math.sqrt(M))) | ||
|
||
plt.figure(figsize=(20, 20)) | ||
|
||
|
||
for i, (name, img) in enumerate(illusions.items()): | ||
plt.subplot(a, a, i+1) | ||
plt.subplots_adjust(wspace=0.3, hspace=0.2) | ||
plt.xticks([]) | ||
plt.yticks([]) | ||
plt.title(name, fontsize=25) | ||
plt.imshow(img) | ||
|
||
|
||
plt.savefig("illusions_overview.png") | ||
plt.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.png |