Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions helpMe.py → overlayImg.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import cv2
import argparse
import os
import random

# construct the argument parser and parse input image arguent
ap = argparse.ArgumentParser()
Expand Down Expand Up @@ -31,14 +32,17 @@ def auto_canny(image, sigma=0.33):
# images
edged = auto_canny(gray)

cnt = cv2.findContours(edged.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
blur = cv2.GaussianBlur(edged,(5,5),0)

cnt = cv2.findContours(blur.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
cnt = cnt[1]
output = image.copy()

height = bg.shape[0]
width = bg.shape[1]

x,y,w,h = cv2.boundingRect(cnt)
for c in cnt:
x,y,w,h = cv2.boundingRect(c)

x1=random.randrange(0, width-w)
y1=random.randrange(0, height-h)
Expand Down