Unverified Commit 7a87abb8 authored by tilman's avatar tilman
Browse files

rework readme and reqs

parent 0f79b364
......@@ -4,45 +4,47 @@ import os
# IN_DIR = "../images/images_imdahl/"
IN_DIR = "../images/out/fuse_1_bsds500/"
IN_DIR = "../images/eccv_other_images_testing"
DISPLAY_RASTER_ELEMENTS=500
KMEANS_K = 3
images = [os.path.join(os.getcwd(), IN_DIR, f) for f in os.listdir(IN_DIR)]
os.chdir('../images/out/images_imdahl/bdcn_filtering/test1') #save images in this dir
os.chdir('/Users/Tilman/Documents/Programme/Python/forschungspraktikum/art-structures-env/src/images/out/asana_task/kmeans/K'+str(KMEANS_K)+'/eccv_other_images_testing') #save images in this dir
for img_name in images:
# img_name=images[0]
print(img_name)
print(img_name,os.path.basename(img_name))
img = cv2.imread(img_name)
# cv2.imshow('res2'+img_name,img)
# cv2.waitKey(0)
# image = cv2.imread('../images/out/fuse_1_bsds500/0.png')
max_lw = max(len(img),len(img[0]))
esz = max_lw / DISPLAY_RASTER_ELEMENTS
print("max_lw,esz",max_lw,esz)
# max_lw = max(len(img),len(img[0]))
# esz = max_lw / DISPLAY_RASTER_ELEMENTS
# print("max_lw,esz",max_lw,esz)
# img = cv2.bitwise_not(img)
cv2.imshow('res2'+img_name,img)
blurred = cv2.medianBlur(img,int(esz*5)+1 if int(esz*5)%2==0 else int(esz*5))
print("med1")
cv2.waitKey(0)
cv2.imshow('res2'+img_name,blurred)
blurred = cv2.bilateralFilter(blurred,30,60,60)
print("bil1")
cv2.waitKey(0)
cv2.imshow('res2'+img_name,blurred)
blurred = cv2.bilateralFilter(blurred,30,60,60)
print("bil2")
cv2.waitKey(0)
cv2.imshow('res2'+img_name,blurred)
blurred = cv2.bilateralFilter(blurred,30,60,60)
print("bil3")
cv2.waitKey(0)
cv2.imshow('res2'+img_name,blurred)
blurred = cv2.bilateralFilter(blurred,30,60,60)
print("bil4")
cv2.waitKey(0)
cv2.imshow('res2'+img_name,blurred)
# cv2.imshow('res2'+img_name,img)
# blurred = cv2.medianBlur(img,int(esz*5)+1 if int(esz*5)%2==0 else int(esz*5))
# print("med1")
# cv2.waitKey(0)
# cv2.imshow('res2'+img_name,blurred)
# blurred = cv2.bilateralFilter(blurred,30,60,60)
# print("bil1")
# cv2.waitKey(0)
# cv2.imshow('res2'+img_name,blurred)
# blurred = cv2.bilateralFilter(blurred,30,60,60)
# print("bil2")
# cv2.waitKey(0)
# cv2.imshow('res2'+img_name,blurred)
# blurred = cv2.bilateralFilter(blurred,30,60,60)
# print("bil3")
# cv2.waitKey(0)
# cv2.imshow('res2'+img_name,blurred)
# blurred = cv2.bilateralFilter(blurred,30,60,60)
# print("bil4")
# cv2.waitKey(0)
# cv2.imshow('res2'+img_name,blurred)
#applying filters
# bil = cv2.bilateralFilter(img,50,30,30)
......@@ -61,13 +63,13 @@ for img_name in images:
# cv2.waitKey(0)
# # img = cv2.imread(img_name)
Z = median.reshape((-1,3))
Z = img.reshape((-1,3))
# # convert to np.float32
Z = np.float32(Z)
# # define criteria, number of clusters(K) and apply kmeans()
criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 10, 1.0)
K = 12
K = KMEANS_K
ret,label,center=cv2.kmeans(Z,K,None,criteria,10,cv2.KMEANS_RANDOM_CENTERS)
# # Now convert back into uint8, and make original image
......@@ -75,10 +77,10 @@ for img_name in images:
res = center[label.flatten()]
kmeans = res.reshape((img.shape))
cv2.imwrite(os.path.basename(img_name)+"_med5esz_30_60_60.png",blurred)
# cv2.imwrite(os.path.basename(img_name),kmeans)
cv2.imshow('res2'+img_name,blurred)
cv2.waitKey(0)
#cv2.imwrite('/Users/Tilman/Documents/Programme/Python/forschungspraktikum/images/out/images_imdahl/kmean/'+img_name,res2)
# cv2.imshow('res2'+img_name,blurred)
# cv2.waitKey(0)
cv2.imwrite(os.path.basename(img_name),kmeans)
# cv2.waitKey(0)
cv2.destroyAllWindows()
\ No newline at end of file
absl-py==0.2.2
appdirs==1.4.3
asn1crypto==0.24.0
astor==0.6.2
attrs==19.3.0
Babel==2.7.0
backports-abc==0.5
backports.functools-lru-cache==1.5
backports.weakref==1.0.post1
bleach==1.5.0
blurhash==1.1.4
boost==0.1
bottle==0.12.16
certifi==2019.3.9
cffi==1.12.2
chardet==3.0.4
click==5.1
cliff==2.16.0
cmd2==0.8.9
colorama==0.4.1
colorlog==4.0.2
configparser==4.0.2
contextlib2==0.6.0.post1
cryptography==2.6.1
cycler==0.10.0
debtcollector==1.22.0
decorator==4.4.1
dogpile.cache==0.9.0
ecdsa==0.13
enum34==1.1.6
esphome==1.12.1
esptool==2.6
funcsigs==1.0.2
functools32==3.2.3.post2
future==0.17.1
futures==3.2.0
gast==0.2.0
grpcio==1.12.1
h5py==2.8.0
html5lib==0.9999999
idna==2.8
ifaddr==0.1.6
importlib-metadata==0.23
ipaddress==1.0.22
iso8601==0.1.12
jmespath==0.9.4
jsonpatch==1.24
jsonpointer==2.0
jsonschema==3.1.1
Keras==2.2.0
Keras-Applications==1.0.2
Keras-Preprocessing==1.0.1
keystoneauth1==3.18.0
kiwisolver==1.0.1
Markdown==2.6.11
Mastodon.py==1.5.0
matplotlib==2.2.2
mercurial==5.1.1
mock==2.0.0
monotonic==1.5
more-itertools==5.0.0
msgpack==0.6.2
munch==2.5.0
netaddr==0.7.19
netifaces==0.10.9
numpy==1.14.5
dotmap
numpy
opencv-python==4.1.2.30
openstacksdk==0.37.0
os-service-types==1.7.0
osc-lib==1.14.1
oslo.config==6.11.1
oslo.i18n==3.24.0
oslo.serialization==2.29.2
oslo.utils==3.41.2
paho-mqtt==1.4.0
pandas==0.23.1
pathlib2==2.3.5
pbr==4.0.4
platformio==3.6.5
powerline-status===2.3.dev9999-git.d611cc2e439e02a123b4f208767c8dc5f72ce567
prettytable==0.7.2
protobuf==3.7.1
pyaes==1.6.1
pycparser==2.19
pyOpenSSL==19.0.0
pyparsing==2.2.0
pyperclip==1.7.0
pyrsistent==0.15.5
pyserial==3.4
python-cinderclient==5.0.0
python-dateutil==2.7.3
python-glanceclient==2.17.0
python-keystoneclient==3.22.0
python-magic==0.4.15
python-novaclient==16.0.0
python-openstackclient==4.0.0
pytz==2018.4
PyYAML==5.1
requests==2.21.0
requestsexceptions==1.4.0
rfc3986==1.3.2
scandir==1.10.0
scikit-learn==0.19.1
scipy==1.1.0
semantic-version==2.6.0
simplejson==3.16.0
singledispatch==3.4.0.3
six==1.11.0
sklearn==0.0
SQLAlchemy==1.3.10
stevedore==1.31.0
subprocess32==3.5.2
tensorboard==1.8.0
tensorflow==1.8.0
tensorflow-hub==0.4.0
termcolor==1.1.0
tornado==5.1.1
typing==3.6.6
tzlocal==1.5.1
unicodecsv==0.14.1
urllib3==1.24.1
virtualenv==16.7.5
voluptuous==0.11.5
warlock==1.3.3
wcwidth==0.1.7
Werkzeug==0.14.1
wrapt==1.11.2
zipp==0.6.0
scipy
Shapely
\ No newline at end of file
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