import cv2


img1=cv2.imread('dilation_for_1_robot.pgm',cv2.IMREAD_COLOR)
img2=cv2.imread('cleaned_skeleton_1_robot.pgm',0)
help=img1.copy()
for i in range(len(img2)):
    for j in range(len(img2[i])):
        if(img2[i][j]!=0):
            help[i][j]=[0,0,255]
cv2.imwrite('dilat1-skeleton1.png', help)

img3=cv2.imread('dilation_for_1_robot.pgm',0)
img4=cv2.imread('dilat1-skeleton1.png',cv2.IMREAD_COLOR)

for i in range(len(img3)):
    for j in range(len(img3[i])):
        if(img3[i][j]==1 and img4[i][j][2]!=255):
            img4[i][j]=[255,255,255]
cv2.imwrite('dilat1-skeleton1.png', img4)

import matplotlib.pyplot as plt
import matplotlib.image as mpimg

img=mpimg.imread('dilat1-skeleton1.png')



imgplot = plt.imshow(img, cmap='gray',extent=[0,19,0,124])
plt.title("Finálna roadmapa")
plt.xlabel("Súradnica x [m]")
plt.ylabel("Súradnica y [m]")
plt.ylim(80,100)




plt.show()
