HaruthaiAi commited on
Commit
7dfc57c
·
verified ·
1 Parent(s): 58c150a

Upload VanGogh_OldMan_Color_18Techniques_AIAnalysis_2025.jpg

Browse files

This figure presents the result of 18 Supreme Techniques applied to the color version of *Portrait of an Old Man with a Beard* (1885) by Vincent van Gogh.
To ensure transparency and reproducibility, the full Python code used to generate this analysis via Google Colab is included below.

Each technique isolates a different layer of brushstroke force, texture, frequency, or contrast.
Together, they create a fingerprint of the artist's hand movement, which is essential for comparative torque studies with *The Tree Oil Painting*.

🔽 The full source code used to produce this figure is shown below:

# ✅ Install required libraries (only once)
!pip install opencv-python matplotlib numpy scipy --quiet

# ✅ Import libraries
import cv2
import numpy as np
import matplotlib.pyplot as plt
from scipy import ndimage
from google.colab import files

# ✅ Upload image file (JPG or PNG)
uploaded = files.upload()
filename = list(uploaded.keys())[0]
img = cv2.imread(filename, cv2.IMREAD_GRAYSCALE)

# ✅ Define the 18 technique analysis function
def analyze_18_techniques(image):
fig, axes = plt.subplots(6, 3, figsize=(18, 36))
fig.suptitle('18 Supreme Techniques – AI Brushstroke Analysis', fontsize=20)
axes = axes.ravel()

# Technique 1: Original
axes[0].imshow(image, cmap='gray'); axes[0].set_title('Original Image')

# Technique 2: Sobel X
sobelx = cv2.Sobel(image, cv2.CV_64F, 1, 0, ksize=5)
axes[1].imshow(sobelx, cmap='gray'); axes[1].set_title('Sobel X')

# Technique 3: Sobel Y
sobely = cv2.Sobel(image, cv2.CV_64F, 0, 1, ksize=5)
axes[2].imshow(sobely, cmap='gray'); axes[2].set_title('Sobel Y')

# Technique 4: Laplacian
laplacian = cv2.Laplacian(image, cv2.CV_64F)
axes[3].imshow(laplacian, cmap='gray'); axes[3].set_title('Laplacian')

# Technique 5: Gaussian Blur
gaussian = cv2.GaussianBlur(image, (11,11), 0)
axes[4].imshow(gaussian, cmap='gray'); axes[4].set_title('Gaussian Blur')

# Technique 6: Median Blur
median = cv2.medianBlur(image, 9)
axes[5].imshow(median, cmap='gray'); axes[5].set_title('Median Blur')

# Technique 7: CLAHE
clahe = cv2.createCLAHE(clipLimit=2.0, tileGridSize=(8, 8))
cl1 = clahe.apply(image)
axes[6].imshow(cl1, cmap='gray'); axes[6].set_title('CLAHE Enhancement')

# Technique 8: Canny Edge
edges = cv2.Canny(image, 100, 200)
axes[7].imshow(edges, cmap='gray'); axes[7].set_title('Canny Edge')

# Technique 9: FFT
f = np.fft.fft2(image)
fshift = np.fft.fftshift(f)
magnitude = 20*np.log(np.abs(fshift) + 1)
axes[8].imshow(magnitude, cmap='inferno'); axes[8].set_title('Fourier Transform')

# Technique 10: Histogram Equalization
hist_eq = cv2.equalizeHist(image)
axes[9].imshow(hist_eq, cmap='gray'); axes[9].set_title('Histogram Equalization')

# Technique 11: Morphological Gradient
gradient = cv2.morphologyEx(image, cv2.MORPH_GRADIENT, np.ones((5, 5), np.uint8))
axes[10].imshow(gradient, cmap='gray'); axes[10].set_title('Texture Gradient')

# Technique 12: Erosion
erosion = cv2.erode(image, np.ones((3, 3), np.uint8), iterations=1)
axes[11].imshow(erosion, cmap='gray'); axes[11].set_title('Erosion')

# Technique 13: Dilation
dilation = cv2.dilate(image, np.ones((3, 3), np.uint8), iterations=1)
axes[12].imshow(dilation, cmap='gray'); axes[12].set_title('Dilation')

# Technique 14: Gabor Filter
gabor = cv2.getGaborKernel((21, 21), 8.0, np.pi/4, 10.0, 0.5, 0, ktype=cv2.CV_32F)
filtered = cv2.filter2D(image, cv2.CV_8UC3, gabor)
axes[13].imshow(filtered, cmap='gray'); axes[13].set_title('Gabor Filter 45°')

# Technique 15: Binary Threshold
_, thresh = cv2.threshold(image, 127, 255, cv2.THRESH_BINARY)
axes[14].imshow(thresh, cmap='gray'); axes[14].set_title('Binary Threshold')

# Technique 16: Contour Detection
contours, _ = cv2.findContours(thresh, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
contour_img = np.zeros_like(image)
cv2.drawContours(contour_img, contours, -1, 255, 1)
axes[15].imshow(contour_img, cmap='gray'); axes[15].set_title('Contour Map')

# Technique 17: Sobel Combined Magnitude
sobel_comb = np.sqrt(sobelx**2 + sobely**2)
axes[16].imshow(sobel_comb, cmap='hot'); axes[16].set_title('Sobel Combined Magnitude')

# Technique 18: Laplacian of Gaussian
lap_gauss = cv2.Laplacian(gaussian, cv2.CV_64F)
axes[17].imshow(lap_gauss, cmap='gray'); axes[17].set_title('Laplacian of Gaussian')

# Hide axes and show result
for ax in axes:
ax.axis('off')
plt.tight_layout()
plt.show()

# ✅ Run the full analysis
analyze_18_techniques(img)

VanGogh_OldMan_Color_18Techniques_AIAnalysis_2025.jpg ADDED

Git LFS Details

  • SHA256: a93dc7d255f762c991c5e0e5a2204708ed0efe15805d0297523493565375239e
  • Pointer size: 131 Bytes
  • Size of remote file: 162 kB