Initial commit

This commit is contained in:
2022-11-22 20:51:20 +03:00
parent fbe67387fb
commit 5408430646
10 changed files with 4604 additions and 0 deletions

3654
lab8/1.xml Normal file

File diff suppressed because it is too large Load Diff

18
lab8/lab8.py Normal file
View File

@@ -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()