Skip to content

Commit

Permalink
Colaboratory를 통해 생성됨
Browse files Browse the repository at this point in the history
  • Loading branch information
seong-heum committed Jul 28, 2021
1 parent aebafbe commit dcc7219
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions ex03.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
"source": [
"# EX. 3\n",
"[Colab.] https://colab.research.google.com/drive/1-akVG4V9HGUE1ZjNOAy-eZLKxkRUb0Kz#scrollTo=VHqOrojPQLcu"
"[Colab.] https://github.com/Seong-heum/kics2021/blob/main/ex03.ipynb"
]
},
{
Expand All @@ -49,7 +49,7 @@
"source": [
"!pip install opencv-contrib-python==4.4.0.44"
],
"execution_count": 1,
"execution_count": null,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -94,7 +94,7 @@
"from google.colab.patches import cv2_imshow\n",
"print(cv.__version__)"
],
"execution_count": 2,
"execution_count": null,
"outputs": [
{
"output_type": "stream",
Expand All @@ -117,7 +117,7 @@
"source": [
"!wget https://www.dropbox.com/s/9bkst33ad79ckvv/baboon.jpg?dl=0 -O baboon.jpg"
],
"execution_count": 3,
"execution_count": null,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -161,7 +161,7 @@
"img = cv.imread(\"baboon.jpg\")\n",
"cv2_imshow(img)"
],
"execution_count": 4,
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
Expand Down Expand Up @@ -193,7 +193,7 @@
"cv2_imshow(G)\n",
"cv2_imshow(R)"
],
"execution_count": 5,
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
Expand Down Expand Up @@ -247,7 +247,7 @@
"ext = cv.inRange(img, (0, 0, 200), (100, 100, 255)) # segmentation\n",
"cv2_imshow(ext)"
],
"execution_count": 6,
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
Expand Down Expand Up @@ -286,7 +286,7 @@
" out = np.flipud(out)\n",
" return out"
],
"execution_count": 7,
"execution_count": null,
"outputs": []
},
{
Expand All @@ -304,7 +304,7 @@
"lines = hist_lines(img)\n",
"cv2_imshow(lines)"
],
"execution_count": 8,
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
Expand Down Expand Up @@ -340,7 +340,7 @@
"cv2_imshow(lines_eq)\n",
"cv2_imshow(img_eq)"
],
"execution_count": 10,
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
Expand Down Expand Up @@ -396,7 +396,7 @@
"img[dst > 0.01 * dst.max()] = [0, 0, 255]\n",
"cv2_imshow(img)\n"
],
"execution_count": 11,
"execution_count": null,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -460,7 +460,7 @@
"!wget https://www.dropbox.com/s/27rvsjfjhnwp6jd/box.png?dl=0 -O box.png\n",
"!wget https://www.dropbox.com/s/muxbttnq26815qy/box_in_scene.png?dl=0 -O box_in_scene.png"
],
"execution_count": 12,
"execution_count": null,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -520,7 +520,7 @@
"img0 = cv.imread(\"box.png\", cv.IMREAD_GRAYSCALE)\n",
"img1 = cv.imread(\"box_in_scene.png\", 0)"
],
"execution_count": 13,
"execution_count": null,
"outputs": []
},
{
Expand All @@ -537,7 +537,7 @@
"#kp0, des0 = orb.detectAndCompute(img0, None)\n",
"#kp1, des1 = orb.detectAndCompute(img1, None)"
],
"execution_count": 14,
"execution_count": null,
"outputs": []
},
{
Expand All @@ -550,7 +550,7 @@
"bf = cv.BFMatcher(cv.DescriptorMatcher_BRUTEFORCE, crossCheck=False)\n",
"pairs_of_matches = bf.knnMatch(des0, des1, k=2)"
],
"execution_count": 15,
"execution_count": null,
"outputs": []
},
{
Expand All @@ -564,7 +564,7 @@
"pairs_of_matches = sorted(pairs_of_matches, key=lambda x:x[0].distance)\n",
"img_pairs_of_matches = cv.drawMatchesKnn( img0, kp0, img1, kp1, pairs_of_matches[:20], img1, flags=cv.DRAW_MATCHES_FLAGS_NOT_DRAW_SINGLE_POINTS)"
],
"execution_count": 16,
"execution_count": null,
"outputs": []
},
{
Expand All @@ -582,7 +582,7 @@
"plt.imshow(img_pairs_of_matches)\n",
"plt.show()"
],
"execution_count": 17,
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
Expand All @@ -608,7 +608,7 @@
"# Apply the ratio test.\n",
"matches = [x[0] for x in pairs_of_matches if len(x) > 1 and x[0].distance < 0.8 * x[1].distance]"
],
"execution_count": 18,
"execution_count": null,
"outputs": []
},
{
Expand All @@ -620,7 +620,7 @@
"# Draw the best 20 matches.\n",
"img_matches = cv.drawMatches( img0, kp0, img1, kp1, matches[:20], img1, flags=cv.DRAW_MATCHES_FLAGS_NOT_DRAW_SINGLE_POINTS)"
],
"execution_count": 19,
"execution_count": null,
"outputs": []
},
{
Expand All @@ -638,7 +638,7 @@
"plt.imshow(img_matches)\n",
"plt.show()"
],
"execution_count": 20,
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
Expand Down Expand Up @@ -674,7 +674,7 @@
"import cv2 as cv\n",
"from matplotlib import pyplot as plt"
],
"execution_count": 21,
"execution_count": null,
"outputs": []
},
{
Expand All @@ -690,7 +690,7 @@
"!wget https://www.dropbox.com/s/oj0mfo6e654c9s2/tsukuba_l.png?dl=0 -O tsukuba_l.png\n",
"!wget https://www.dropbox.com/s/0pe324puqcd6o7e/tsukuba_r.png?dl=0 -O tsukuba_r.png"
],
"execution_count": 22,
"execution_count": null,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -756,7 +756,7 @@
"cv2_imshow(imgL)\n",
"cv2_imshow(imgR)"
],
"execution_count": 23,
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
Expand Down Expand Up @@ -800,7 +800,7 @@
"plt.imshow(disparity,'gray')\n",
"plt.show()"
],
"execution_count": 24,
"execution_count": null,
"outputs": [
{
"output_type": "display_data",
Expand Down

0 comments on commit dcc7219

Please sign in to comment.