-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_crow.py
More file actions
81 lines (63 loc) · 2.55 KB
/
test_crow.py
File metadata and controls
81 lines (63 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/env python3
"""
Test script for CROW
Creates a synthetic test image with simulated iridescent colors
"""
import cv2
import numpy as np
def create_test_image():
"""
Create a test image that simulates crow feathers with iridescence
"""
# Dimensions
width, height = 800, 600
# Create a black background
img = np.zeros((height, width, 3), dtype=np.uint8)
# Add zones with subtle iridescent colors
# Zone 1: Blue-violet (top left)
img[50:250, 50:250] = [30, 10, 5] # BGR - mostly dark with slight blue
for i in range(50, 250, 10):
cv2.circle(img, (150, 150), i, (40 + i//5, 15, 10), 2)
# Zone 2: Green-blue (center)
img[200:400, 300:500] = [15, 20, 5] # BGR - mostly dark with slight green
for i in range(0, 200, 15):
cv2.ellipse(img, (400, 300), (i, i//2), 45, 0, 360, (20, 30 + i//8, 10), 2)
# Zone 3: Purple (bottom right)
img[350:550, 550:750] = [25, 10, 20] # BGR - mostly dark with purple tint
for i in range(0, 150, 12):
cv2.rectangle(img, (550 + i, 350 + i), (750 - i, 550 - i),
(35 + i//6, 12, 28 + i//6), 2)
# Add "feather" pattern
for y in range(0, height, 40):
for x in range(0, width, 40):
# Choose subtle random colors
r = np.random.randint(5, 15)
g = np.random.randint(8, 25)
b = np.random.randint(10, 30)
# Draw "feathers" as thin lines
cv2.line(img, (x, y), (x + 30, y + 35), (b, g, r), 1)
cv2.line(img, (x + 5, y), (x + 25, y + 35), (b + 5, g + 5, r), 1)
# Add text
cv2.putText(img, "CROW Test Image", (width//2 - 150, 30),
cv2.FONT_HERSHEY_SIMPLEX, 1, (50, 50, 50), 2)
cv2.putText(img, "Simulated Iridescence", (width//2 - 150, height - 20),
cv2.FONT_HERSHEY_SIMPLEX, 0.7, (40, 40, 40), 1)
return img
def main():
print("🐦 Creating test image for CROW...")
# Create the image
test_img = create_test_image()
# Save the image
output_path = "test_crow_image.png"
cv2.imwrite(output_path, test_img)
print(f"✅ Test image created: {output_path}")
print("\nYou can test CROW with this image:")
print(f" python crow_color_analyzer.py -i {output_path}")
print("\nThis image contains zones with:")
print(" - Blue-violet (top left)")
print(" - Green-blue (center)")
print(" - Purple (bottom right)")
print(" - 'Feather' pattern with subtle colors")
print("\nCROW methods should reveal these hidden colors!")
if __name__ == "__main__":
main()