Skip to content
Open
Show file tree
Hide file tree
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
12 changes: 12 additions & 0 deletions .idea/PerceptionTutorials.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/detectron2
Submodule detectron2 added at 0703e0
6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

115 changes: 115 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

137 changes: 137 additions & 0 deletions 08_2d_visulization/submissions/kim8210.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "36786708-42e2-421b-847c-64a026c2e812",
"metadata": {
"pycharm": {
"name": "#%%\n",
"is_executing": true
}
},
"outputs": [],
"source": [
"from PIL import Image\n",
"import matplotlib.pyplot as plt\n",
"import cv2\n",
"import numpy as np "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "caaab820-0022-4a67-adf2-e5b8c2c56372",
"metadata": {
"pycharm": {
"is_executing": true,
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"sample = Image.open(\"sample.jpg\")\n",
"plt.imshow(sample)\n",
"image = cv2.imread(\"sample.jpg\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"original = image.copy()\n",
"image = cv2.cvtColor(image, cv2.COLOR_BGR2HSV)\n",
"lower = np.array([0,50,50], dtype=\"uint8\")\n",
"upper = np.array([10,255,255], dtype=\"uint8\")\n",
"mask = cv2.inRange(image, lower, upper)\n",
"\n",
"cnts = cv2.findContours(mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)\n",
"cnts = cnts[0] if len(cnts) == 2 else cnts[1]\n",
"cv2.fillPoly(mask, cnts, (255,255,255))\n",
"result = cv2.bitwise_and(original,original,mask=mask)\n",
"\n",
"cv2.imread('mask', mask)\n",
"cv2.imread('result', result)\n",
"cv2.waitKey()\n",
"#changed\n",
"\n"
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
},
{
"cell_type": "code",
"execution_count": null,
"id": "7e63a999",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "da5bb592",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "bb43bf38",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
}
},
"nbformat": 4,
"nbformat_minor": 5
}