Skip to content

Comments

Task 3#2

Open
franlsym wants to merge 2 commits intomainfrom
task-3
Open

Task 3#2
franlsym wants to merge 2 commits intomainfrom
task-3

Conversation

@franlsym
Copy link
Collaborator

Script:

import cv2  
import numpy as np
import matplotlib.pyplot as plt

# Size of the chessboard
width = 800
height = 800
square_size = 100

# Create a single-plane image (white)
chessboard = np.ones((height, width, 3), dtype=np.uint8) * 255

cv2.rectangle(chessboard, (0,0), (width,height), (1,1,1), 10)

for i in range(0, width, square_size):
    for j in range(0, height, square_size):
        if (i // square_size + j // square_size) % 2 == 0:
            cv2.rectangle(chessboard, (j,i), (j+square_size, i+square_size), (240, 217, 181), -1)
        else:
            cv2.rectangle(chessboard, (j,i), (j+square_size, i+square_size), (181, 136, 99), -1)

# Show the image
plt.imshow(chessboard)
plt.axis('off') 
plt.show()

Resultado:

image

@franlsym franlsym requested a review from DerKom September 14, 2024 18:21
@franlsym franlsym added the enhancement New feature or request label Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants