Created
April 26, 2016 14:20
-
-
Save Seagor/6de79d11ac8d10f1061e6b9a5bd64f24 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
areas = [] | |
for i, img in enumerate(found_objects): | |
for r, reg in enumerate(img): | |
for cnt in reg['contours']: | |
areas.append((cv2.contourArea(cnt), r, i)) | |
df = pd.DataFrame(data = areas, columns=['area', 'dock', 'image']) | |
df.plot(kind='scatter', x='dock', y='area', figsize=(10, 5), c='gray', s=df['area'], ylim=(0,600), title="Object area by Dock") | |
df.plot(kind='scatter', x='image', y='area', figsize=(10, 5), s=75) | |
df.plot(kind='scatter', x='dock', y='image', figsize=(10, 5), s=df['area']) | |
plt.figure(); | |
df['area'].plot(kind='hist', bins=15, figsize=(10, 5), x='Area') | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment