8000 Task 3 by franlsym · Pull Request #2 · gitfrandu4/40982-P1 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Task 3 #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Task 3 #2

wants to merge 2 commits into from

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
0