Skip to content
Snippets Groups Projects
Commit 7e50dd1e authored by goldaan's avatar goldaan
Browse files

removed not nessesary code and 2 more examples

parent 2da9f66a
No related branches found
No related tags found
No related merge requests found
......@@ -18,8 +18,8 @@
<file leaf-file-name="picture.py" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/picture.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="34">
<caret line="2" column="64" lean-forward="false" selection-start-line="2" selection-start-column="64" selection-end-line="2" selection-end-column="64" />
<state relative-caret-position="-404">
<caret line="45" column="45" lean-forward="false" selection-start-line="45" selection-start-column="45" selection-end-line="45" selection-end-column="45" />
<folding>
<element signature="e#0#21#0" expanded="true" />
</folding>
......@@ -27,6 +27,42 @@
</provider>
</entry>
</file>
<file leaf-file-name="generate_cube.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/../../sounds-cubes/generate_cube.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1462">
<caret line="86" column="96" lean-forward="false" selection-start-line="86" selection-start-column="96" selection-end-line="86" selection-end-column="96" />
<folding>
<element signature="e#0#10#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="sound_analyze.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/../../sounds-cubes/sound_analyze.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="85">
<caret line="5" column="0" lean-forward="false" selection-start-line="5" selection-start-column="0" selection-end-line="5" selection-end-column="0" />
<folding>
<element signature="e#0#40#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="process_sounds.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/../../sounds-cubes/process_sounds.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="51">
<caret line="3" column="84" lean-forward="false" selection-start-line="3" selection-start-column="84" selection-end-line="3" selection-end-column="84" />
<folding>
<element signature="e#0#17#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FileTemplateManagerImpl">
......@@ -39,15 +75,17 @@
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/../../sounds-cubes/generate_cube.py" />
<option value="$PROJECT_DIR$/../../sounds-cubes/process_sounds.py" />
<option value="$PROJECT_DIR$/../../sounds-cubes/sound_analyze.py" />
<option value="$PROJECT_DIR$/picture.py" />
</list>
</option>
</component>
<component name="ProjectFrameBounds">
<option name="x" value="-8" />
<option name="y" value="-8" />
<option name="width" value="1936" />
<option name="height" value="1056" />
<option name="width" value="1924" />
<option name="height" value="1055" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
......@@ -64,7 +102,7 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scratches" />
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<PATH>
......@@ -133,11 +171,12 @@
</PATH>
</subPane>
</pane>
<pane id="Scope" />
<pane id="Scratches" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../../sounds-cubes/process_sounds.py" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
......@@ -303,14 +342,14 @@
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1936" height="1056" extended-state="7" />
<editor active="false" />
<frame x="-8" y="0" width="1924" height="1055" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.18229716" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.18186638" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32936078" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Python Console" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.30119178" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.30151844" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
......@@ -333,6 +372,86 @@
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/picture.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="85">
<caret line="5" column="104" lean-forward="false" selection-start-line="5" selection-start-column="104" selection-end-line="5" selection-end-column="104" />
<folding>
<element signature="e#0#21#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../../sounds-cubes/generate_cube.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="e#0#10#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../../sounds-cubes/sound_analyze.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="e#0#40#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../../sounds-cubes/process_sounds.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="e#0#17#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/picture.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="85">
<caret line="5" column="104" lean-forward="false" selection-start-line="5" selection-start-column="104" selection-end-line="5" selection-end-column="104" />
<folding>
<element signature="e#0#21#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../../sounds-cubes/generate_cube.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="e#0#10#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../../sounds-cubes/sound_analyze.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="e#0#40#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../../sounds-cubes/process_sounds.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="e#0#17#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/picture.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
......@@ -385,8 +504,58 @@
</entry>
<entry file="file://$PROJECT_DIR$/picture.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="34">
<caret line="2" column="64" lean-forward="false" selection-start-line="2" selection-start-column="64" selection-end-line="2" selection-end-column="64" />
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="e#0#21#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/picture.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="e#0#21#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../../sounds-cubes/process_sounds.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="51">
<caret line="3" column="84" lean-forward="false" selection-start-line="3" selection-start-column="84" selection-end-line="3" selection-end-column="84" />
<folding>
<element signature="e#0#17#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../../sounds-cubes/generate_cube.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1462">
<caret line="86" column="96" lean-forward="false" selection-start-line="86" selection-start-column="96" selection-end-line="86" selection-end-column="96" />
<folding>
<element signature="e#0#10#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../../sounds-cubes/sound_analyze.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="85">
<caret line="5" column="0" lean-forward="false" selection-start-line="5" selection-start-column="0" selection-end-line="5" selection-end-column="0" />
<folding>
<element signature="e#0#40#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/picture.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-404">
<caret line="45" column="45" lean-forward="false" selection-start-line="45" selection-start-column="45" selection-end-line="45" selection-end-column="45" />
<folding>
<element signature="e#0#21#0" expanded="true" />
</folding>
......
PTTTest/bild.PNG

71.5 KiB

PTTTest/bild.jpg

13.8 KiB

