pls
Created on: June 4, 2025
Created on: June 4, 2025
pls
pythonfrom PIL import Image import matplotlib.pyplot as plt img = Image.open('/mnt/data/Screenshot 2025-06-04 12.25.54 PM.png') plt.imshow(img) plt.axis('off') (-0.5, 603.5, 484.5, -0.5)
pythonplt.figure(figsize=(4,4)) plt.imshow(img.crop((200,100,650,650))) plt.axis('off') (-0.5, 449.5, 549.5, -0.5)
pythonplt.figure(figsize=(4,4)) plt.imshow(img.crop((230,126,420,315))) plt.axis('off') (-0.5, 189.5, 188.5, -0.5)
pythonplt.figure(figsize=(4,4)) plt.imshow(img.crop((240,150,380,280))) plt.axis('off') (-0.5, 139.5, 129.5, -0.5)
pythonplt.figure(figsize=(4,4)) plt.imshow(img.crop((250,160,330,240))) plt.axis('off') (-0.5, 79.5, 79.5, -0.5)
pythonplt.figure(figsize=(4,4)) plt.imshow(img.crop((260,170,310,220))) plt.axis('off') (-0.5, 49.5, 49.5, -0.5)
pythonplt.figure(figsize=(4,4)) plt.imshow(img.crop((210,100,430,320))) plt.axis('off') (-0.5, 219.5, 219.5, -0.5)
pythonplt.figure(figsize=(3,3)) plt.imshow(img.crop((210,100,260,320))) plt.axis('off') (-0.5, 49.5, 219.5, -0.5)
pythonplt.figure(figsize=(4,4)) plt.imshow(img.crop((210,240,430,280))) plt.axis('off') (-0.5, 219.5, 39.5, -0.5)
pythonplt.figure(figsize=(4,4)) plt.imshow(img.crop((210,100,430,320))) plt.axis('off') plt.show()
pythonplt.figure(figsize=(3,3)) plt.imshow(img.crop((250,160,390,305))) plt.axis('off') (-0.5, 139.5, 144.5, -0.5)
pythonplt.figure(figsize=(3,3)) plt.imshow(img.crop((350,100,500,250))) plt.axis('off') (-0.5, 149.5, 149.5, -0.5)
pythonplt.figure(figsize=(3,3)) plt.imshow(img.crop((320,60,420,190))) plt.axis('off') (-0.5, 99.5, 129.5, -0.5)
pythonplt.figure(figsize=(6,6)) plt.imshow(img.crop((180,80,480,380))) plt.axis('off') (-0.5, 299.5, 299.5, -0.5)
pythonplt.figure(figsize=(6,2)) plt.imshow(img.crop((180,190,480,260))) plt.axis('off') (-0.5, 299.5, 69.5, -0.5)
pythonplt.figure(figsize=(3,4)) plt.imshow(img.crop((220,80,280,300))) plt.axis('off') (-0.5, 59.5, 219.5, -0.5)
pythonplt.figure(figsize=(4,4)) plt.imshow(img.crop((260,135,370,210))) plt.axis('off') (-0.5, 109.5, 74.5, -0.5)
pythonplt.figure(figsize=(6,6)) plt.imshow(img.crop((220,110,370,260))) plt.axis('off') (-0.5, 149.5, 149.5, -0.5)
pythonplt.figure(figsize=(3,3)) plt.imshow(img.crop((250,150,290,190))) plt.axis('off') (-0.5, 39.5, 39.5, -0.5)
pythonplt.figure(figsize=(3,3)) plt.imshow(img.crop((285,150,315,190))) plt.axis('off') (-0.5, 29.5, 39.5, -0.5)
pythonimport numpy as np import cv2 import matplotlib.pyplot as plt # load grayscale version gray = cv2.cvtColor(np.array(img), cv2.COLOR_BGR2GRAY) # find vertical gray axis maybe darker grey line without black. # Let's find column with many dark pixels horizontally across mix. # compute vertical sum of low intensities under threshold h, w = gray.shape threshold = 100 col_sums = np.sum(gray < threshold, axis=0) # display peaks # find index of maximum x_axis = np.argmax(col_sums) x_axis 30
pythonplt.figure(figsize=(4,4)) plt.imshow(img) plt.axvline(x=30,color='red') plt.axis('off') (-0.5, 603.5, 484.5, -0.5)
pythongraph = img.crop((180,80,480,380)) grayg = cv2.cvtColor(np.array(graph), cv2.COLOR_BGR2GRAY) h2,w2 = grayg.shape col_s = np.sum(grayg < threshold, axis=0) row_s = np.sum(grayg < threshold, axis=1) # find vertical axis, choose col with high sum x_axis_col = np.argmax(col_s) y_axis_row = np.argmax(row_s) x_axis_col, y_axis_row (116, 119)
pythonplt.figure(figsize=(4,4)) plt.imshow(graph) plt.axvline(x=x_axis_col,color='red') plt.axhline(y=y_axis_row,color='blue') plt.axis('off') (-0.5, 299.5, 299.5, -0.5)
python# detect black pixels # threshold: black pixel intensity < 50 maybe mask = grayg < 50 # find coordinates of mask coords = np.column_stack(np.where(mask)) # choose coords where x <= x_axis_col perhaps for left side left_coords = coords[coords[:,1] < x_axis_col - 5] # avoid axis # may also filter above y axis row maybe y<=y_axis_row? Actually P is above y-axis and above origin maybe around y slightly above axis row # Actually P is above x-axis maybe above row y_axis_row? # Let's filter rows less than maybe y_axis_row but greater than y_axis_row - some margin? p_candidates = left_coords[left_coords[:,0] <= y_axis_row + 10] # within maybe 10 px above axis row # Actually P dot is above x-axis maybe 1-3 squares above axis, which may be around 2*grid spacing ~ maybe 40 pixels above y_axis_row? # Let's search candidates where row < y_axis_row p_candidates = left_coords[left_coords[:,0] < y_axis_row - 10] # compute mean row/col of cluster py, px = np.mean(p_candidates, axis=0) py, px (93.45161290322581, 103.58064516129032)
El punto P parte de (-1, 2).
Al girarlo 90° en sentido horario alrededor del origen, sus coordenadas se transforman según (x, y) → (y, −x), de modo que
.
Por lo tanto, la coordenada de es 1.