diff --git a/lab2_1/lab2_1.py b/lab2_1/lab2_1.py new file mode 100644 index 0000000..b3e7937 --- /dev/null +++ b/lab2_1/lab2_1.py @@ -0,0 +1,162 @@ +import os +import sys +import cv2 +import numpy as np +from matplotlib import pyplot as plt + + +def menu(): + print("Выберите пункт меню:\n1.Linear filter\n2.Blur\n3.Median blur\n4.GaussianBlur\n5.Erode") + print("6.Dilate\n7.MORPH_OPERATIONS\n8.Sobel\n9.Laplacian\n10.Canny\n11.CalcHist\n12.EqualizeHist") + print("13.Save\n14.Add Figure\n15.Del Figure\n16.Exit") + + +def main(): + image1 = cv2.imread("D:\\MACH\\LAB_2\\image0.jpg") + image2 = image1.copy() + im = image1.copy() + while True: + menu() + try: + s = int(input()) + if s == 1: + image2 = image1.copy() + kernel = np.array([[-0.1, 0.2, -0.1], [0.2, 3.0, 0.2], [-0.1, 0.2, -0.1]]) + image2 = cv2.filter2D(image2, -1, kernel) + cv2.imshow("Image_load", image1) + cv2.imshow("Result_Image", image2) + cv2.waitKey(0) + if s == 2: + image2 = image1.copy() + image2 = cv2.blur(image2, (5, 5)) + cv2.imshow("Image_load", image1) + cv2.imshow("Result_Image", image2) + cv2.waitKey(0) + if s == 3: + image2 = image1.copy() + image2 = cv2.medianBlur(image2, 5) + cv2.imshow("Image_load", image1) + cv2.imshow("Result_Image", image2) + cv2.waitKey(0) + if s == 4: + image2 = image1.copy() + image2 = cv2.GaussianBlur(image2, (9, 9), cv2.BORDER_DEFAULT) + cv2.imshow("Image_load", image1) + cv2.imshow("Result_Image", image2) + cv2.waitKey(0) + if s == 5: + image2 = image1.copy() + image2 = cv2.erode(image2, np.ones((11, 11))) + cv2.imshow("Image_load", image1) + cv2.imshow("Result_Image", image2) + cv2.waitKey(0) + if s == 6: + image2 = image1.copy() + image2 = cv2.dilate(image2, np.ones((11, 11))) + cv2.imshow("Image_load", image1) + cv2.imshow("Result_Image", image2) + cv2.waitKey(0) + if s == 7: + image2 = image1.copy() + image3 = cv2.cvtColor(image2, cv2.COLOR_BGR2GRAY) + cv2.imshow("Image_load", image1) + kernel = np.ones((6, 6), np.uint8) + image3 = cv2.morphologyEx(image3, cv2.MORPH_OPEN, kernel, iterations=1) + cv2.imshow("MORPH_OPEN", image3) + image3 = cv2.cvtColor(image2, cv2.COLOR_BGR2GRAY) + image3 = cv2.morphologyEx(image3, cv2.MORPH_CLOSE, kernel, iterations=1) + cv2.imshow("MORPH_CLOSE", image3) + image3 = cv2.cvtColor(image2, cv2.COLOR_BGR2GRAY) + image3 = cv2.morphologyEx(image3, cv2.MORPH_GRADIENT, kernel, iterations=1) + cv2.imshow("MORPH_GRADIENT", image3) + image3 = cv2.cvtColor(image2, cv2.COLOR_BGR2GRAY) + image3 = cv2.morphologyEx(image3, cv2.MORPH_TOPHAT, kernel, iterations=1) + cv2.imshow("MORPH_TOPHAT", image3) + image3 = cv2.cvtColor(image2, cv2.COLOR_BGR2GRAY) + image3 = cv2.morphologyEx(image3, cv2.MORPH_BLACKHAT, kernel, iterations=1) + cv2.imshow("MORPH_BLACKHAT", image3) + image3 = cv2.cvtColor(image2, cv2.COLOR_BGR2GRAY) + cv2.waitKey(0) + if s == 8: + image2 = image1.copy() + image3 = cv2.cvtColor(image2, cv2.COLOR_BGR2GRAY) + image3 = cv2.GaussianBlur(image3, (3, 3), 0) + im3 = cv2.Sobel(image3, cv2.CV_64F, 1, 0, ksize=5) + im4 = cv2.Sobel(image3, cv2.CV_64F, 0, 1, ksize=5) + im5 = cv2.Sobel(image3, cv2.CV_8UC1, 0, 1, ksize=5) + cv2.imshow("Image_load", image1) + cv2.imshow("Result_Image_X", im3) # x + cv2.imshow("Result_Image_Y", im4) # y + cv2.imshow("Result_Gradient", im5) # gradient + cv2.waitKey(0) + if s == 9: + image2 = image1.copy() + image3 = cv2.cvtColor(image2, cv2.COLOR_RGB2GRAY) + image3 = cv2.GaussianBlur(image3, (3, 3), 0) + im3 = cv2.Laplacian(image3, cv2.CV_64F) + cv2.imshow("Image_load", image1) + cv2.imshow("Result_Image", im3) # x + cv2.waitKey(0) + if s == 10: + image2 = image1.copy() + image3 = cv2.cvtColor(image2, cv2.COLOR_RGB2GRAY) + image3 = cv2.blur(image2, (5, 5)) + image3 = cv2.Canny(image3, 100, 100) + cv2.imshow("Image_load", image1) + cv2.imshow("Result_Image", image3) # x + cv2.waitKey(0) + if s == 11: + image2 = image1.copy() + color = ('b', 'g', 'r') + cv2.imshow("Image_load", image1) + for i, col in enumerate(color): + histr = cv2.calcHist([image2], [i], None, [256], [0, 256]) + plt.plot(histr, color=col) + plt.xlim([0, 256]) + plt.show() + plt.close() + cv2.waitKey(0) + if s == 12: + image2 = image1.copy() + image2 = cv2.cvtColor(image2, cv2.COLOR_RGB2GRAY) + image2 = cv2.equalizeHist(image2) + cv2.imshow("Image_load", image1) + cv2.imshow("Result_Image", image2) + cv2.waitKey(0) + if s == 13: + cv2.imshow("Image_load", image1) + cv2.imshow("Result_Image", image2) + cv2.imwrite("D:\\im1.jpg", image1) + cv2.imwrite("D:\\im2.jpg", image2) + cv2.waitKey(0) + if s == 14: + image2 = image1.copy() + cv2.imshow("Image_load", image1) + image2 = cv2.line(image2, (15, 15), (270, 270), (76, 187, 23), 10) # линия + image2 = cv2.rectangle(image2, (20, 20), (100, 100), (0, 0, 255), 10) # нарисуем четырехугольник + image2 = cv2.circle(image2, (100, 100), 40, (0, 255, 0), 10) # нарисуем круг + cv2.imshow("Result_Image", image2) + image1 = image2 + cv2.waitKey(0) + if s == 15: + cv2.imwrite("1.jpg", im) + cv2.imwrite("2.jpg", image1) + img = cv2.imread("1.jpg") + mask = cv2.imread("2.jpg", 0) + res = cv2.bitwise_and(img, img, mask=mask) + image2 = res.copy() + image1 = res.copy() + cv2.imshow("Result_Image", res) + + cv2.waitKey(0) + os.remove("1.jpg") + os.remove("2.jpg") + if s == 16: + cv2.destroyAllWindows() + sys.exit(0) + except ValueError: + print("Неверный пункт меню!!!! Выберите другое!") + + +if __name__ == "__main__": + main() diff --git a/lab2_2/Operate.txt b/lab2_2/Operate.txt new file mode 100644 index 0000000..7dfcb1c --- /dev/null +++ b/lab2_2/Operate.txt @@ -0,0 +1,21 @@ +1.Image +2.Linear filter +3.Blur +4.Median blur +5.GaussianBlur +6.Erode +7.Dilate +8.1.MORPH_MORPH_OPEN +8.2.MORPH_MORPH_CLOSE +8.3.MORPH_MORPH_GRADIENT +8.4.MORPH_MORPH_TOPHAT +8.5.MORPH_MORPH_BLACKHAT +9.Sobel_X +10.Sobel_Y +11.Sobel_Gradient +12.Laplacian +13.Canny +14.CalcHist +15.EqualizeHist +16.Add Figure +17.Del Figure diff --git a/lab2_2/lab2_2.py b/lab2_2/lab2_2.py new file mode 100644 index 0000000..4326d71 --- /dev/null +++ b/lab2_2/lab2_2.py @@ -0,0 +1,271 @@ +import sys +import cv2 +import numpy +from PyQt5.QtGui import QImage, QPixmap +from PyQt5.QtWidgets import QWidget, QApplication, QLabel, QVBoxLayout, QHBoxLayout, QPushButton, QFileDialog,QComboBox,QMessageBox +from PyQt5.QtCore import Qt +from matplotlib import pyplot as plt +class Example(QWidget): + def __init__(self): + super().__init__() + self.image = None + self.label = QLabel() + self.initUI() + + def initUI(self): + self.label.setText('OpenCV Image') + self.label.setAlignment(Qt.AlignCenter) + + btn_open = QPushButton('Открыть изображение') + btn_open.clicked.connect(self.openImage) + + btn_procesar = QPushButton('Сохранить изображение') + btn_procesar.clicked.connect(self.saveImage) + + + f=open("Operate.txt","r") + attr=f.read().splitlines() + f.close() + self.oper=QComboBox() + self.oper.addItems(attr) + self.oper.currentIndexChanged.connect(self.combobox) + + top_bar = QHBoxLayout() + top_bar.addWidget(btn_open) + top_bar.addWidget(btn_procesar) + top_bar.addWidget(self.oper) + + root = QVBoxLayout(self) + root.addLayout(top_bar) + root.addWidget(self.label) + self.resize(540, 574) + self.setWindowTitle('ST_2_2') + self.show() + + def openImage(self): + self.filename, _ = QFileDialog.getOpenFileName(None, 'Buscar Imagen', '.', 'Image Files (*.png *.jpg *.jpeg *.bmp)') + if self.filename: + with open(self.filename, "rb") as file: + data = numpy.array(bytearray(file.read())) + self.image = cv2.imdecode(data, cv2.IMREAD_UNCHANGED) + self.mostrarImagen(self.image) + self.image2=self.image + + + + + def saveImage(self): + filename = QFileDialog.getSaveFileName(self,"QFileDialog.getSaveFileName()","","Image Files (*.jpg)") + img=self.image2 + cv2.imwrite(filename[0],img) + + + + def mostrarImagen(self,s): + size = s.shape + step = s.size / size[0] + qformat = QImage.Format_Indexed8 + if len(size) == 3: + if size[2] == 4: + qformat = QImage.Format_RGBA8888 + else: + qformat = QImage.Format_RGB888 + img = QImage(s, size[1], size[0], step, qformat) + img = img.rgbSwapped() + self.label.setPixmap(QPixmap.fromImage(img)) + self.resize(self.label.pixmap().size()) + + + def combobox(self, index): + if index==0: + self.i0() + if index==1: + self.i1() + if index==2: + self.i2() + if index==3: + self.i3() + if index==4: + self.i4() + if index==5: + self.i5() + if index==6: + self.i6() + if index==7: + self.i7() + if index==8: + self.i8() + if index==9: + self.i9() + if index==10: + self.i10() + if index==11: + self.i11() + if index==12: + self.i12() + if index==13: + self.i13() + if index==14: + self.i14() + if index==15: + self.i15() + if index==16: + self.i16() + if index==17: + self.i17() + if index==18: + self.i18() + if index==19: + self.i19() + if index==20: + self.i20() + + + def i0(self): + self.image2=self.image + self.mostrarImagen(self.image) + + def i1(self): + self.image2=self.image + kernel = numpy.array([[-0.1,0.2,-0.1],[0.2,3.0,0.2],[-0.1,0.2,-0.1]]) + self.image2=cv2.filter2D(self.image2,-1,kernel) + self.mostrarImagen(self.image2) + + + def i2(self): + self.image2=self.image + self.image2 = cv2.blur(self.image2,(5,5)) + self.mostrarImagen(self.image2) + + + def i3(self): + self.image2=self.image + self.image2 = cv2.medianBlur(self.image2,5) + self.mostrarImagen(self.image2) + + def i4(self): + self.image2=self.image + self.image2 = cv2.GaussianBlur(self.image2, (9,9),cv2.BORDER_DEFAULT) + self.mostrarImagen(self.image2) + + def i5(self): + self.image2=self.image + self.image2 = cv2.erode(self.image2, numpy.ones((11, 11))) + self.mostrarImagen(self.image2) + + def i6(self): + self.image2=self.image + self.image2 = cv2.dilate(self.image2, numpy.ones((11, 11))) + self.mostrarImagen(self.image2) + + def i7(self): + self.image2=self.image + kernel = numpy.ones((6,6),numpy.uint8) + self.image2=cv2.morphologyEx(self.image2, cv2.MORPH_OPEN, kernel,iterations = 1) + self.mostrarImagen(self.image2) + + def i8(self): + self.image2=self.image + kernel = numpy.ones((6,6),numpy.uint8) + self.image2=cv2.morphologyEx(self.image2, cv2.MORPH_CLOSE, kernel,iterations = 1) + self.mostrarImagen(self.image2) + + def i9(self): + self.image2=self.image + kernel = numpy.ones((6,6),numpy.uint8) + self.image2=cv2.morphologyEx(self.image2, cv2.MORPH_GRADIENT, kernel,iterations = 1) + self.mostrarImagen(self.image2) + + def i10(self): + self.image2=self.image + kernel = numpy.ones((6,6),numpy.uint8) + self.image2=cv2.morphologyEx(self.image2, cv2.MORPH_TOPHAT, kernel,iterations = 1) + self.mostrarImagen(self.image2) + + def i11(self): + self.image2=self.image + kernel = numpy.ones((6,6),numpy.uint8) + self.image2=cv2.morphologyEx(self.image2, cv2.MORPH_BLACKHAT, kernel,iterations = 1) + self.mostrarImagen(self.image2) + + + def i12(self): + self.image2=self.image + self.image2 = cv2.cvtColor(self.image2,cv2.COLOR_BGR2GRAY) + self.image2 = cv2.GaussianBlur(self.image2,(3,3),0) + self.image2 = cv2.Sobel(self.image2,cv2.CV_64F,1,0,ksize=5) + self.mostrarImagen(self.image2) + + def i13(self): + self.image2=self.image + self.image2 = cv2.cvtColor(self.image2,cv2.COLOR_BGR2GRAY) + self.image2 = cv2.GaussianBlur(self.image2,(3,3),0) + self.image2 = cv2.Sobel(self.image2,cv2.CV_64F,0,1,ksize=5) + self.mostrarImagen(self.image2) + + def i14(self): + self.image2=self.image + self.image2 = cv2.cvtColor(self.image2,cv2.COLOR_BGR2GRAY) + self.image2 = cv2.GaussianBlur(self.image2,(3,3),0) + self.image2 = cv2.Sobel(self.image2,cv2.CV_8UC1,0,1,ksize=5) + self.mostrarImagen(self.image2) + + def i15(self): + self.image2=self.image + self.image2 = cv2.cvtColor(self.image2,cv2.COLOR_RGB2GRAY) + self.image2 = cv2.GaussianBlur(self.image2,(3,3),0) + self.image2 = cv2.Laplacian(self.image2,cv2.CV_64F) + self.mostrarImagen(self.image2) + + def i16(self): + self.image2=self.image + self.image2 = cv2.cvtColor(self.image2,cv2.COLOR_RGB2GRAY) + self.image2 = cv2.blur(self.image2,(5,5)) + self.image2 = cv2.Canny(self.image2, 100, 100) + self.mostrarImagen(self.image2) + + def i17(self): + self.image2=self.image + color = ('b','g','r') + for i,col in enumerate(color): + histr = cv2.calcHist([self.image2],[i],None,[256],[0,256]) + plt.plot(histr,color = col) + plt.xlim([0,256]) + plt.show() + + + def i18(self): + self.image2=self.image + self.image2 = cv2.cvtColor(self.image2,cv2.COLOR_RGB2GRAY) + self.image2 = cv2.equalizeHist(self.image2) + self.mostrarImagen(self.image2) + + def i19(self): + + self.image2=self.image + self.image2 = cv2.line(self.image2,(15,15),(270,270),(76,187,23),10)#линия + self.image2 = cv2.rectangle(self.image2,(20,20),(100,100),(0,0,255),10)#нарисуем четырехугольник + self.image2 = cv2.circle(self.image2,(100,100),40,(0,255,0),10)#нарисуем круг + self.image=self.image2 + self.mostrarImagen(self.image2) + + def i20(self): + if self.filename: + with open(self.filename, "rb") as file: + data = numpy.array(bytearray(file.read())) + self.image = cv2.imdecode(data, cv2.IMREAD_UNCHANGED) + self.mostrarImagen(self.image) + self.mostrarImagen(self.image) + self.image2=self.image + + def closeEvent(self, event): + close = QMessageBox.question(self,"Выход","Вы хотите завершить работу?",QMessageBox.Yes | QMessageBox.No) + if close == QMessageBox.Yes: + event.accept() + else: + event.ignore() + +if __name__ == '__main__': + app = QApplication(sys.argv) + win = Example() + sys.exit(app.exec_()) \ No newline at end of file diff --git a/lab4/1.yml b/lab4/1.yml new file mode 100644 index 0000000..c864de8 --- /dev/null +++ b/lab4/1.yml @@ -0,0 +1,81 @@ +%YAML:1.0 +--- +opencv_ml_svm: + format: 3 + svmType: C_SVC + kernel: + type: RBF + gamma: 1. + C: 1. + term_criteria: { epsilon:1.1920928955078125e-07, iterations:1000 } + var_count: 1 + class_count: 2 + class_labels: !!opencv-matrix + rows: 2 + cols: 1 + dt: i + data: [ -1, 1 ] + sv_total: 50 + support_vectors: + - [ 0. ] + - [ 0. ] + - [ 1.40129846e-45 ] + - [ 0. ] + - [ 1.40129846e-45 ] + - [ 1.40129846e-45 ] + - [ 0. ] + - [ 0. ] + - [ 2.80259693e-45 ] + - [ 0. ] + - [ 2.80259693e-45 ] + - [ 2.80259693e-45 ] + - [ 2.80259693e-45 ] + - [ 2.80259693e-45 ] + - [ 4.20389539e-45 ] + - [ 2.80259693e-45 ] + - [ 1.40129846e-45 ] + - [ 0. ] + - [ 0. ] + - [ 0. ] + - [ 0. ] + - [ 1.40129846e-45 ] + - [ 0. ] + - [ 2.80259693e-45 ] + - [ 1.40129846e-45 ] + - [ 0. ] + - [ 0. ] + - [ 0. ] + - [ 0. ] + - [ 1.40129846e-45 ] + - [ 2.80259693e-45 ] + - [ 2.80259693e-45 ] + - [ 1.40129846e-45 ] + - [ 1.40129846e-45 ] + - [ 0. ] + - [ 0. ] + - [ 0. ] + - [ 0. ] + - [ 0. ] + - [ 0. ] + - [ 1.40129846e-45 ] + - [ 0. ] + - [ 1.40129846e-45 ] + - [ 0. ] + - [ 2.80259693e-45 ] + - [ 0. ] + - [ 1.40129846e-45 ] + - [ 2.80259693e-45 ] + - [ 1.40129846e-45 ] + - [ 0. ] + decision_functions: + - + sv_count: 50 + rho: 0. + alpha: [ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., + 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., -1., -1., -1., + -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., + -1., -1., -1., -1., -1., -1., -1., -1., -1., -1. ] + index: [ 12, 15, 2, 16, 4, 5, 21, 24, 8, 31, 10, 11, 23, 13, 14, + 29, 30, 32, 33, 40, 42, 44, 46, 47, 48, 19, 26, 27, 28, 1, + 3, 25, 0, 7, 34, 35, 36, 37, 38, 39, 9, 41, 6, 43, 17, 45, + 18, 20, 22, 49 ] diff --git a/lab4/lab4.py b/lab4/lab4.py new file mode 100644 index 0000000..4131c40 --- /dev/null +++ b/lab4/lab4.py @@ -0,0 +1,214 @@ +#import numpy as np +#import cv2 +#img = cv2.imread("D:\MACH\LAB_4\crocodile\image_0001.jpg") +#gray= cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) +#sift = cv2.SIFT_create() +#kp = sift.detect(gray,None) +#img=cv2.drawKeypoints(gray,kp,img) +#cv2.imshow("R",img) +#cv2.waitKey(0) +#cv2.destroyAllWindows() +import sys +import cv2 +import numpy as np +import random +import math +from sklearn.ensemble import RandomForestClassifier +from sklearn.metrics import accuracy_score +from PyQt5.QtGui import QImage, QPixmap +from PyQt5.QtWidgets import (QWidget, QApplication, QLabel, QVBoxLayout, QHBoxLayout, QPushButton, + QFileDialog,QComboBox,QMessageBox,QTextBrowser) +from PyQt5.QtCore import Qt +class Example(QWidget): + def __init__(self): + super().__init__() + self.image = None + self.textbrowser = QTextBrowser() + self.initUI() + + def initUI(self): + + self.btn_open = QPushButton('Изображения folder1') + self.btn_open.clicked.connect(self.openImages1) + + self.btn_open1 = QPushButton('Изображения folder2') + self.btn_open1.clicked.connect(self.openImages2) + + + self.btn_ = QPushButton('Обучить и создать матрицы') + self.btn_.clicked.connect(self.matrix_and_train) + + + self.btn1 = QPushButton('Детектировать тестовые изображения') + self.btn1.clicked.connect(self.detect_image) + + self.btn2 = QPushButton('Сформировать лес и натренировать полученную модель') + self.btn2.clicked.connect(self.form_les_and_train) + + self.btn_.setVisible(False) + self.btn1.setVisible(False) + self.btn2.setVisible(False) + + + top_bar = QHBoxLayout() + top_bar.addWidget(self.btn_open) + top_bar.addWidget(self.btn_open1) + top_bar.addWidget(self.btn_) + top_bar.addWidget(self.btn1) + top_bar.addWidget(self.btn2) + root = QVBoxLayout(self) + root.addLayout(top_bar) + root.addWidget(self.textbrowser) + + self.spisok=list() + self.spisok2=list() + self.spisok3=list() + + + self.train=list() + self.matrix=list() + self.resize(540, 574) + self.setWindowTitle('ST_4') + self.show() + + def openImages1(self): + filenames1 = QFileDialog.getOpenFileNames(None, 'Открыть изображения', '.', 'Image Files (*.png *.jpg *.jpeg *.bmp)') + lk=filenames1[0] + self.erroropened(lk,"1") + self.mass(lk,1) + lk.clear() + + + def openImages2(self): + filenames2 = QFileDialog.getOpenFileNames(None, 'Открыть изображения', '.', 'Image Files (*.png *.jpg *.jpeg *.bmp)') + lk=filenames2[0] + self.erroropened(lk,"2") + self.mass(lk,2) + lk.clear() + + def erroropened(self,s,s1): + if len(s)!=0: + q=QMessageBox.information(self,"Информация","Изображения из "+s1+" папки получены!") + else: + q=QMessageBox.information(self,"Информация","Вы не выбрали изображения!") + + + def mass(self,p,s1): + if s1==1: + self.spisok3.clear() + for v in range(len(p)): + self.spisok.append(str(p[v])) + self.spisok3.append(str(p[v])+"SKT") + self.appendos("Тестовый набор картинок",self.spisok) + if s1==2: + for v in range(len(p)): + self.spisok2.append(str(p[v])) + self.spisok3.append(str(p[v])+"NO") + self.spisok3=list(set(self.spisok3)) + self.appendos("Набор картинок для тренировки",self.spisok2) + self.btn_open.setVisible(False) + self.btn_open1.setVisible(False) + self.btn_.setVisible(True) + q=QMessageBox.information(self,"Информация","Количество изображений тестовой категории: "+str(len(self.spisok))+"\nКоличество изображений основной категории: "+str(len(self.spisok2))+"\nОбщее количество изображений: "+str(int(len(self.spisok)+int(len(self.spisok2))))) + + def matrix_and_train(self): + for v in range(len(self.spisok3)): + s=str(self.spisok3[v]) + if s.endswith("SKT"): + self.train.append(round(float(0.5),1)) + self.matrix.append(round(float(1.0),1)) + if s.endswith("NO"): + q=round(float(random.uniform(1.0,3.0)),1) + self.train.append(q) + self.matrix.append(round(float(-1.0),1)) + + self.appendos("Ваши тренировочные данные",self.train) + self.appendos("Ваша матрица",self.matrix) + train=np.array([self.train],dtype=int) + labels = np.array(self.matrix,dtype=int) + self.svm = cv2.ml.SVM_create() + self.svm.train(train, cv2.ml.COL_SAMPLE, labels) + self.svm.save("1.yml") + self.textbrowser.append("Модель сохранена!") + close = QMessageBox.question(self,"Поздравляем!","Ваша модель натренирована!",QMessageBox.Yes | QMessageBox.No) + if close == QMessageBox.Yes: + pass + self.btn_.setVisible(False) + self.btn1.setVisible(True) + + def appendos(self,s1,s2): + self.textbrowser.append(s1) + for v in range(len(s2)): + self.textbrowser.append(str(s2[v])) + + def detect_image(self): + self.model = RandomForestClassifier(n_estimators=100,bootstrap = True,max_features = 'sqrt') + self.spisok3.clear() + for v in range(len(self.spisok)): + lkst=list() + img = cv2.imread(str(self.spisok[v])) + gray= cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) + sift = cv2.SIFT_create() + kp = sift.detect(gray,None) + for keyPoint in kp: + #self.spisok3.append(keyPoint.pt[0]) + #self.spisok3.append(keyPoint.pt[1]) + #print(keyPoint.pt[0]) + #print(keyPoint.pt[1]) + lkst.append(keyPoint.pt[0]) + lkst.append(keyPoint.pt[1]) + + #self.spisok3.append(lkst) + train=np.array([lkst],dtype=int) + labels = np.array([lkst],dtype=int) + self.model.fit(train, labels) + self.textbrowser.append("Модель натренирована на рисунке "+str(v)) + #print(len(self.spisok3)) + self.textbrowser.append("Выявлены контурные точки на тестовых изображениях!") + + #s = keyPoint.size + #print(x,y,s) + self.btn1.setVisible(False) + self.btn2.setVisible(True) + + def form_les_and_train(self): + + #print(self.spisok3) + for v in range(len(self.spisok2)): + lk=list() + img = cv2.imread(str(self.spisok2[v])) + gray= cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) + sift = cv2.SIFT_create() + kp = sift.detect(gray,None) + for keyPoint in kp: + #self.spisok3.append(keyPoint.pt[0]) + #self.spisok3.append(keyPoint.pt[1]) + #print(keyPoint.pt[0]) + #print(keyPoint.pt[1]) + lkst.append(keyPoint.pt[0]) + lkst.append(keyPoint.pt[1]) + train =np.array([lkst],dtype=int) + self.model.predict(train) + #self.model. + print("RED") + #train = np.array([self.spisok3],dtype=int) + #labels = np.array([self.spisok3],dtype=int) + #model = RandomForestClassifier(n_estimators=100,bootstrap = True,max_features = 'sqrt') + #model.fit(train, labels) + #tree = DecisionTreeClassifier() + #tree.fit(self.spisok3, self.spisok3) + #accuracy = accuracy_score(len(self.spisok3), len(self.spisok3)) + #print('Model Accuracy:',accuracy) + + + def closeEvent(self, event): + close = QMessageBox.question(self,"Выход","Вы хотите завершить работу?",QMessageBox.Yes | QMessageBox.No) + if close == QMessageBox.Yes: + event.accept() + else: + event.ignore() + +if __name__ == '__main__': + app = QApplication(sys.argv) + win = Example() + sys.exit(app.exec_()) \ No newline at end of file diff --git a/lab4/sift_keypoints.jpg b/lab4/sift_keypoints.jpg new file mode 100644 index 0000000..d852d0e Binary files /dev/null and b/lab4/sift_keypoints.jpg differ diff --git a/lab6_1/lab6_1.py b/lab6_1/lab6_1.py new file mode 100644 index 0000000..59e38c0 --- /dev/null +++ b/lab6_1/lab6_1.py @@ -0,0 +1,87 @@ +import os +import sys +import cv2 +import numpy as np +from matplotlib import pyplot as plt +def main(): + lstone=list() + lsttwo=list() + image1 = cv2.imread("D:\\MACH\\MACH\\LAB_2\\image0.jpg") + image2=image1 + image3=image1 + image4=image1 + image5=image1 + image6=image1 + image7=image1 + image2=erode_cv(image2,11) + image3=dilate_cv(image3,11) + image4=median_cv(image4,5) + image5=erode_ipp(image5,14) + image6=dilate_ipp(image6,14) + image7=median_ipp(image7,7) + + cv2.imshow("Image_load",image1) + cv2.imshow("erode_cv",image2) + cv2.imshow("dilate_cv",image3) + cv2.imshow("median_cv",image4) + cv2.imshow("erode_ipp",image5) + cv2.imshow("dilate_ipp",image6) + cv2.imshow("median_ipp",image7) + cv2.waitKey(0) + + lstone=sravit_metod(image2) + lsttwo=sravit_metod(image5) + lsttree=lsttwo[len(lstone):] + print("Erode") + print("Количество отличий : "+str(len(lsttwo)-len(lstone))+" \nРазница") + print(lsttree) + + lstone=sravit_metod(image3) + lsttwo=sravit_metod(image5) + lsttree=lstone[len(lsttwo):] + print("Dilate") + print("Количество отличий : "+str(len(lstone)-len(lsttwo))+" \nРазница") + print(lsttree) + + lstone=sravit_metod(image4) + lsttwo=sravit_metod(image7) + lsttree=lstone[len(lsttwo):] + print("Median") + print("Количество отличий : "+str(len(lstone)-len(lsttwo))+" \nРазница") + print(lsttree) + +def erode_cv(s1,s2): + s1 = cv2.erode(s1, np.ones((s2, s2))) + return s1 +def dilate_cv(s1,s2): + s1 = cv2.dilate(s1, np.ones((s2, s2))) + return s1 +def median_cv(s1,s2): + s1 = cv2.medianBlur(s1,s2) + return s1 +def erode_ipp(s1,s2): + s1 = cv2.erode(s1, np.ones((s2, s2))) + return s1 +def dilate_ipp(s1,s2): + s1 = cv2.dilate(s1, np.ones((s2, s2))) + return s1 +def median_ipp(s1,s2): + s1 = cv2.medianBlur(s1,s2) + return s1 + +def sravit_metod(s1): + cv2.imwrite("im1.jpg",s1) + s1 = cv2.imread("im1.jpg", 0) + th, threshed = cv2.threshold(s1, 100, 255,cv2.THRESH_BINARY_INV|cv2.THRESH_OTSU) + cnts = cv2.findContours(threshed, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)[-2] + t1= 3 + t2 = 20 + xcnts = [] + for cnt in cnts: + if t1 + + + + + 20 20 + + <_> + + + <_> + + <_> + + + + <_> + 6 12 8 8 -1. + <_> + 6 16 8 4 2. + 0 + 0.0452074706554413 + -0.7191650867462158 + 0.7359663248062134 + <_> + + <_> + + + + <_> + 1 12 18 1 -1. + <_> + 7 12 6 1 3. + 0 + -0.0161712504923344 + 0.5866637229919434 + -0.5909150242805481 + <_> + + <_> + + + + <_> + 7 18 5 2 -1. + <_> + 7 19 5 1 2. + 0 + 0.0119725503027439 + -0.3645753860473633 + 0.8175076246261597 + <_> + + <_> + + + + <_> + 5 12 11 4 -1. + <_> + 5 14 11 2 2. + 0 + 0.0554178208112717 + -0.5766019225120544 + 0.8059020042419434 + -1.0691740512847900 + -1 + -1 + <_> + + + <_> + + <_> + + + + <_> + 1 12 18 2 -1. + <_> + 7 12 6 2 3. + 0 + -0.0243058893829584 + 0.5642552971839905 + -0.7375097870826721 + <_> + + <_> + + + + <_> + 3 1 14 6 -1. + <_> + 3 3 14 2 3. + 0 + -0.0302439108490944 + 0.5537161827087402 + -0.5089462995529175 + <_> + + <_> + + + + <_> + 4 8 12 9 -1. + <_> + 4 11 12 3 3. + 0 + -0.1937028020620346 + 0.7614368200302124 + -0.3485977053642273 + <_> + + <_> + + + + <_> + 8 18 12 2 -1. + <_> + 14 18 6 1 2. + <_> + 8 19 6 1 2. + 0 + 0.0120156398043036 + -0.4035871028900146 + 0.6296288967132568 + <_> + + <_> + + + + <_> + 0 12 6 6 -1. + <_> + 2 12 2 6 3. + 0 + 2.9895049519836903e-03 + -0.4086846113204956 + 0.4285241067409515 + <_> + + <_> + + + + <_> + 6 11 9 8 -1. + <_> + 6 15 9 4 2. + 0 + 0.1299877017736435 + -0.2570166885852814 + 0.5929297208786011 + <_> + + <_> + + + + <_> + 1 6 10 2 -1. + <_> + 1 6 5 1 2. + <_> + 6 7 5 1 2. + 0 + -6.0164160095155239e-03 + 0.5601549744606018 + -0.2849527895450592 + -1.0788700580596924 + 0 + -1 + <_> + + + <_> + + <_> + + + + <_> + 3 2 14 12 -1. + <_> + 3 6 14 4 3. + 0 + 0.0943963602185249 + -0.5406976938247681 + 0.5407304763793945 + <_> + + <_> + + + + <_> + 1 11 18 9 -1. + <_> + 7 11 6 9 3. + 0 + -0.0279577299952507 + 0.3281945884227753 + -0.7144141197204590 + <_> + + <_> + + + + <_> + 5 12 10 4 -1. + <_> + 5 14 10 2 2. + 0 + 0.0635356530547142 + -0.3744345009326935 + 0.5956786870956421 + <_> + + <_> + + + + <_> + 6 18 9 2 -1. + <_> + 6 19 9 1 2. + 0 + 0.0211040005087852 + -0.4845815896987915 + 0.7378302812576294 + <_> + + <_> + + + + <_> + 9 12 2 8 -1. + <_> + 9 16 2 4 2. + 0 + 2.6957250665873289e-03 + -0.8702409863471985 + 0.2475769072771072 + <_> + + <_> + + + + <_> + 15 3 3 16 -1. + <_> + 15 11 3 8 2. + 0 + 0.0110464803874493 + -0.5981134176254272 + 0.1849218010902405 + <_> + + <_> + + + + <_> + 7 9 1 6 -1. + <_> + 7 11 1 2 3. + 0 + -1.3549139839597046e-04 + 0.3266639113426208 + -0.8332661986351013 + <_> + + <_> + + + + <_> + 6 0 8 6 -1. + <_> + 6 3 8 3 2. + 0 + -0.0495516993105412 + 0.7439032196998596 + -0.4024896025657654 + <_> + + <_> + + + + <_> + 1 13 6 1 -1. + <_> + 4 13 3 1 2. + 0 + -1.9892829004675150e-03 + 0.5047793984413147 + -0.5123764276504517 + <_> + + <_> + + + + <_> + 10 10 6 1 -1. + <_> + 12 10 2 1 3. + 0 + -5.7016697246581316e-04 + 0.2391823977231979 + -0.2104973942041397 + <_> + + <_> + + + + <_> + 4 10 6 1 -1. + <_> + 6 10 2 1 3. + 0 + 5.4985969327390194e-03 + -0.3141318857669830 + 0.7439212799072266 + <_> + + <_> + + + + <_> + 6 6 8 3 -1. + <_> + 6 7 8 1 3. + 0 + -7.7209789305925369e-03 + 0.6021335721015930 + -0.3841854035854340 + -1.5200910568237305 + 1 + -1 + <_> + + + <_> + + <_> + + + + <_> + 1 12 14 1 -1. + <_> + 8 12 7 1 2. + 0 + -1.1992900399491191e-03 + 0.2906270921230316 + -0.7548354268074036 + <_> + + <_> + + + + <_> + 5 2 15 12 -1. + <_> + 5 6 15 4 3. + 0 + 0.0943495184183121 + -0.4595882892608643 + 0.3241611123085022 + <_> + + <_> + + + + <_> + 7 18 6 2 -1. + <_> + 7 19 6 1 2. + 0 + 0.0227251593023539 + -0.2826507091522217 + 0.7242512702941895 + <_> + + <_> + + + + <_> + 5 12 10 4 -1. + <_> + 5 14 10 2 2. + 0 + 0.0585403405129910 + -0.5193219780921936 + 0.6013407111167908 + <_> + + <_> + + + + <_> + 2 19 4 1 -1. + <_> + 4 19 2 1 2. + 0 + 2.8358890631352551e-05 + -0.6561384201049805 + 0.3897354006767273 + <_> + + <_> + + + + <_> + 10 12 10 8 -1. + <_> + 10 16 10 4 2. + 0 + 3.9341559750027955e-04 + -0.8008638024330139 + 0.2018187046051025 + <_> + + <_> + + + + <_> + 1 13 6 6 -1. + <_> + 4 13 3 6 2. + 0 + -5.8259762590751052e-04 + 0.2970958054065704 + -0.8628513216972351 + <_> + + <_> + + + + <_> + 9 18 6 2 -1. + <_> + 12 18 3 1 2. + <_> + 9 19 3 1 2. + 0 + 2.7955149562330917e-05 + -0.4508801102638245 + 0.1758446991443634 + <_> + + <_> + + + + <_> + 1 10 9 10 -1. + <_> + 1 15 9 5 2. + 0 + 1.2162160128355026e-03 + -0.8695623278617859 + 0.2619656026363373 + <_> + + <_> + + + + <_> + 1 2 18 5 -1. + <_> + 7 2 6 5 3. + 0 + 0.0133769698441029 + -0.6464508175849915 + 0.3887208998203278 + <_> + + <_> + + + + <_> + 1 12 18 4 -1. + <_> + 7 12 6 4 3. + 0 + -0.0113867800682783 + 0.2826564013957977 + -0.8351002931594849 + <_> + + <_> + + + + <_> + 9 11 6 3 -1. + <_> + 9 11 3 3 2. + 0 + 2.6949660386890173e-03 + -0.5282859802246094 + 0.6657627820968628 + <_> + + <_> + + + + <_> + 5 10 3 2 -1. + <_> + 6 10 1 2 3. + 0 + 2.8329479391686618e-05 + -0.6864507794380188 + 0.5240061283111572 + <_> + + <_> + + + + <_> + 8 12 9 8 -1. + <_> + 8 16 9 4 2. + 0 + 1.4069270109757781e-03 + -0.8969905972480774 + 0.2389785945415497 + <_> + + <_> + + + + <_> + 6 1 3 2 -1. + <_> + 6 2 3 1 2. + 0 + -2.9115570214344189e-05 + 0.4608972072601318 + -0.8574141860008240 + <_> + + <_> + + + + <_> + 2 12 18 6 -1. + <_> + 2 14 18 2 3. + 0 + 4.5082978904247284e-03 + -0.7511271238327026 + 0.4849173128604889 + <_> + + <_> + + + + <_> + 0 11 18 1 -1. + <_> + 6 11 6 1 3. + 0 + -0.0198406204581261 + 0.6246759295463562 + -0.7629678845405579 + <_> + + <_> + + + + <_> + 9 5 6 3 -1. + <_> + 9 6 6 1 3. + 0 + 3.8021910004317760e-03 + -0.4809493124485016 + 0.6243296861648560 + <_> + + <_> + + + + <_> + 3 11 4 6 -1. + <_> + 3 14 4 3 2. + 0 + 1.1158349661855027e-04 + -0.8559886217117310 + 0.3861764967441559 + <_> + + <_> + + + + <_> + 12 18 2 2 -1. + <_> + 13 18 1 1 2. + <_> + 12 19 1 1 2. + 0 + 2.7662550564855337e-05 + -0.7629433274269104 + 0.3604950010776520 + <_> + + <_> + + + + <_> + 3 12 9 8 -1. + <_> + 3 16 9 4 2. + 0 + 2.7047859039157629e-03 + -0.9496951103210449 + 0.3921845853328705 + <_> + + <_> + + + + <_> + 6 12 9 2 -1. + <_> + 9 12 3 2 3. + 0 + 5.1935878582298756e-04 + -0.8682754039764404 + 0.4790566861629486 + <_> + + <_> + + + + <_> + 2 12 12 8 -1. + <_> + 2 12 6 4 2. + <_> + 8 16 6 4 2. + 0 + 1.0928940173471346e-04 + -0.9670708775520325 + 0.6848754286766052 + <_> + + <_> + + + + <_> + 1 6 19 3 -1. + <_> + 1 7 19 1 3. + 0 + 5.7576759718358517e-03 + -0.9778658747673035 + 0.8792119026184082 + <_> + + <_> + + + + <_> + 0 0 8 2 -1. + <_> + 0 0 4 1 2. + <_> + 4 1 4 1 2. + 0 + -4.2572239181026816e-05 + 1. + -1. + <_> + + <_> + + + + <_> + 12 0 8 2 -1. + <_> + 16 0 4 1 2. + <_> + 12 1 4 1 2. + 0 + 3.4698568924795836e-05 + -0.8942371010780334 + 0.6385173201560974 + <_> + + <_> + + + + <_> + 1 0 13 15 -1. + <_> + 1 5 13 5 3. + 0 + 6.0833231545984745e-03 + -0.9911761283874512 + 0.8617964982986450 + <_> + + <_> + + + + <_> + 17 18 1 2 -1. + <_> + 17 19 1 1 2. + 0 + 1.5569420065730810e-04 + -1. + 0.9989972114562988 + <_> + + <_> + + + + <_> + 0 0 4 3 -1. + <_> + 2 0 2 3 2. + 0 + 0. + 0. + -1. + <_> + + <_> + + + + <_> + 9 19 4 1 -1. + <_> + 9 19 2 1 2. + 0 + 5.8437039115233347e-05 + -0.9401987791061401 + 0.9499294161796570 + <_> + + <_> + + + + <_> + 3 13 14 4 -1. + <_> + 3 15 14 2 2. + 0 + 8.5243082139641047e-04 + -1. + 1.0000870227813721 + <_> + + <_> + + + + <_> + 17 0 3 4 -1. + <_> + 17 2 3 2 2. + 0 + 0. + 0. + -1. + <_> + + <_> + + + + <_> + 7 1 2 3 -1. + <_> + 7 2 2 1 3. + 0 + 8.8114888058044016e-05 + -1. + 1.0001029968261719 + <_> + + <_> + + + + <_> + 17 0 3 4 -1. + <_> + 17 2 3 2 2. + 0 + 0. + 0. + -1. + <_> + + <_> + + + + <_> + 1 12 18 2 -1. + <_> + 7 12 6 2 3. + 0 + -1.6535379691049457e-03 + 0.9649471044540405 + -0.9946994185447693 + <_> + + <_> + + + + <_> + 16 3 2 4 -1. + <_> + 17 3 1 2 2. + <_> + 16 5 1 2 2. + 0 + 2.2355250257533044e-04 + -0.8841317892074585 + 0.5885220170021057 + <_> + + <_> + + + + <_> + 3 13 10 2 -1. + <_> + 3 13 5 1 2. + <_> + 8 14 5 1 2. + 0 + -2.0420220680534840e-03 + 0.8850557208061218 + -0.9887136220932007 + <_> + + <_> + + + + <_> + 11 13 6 2 -1. + <_> + 11 13 3 2 2. + 0 + -2.7822980191558599e-03 + 0.8021606206893921 + -0.8011325001716614 + <_> + + <_> + + + + <_> + 6 4 6 12 -1. + <_> + 9 4 3 12 2. + 0 + 2.6262819301337004e-03 + -0.8629643917083740 + 0.9028394818305969 + <_> + + <_> + + + + <_> + 14 5 2 14 -1. + <_> + 15 5 1 7 2. + <_> + 14 12 1 7 2. + 0 + -5.8437039115233347e-05 + 0.5506380796432495 + -0.8834760189056396 + <_> + + <_> + + + + <_> + 3 2 12 10 -1. + <_> + 9 2 6 10 2. + 0 + -1.1351429857313633e-03 + 0.9118285179138184 + -0.8601468205451965 + <_> + + <_> + + + + <_> + 16 11 4 4 -1. + <_> + 16 13 4 2 2. + 0 + 6.5544509561732411e-04 + -0.5529929995536804 + 0.6181765794754028 + <_> + + <_> + + + + <_> + 5 19 10 1 -1. + <_> + 10 19 5 1 2. + 0 + 3.8200760172912851e-05 + -0.8676869273185730 + 0.7274010777473450 + <_> + + <_> + + + + <_> + 15 2 1 18 -1. + <_> + 15 11 1 9 2. + 0 + -6.2933329900261015e-05 + 0.3377492129802704 + -0.8335667848587036 + <_> + + <_> + + + + <_> + 1 4 5 16 -1. + <_> + 1 12 5 8 2. + 0 + 2.8638119692914188e-04 + -0.8729416131973267 + 0.7917960286140442 + <_> + + <_> + + + + <_> + 7 6 12 6 -1. + <_> + 7 8 12 2 3. + 0 + 3.6316178739070892e-04 + -0.9013931751251221 + 0.7772005200386047 + <_> + + <_> + + + + <_> + 2 11 12 6 -1. + <_> + 2 11 6 3 2. + <_> + 8 14 6 3 2. + 0 + 1.2007999466732144e-03 + -0.9860498905181885 + 0.8049355149269104 + <_> + + <_> + + + + <_> + 6 0 14 18 -1. + <_> + 6 6 14 6 3. + 0 + -2.3152970243245363e-03 + 1. + -1. + <_> + + <_> + + + + <_> + 0 0 19 18 -1. + <_> + 0 6 19 6 3. + 0 + 0.0144739197567105 + -0.9682086706161499 + 0.9563586115837097 + <_> + + <_> + + + + <_> + 10 17 1 3 -1. + <_> + 10 18 1 1 3. + 0 + -3.2585670705884695e-03 + 1. + -0.9941142201423645 + <_> + + <_> + + + + <_> + 2 10 5 10 -1. + <_> + 2 15 5 5 2. + 0 + 0.0134088601917028 + -0.9944000840187073 + 0.8795533776283264 + <_> + + <_> + + + + <_> + 17 0 3 1 -1. + <_> + 18 0 1 1 3. + 0 + 4.0174949390348047e-05 + -0.9955059885978699 + 0.4559975862503052 + <_> + + <_> + + + + <_> + 0 16 5 3 -1. + <_> + 0 17 5 1 3. + 0 + 1.8752219330053777e-04 + -1. + 1.0003039836883545 + <_> + + <_> + + + + <_> + 19 0 1 2 -1. + <_> + 19 1 1 1 2. + 0 + 0. + 0. + -1. + <_> + + <_> + + + + <_> + 0 12 14 1 -1. + <_> + 7 12 7 1 2. + 0 + -5.7442798279225826e-03 + 1. + -1. + <_> + + <_> + + + + <_> + 13 12 6 6 -1. + <_> + 13 14 6 2 3. + 0 + 2.8128331177867949e-04 + -0.9679043292999268 + 0.5377150774002075 + <_> + + <_> + + + + <_> + 0 11 4 4 -1. + <_> + 0 13 4 2 2. + 0 + 2.9258249560371041e-04 + -0.9925985932350159 + 0.7377948760986328 + <_> + + <_> + + + + <_> + 10 17 3 3 -1. + <_> + 10 18 3 1 3. + 0 + -7.6873782090842724e-03 + 0.4390138089656830 + -0.9956768155097961 + <_> + + <_> + + + + <_> + 2 10 15 5 -1. + <_> + 7 10 5 5 3. + 0 + -1.6997690545395017e-04 + 0.8890876173973083 + -0.9900755286216736 + <_> + + <_> + + + + <_> + 14 9 1 4 -1. + <_> + 14 11 1 2 2. + 0 + -2.8665470381383784e-05 + 0.4759410917758942 + -0.9352231025695801 + <_> + + <_> + + + + <_> + 5 9 6 4 -1. + <_> + 5 9 3 2 2. + <_> + 8 11 3 2 2. + 0 + 4.4182338751852512e-04 + -0.7511792182922363 + 0.8805574178695679 + -4.9593520164489746 + 2 + -1 + <_> + + + <_> + + <_> + + + + <_> + 0 3 14 14 -1. + <_> + 0 3 7 7 2. + <_> + 7 10 7 7 2. + 0 + -0.0127300098538399 + 0.4832380115985870 + -0.7198603749275208 + <_> + + <_> + + + + <_> + 0 2 20 8 -1. + <_> + 0 6 20 4 2. + 0 + 0.0589522011578083 + -0.4658026993274689 + 0.4875808060169220 + <_> + + <_> + + + + <_> + 0 12 8 8 -1. + <_> + 0 16 8 4 2. + 0 + 7.8740529716014862e-04 + -0.7789018750190735 + 0.2557401061058044 + <_> + + <_> + + + + <_> + 7 12 6 6 -1. + <_> + 7 14 6 2 3. + 0 + 0.0105524603277445 + -0.6375812888145447 + 0.3461680114269257 + <_> + + <_> + + + + <_> + 1 18 8 2 -1. + <_> + 1 18 4 1 2. + <_> + 5 19 4 1 2. + 0 + 8.0834580585360527e-03 + -0.6557192206382751 + 0.6636518239974976 + <_> + + <_> + + + + <_> + 8 10 4 8 -1. + <_> + 8 14 4 4 2. + 0 + 0.0235214307904243 + -0.9006652832031250 + 0.4957715868949890 + <_> + + <_> + + + + <_> + 0 12 6 5 -1. + <_> + 2 12 2 5 3. + 0 + 2.1901269792579114e-04 + -0.9414082765579224 + 0.4645870029926300 + <_> + + <_> + + + + <_> + 10 8 9 12 -1. + <_> + 10 12 9 4 3. + 0 + -1.5295119374059141e-04 + 0.1733245998620987 + -0.9518421888351440 + <_> + + <_> + + + + <_> + 5 5 10 15 -1. + <_> + 5 10 10 5 3. + 0 + -4.9944370985031128e-03 + 0.2332555055618286 + -0.9303036928176880 + <_> + + <_> + + + + <_> + 1 2 18 14 -1. + <_> + 10 2 9 7 2. + <_> + 1 9 9 7 2. + 0 + -2.8488549869507551e-03 + 0.5224574208259583 + -0.6394140124320984 + <_> + + <_> + + + + <_> + 2 3 3 16 -1. + <_> + 2 11 3 8 2. + 0 + 8.3920639008283615e-03 + -0.6068183183670044 + 0.4723689854145050 + <_> + + <_> + + + + <_> + 6 17 13 3 -1. + <_> + 6 18 13 1 3. + 0 + -3.5511489841155708e-05 + 0.2968985140323639 + -0.6452224850654602 + <_> + + <_> + + + + <_> + 5 11 9 3 -1. + <_> + 8 11 3 3 3. + 0 + 2.1621841005980968e-03 + -0.4258666932582855 + 0.5548338890075684 + <_> + + <_> + + + + <_> + 1 12 18 4 -1. + <_> + 7 12 6 4 3. + 0 + -5.1551498472690582e-03 + 0.3051683902740479 + -0.8206862807273865 + <_> + + <_> + + + + <_> + 3 9 4 2 -1. + <_> + 3 9 2 1 2. + <_> + 5 10 2 1 2. + 0 + 1.7603079322725534e-04 + -0.4252283871173859 + 0.4734784960746765 + <_> + + <_> + + + + <_> + 7 3 8 3 -1. + <_> + 7 4 8 1 3. + 0 + -5.6310528889298439e-03 + 0.4430184960365295 + -0.5268139839172363 + <_> + + <_> + + + + <_> + 0 17 2 3 -1. + <_> + 0 18 2 1 3. + 0 + 1.0609399760141969e-04 + -0.4128456115722656 + 0.4862971007823944 + <_> + + <_> + + + + <_> + 5 8 10 4 -1. + <_> + 5 10 10 2 2. + 0 + -0.0146872196346521 + 0.3483710885047913 + -0.6565722227096558 + <_> + + <_> + + + + <_> + 1 12 15 6 -1. + <_> + 1 14 15 2 3. + 0 + 0.0810066536068916 + -0.3347136080265045 + 0.6498758792877197 + <_> + + <_> + + + + <_> + 6 19 14 1 -1. + <_> + 6 19 7 1 2. + 0 + 7.1147878770716488e-05 + -0.5422406792640686 + 0.2807042896747589 + <_> + + <_> + + + + <_> + 0 19 16 1 -1. + <_> + 8 19 8 1 2. + 0 + 2.6208710551145487e-05 + -0.7503160834312439 + 0.4175724089145660 + <_> + + <_> + + + + <_> + 14 11 1 2 -1. + <_> + 14 12 1 1 2. + 0 + -2.2025800717528909e-05 + 0.3986887931823730 + -0.8484249711036682 + <_> + + <_> + + + + <_> + 3 11 3 2 -1. + <_> + 3 12 3 1 2. + 0 + -2.7908370611839928e-05 + 0.4262354969978333 + -0.6090481281280518 + <_> + + <_> + + + + <_> + 5 12 12 1 -1. + <_> + 5 12 6 1 2. + 0 + -3.7988298572599888e-04 + 0.2306731045246124 + -0.3030667901039124 + <_> + + <_> + + + + <_> + 3 12 12 1 -1. + <_> + 9 12 6 1 2. + 0 + -2.8329479391686618e-05 + 0.4294688999652863 + -0.6150280237197876 + -2.0059499740600586 + 3 + -1 + <_> + + + <_> + + <_> + + + + <_> + 7 18 3 2 -1. + <_> + 8 18 1 2 3. + 0 + -8.7926961714401841e-04 + -0.8508998155593872 + 0.2012203931808472 + <_> + + <_> + + + + <_> + 10 18 3 2 -1. + <_> + 11 18 1 2 3. + 0 + -1.0719529818743467e-03 + -0.8750498294830322 + 0.1188623011112213 + <_> + + <_> + + + + <_> + 7 18 3 2 -1. + <_> + 8 18 1 2 3. + 0 + 1.1958930408582091e-03 + 0.1821606010198593 + -0.8673701882362366 + <_> + + <_> + + + + <_> + 4 1 13 6 -1. + <_> + 4 3 13 2 3. + 0 + -0.0367217697203159 + 0.3615708947181702 + -0.3918508887290955 + <_> + + <_> + + + + <_> + 8 15 2 1 -1. + <_> + 9 15 1 1 2. + 0 + 2.8816348640248179e-04 + 0.1872649937868118 + -0.7076212763786316 + <_> + + <_> + + + + <_> + 10 15 3 1 -1. + <_> + 11 15 1 1 3. + 0 + 6.8340590223670006e-04 + 0.1269242018461227 + -0.7228708863258362 + <_> + + <_> + + + + <_> + 1 12 18 1 -1. + <_> + 7 12 6 1 3. + 0 + -0.0425732918083668 + 0.5858349800109863 + -0.2147608995437622 + -0.9255558848381042 + 4 + -1 + <_> + + + <_> + + <_> + + + + <_> + 6 18 7 2 -1. + <_> + 6 19 7 1 2. + 0 + 0.0233492702245712 + -0.2366411983966827 + 0.5849282145500183 + <_> + + <_> + + + + <_> + 12 16 2 1 -1. + <_> + 12 16 1 1 2. + 0 + 4.9444608157500625e-04 + 0.1428918987512589 + -0.6820772290229797 + <_> + + <_> + + + + <_> + 3 8 4 6 -1. + <_> + 3 8 2 3 2. + <_> + 5 11 2 3 2. + 0 + -0.0177930891513824 + 0.5955523848533630 + -0.2330096960067749 + <_> + + <_> + + + + <_> + 2 3 18 4 -1. + <_> + 2 5 18 2 2. + 0 + 0.0353034809231758 + -0.3556973040103912 + 0.3598164916038513 + <_> + + <_> + + + + <_> + 6 16 2 2 -1. + <_> + 7 16 1 2 2. + 0 + 7.1409897645935416e-04 + 0.1659422963857651 + -0.7856965065002441 + <_> + + <_> + + + + <_> + 9 19 2 1 -1. + <_> + 9 19 1 1 2. + 0 + -3.5466518602333963e-04 + -0.7188175916671753 + 0.1491793990135193 + <_> + + <_> + + + + <_> + 9 19 2 1 -1. + <_> + 10 19 1 1 2. + 0 + -3.2956211362034082e-04 + -0.7239602804183960 + 0.1283237040042877 + <_> + + <_> + + + + <_> + 1 12 18 3 -1. + <_> + 7 12 6 3 3. + 0 + -0.0558854192495346 + 0.2699365019798279 + -0.3814569115638733 + <_> + + <_> + + + + <_> + 5 8 10 9 -1. + <_> + 5 11 10 3 3. + 0 + -0.2315281033515930 + 0.5102406740188599 + -0.2150623947381973 + <_> + + <_> + + + + <_> + 7 0 6 18 -1. + <_> + 9 0 2 18 3. + 0 + 3.8320471066981554e-03 + -0.3187570869922638 + 0.3741405010223389 + <_> + + <_> + + + + <_> + 2 5 8 4 -1. + <_> + 2 5 4 2 2. + <_> + 6 7 4 2 2. + 0 + -7.1148001588881016e-03 + 0.3868972063064575 + -0.3064059019088745 + <_> + + <_> + + + + <_> + 13 11 2 3 -1. + <_> + 13 11 1 3 2. + 0 + 1.0463730432093143e-03 + -0.0578359216451645 + 0.2854403853416443 + <_> + + <_> + + + + <_> + 5 11 2 3 -1. + <_> + 6 11 1 3 2. + 0 + 1.2736029748339206e-04 + -0.3159281015396118 + 0.4068993926048279 + -1.1411540508270264 + 5 + -1 + <_> + + + <_> + + <_> + + + + <_> + 1 19 18 1 -1. + <_> + 7 19 6 1 3. + 0 + 0.0220439601689577 + -0.2536872923374176 + 0.5212177038192749 + <_> + + <_> + + + + <_> + 12 14 3 6 -1. + <_> + 13 14 1 6 3. + 0 + 2.1312560420483351e-03 + 0.1482914984226227 + -0.5914195775985718 + <_> + + <_> + + + + <_> + 0 11 12 4 -1. + <_> + 4 11 4 4 3. + 0 + -0.0413990207016468 + 0.4204145073890686 + -0.2349137067794800 + <_> + + <_> + + + + <_> + 0 2 20 8 -1. + <_> + 0 6 20 4 2. + 0 + 0.1522327959537506 + -0.3104422092437744 + 0.4176956117153168 + <_> + + <_> + + + + <_> + 7 14 2 4 -1. + <_> + 8 14 1 4 2. + 0 + 7.2278419975191355e-04 + 0.2251144051551819 + -0.6049224138259888 + <_> + + <_> + + + + <_> + 5 10 10 8 -1. + <_> + 10 10 5 4 2. + <_> + 5 14 5 4 2. + 0 + 0.0139188598841429 + 0.1998808979988098 + -0.5362910032272339 + <_> + + <_> + + + + <_> + 5 12 1 4 -1. + <_> + 5 14 1 2 2. + 0 + 9.3200067058205605e-03 + -0.3086053133010864 + 0.3600850105285645 + <_> + + <_> + + + + <_> + 10 0 1 8 -1. + <_> + 10 4 1 4 2. + 0 + -0.0135594001039863 + 0.7699136137962341 + -0.1129935979843140 + <_> + + <_> + + + + <_> + 1 8 18 8 -1. + <_> + 7 8 6 8 3. + 0 + -0.2024694979190826 + 0.5726454854011536 + -0.1685701012611389 + <_> + + <_> + + + + <_> + 9 8 10 4 -1. + <_> + 9 8 5 4 2. + 0 + 0.0256939493119717 + -0.0890305936336517 + 0.4055748879909515 + <_> + + <_> + + + + <_> + 6 6 8 3 -1. + <_> + 6 7 8 1 3. + 0 + -0.0135868499055505 + 0.4805161952972412 + -0.1680151969194412 + <_> + + <_> + + + + <_> + 10 9 3 3 -1. + <_> + 11 9 1 3 3. + 0 + -6.3351547578349710e-04 + 0.2068227976560593 + -0.2571463882923126 + <_> + + <_> + + + + <_> + 4 14 2 4 -1. + <_> + 5 14 1 4 2. + 0 + 1.3086969556752592e-04 + 0.2003916949033737 + -0.4468185007572174 + <_> + + <_> + + + + <_> + 10 17 10 2 -1. + <_> + 15 17 5 1 2. + <_> + 10 18 5 1 2. + 0 + 9.4451867043972015e-03 + 0.0453975386917591 + -0.6604390144348145 + <_> + + <_> + + + + <_> + 3 18 3 2 -1. + <_> + 4 18 1 2 3. + 0 + -1.1732289567589760e-03 + -0.7233589887619019 + 0.1189457029104233 + <_> + + <_> + + + + <_> + 13 2 4 9 -1. + <_> + 13 2 2 9 2. + 0 + -0.0270948894321918 + 0.4183718860149384 + -0.0622722618281841 + <_> + + <_> + + + + <_> + 3 2 4 9 -1. + <_> + 5 2 2 9 2. + 0 + 0.0128746498376131 + -0.2036883980035782 + 0.4376415908336639 + <_> + + <_> + + + + <_> + 9 8 2 8 -1. + <_> + 10 8 1 4 2. + <_> + 9 12 1 4 2. + 0 + -2.8124409727752209e-03 + -0.6812670230865479 + 0.1294167041778564 + -1.2025229930877686 + 6 + -1 + <_> + + + <_> + + <_> + + + + <_> + 0 18 14 2 -1. + <_> + 0 18 7 1 2. + <_> + 7 19 7 1 2. + 0 + 0.0179104395210743 + -0.2364671975374222 + 0.5514438152313232 + <_> + + <_> + + + + <_> + 10 13 9 1 -1. + <_> + 13 13 3 1 3. + 0 + -5.0143511034548283e-03 + 0.4693753123283386 + -0.3883568942546844 + <_> + + <_> + + + + <_> + 6 15 3 1 -1. + <_> + 7 15 1 1 3. + 0 + 4.2181540629826486e-04 + 0.1153784990310669 + -0.7132592797279358 + <_> + + <_> + + + + <_> + 0 16 20 4 -1. + <_> + 10 16 10 2 2. + <_> + 0 18 10 2 2. + 0 + -0.0263313204050064 + -0.6675789952278137 + 0.1828629970550537 + <_> + + <_> + + + + <_> + 1 13 18 4 -1. + <_> + 1 13 9 2 2. + <_> + 10 15 9 2 2. + 0 + 0.0270899794995785 + 0.0714882835745811 + -0.7389600276947021 + <_> + + <_> + + + + <_> + 10 10 6 1 -1. + <_> + 12 10 2 1 3. + 0 + 3.9808810688555241e-03 + -0.0624900311231613 + 0.2579961121082306 + <_> + + <_> + + + + <_> + 0 10 12 6 -1. + <_> + 4 10 4 6 3. + 0 + 0.0938581079244614 + -0.1166857033967972 + 0.8323975801467896 + <_> + + <_> + + + + <_> + 10 11 9 4 -1. + <_> + 13 11 3 4 3. + 0 + -0.0170704908668995 + 0.2551425099372864 + -0.1464619040489197 + <_> + + <_> + + + + <_> + 1 13 9 1 -1. + <_> + 4 13 3 1 3. + 0 + -5.6102341040968895e-03 + 0.3810698091983795 + -0.2898282110691071 + <_> + + <_> + + + + <_> + 12 17 1 3 -1. + <_> + 12 18 1 1 3. + 0 + -1.6884109936654568e-03 + 0.3976930975914001 + -0.1791553944349289 + <_> + + <_> + + + + <_> + 5 17 3 3 -1. + <_> + 6 17 1 3 3. + 0 + 1.1422219686210155e-03 + 0.1220583021640778 + -0.7954893708229065 + <_> + + <_> + + + + <_> + 0 2 20 8 -1. + <_> + 0 6 20 4 2. + 0 + 0.0854484736919403 + -0.3227156102657318 + 0.2583124935626984 + -0.8488889932632446 + 7 + -1 + <_> + + + <_> + + <_> + + + + <_> + 5 12 1 6 -1. + <_> + 5 15 1 3 2. + 0 + -1.2407209724187851e-03 + 0.7162470817565918 + -0.2007752954959869 + <_> + + <_> + + + + <_> + 6 5 14 10 -1. + <_> + 13 5 7 5 2. + <_> + 6 10 7 5 2. + 0 + -0.0822703167796135 + 0.3968873023986816 + -0.2290832996368408 + <_> + + <_> + + + + <_> + 2 9 9 1 -1. + <_> + 5 9 3 1 3. + 0 + 6.2309550121426582e-03 + -0.2406931966543198 + 0.3659430146217346 + <_> + + <_> + + + + <_> + 10 11 9 3 -1. + <_> + 13 11 3 3 3. + 0 + -0.0140555696561933 + 0.2607584893703461 + -0.2829737067222595 + <_> + + <_> + + + + <_> + 7 14 6 1 -1. + <_> + 9 14 2 1 3. + 0 + 6.5327459014952183e-04 + 0.1528156995773315 + -0.5593969821929932 + <_> + + <_> + + + + <_> + 19 0 1 16 -1. + <_> + 19 8 1 8 2. + 0 + 0.0125494198873639 + -0.2089716047048569 + 0.2781802117824554 + <_> + + <_> + + + + <_> + 7 4 6 10 -1. + <_> + 7 4 3 5 2. + <_> + 10 9 3 5 2. + 0 + 0.0156330708414316 + 0.1483357995748520 + -0.6003684997558594 + <_> + + <_> + + + + <_> + 10 9 2 3 -1. + <_> + 10 9 1 3 2. + 0 + 7.4582709930837154e-04 + -0.2270790934562683 + 0.1987556070089340 + <_> + + <_> + + + + <_> + 0 12 12 2 -1. + <_> + 4 12 4 2 3. + 0 + -0.0158222708851099 + 0.2820397913455963 + -0.2920896112918854 + <_> + + <_> + + + + <_> + 12 18 3 2 -1. + <_> + 12 19 3 1 2. + 0 + 8.7247788906097412e-03 + -0.1720713973045349 + 0.4697273969650269 + <_> + + <_> + + + + <_> + 5 17 1 2 -1. + <_> + 5 18 1 1 2. + 0 + 6.8489677505567670e-04 + 0.1544692963361740 + -0.6636797189712524 + <_> + + <_> + + + + <_> + 9 11 2 1 -1. + <_> + 9 11 1 1 2. + 0 + 2.5823758915066719e-04 + 0.1690579950809479 + -0.4210532009601593 + <_> + + <_> + + + + <_> + 5 0 9 4 -1. + <_> + 8 0 3 4 3. + 0 + 0.0420489497482777 + -0.1286004930734634 + 0.6025344729423523 + <_> + + <_> + + + + <_> + 7 11 7 3 -1. + <_> + 7 12 7 1 3. + 0 + -0.0152104198932648 + 0.3247380852699280 + -0.2400044947862625 + <_> + + <_> + + + + <_> + 8 14 3 1 -1. + <_> + 9 14 1 1 3. + 0 + -7.4586068512871861e-04 + -0.7052754759788513 + 0.1198176965117455 + <_> + + <_> + + + + <_> + 7 9 6 4 -1. + <_> + 10 9 3 2 2. + <_> + 7 11 3 2 2. + 0 + -5.6090662255883217e-03 + -0.5189142227172852 + 0.1511954963207245 + <_> + + <_> + + + + <_> + 7 9 3 3 -1. + <_> + 8 9 1 3 3. + 0 + -6.9692882243543863e-04 + 0.2492880970239639 + -0.2738071978092194 + <_> + + <_> + + + + <_> + 9 9 2 1 -1. + <_> + 9 9 1 1 2. + 0 + -1.3032859424129128e-03 + -0.7021797895431519 + 0.1096538975834846 + -1.0809509754180908 + 8 + -1 + <_> + + + <_> + + <_> + + + + <_> + 1 19 15 1 -1. + <_> + 6 19 5 1 3. + 0 + 0.0127973603084683 + -0.2490361928939819 + 0.4674673080444336 + <_> + + <_> + + + + <_> + 9 3 3 3 -1. + <_> + 9 4 3 1 3. + 0 + -4.1834129951894283e-03 + 0.3007251024246216 + -0.2219883054494858 + <_> + + <_> + + + + <_> + 1 12 18 1 -1. + <_> + 7 12 6 1 3. + 0 + -0.0236128699034452 + 0.2414264976978302 + -0.3374670147895813 + <_> + + <_> + + + + <_> + 14 8 1 9 -1. + <_> + 14 11 1 3 3. + 0 + -0.0251536108553410 + 0.4372070133686066 + -0.3275614082813263 + <_> + + <_> + + + + <_> + 2 2 2 18 -1. + <_> + 2 11 2 9 2. + 0 + 0.0211393106728792 + -0.2863174080848694 + 0.3124063909053802 + <_> + + <_> + + + + <_> + 13 11 6 6 -1. + <_> + 16 11 3 3 2. + <_> + 13 14 3 3 2. + 0 + -0.0217125993221998 + 0.6942697763442993 + -0.1012582033872604 + <_> + + <_> + + + + <_> + 1 9 18 6 -1. + <_> + 1 9 9 3 2. + <_> + 10 12 9 3 2. + 0 + -0.0430783592164516 + -0.5607234239578247 + 0.1663125008344650 + <_> + + <_> + + + + <_> + 10 10 6 1 -1. + <_> + 12 10 2 1 3. + 0 + -1.4987450558692217e-03 + 0.1272646039724350 + -0.1166080012917519 + <_> + + <_> + + + + <_> + 4 10 6 1 -1. + <_> + 6 10 2 1 3. + 0 + 4.1716569103300571e-03 + -0.2401334047317505 + 0.4614624083042145 + <_> + + <_> + + + + <_> + 17 13 3 7 -1. + <_> + 18 13 1 7 3. + 0 + 4.8898528330028057e-03 + 0.0905465632677078 + -0.4839006960391998 + <_> + + <_> + + + + <_> + 0 13 3 7 -1. + <_> + 1 13 1 7 3. + 0 + -1.1625960469245911e-03 + -0.5429257154464722 + 0.1364106982946396 + <_> + + <_> + + + + <_> + 3 10 14 6 -1. + <_> + 10 10 7 3 2. + <_> + 3 13 7 3 2. + 0 + -0.0367816612124443 + -0.7064548730850220 + 0.1088668033480644 + <_> + + <_> + + + + <_> + 1 10 6 5 -1. + <_> + 3 10 2 5 3. + 0 + 0.0246897693723440 + -0.1673354059457779 + 0.5149983167648315 + <_> + + <_> + + + + <_> + 9 7 2 3 -1. + <_> + 9 8 2 1 3. + 0 + -4.8654521815478802e-03 + 0.5060626268386841 + -0.1594700068235397 + <_> + + <_> + + + + <_> + 5 8 10 3 -1. + <_> + 5 9 10 1 3. + 0 + -0.0117849996313453 + 0.4351908862590790 + -0.1512733995914459 + <_> + + <_> + + + + <_> + 10 13 2 1 -1. + <_> + 10 13 1 1 2. + 0 + 9.4989547505974770e-04 + 0.0692935213446617 + -0.4393649101257324 + <_> + + <_> + + + + <_> + 8 13 2 1 -1. + <_> + 9 13 1 1 2. + 0 + 5.9616740327328444e-04 + 0.0982565581798553 + -0.6629868745803833 + <_> + + <_> + + + + <_> + 9 9 2 3 -1. + <_> + 9 10 2 1 3. + 0 + -6.2817288562655449e-03 + 0.4888150990009308 + -0.1557238996028900 + -1.1087180376052856 + 9 + -1 + <_> + + + <_> + + <_> + + + + <_> + 9 0 1 8 -1. + <_> + 9 4 1 4 2. + 0 + -9.9095050245523453e-03 + 0.5630884766578674 + -0.2063539028167725 + <_> + + <_> + + + + <_> + 19 0 1 14 -1. + <_> + 19 7 1 7 2. + 0 + 4.5435219071805477e-03 + -0.2470169961452484 + 0.1799020022153854 + <_> + + <_> + + + + <_> + 7 6 6 2 -1. + <_> + 7 7 6 1 2. + 0 + -8.7091082241386175e-04 + 0.2453050017356873 + -0.2765454053878784 + <_> + + <_> + + + + <_> + 14 8 1 9 -1. + <_> + 14 11 1 3 3. + 0 + -0.0216368697583675 + 0.2515161931514740 + -0.3227509856224060 + <_> + + <_> + + + + <_> + 2 18 4 2 -1. + <_> + 2 18 2 1 2. + <_> + 4 19 2 1 2. + 0 + 2.5493409484624863e-03 + -0.1476895958185196 + 0.5545899271965027 + <_> + + <_> + + + + <_> + 9 11 6 3 -1. + <_> + 9 11 3 3 2. + 0 + 1.6613079933449626e-03 + -0.2122790962457657 + 0.1571837961673737 + <_> + + <_> + + + + <_> + 0 0 1 14 -1. + <_> + 0 7 1 7 2. + 0 + 9.4684818759560585e-03 + -0.2621173858642578 + 0.2920702099800110 + <_> + + <_> + + + + <_> + 10 5 2 15 -1. + <_> + 10 10 2 5 3. + 0 + -0.0522385612130165 + 0.1780423969030380 + -0.3343229889869690 + <_> + + <_> + + + + <_> + 5 11 6 3 -1. + <_> + 8 11 3 3 2. + 0 + 2.5752868968993425e-03 + -0.2065097987651825 + 0.4189889132976532 + <_> + + <_> + + + + <_> + 11 6 6 7 -1. + <_> + 13 6 2 7 3. + 0 + -0.0160471405833960 + 0.2585200071334839 + -0.1094772964715958 + <_> + + <_> + + + + <_> + 4 10 12 9 -1. + <_> + 8 10 4 9 3. + 0 + -0.1159958988428116 + 0.6298483014106750 + -0.1196947023272514 + <_> + + <_> + + + + <_> + 10 14 3 1 -1. + <_> + 11 14 1 1 3. + 0 + -9.7595580155029893e-04 + -0.6507467031478882 + 0.0756275802850723 + <_> + + <_> + + + + <_> + 7 14 3 1 -1. + <_> + 8 14 1 1 3. + 0 + -4.2097578989341855e-04 + -0.5833796858787537 + 0.1222841963171959 + <_> + + <_> + + + + <_> + 10 14 3 2 -1. + <_> + 11 14 1 2 3. + 0 + 3.9017631206661463e-04 + 0.0758925378322601 + -0.2629995942115784 + <_> + + <_> + + + + <_> + 4 8 2 6 -1. + <_> + 5 8 1 6 2. + 0 + 3.1535029411315918e-03 + -0.1664831042289734 + 0.4664255082607269 + <_> + + <_> + + + + <_> + 10 14 3 2 -1. + <_> + 11 14 1 2 3. + 0 + -1.4046890428289771e-03 + -0.3981274962425232 + 0.0561619699001312 + <_> + + <_> + + + + <_> + 3 12 3 4 -1. + <_> + 4 12 1 4 3. + 0 + 3.1666089780628681e-03 + -0.1787768006324768 + 0.4090973138809204 + <_> + + <_> + + + + <_> + 3 1 14 6 -1. + <_> + 3 3 14 2 3. + 0 + -0.0164993591606617 + 0.2048030048608780 + -0.3630825877189636 + <_> + + <_> + + + + <_> + 7 14 3 2 -1. + <_> + 8 14 1 2 3. + 0 + 4.1761019383557141e-04 + 0.1311777979135513 + -0.4833852946758270 + <_> + + <_> + + + + <_> + 12 11 3 3 -1. + <_> + 13 11 1 3 3. + 0 + 9.0707670897245407e-03 + 9.2487707734107971e-03 + -0.6447566151618958 + <_> + + <_> + + + + <_> + 5 11 3 3 -1. + <_> + 6 11 1 3 3. + 0 + 3.3107338822446764e-04 + -0.2549797892570496 + 0.2758406996726990 + <_> + + <_> + + + + <_> + 4 0 12 3 -1. + <_> + 4 1 12 1 3. + 0 + 0.0139847695827484 + 0.1226134970784187 + -0.5258917808532715 + <_> + + <_> + + + + <_> + 1 19 18 1 -1. + <_> + 7 19 6 1 3. + 0 + 0.0238846298307180 + -0.1637594997882843 + 0.3971964120864868 + <_> + + <_> + + + + <_> + 5 10 11 6 -1. + <_> + 5 12 11 2 3. + 0 + -0.0941136777400970 + 0.2231238931417465 + -0.2817093133926392 + <_> + + <_> + + + + <_> + 0 9 12 1 -1. + <_> + 6 9 6 1 2. + 0 + -0.0163963604718447 + 0.5174812078475952 + -0.1398597955703735 + -1.1378910541534424 + 10 + -1 + <_> + + + <_> + + <_> + + + + <_> + 5 12 1 6 -1. + <_> + 5 15 1 3 2. + 0 + -1.8984159396495670e-04 + 0.4796459972858429 + -0.1926054060459137 + <_> + + <_> + + + + <_> + 14 12 6 6 -1. + <_> + 16 12 2 6 3. + 0 + 4.7213290818035603e-03 + -0.3855938911437988 + 0.2359178066253662 + <_> + + <_> + + + + <_> + 5 17 3 2 -1. + <_> + 5 18 3 1 2. + 0 + 1.7611780203878880e-03 + 0.1145095974206924 + -0.5536686778068542 + <_> + + <_> + + + + <_> + 14 12 6 6 -1. + <_> + 16 12 2 6 3. + 0 + 0.0619058012962341 + 0.0361764803528786 + -0.7537580132484436 + <_> + + <_> + + + + <_> + 0 12 6 6 -1. + <_> + 2 12 2 6 3. + 0 + 6.8295709788799286e-03 + -0.2995564043521881 + 0.2059424966573715 + <_> + + <_> + + + + <_> + 14 8 1 9 -1. + <_> + 14 11 1 3 3. + 0 + -0.0229486804455519 + 0.1910860985517502 + -0.2746480107307434 + <_> + + <_> + + + + <_> + 0 16 11 4 -1. + <_> + 0 18 11 2 2. + 0 + 0.0131213096901774 + -0.1467829048633575 + 0.4494847953319550 + <_> + + <_> + + + + <_> + 14 8 1 9 -1. + <_> + 14 11 1 3 3. + 0 + -0.0331512987613678 + 0.2912957966327667 + -0.1595291942358017 + <_> + + <_> + + + + <_> + 5 2 4 6 -1. + <_> + 5 5 4 3 2. + 0 + 0.0224155597388744 + -0.1776317954063416 + 0.3403505980968475 + <_> + + <_> + + + + <_> + 9 0 2 8 -1. + <_> + 9 4 2 4 2. + 0 + -0.0255698896944523 + 0.5480523109436035 + -0.1752621978521347 + <_> + + <_> + + + + <_> + 8 10 2 8 -1. + <_> + 8 14 2 4 2. + 0 + 0.0174023006111383 + -0.3940981030464172 + 0.1953804939985275 + <_> + + <_> + + + + <_> + 12 12 8 3 -1. + <_> + 12 12 4 3 2. + 0 + -6.6808518022298813e-03 + 0.1267247051000595 + -0.3698250055313110 + <_> + + <_> + + + + <_> + 1 3 18 3 -1. + <_> + 7 3 6 3 3. + 0 + -0.0474075004458427 + -0.6734154224395752 + 0.0941268503665924 + <_> + + <_> + + + + <_> + 10 13 4 4 -1. + <_> + 12 13 2 2 2. + <_> + 10 15 2 2 2. + 0 + -7.0174131542444229e-03 + -0.4878580868244171 + -4.7722761519253254e-03 + <_> + + <_> + + + + <_> + 4 17 1 3 -1. + <_> + 4 18 1 1 3. + 0 + -5.6818639859557152e-04 + 0.3031811118125916 + -0.1906266957521439 + <_> + + <_> + + + + <_> + 12 12 8 3 -1. + <_> + 12 12 4 3 2. + 0 + -0.0346436500549316 + 0.1061747968196869 + -0.1113270968198776 + <_> + + <_> + + + + <_> + 5 13 8 4 -1. + <_> + 5 13 4 2 2. + <_> + 9 15 4 2 2. + 0 + 0.0128513900563121 + 0.1139544025063515 + -0.6669226884841919 + <_> + + <_> + + + + <_> + 0 0 20 18 -1. + <_> + 0 9 20 9 2. + 0 + 0.2961465120315552 + -0.1820058971643448 + 0.3209075033664703 + <_> + + <_> + + + + <_> + 5 17 1 2 -1. + <_> + 5 18 1 1 2. + 0 + -1.3540580403059721e-03 + -0.7073159813880920 + 0.0918638333678246 + <_> + + <_> + + + + <_> + 17 18 3 2 -1. + <_> + 17 19 3 1 2. + 0 + -7.0616841549053788e-04 + 0.1960162967443466 + -0.1338178962469101 + <_> + + <_> + + + + <_> + 4 8 7 3 -1. + <_> + 4 9 7 1 3. + 0 + -5.4999729618430138e-03 + 0.3074981868267059 + -0.1724286973476410 + <_> + + <_> + + + + <_> + 7 9 13 2 -1. + <_> + 7 10 13 1 2. + 0 + -0.0122836297377944 + 0.1942628026008606 + -0.1230755969882011 + <_> + + <_> + + + + <_> + 7 12 2 1 -1. + <_> + 8 12 1 1 2. + 0 + 1.9181630341336131e-04 + 0.1334999054670334 + -0.3691028952598572 + <_> + + <_> + + + + <_> + 7 11 6 5 -1. + <_> + 9 11 2 5 3. + 0 + 2.7476788964122534e-03 + -0.1872316002845764 + 0.2906386852264404 + <_> + + <_> + + + + <_> + 8 14 3 2 -1. + <_> + 9 14 1 2 3. + 0 + 5.3845712682232261e-04 + 0.1176405027508736 + -0.5548595190048218 + <_> + + <_> + + + + <_> + 17 18 3 2 -1. + <_> + 17 19 3 1 2. + 0 + -6.2914132140576839e-03 + -0.6762797832489014 + 0.0256425291299820 + <_> + + <_> + + + + <_> + 0 18 3 2 -1. + <_> + 0 19 3 1 2. + 0 + -8.0435717245563865e-04 + 0.3097242116928101 + -0.2231778949499130 + <_> + + <_> + + + + <_> + 16 18 3 2 -1. + <_> + 16 19 3 1 2. + 0 + 0.0178245995193720 + 0.0100319497287273 + -1.0000309944152832 + <_> + + <_> + + + + <_> + 1 18 3 2 -1. + <_> + 1 19 3 1 2. + 0 + -4.5915339142084122e-03 + -0.7925583124160767 + 0.0804975628852844 + <_> + + <_> + + + + <_> + 11 15 2 2 -1. + <_> + 12 15 1 1 2. + <_> + 11 16 1 1 2. + 0 + -4.2610289528965950e-04 + -0.4836213886737823 + 0.0490311309695244 + -1.0918780565261841 + 11 + -1 + \ No newline at end of file diff --git a/lab8/lab8.py b/lab8/lab8.py new file mode 100644 index 0000000..b5b6994 --- /dev/null +++ b/lab8/lab8.py @@ -0,0 +1,18 @@ +import cv2 +import numpy as np +from PIL import Image, ImageDraw +def main(): + image = Image.open('D:\\MACH\\MACH\\LAB_2\\img1.jpg') + image_arr = np.asarray(image) + + hog = cv2.HOGDescriptor() + hog.setSVMDetector(cv2.HOGDescriptor_getDefaultPeopleDetector()) + detections, weights = hog.detectMultiScale(image_arr) + detections_rectangles = detections.tolist() + draw = ImageDraw.Draw(image) + for x, y, w, h in detections_rectangles: + draw.rectangle( + [x, y, x + w, y + h], outline=(255, 0, 0)) + image.show() +if __name__ == '__main__': + main()