рабочая лаба 8

This commit is contained in:
2022-11-24 13:06:42 +03:00
parent c6e36a2f72
commit fffd3dbe72
4 changed files with 9 additions and 83 deletions

BIN
lab8/input.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

View File

@@ -1,8 +1,10 @@
import cv2
import numpy as np
from PIL import Image, ImageDraw
def main():
image = Image.open('D:\\MACH\\MACH\\LAB_2\\img1.jpg')
image = Image.open('input.jpeg')
image_arr = np.asarray(image)
hog = cv2.HOGDescriptor()
@@ -11,8 +13,9 @@ def main():
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))
draw.rectangle((x, y, x + w, y + h), outline=(255, 0, 0))
image.show()
if __name__ == '__main__':
main()