diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/Calibration_cam/out.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/Calibration_cam/out.jpg index 3b2f09ab135d9b1029dc1fb1a6fdbe3e40c5a5f9..02c35afc965ab6e431b000f0bcc4fbb4df3b0ad7 100644 Binary files a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/Calibration_cam/out.jpg and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/Calibration_cam/out.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/MCL.py b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/MCL.py index 6cd07d0cbe0ee518c20595d20a68f5ba584f0093..16b1f4aa1c1649021e14b8b5a8d0b1ef1e9ef754 100644 --- a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/MCL.py +++ b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/MCL.py @@ -1,12 +1,12 @@ -#import os -#os.environ['CUDA_VISIBLE_DEVICES'] = '0' -#import cv2 -#import tensorflow as tf -#from yolov3.utils import detect_image, detect_realtime, detect_video, Load_Yolo_model, detect_video_realtime_mp -#from yolov3.configs import * +# import os +# os.environ['CUDA_VISIBLE_DEVICES'] = '0' +# import cv2 +# import tensorflow as tf +# from yolov3.utils import detect_image, detect_realtime, detect_video, Load_Yolo_model, detect_video_realtime_mp +# from yolov3.configs import * import matplotlib.pyplot as plt -#from mpl_toolkits.mplot3d import axes3d -#from matplotlib import cm +from mpl_toolkits.mplot3d import axes3d +from matplotlib import cm import numpy as np import random as rd @@ -17,19 +17,48 @@ from math import cos, sin, tan, atan ### Carte ### -pixel_x_ext, pixel_y_ext = [242, 220, 165, 110, 63, 33, 22, 34, 63, 110, 165, 220, 243, 310, 334, 388, 443, 490, 521, 531, 520, 489, 443, 388, 333, 310], [76, 64, 52, 64, 95, 141, 196, 252, 298, 330, 340, 328, 318, 316, 328, 339, 329, 298, 251, 196, 142, 95, 64, 53, 64, 77] -pixel_x_int, pixel_y_int = [245, 238, 222, 196, 166, 134, 108, 91, 85, 90, 109, 134, 165, 196, 222, 239, 308, 314, 332, 358, 388, 419, 445, 462, 468, 462, 445, 419, 388, 359, 332, 314], [201, 167, 140, 123, 116, 123, 140, 165, 195, 228, 253, 270, 277, 270, 253, 227, 200, 226, 253, 270, 277, 270, 253, 228, 197, 166, 140, 122, 117, 123, 140, 166] -diametre = 225 -centre_x, centre_y = 278, 200 -coord_x_ext, coord_y_ext = [i/diametre for i in pixel_x_ext], [i/diametre for i in pixel_y_ext] -coord_x_int, coord_y_int = [i/diametre for i in pixel_x_int], [i/diametre for i in pixel_y_int] +# pixel_x_ext, pixel_y_ext = [242, 220, 165, 110, 63, 33, 22, 34, 63, 110, 165, 220, 243, 310, 334, 388, 443, 490, 521, 531, 520, 489, 443, 388, 333, 310], [76, 64, 52, 64, 95, 141, 196, 252, 298, 330, 340, 328, 318, 316, 328, 339, 329, 298, 251, 196, 142, 95, 64, 53, 64, 77] +# pixel_x_int, pixel_y_int = [245, 238, 222, 196, 166, 134, 108, 91, 85, 90, 109, 134, 165, 196, 222, 239, 308, 314, 332, 358, 388, 419, 445, 462, 468, 462, 445, 419, 388, 359, 332, 314], [201, 167, 140, 123, 116, 123, 140, 165, 195, 228, 253, 270, 277, 270, 253, 227, 200, 226, 253, 270, 277, 270, 253, 228, 197, 166, 140, 122, 117, 123, 140, 166] +# diametre = 225 +# centre_x, centre_y = 278, 200 +# coord_x_ext, coord_y_ext = [i/diametre for i in pixel_x_ext], [i/diametre for i in pixel_y_ext] +# coord_x_int, coord_y_int = [i/diametre for i in pixel_x_int], [i/diametre for i in pixel_y_int] -coord_ext = [(i/diametre , j/diametre) for i,j in zip(pixel_x_ext, pixel_y_ext)] -coord_int = [(i/diametre , j/diametre) for i,j in zip(pixel_x_int, pixel_y_int)] +#coord_ext = [(i/diametre , j/diametre) for i,j in zip(pixel_x_ext, pixel_y_ext)] +#coord_int = [(i/diametre , j/diametre) for i,j in zip(pixel_x_int, pixel_y_int)] + + +coord_x_int = [] +coord_y_int = [] + +coord_x_ext = [] +coord_y_ext = [] + +r_in = 1-0.14/2 +r_ext = r_in + 0.394 + 0.14 + +for i in range(16): + theta = 2*3.1415*i/16 + coord_x_int.append(-1.2+r_in*cos(theta)) + coord_y_int.append(r_in*sin(theta)) + + coord_x_int.append(1.2+r_in*cos(theta)) + coord_y_int.append(r_in*sin(theta)) + + if 1<i<15: + coord_x_ext.append(-1.2+r_ext*cos(theta)) + coord_y_ext.append(r_ext*sin(theta)) + + if not 7<=i<=9: + coord_x_ext.append(1.2+r_ext*cos(theta)) + coord_y_ext.append(r_ext*sin(theta)) + +coord_ext = [(i,j) for i,j in zip(coord_x_ext, coord_y_ext)] +coord_int = [(i,j) for i,j in zip(coord_x_int, coord_y_int)] ### Paramètres ### -sigma_position = 0.02 -sigma_direction = 1*3.1415/180 +sigma_position = 0.05 +sigma_direction = 8*3.1415/180 seuil_cone = 0.6 @@ -37,9 +66,9 @@ dep_x, dep_y, dep_theta = 1.314, 1.162, 3.14/3.6 nb_particule = 30 pos = [[dep_x, dep_y, dep_theta] for i in range(nb_particule)] -F = 156.25 #3957/3 #Focale camera +F = 145.31 #194.97 #1/0.0051/0.8 #3957/3 #156.25 #Focale camera h_reel = 1 #Hauteur d'un plot -y_0 = 240 #Milieu de l'image +y_0 = 3264/2 #Milieu de l'image dist_roue = 0.25 #Distance entre les roues avant et les roues arrieres @@ -59,13 +88,18 @@ def distance(x_1, y_1, x_2, y_2): def boite2coord(x1,y1,x2,y2): - d = F*h_reel/abs(y1-y2) - #y_r = -((x1+x2)/2 - y_0)*d/F - ypmax=480/2 - ymax=0.54 - y_r=((x1+x2)/2-ypmax)/ypmax*ymax - sin_theta= y_r/d - x_r = d*(1-sin_theta**2)**0.5 + d = F*h_reel/abs(y1-y2) - 0.3982 + + ypmax=960/2 + ymax=0.6 + #y_r = -((x1+x2)/2 - ypmax)*d/F + tan_theta=((x1+x2)/2-ypmax)/ypmax*ymax + theta = -atan(tan_theta) + x_r = d*cos(theta) + y_r = d*sin(theta) + + #print(sin_theta) + #x_r = d*(1-sin_theta**2)**0.5 return x_r,y_r @@ -98,21 +132,16 @@ def distance_Chamfer(A_x, A_y, B_x, B_y): return res -def orientation_voiture(x,y): - x1, y1=x,y - #x1,y1 = x-centre_x, y-centre_y - #print(f"1: x: {x1}, y: {y1}") - - if x<0: - x2,y2 = x1+diametre/2, y1 - #print(f"2: x: {x2}, y: {y2}") - theta = atan(y2/x2) - return theta-3.1415/2 - else: - x2,y2 = x1-diametre/2, y1 - #print(f"2: x: {x2}, y: {y2}") - theta = atan(y2/x2) - return theta+3.1415/2 +# def orientation_voiture(x,y): +# x1,y1 = x-centre_x, y-centre_y +# if x<0: +# x2,y2 = x1+diametre/2, y1 +# theta = atan(y2/x2) +# return theta-3.1415/2 +# else: +# x2,y2 = x1-diametre/2, y1 +# theta = atan(y2/x2) +# return theta-3.1415/2 def motion_update(commande, position): @@ -138,8 +167,7 @@ def motion_update(commande, position): centre_rotation_y = y + R*cos(theta) new_x, new_y = rotation((x,y),(centre_rotation_x, centre_rotation_y), angle_rotation) - new_theta = orientation_voiture(new_x, new_y) - #print(new_theta) + new_theta = theta + angle_rotation #orientation_voiture(new_x, new_y) new_x += rd.gauss(0, sigma_position) new_y += rd.gauss(0, sigma_position) @@ -167,12 +195,12 @@ def sensor_update(observation, position): cones_vu_x = [] cones_vu_y = [] for i in range(len(vision_x)): - if vision_x[i]>0 and abs(vision_y[i])<0.54*vision_x[i]: + if vision_x[i]>0 and abs(vision_y[i])<1.15*vision_x[i]: cones_vu_x.append(vision_x[i]) cones_vu_y.append(vision_y[i]) for i in range(len(vision_x_ext)): - if vision_x_ext[i]>0 and abs(vision_y_ext[i])<0.67*vision_x_ext[i]: + if vision_x_ext[i]>0 and abs(vision_y_ext[i])<0.6*vision_x_ext[i]: cones_vu_x.append(vision_x_ext[i]) cones_vu_y.append(vision_y_ext[i]) @@ -264,41 +292,25 @@ def get_position(boxes,commande,pos): if __name__ == "__main__": - # detection = [[2.18939087e+03, 1.48177417e+03, 2.86449023e+03, 2.54427783e+03, 9.66490030e-01, 0.00000000e+00], - # [4.22634644e+02, 1.44312561e+03, 1.08822302e+03, 2.31131567e+03, 9.36378121e-01, 0.00000000e+00], - # [1.33116504e+03, 1.42764783e+03, 1.70783643e+03, 1.98202075e+03, 9.03878212e-01, 0.00000000e+00], - # [2.11831836e+03, 1.41914294e+03, 2.43602563e+03, 1.87002930e+03, 9.03337121e-01, 0.00000000e+00], - # [2.24867358e+03, 1.59305701e+03, 2.99900000e+03, 3.76038647e+03, 8.82729828e-01, 0.00000000e+00], - # [2.64460254e+03, 1.44378406e+03, 2.91649780e+03, 2.14795459e+03, 3.62023830e-01, 0.00000000e+00]] - - # detection = [[0.00000000e+00, 1.85167456e+03, 9.15495361e+02, 3.25824146e+03, 9.37295914e-01, 0.00000000e+00], - # [2.41986987e+03, 1.86332446e+03, 2.86713550e+03, 2.42170972e+03, 9.23870742e-01, 0.00000000e+00], - # [1.36284387e+03, 1.83517468e+03, 1.92408057e+03, 2.59739648e+03, 9.17667687e-01, 0.00000000e+00]] - - detection = [[1.28486133e+03, 1.79538904e+03, 1.78743445e+03, 2.45994067e+03, 9.39055085e-01, 0.00000000e+00], - [0.00000000e+00, 1.87250220e+03, 7.69682068e+02, 3.12636377e+03, 9.35593545e-01, 0.00000000e+00], - [2.12719995e+03, 1.72824695e+03, 2.48698218e+03, 2.24433813e+03, 9.07173812e-01, 0.00000000e+00], - [2.72219897e+03, 2.18795605e+03, 2.99900000e+03, 3.47306348e+03, 3.55658233e-01, 0.00000000e+00]] - - # detection = [[1.12150806e+03, 1.82397412e+03, 1.71230017e+03, 2.59400610e+03, 9.47640836e-01, 0.00000000e+00], - # [2.17284106e+03, 1.79985144e+03, 2.59600366e+03, 2.34515747e+03, 9.44890141e-01, 0.00000000e+00], - # [2.78233301e+03, 1.75100500e+03, 2.99900000e+03, 2.26862329e+03, 9.10233915e-01, 0.00000000e+00], - # [0.00000000e+00, 1.92825171e+03, 5.37962524e+02, 3.36087646e+03, 8.53242218e-01, 0.00000000e+00], - # [2.80115698e+03, 3.22995215e+03, 2.99900000e+03, 3.76810620e+03, 3.35420161e-01, 0.00000000e+00], - # [6.21354027e+01, 1.80441516e+03, 3.51005554e+02, 2.08294287e+03, 3.16491544e-01, 0.00000000e+00]] + + detection = [np.array([115.43045807, 210.114151 , 394.80041504, 559.36151123, + 0.95864254, 0. ]), np.array([515.29907227, 304.63769531, 671.36590576, 497.72848511, + 0.93361914, 0. ]), np.array([7.85924133e+02, 3.29671387e+02, 9.00264526e+02, 4.77042267e+02, + 7.98994482e-01, 0.00000000e+00])] + z_t = [] liste_x = [] liste_y = [] nb_particle = 100 - pos = [(2.5*rd.random(), 1.6*rd.random(), 2*3.14*rd.random()) for i in range(nb_particle)] - #pos = [(1.5, 1.180, 3.14/3) for i in range(nb_particle)] + #pos = [(2.5*rd.random(), 1.6*rd.random(), 2*3.14*rd.random()) for i in range(nb_particle)] + pos = [(1.2,1.19,-0.3) for i in range(nb_particle)] for i in detection: if i[4] >= seuil_cone: x,y = boite2coord(i[0],i[1],i[2],i[3]) - liste_x.append(x*2/3) - liste_y.append(y*2/3) + liste_x.append(x) + liste_y.append(y) for i in range(len(liste_x)): z_t.append((liste_x[i], liste_y[i])) @@ -310,7 +322,8 @@ if __name__ == "__main__": # Z = np.zeros((100,100)) # for i in range(100): # for j in range(100): - # Z[i,j] = sensor_update(z_t, (X[i,j],Y[i,j], 3.14/3)) + # #Z[i,j] = sensor_update(z_t, (X[i,j],Y[i,j], 3.14/3)) + # Z[i,j] = orientation_voiture(X[i,j], Y[i,j]) # fig, ax = plt.subplots(subplot_kw={"projection": "3d"}) # surf = ax.plot_surface(X, Y, Z, cmap=cm.coolwarm, @@ -363,7 +376,7 @@ if __name__ == "__main__": fig.canvas.draw() plt.pause(0.1) -''' +''' if __name__ == "__main__": # pos = [(1.314, 1.162, 3.14/3.6) for i in range(10)] # #pos = [(2.5*rd.random(), 1.5*rd.random(), 6.28*rd.random()) for i in range(50)] diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/__pycache__/MCL.cpython-38.pyc b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/__pycache__/MCL.cpython-38.pyc index 143a98a285fc8e618c677c725b1ffde81f4d5358..a67d2f76d8ea432cd871518cde5ab2c70f8b5dd6 100644 Binary files a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/__pycache__/MCL.cpython-38.pyc and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/__pycache__/MCL.cpython-38.pyc differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/calibration.py b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/calibration.py index bb816ef09810d906c95ea7628edc4b0e91ec79b6..b0e1e48caed045b23b0cc06f003b689a600f1220 100644 --- a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/calibration.py +++ b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/calibration.py @@ -5,6 +5,7 @@ Created on Mon Mar 6 08:43:27 2023 @author: paull """ +import matplotlib.pyplot as plt import os os.environ['CUDA_VISIBLE_DEVICES'] = '0' import cv2 @@ -12,25 +13,42 @@ import numpy as np import tensorflow as tf from yolov3.utils import detect_image, detect_realtime, detect_video, Load_Yolo_model, detect_video_realtime_mp from yolov3.configs import * - -image_path = "./Calibration_cam/" #".jpg" +from MCL import boite2coord +image_path = "./test/webcam chalon/" #".jpg" video_path = "./IMAGES/test.mp4" + yolo = Load_Yolo_model() distances = [0.5, 1, 2] h_pixel = [] -F = 0 +F = 1/0.0051 h_cone = 0.27 +calib=False -for dist in distances: - path = image_path + str(dist) + "m.jpg" - - print(path) - - _, boxes = detect_image(yolo, path, "./Calibration_cam/out.jpg", input_size=YOLO_INPUT_SIZE, show=False, CLASSES=TRAIN_CLASSES, rectangle_colors=(255,0,0)) - - h_pixel.append(abs(boxes[0][1] - boxes[0][3])) - F += abs(boxes[0][1] - boxes[0][3])*dist/h_cone -print(F/len(distances)) \ No newline at end of file +if calib: + for dist in distances: + path = image_path + str(dist) + "m.jpg" + + print(path) + + _, boxes = detect_image(yolo, path, "./Calibration_cam/out.jpg", input_size=YOLO_INPUT_SIZE, show=False, CLASSES=TRAIN_CLASSES, rectangle_colors=(255,0,0)) + + print("Distance : ", dist,", taille : ", abs(boxes[0][1] - boxes[0][3])) +else: + #path = "./test/tel grand angle/test.jpg" + path = image_path + '1.jpg' + _, boxes = detect_image(yolo, path, "./Calibration_cam/out.jpg", input_size=YOLO_INPUT_SIZE, show=True, CLASSES=TRAIN_CLASSES, rectangle_colors=(255,0,0)) + print(boxes) + plot_x = [] + plot_y = [] + for i in boxes: + if i[4] >= 0.7: + x,y = boite2coord(i[0],i[1],i[2],i[3]) + plot_x.append(x) + plot_y.append(y) + print("Position du plot : x={}, y={}".format(x,y)) + plt.plot(plot_x, plot_y,'.') + plt.plot(0,0,'+') + plt.show() \ No newline at end of file diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/detection_custom.py b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/detection_custom.py index 50ab1cce38df07693e6682f1752dab7c6057e8f3..c5717f681e4b698ab2ee8efd0ac96744a53dc736 100644 --- a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/detection_custom.py +++ b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/detection_custom.py @@ -16,12 +16,12 @@ import tensorflow as tf from yolov3.utils import detect_image, detect_realtime, detect_video, Load_Yolo_model, detect_video_realtime_mp from yolov3.configs import * -image_path = "./Calibration_cam/0.5m.jpg" +image_path = "./test/webcam chalon/doehff.jpg" video_path = "./IMAGES/test.mp4" yolo = Load_Yolo_model() -#_, boxes = detect_image(yolo, image_path, "./images test/test2_pred.jpg", input_size=YOLO_INPUT_SIZE, show=True, CLASSES=TRAIN_CLASSES, rectangle_colors=(255,0,0)) +_, boxes = detect_image(yolo, image_path, "./images test/test2_pred.jpg", input_size=YOLO_INPUT_SIZE, show=True, CLASSES=TRAIN_CLASSES, rectangle_colors=(255,0,0)) #detect_video(yolo, video_path, './IMAGES/detected.mp4', input_size=YOLO_INPUT_SIZE, show=False, CLASSES=TRAIN_CLASSES, rectangle_colors=(255,0,0)) -detect_realtime(yolo, '', input_size=YOLO_INPUT_SIZE, show=True, CLASSES=TRAIN_CLASSES, rectangle_colors=(255, 0, 0)) +#detect_realtime(yolo, '', input_size=YOLO_INPUT_SIZE, show=True, CLASSES=TRAIN_CLASSES, rectangle_colors=(255, 0, 0)) #detect_video_realtime_mp(video_path, "Output.mp4", input_size=YOLO_INPUT_SIZE, show=True, CLASSES=TRAIN_CLASSES, rectangle_colors=(255,0,0), realtime=False) diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/images test/test2_pred.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/images test/test2_pred.jpg index 52004145ecfc3fd10f5d3c196c1e0a43215ab5db..fd9f1c5105feb106ec3c0ac097c466c1d222e29a 100644 Binary files a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/images test/test2_pred.jpg and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/images test/test2_pred.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/result.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/result.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1decd32fc417eb98ac3b1635c037f76accbe35e2 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/result.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/0.5m.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/0.5m.jpg new file mode 100644 index 0000000000000000000000000000000000000000..38dae11942e3c3b2111c58b2563fd3af569d4a56 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/0.5m.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/1.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fa338fe4759c399442cf44b07e8726da6b363714 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/1.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/10.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/10.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2cdae9ba333d60f0db419f60d16834114be10612 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/10.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/11.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/11.jpg new file mode 100644 index 0000000000000000000000000000000000000000..041143fe269602e2ca85dc250408f5c8350ce839 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/11.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/12.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/12.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7acd16dd4367433113f1442f6eb650b75c8de43f Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/12.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/13.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/13.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f5935b4d2230fd608c53d55980130000fe5ccead Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/13.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/14.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/14.jpg new file mode 100644 index 0000000000000000000000000000000000000000..eec459df24a96cd67e2ba16d15fe8d86659eeaf7 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/14.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/15.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/15.jpg new file mode 100644 index 0000000000000000000000000000000000000000..49c8240eafd988f92cefc328d59967ea1280c97f Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/15.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/16.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/16.jpg new file mode 100644 index 0000000000000000000000000000000000000000..07459bc6df9e1c4ce8b98e42d5cc3f4ef316d815 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/16.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/17.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/17.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ff3025d12c2e7cf575776e5263d2cf0bee1550e2 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/17.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/18.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/18.jpg new file mode 100644 index 0000000000000000000000000000000000000000..00da716ea64b232029eec42b9cc333fcc19801fc Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/18.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/19.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/19.jpg new file mode 100644 index 0000000000000000000000000000000000000000..88ed71b3722ec9450132184845434172034b7b01 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/19.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/1m.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/1m.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fe199c0ffc0a486ab50a805b26b9edd161c773b4 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/1m.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/2.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..642e8ee805aedf3c8e98f3c71e6767c96860988b Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/2.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/2m.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/2m.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2ed082cc54c440e4922b12b66874fec9d1004087 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/2m.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/3.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fefe0c34e47e08e3868c3956c45d688686381242 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/3.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/4.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/4.jpg new file mode 100644 index 0000000000000000000000000000000000000000..261128cf15c37f27e5fafce12e78e2d57ceea65f Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/4.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/5.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/5.jpg new file mode 100644 index 0000000000000000000000000000000000000000..46bfb5583a171643dd37535c54b2f1fa6a48d6dc Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/5.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/6.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/6.jpg new file mode 100644 index 0000000000000000000000000000000000000000..92ff0c7a66517f9713567b95886cf7c4fa685f10 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/6.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/7.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/7.jpg new file mode 100644 index 0000000000000000000000000000000000000000..583d39b6ace07bf4917181b3759f0977d7109e97 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/7.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/8.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/8.jpg new file mode 100644 index 0000000000000000000000000000000000000000..429727314ce7fd20fbe877878064f536c055fa10 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/8.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/9.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/9.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a8587712657e107e279307251db854778de3e461 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/9.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/test.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/test.jpg new file mode 100644 index 0000000000000000000000000000000000000000..eae33efc1676c5eb6e796ce05f4222c7393fc3a8 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel grand angle/test.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/Calibration_cam/0.5m.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel tom/0.5m.jpg similarity index 100% rename from PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/Calibration_cam/0.5m.jpg rename to PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel tom/0.5m.jpg diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/Calibration_cam/1m.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel tom/1m.jpg similarity index 100% rename from PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/Calibration_cam/1m.jpg rename to PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel tom/1m.jpg diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/Calibration_cam/2m.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel tom/2m.jpg similarity index 100% rename from PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/Calibration_cam/2m.jpg rename to PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/tel tom/2m.jpg diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/0.5m.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/0.5m.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a962f37029d80658c9b02695cddcf9159a4f42cd Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/0.5m.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/1.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..048ab1c7901d3ee9326ea95834ee56d8d76a970d Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/1.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/10.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/10.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4cca747db6798b60b605bbe9c36956eefd41fcab Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/10.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/11.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/11.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6d1835de61bcf5b60e50283059233711754a022e Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/11.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/12.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/12.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b190fbbc74a85d2a7efba521bf38b3d31c67175d Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/12.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/13.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/13.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0f711f304d39e67903c9ad01b2a2a069198b34aa Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/13.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/14.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/14.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3c2b8c4417d2f95468c84eeafbf65fe5140a0c7e Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/14.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/15.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/15.jpg new file mode 100644 index 0000000000000000000000000000000000000000..93025c4ace42a82c389e4351985f82f450a62e00 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/15.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/16.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/16.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b3b21decb5578d598bf950c3d42709103889e794 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/16.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/17.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/17.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f9a9bf33e24e2fd8f0be31606e88264a8a11f4e7 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/17.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/18.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/18.jpg new file mode 100644 index 0000000000000000000000000000000000000000..70a6188ed38a6f2fff939c781a68b567a1cc3d6f Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/18.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/19.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/19.jpg new file mode 100644 index 0000000000000000000000000000000000000000..af22cc713abb889703d3551e78201c0bd62084b9 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/19.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/1m.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/1m.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6ed9c4e276e6015bcce7109e4595e7773999023e Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/1m.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/2.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9fc6e6df27b3ba01d507f1a82de61f613014f0ff Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/2.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/20.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/20.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9b743432ef51e82c038105b9ab4ccd1190362bb3 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/20.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/2m.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/2m.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7f970259842807d9aa4979d3e2be4ca696ae3ac4 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/2m.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/3.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2ff91dbd16ef02404f2e93fd4b9dde14893b13f7 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/3.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/4.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/4.jpg new file mode 100644 index 0000000000000000000000000000000000000000..501e2b90634ddf84b50328b3ad317a215298503d Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/4.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/5.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/5.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e5a107f514e82778be215e40e761c747d0116a01 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/5.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/6.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/6.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a8a0bf96c5b9e44226835c43a23d6b2f7d6394fe Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/6.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/7.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/7.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0bdf82f7a08dad879b980ce2de5003fd8e2ef86a Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/7.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/8.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/8.jpg new file mode 100644 index 0000000000000000000000000000000000000000..93174d3cd3ee4559562df14d6bead66eec79792b Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/8.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/9.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/9.jpg new file mode 100644 index 0000000000000000000000000000000000000000..39f30906161d8988f2caa82fc8869795fc19c613 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test/webcam chalon/9.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test_positionnement.py b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test_positionnement.py new file mode 100644 index 0000000000000000000000000000000000000000..508e337bd32d8ac5a10d08149efad715096c15f6 --- /dev/null +++ b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/test_positionnement.py @@ -0,0 +1,77 @@ +# -*- coding: utf-8 -*- +""" +Created on Tue Mar 14 16:03:28 2023 + +@author: paull +""" + +import matplotlib.pyplot as plt +from MCL import get_position +from yolov3.utils import detect_image, Load_Yolo_model +from yolov3.configs import * +from math import sin, cos + +image_path = './test/webcam chalon/' + + +# pixel_x_ext, pixel_y_ext = [242, 220, 165, 110, 63, 33, 22, 34, 63, 110, 165, 220, 243, 310, 334, 388, 443, 490, 521, 531, 520, 489, 443, 388, 333, 310], [76, 64, 52, 64, 95, 141, 196, 252, 298, 330, 340, 328, 318, 316, 328, 339, 329, 298, 251, 196, 142, 95, 64, 53, 64, 77] +# pixel_x_int, pixel_y_int = [245, 238, 222, 196, 166, 134, 108, 91, 85, 90, 109, 134, 165, 196, 222, 239, 308, 314, 332, 358, 388, 419, 445, 462, 468, 462, 445, 419, 388, 359, 332, 314], [201, 167, 140, 123, 116, 123, 140, 165, 195, 228, 253, 270, 277, 270, 253, 227, 200, 226, 253, 270, 277, 270, 253, 228, 197, 166, 140, 122, 117, 123, 140, 166] +# diametre = 225 +# centre_x, centre_y = 278, 200 +# coord_x_ext, coord_y_ext = [i/diametre for i in pixel_x_ext], [i/diametre for i in pixel_y_ext] +# coord_x_int, coord_y_int = [i/diametre for i in pixel_x_int], [i/diametre for i in pixel_y_int] + +coord_x_int = [] +coord_y_int = [] + +coord_x_ext = [] +coord_y_ext = [] + +r_in = 1-0.14/2 +r_ext = r_in + 0.394 + 0.14 + +for i in range(16): + theta = 2*3.1415*i/16 + coord_x_int.append(-1.2+r_in*cos(theta)) + coord_y_int.append(r_in*sin(theta)) + + coord_x_int.append(1.2+r_in*cos(theta)) + coord_y_int.append(r_in*sin(theta)) + + if 1<i<15: + coord_x_ext.append(-1.2+r_ext*cos(theta)) + coord_y_ext.append(r_ext*sin(theta)) + + if not 7<=i<=9: + coord_x_ext.append(1.2+r_ext*cos(theta)) + coord_y_ext.append(r_ext*sin(theta)) + +yolo = Load_Yolo_model() + +particles = [(1.2,1.19,0) for i in range(50)] + +plt.ion() +fig = plt.figure() +ax = fig.add_subplot(111) +exterieur = ax.plot(coord_x_ext, coord_y_ext,'+') +interieur = ax.plot(coord_x_int, coord_y_int,'+') +line1, = ax.plot(1.2, 1.19, '.') +line2, = ax.plot(0,0,'+') + +if __name__ == '__main__': + for i in range(1,20): + image = image_path + str(i) +'.jpg' + _, boxes = detect_image(yolo, image, "./test/result.jpg", input_size=YOLO_INPUT_SIZE, show=False, CLASSES=TRAIN_CLASSES, rectangle_colors=(255,0,0)) + + pos, particles,cone_x,cone_y = get_position(boxes, (0.05, -15*3.14/180, 1), particles) + + print("Position : ", pos) + + line1.set_xdata(pos[0]) + line1.set_ydata(pos[1]) + line2.set_xdata(cone_x) + line2.set_ydata(cone_y) + plt.arrow(pos[0], pos[1], 0.1*cos(pos[2]), 0.1*sin(pos[2])) + ## Affichage graphique + + plt.pause(0.001) diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/__pycache__/track_2_generator.cpython-38.pyc b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/__pycache__/track_2_generator.cpython-38.pyc index 894fe1bdc11300f1a010521fa34eadf9b6cbd654..6ad871e92aa1ad55e4a0b1b22544fa61978ab86b 100644 Binary files a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/__pycache__/track_2_generator.cpython-38.pyc and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/__pycache__/track_2_generator.cpython-38.pyc differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/__pycache__/utils.cpython-38.pyc b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/__pycache__/utils.cpython-38.pyc index 85d639dd599df3056aa50cd8831f9a516beeb23f..041154099828f9eed31c4a67d0d0b060d8297cce 100644 Binary files a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/__pycache__/utils.cpython-38.pyc and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/__pycache__/utils.cpython-38.pyc differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/utils.py b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/utils.py index 2b3550bf951fbba3b6d706afd88e40cfd4b14f72..0a67221cc8d2531d1d06c830f031c6ef31cca264 100644 --- a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/utils.py +++ b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/utils.py @@ -220,14 +220,14 @@ def draw_bbox(image, bboxes,liste_pos_car=liste_pos((0,0,0),1), CLASSES=YOLO_COC """loading cones""" cone_map = get_cone_map() - plt.plot([x for x,y in cone_map], [y for x,y in cone_map], 'o') + # plt.plot([x for x,y in cone_map], [y for x,y in cone_map], 'o') - plt.plot(x_car, y_car,'+') - for x,y in zip(cone_x, cone_y): - x, y= (x-278/225)/2.4+1, (y-200/225)/2.4+0.5 - plt.plot(x,y,'*') - plt.plot([i for i,j in track_points], [j for i,j in track_points]) - plt.show() + # plt.plot(x_car, y_car,'+') + # for x,y in zip(cone_x, cone_y): + # x, y= (x-278/225)/2.4+1, (y-200/225)/2.4+0.5 + # plt.plot(x,y,'*') + # plt.plot([i for i,j in track_points], [j for i,j in track_points]) + # plt.show() speed, commande, a = pilot.get_command() diff --git a/PAR 152/carte_cones.py b/PAR 152/carte_cones.py index 34a4efc75a7e8cdb232dc44c991494a2f77f9bae..be2c6a4cbe56c23d68d21149a534e75b1d3d97ff 100644 --- a/PAR 152/carte_cones.py +++ b/PAR 152/carte_cones.py @@ -53,30 +53,55 @@ def motion_update(commande, position): return [(new_x, new_y, new_theta), (centre_rotation_x, centre_rotation_y)] -pixel_x_ext, pixel_y_ext = [242, 220, 165, 110, 63, 33, 22, 34, 63, 110, 165, 220, 243, 310, 334, 388, 443, 490, 521, 531, 520, 489, 443, 388, 333, 310], [76, 64, 52, 64, 95, 141, 196, 252, 298, 330, 340, 328, 318, 316, 328, 339, 329, 298, 251, 196, 142, 95, 64, 53, 64, 77] -pixel_x_int, pixel_y_int = [245, 238, 222, 196, 166, 134, 108, 91, 85, 90, 109, 134, 165, 196, 222, 239, 308, 314, 332, 358, 388, 419, 445, 462, 468, 462, 445, 419, 388, 359, 332, 314], [201, 167, 140, 123, 116, 123, 140, 165, 195, 228, 253, 270, 277, 270, 253, 227, 200, 226, 253, 270, 277, 270, 253, 228, 197, 166, 140, 122, 117, 123, 140, 166] -diametre = 225 -centre_x, centre_y = 278, 200 -coord_x_ext, coord_y_ext = [i/diametre for i in pixel_x_ext], [i/diametre for i in pixel_y_ext] -coord_x_int, coord_y_int = [i/diametre for i in pixel_x_int], [i/diametre for i in pixel_y_int] -print(coord_x_int, coord_x_int) - -coord_int = [(i/diametre , j/diametre) for i,j in zip(pixel_x_int, pixel_y_int)] -coord_ext = [(i/diametre , j/diametre) for i,j in zip(pixel_x_ext, pixel_y_ext)] +# pixel_x_ext, pixel_y_ext = [242, 220, 165, 110, 63, 33, 22, 34, 63, 110, 165, 220, 243, 310, 334, 388, 443, 490, 521, 531, 520, 489, 443, 388, 333, 310], [76, 64, 52, 64, 95, 141, 196, 252, 298, 330, 340, 328, 318, 316, 328, 339, 329, 298, 251, 196, 142, 95, 64, 53, 64, 77] +# pixel_x_int, pixel_y_int = [245, 238, 222, 196, 166, 134, 108, 91, 85, 90, 109, 134, 165, 196, 222, 239, 308, 314, 332, 358, 388, 419, 445, 462, 468, 462, 445, 419, 388, 359, 332, 314], [201, 167, 140, 123, 116, 123, 140, 165, 195, 228, 253, 270, 277, 270, 253, 227, 200, 226, 253, 270, 277, 270, 253, 228, 197, 166, 140, 122, 117, 123, 140, 166] +# diametre = 225 +# centre_x, centre_y = 278, 200 +# coord_x_ext, coord_y_ext = [i/diametre for i in pixel_x_ext], [i/diametre for i in pixel_y_ext] +# coord_x_int, coord_y_int = [i/diametre for i in pixel_x_int], [i/diametre for i in pixel_y_int] +# print(coord_x_int, coord_x_int) + +coord_x_int = [] +coord_y_int = [] + +coord_x_ext = [] +coord_y_ext = [] + +r_in = 1-0.14/2 +r_ext = r_in + 0.394 + 0.14 + +for i in range(16): + theta = 2*3.1415*i/16 + coord_x_int.append(-1.2+r_in*cos(theta)) + coord_y_int.append(r_in*sin(theta)) + + coord_x_int.append(1.2+r_in*cos(theta)) + coord_y_int.append(r_in*sin(theta)) + + if 1<i<15: + coord_x_ext.append(-1.2+r_ext*cos(theta)) + coord_y_ext.append(r_ext*sin(theta)) + + if not 7<=i<=9: + coord_x_ext.append(1.2+r_ext*cos(theta)) + coord_y_ext.append(r_ext*sin(theta)) + +#coord_int = [(i/diametre , j/diametre) for i,j in zip(pixel_x_int, pixel_y_int)] +#coord_ext = [(i/diametre , j/diametre) for i,j in zip(pixel_x_ext, pixel_y_ext)] x = 1.4 y = 1.271 -theta = 3.14/5.5 +theta = 0 vision_x = [] vision_y = [] vision_x_ext = [] vision_y_ext = [] -for pt in coord_int: - vision_x.append((pt[0]-x)*cos(theta) + (pt[1]-y)*sin(theta)) - vision_y.append(-(pt[0]-x)*sin(theta) + (pt[1]-y)*cos(theta)) +# for pt in coord_int: +# vision_x.append((pt[0]-x)*cos(theta) + (pt[1]-y)*sin(theta)) +# vision_y.append(-(pt[0]-x)*sin(theta) + (pt[1]-y)*cos(theta)) -for pt in coord_ext: - vision_x_ext.append((pt[0]-x)*cos(theta) + (pt[1]-y)*sin(theta)) - vision_y_ext.append(-(pt[0]-x)*sin(theta) + (pt[1]-y)*cos(theta)) +# for pt in coord_ext: +# vision_x_ext.append((pt[0]-x)*cos(theta) + (pt[1]-y)*sin(theta)) +# vision_y_ext.append(-(pt[0]-x)*sin(theta) + (pt[1]-y)*cos(theta)) plt.figure(1) @@ -84,12 +109,12 @@ plt.plot(coord_x_ext, coord_y_ext,'+') plt.plot(coord_x_int, coord_y_int,'+') #plt.arrow(x,y,0.1*cos(theta),0.1*sin(theta), width=0.01) -tab = motion_update((0.1,-3.14/6), (x,y,theta)) -x2,y2,theta2 = tab[0] -x_r, y_r = tab[1] +#tab = motion_update((0.1,-3.14/6), (x,y,theta)) +#x2,y2,theta2 = tab[0] +#x_r, y_r = tab[1] -plt.arrow(x2,y2,0.1*cos(theta2),0.1*sin(theta2), width=0.01) -plt.plot(x_r,y_r,'o') +#plt.arrow(x2,y2,0.1*cos(theta2),0.1*sin(theta2), width=0.01) +#plt.plot(x_r,y_r,'o') plt.show()