......@@ -29,14 +29,10 @@ def test_mean(img):
mean=box_mean(im)
#print(box_list)
#print(mean_list)
#print(counter_list)
print(im.getdata())
print(max)
max_list=[max[0][0],max[1][0],max[2][0]]
show_color(max_list)
#print(mean)
#Helpfunction; returns the mean rgb valur of a given image (area)
def box_mean(img_region):
......@@ -47,21 +43,20 @@ def box_mean(img_region):
meanvalg = int(numpy.mean(g))
meanvalb = int(numpy.mean(b))
#return as tuple
#return as tuple; so values merched again
return ((meanvalr,meanvalg,meanvalb))
#counts how often a nearly rgb value is part of the picture
def rgb_count(rgbList):
count_list=[]
first=rgbList.pop()
#first_element=[first,1] #form of the list elements: [(r,g,b),count]
count_list.append([first,1])
for item in rgbList:
found = False
#top=rgbList.pop()
for element in count_list:
if alike(item,element[0],25):#45 seems to be a good value
if alike(item,element[0],25):
element[1] += 1
found=True
break
......@@ -103,117 +98,3 @@ def show_color(max_list):
if(x >= 400):
pixels[x,y]=max_list[2]
pic.show()
\ No newline at end of file
#_________________________not needed anymore______________________________________________________________
def image_boxing(img):
im=Image.open(img)
width, height = im.size # image size
mean_list = [] # saves the mean rgb value of each area
box=()
x=0
y=0
#let the boxing begin (area of 50x50 pixels)
while (x<width):#wie rum läuft was?
while (y<height): #brechnung der einzelnen felder
if(x+50>=width&y+50>height):#fall für letztes feld
img_region = im.crop((x, y, (width - 1),(height-1)))
r, g, b = img_region.split()
meanvalr = int(numpy.mean(r))
meanvalg = int(numpy.mean(g))
meanvalb = int(numpy.mean(b))
addtuple=(meanvalr,meanvalg,meanvalb)
mean_list.append(addtuple)
break
if(x+50>=width):
img_region=im.crop((x,y,(width-1),(y+50)))
r, g, b = img_region.split()
meanvalr = int(numpy.mean(r))
meanvalg = int(numpy.mean(g))
meanvalb = int(numpy.mean(b))
addtuple = (meanvalr, meanvalg, meanvalb)
mean_list.append(addtuple)
y=y+50
if(y+50>=height):
img_region = im.crop((x, y, (x+50), (height-1)))
r, g, b = img_region.split()
meanvalr = int(numpy.mean(r))
meanvalg = int(numpy.mean(g))
meanvalb = int(numpy.mean(b))
addtuple = (meanvalr, meanvalg, meanvalb)
mean_list.append(addtuple)
x=x+50
else:
img_region = im.crop((x, y, (x+50), (y + 50)))
r, g, b = img_region.split()
meanvalr = int(numpy.mean(r))
meanvalg = int(numpy.mean(g))
meanvalb = int(numpy.mean(b))
addtuple = (meanvalr, meanvalg, meanvalb)
mean_list.append(addtuple)
y=y+50
print(mean_list)
print("should be:"+(width/50)*(height/50))
print("is:"+mean_list.count())
def picture_to_colors():
im = Image.open("test.jpg")
pixels = list(im.getdata()) #gets the rgb values from all pixels of the image and puts them in a list
return pixels
def show_Image(im):
test=Image.open(im)
test.show()
def test_show():
img=Image.open("test.jpg")#loads image
width,height=img.size
print((width,height))
box = (0, 0, 50, 50) #tupel, das angibt, von wo bis wo die pixel genommen werden sollen
img_region = img.crop(box) #takes the defined area
#pixels = list(img_region.getdata()) # get pixels of the area
#print(pixels)
r,g,b=img_region.split()
meanvalr = int(numpy.mean(r))
meanvalg = int(numpy.mean(g))
meanvalb = int(numpy.mean(b))
img_region.show()
# pixels=list(img_region.getdata()) #get pixels of the area
# meanval=numpy.mean(pixels)
# print(pixels)
# print(meanval)
print((meanvalr, meanvalg, meanvalb))
#elemente zu sortieren könnte sinnvoll sein
def colorcounter(rgbList):
counterList=[] #in this list all rgb values of the image get saved with their number of appearance in the image
for i in rgbList:
new_element=[i,rgbList.count(i)]
if new_element not in counterList:
counterList.append(new_element)#rgb values get in the list. "count" counts the number of appearance
return counterList
#idee: nach größe des vorkommens sortieren. ersten 3 elemente der Liste ausgeben lassen.
#def get_the_most(counterList):
# for i in counterList:
PTTTest/test2.jpg

3.73 MiB | W: | H:

PTTTest/test2.jpg

5.93 MiB | W: | H:

PTTTest/test2.jpg
PTTTest/test2.jpg
PTTTest/test2.jpg
PTTTest/test2.jpg
  • 2-up
  • Swipe
  • Onion skin
PTTTest/wagen2.jpg

1.39 MiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment