Unverified Commit ad13df6b authored by tilman's avatar tilman
Browse files

add stuff

parent 436b3fc3
......@@ -2,7 +2,7 @@
* tested with `Python 3.7.5`, `pip 19.3.1` and
* Install and build OpenPose (including OpenCV), for details see [official instructions](https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/installation.md#installation)
* make sure to append the openpose python bindings to your python path: `export PYTHONPATH=/path/to/openpose/build/python:$PYTHONPATH` !Important!: replace `/path/to/openpose` with your own path to your local openpose instalation
* set env var export OPENPOSE_MODELS="/path/to/openpose/models/"
* set env var for openpose models `export OPENPOSE_MODELS="/path/to/openpose/models/"`
* install all python dependencies: 'pip install -r requirements.txt'
## Usage
......
......@@ -11,11 +11,13 @@ from lib.triangles import *
from lib.bisection import *
from lib.misc import *
SHOW_WINDOW = False
SAVE_FILE = True
OUT_DIR = 'images/out/images_imdahl/main_structure_skelletons/'
SHOW_WINDOW = True
SAVE_FILE = False
TRIANGLES = True
BISEC_VECTORS = True
OUT_DIR = 'images/out/first_email/'
#IN_DIR = "images/first_email/" # images from first email
IN_DIR = "images/images_imdahl/" # images from imdahl
IN_DIR = "images/first_email/" # images from imdahl
params = dict()
#params["model_folder"] = "/Users/Tilman/Documents/Programme/Python/forschungspraktikum/openpose/models/"
......@@ -39,19 +41,19 @@ for img_name in images:
datum.cvInputData = img
opWrapper.emplaceAndPop([datum])
img = datum.cvOutputData
#img = datum.cvOutputData
#print("poses:"+str(len(datum.poseKeypoints)))
triangles = [poseToTriangle(pose) for pose in datum.poseKeypoints]
bisecVectors= [poseToBisectVector(pose) for pose in datum.poseKeypoints]
#paint triangles
for triangle in triangles:
if triangle is not None:
cv2.drawContours(img, [triangle], 0, 255, -1)
for bisecVector in bisecVectors:
if bisecVector is not None:
cv2.arrowedLine(img, trp(bisecVector[1]), trp(bisecVector[0]), (0,0,255), 2);
if TRIANGLES:
triangles = [poseToTriangle(pose) for pose in datum.poseKeypoints]
for triangle in triangles:
if triangle is not None:
cv2.drawContours(img, [triangle], 0, 255, -1)
if BISEC_VECTORS:
bisecVectors= [poseToBisectVector(pose) for pose in datum.poseKeypoints]
for bisecVector in bisecVectors:
if bisecVector is not None:
cv2.arrowedLine(img, trp(bisecVector[1]), trp(bisecVector[0]), (0,0,255), 2);
if SAVE_FILE:
cv2.imwrite(os.path.basename(img_name),img)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment