Skip to content

Commit 868db5e

Browse files
committed
Initial commit
1 parent edfdbd7 commit 868db5e

15 files changed

+163
-0
lines changed

.devcontainer/Dockerfile

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Use the official Python image
2+
FROM python:3.10-slim
3+
4+
# Set the working directory in the container
5+
WORKDIR /workspace
6+
7+
# Copy your project files to the container
8+
COPY . /workspace
9+
10+
# Install any additional dependencies required by your project
11+
RUN pip install --no-cache-dir -r .devcontainer/requirements.txt
12+
13+
# Expose port 8000 (or whatever port your application uses)
14+
EXPOSE 8000
15+
16+
# Set the default command to run your Python application
17+
CMD ["python3", "main.py"]

.devcontainer/devcontainer.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "Python Dev Container",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"context": ".."
6+
},
7+
"customizations": {
8+
"vscode": {
9+
"extensions": [
10+
"ms-python.python",
11+
"ms-python.vscode-pylance",
12+
"akamud.vscode-theme-onedark",
13+
"vscode-icons-team.vscode-icons",
14+
"ms-azuretools.vscode-docker",
15+
"github.copilot",
16+
"ms-toolsai.jupyter",
17+
"mechatroner.rainbow-csv"
18+
],
19+
"settings": {
20+
"terminal.integrated.shell.linux": "/bin/bash",
21+
"workbench.colorTheme": "Atom One Dark",
22+
"workbench.iconTheme": "vscode-icons"
23+
}
24+
}
25+
},
26+
"forwardPorts": [8000],
27+
"postCreateCommand": "pip install -r .devcontainer/requirements.txt",
28+
"remoteUser": "root"
29+
}

.devcontainer/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
opencv-python

datasets/aalesund/1504200/200.jpg

2.95 MB
Loading

datasets/aalesund/1504200/200.sos

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.HODE
2+
..PRODUSENT "Bravida Geomatikk AS"
3+
..EIER "�lesund kommune"
4+
..KOMM 1504
5+
..TEGNSETT ISO8859-10
6+
..TRANSPAR
7+
...KOORDSYS 110
8+
...ORIGO-N� 0 0
9+
...ENHET 1.000
10+
..OMR�DE
11+
...MIN-N� 496779 13727
12+
...MAX-N� 497712 15419
13+
..SOSI-VERSJON 3.3
14+
..SOSI-NIV� 2
15+
..DATO 20040929
16+
..KVALITET 79
17+
.RASTER 1:
18+
..BILDE
19+
...BILDE-SYS 110
20+
...BILDE-TYPE JPEG
21+
...BILDE-FIL "200.jpg"
22+
..PIXEL-ST�RR 0.1000000000 0.1000000000
23+
! Antall pixler i N , � : 9325 , 16908
24+
..N�
25+
496779 13727
26+
497712 15418
27+
.SLUTT
80.1 KB
Binary file not shown.

datasets/aalesund/1504201/201.jpg

1.6 MB
Loading

datasets/aalesund/1504201/201.sos

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.HODE
2+
..PRODUSENT "Bravida Geomatikk AS"
3+
..EIER "�lesund Kommune"
4+
..KOMM 1504
5+
..TEGNSETT ISO8859-10
6+
..TRANSPAR
7+
...KOORDSYS 110
8+
...ORIGO-N� 0 0
9+
...ENHET 1.000
10+
..OMR�DE
11+
...MIN-N� 497197 16072
12+
...MAX-N� 498311 16977
13+
..SOSI-VERSJON 3.3
14+
..SOSI-NIV� 2
15+
..DATO 20041001
16+
..KVALITET 79
17+
.RASTER 1:
18+
..BILDE
19+
...BILDE-SYS 110
20+
...BILDE-TYPE JPEG
21+
...BILDE-FIL "201.jpg"
22+
..PIXEL-ST�RR 0.1000000000 0.1000000000
23+
! Antall pixler i N , � : 11132 , 9036
24+
..N�
25+
497197 16073
26+
498310 16976
27+
.SLUTT
Binary file not shown.

datasets/molde/0488/0488_plankart.tif

51.6 MB
Binary file not shown.
3.66 MB
Loading

datasets/molde/2102/2102_plankart.pdf

1.91 MB
Binary file not shown.
400 KB
Loading

how-to-segment-anything-with-sam.ipynb

+1
Large diffs are not rendered by default.

src/sam_segmentation.ipynb

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 3,
6+
"metadata": {},
7+
"outputs": [
8+
{
9+
"ename": "error",
10+
"evalue": "OpenCV(4.10.0) D:\\a\\opencv-python\\opencv-python\\opencv\\modules\\imgproc\\src\\smooth.dispatch.cpp:617: error: (-215:Assertion failed) !_src.empty() in function 'cv::GaussianBlur'\n",
11+
"output_type": "error",
12+
"traceback": [
13+
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
14+
"\u001b[1;31merror\u001b[0m Traceback (most recent call last)",
15+
"Cell \u001b[1;32mIn[3], line 7\u001b[0m\n\u001b[0;32m 4\u001b[0m img \u001b[38;5;241m=\u001b[39m cv2\u001b[38;5;241m.\u001b[39mimread(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mdatasets\u001b[39m\u001b[38;5;130;01m\\\\\u001b[39;00m\u001b[38;5;124maalesund\u001b[39m\u001b[38;5;130;01m\\\\\u001b[39;00m\u001b[38;5;124m1504200\u001b[39m\u001b[38;5;130;01m\\\\\u001b[39;00m\u001b[38;5;124m200.jpg\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;241m0\u001b[39m)\n\u001b[0;32m 6\u001b[0m \u001b[38;5;66;03m# Apply Gaussian Blur to reduce noise\u001b[39;00m\n\u001b[1;32m----> 7\u001b[0m blurred_img \u001b[38;5;241m=\u001b[39m \u001b[43mcv2\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mGaussianBlur\u001b[49m\u001b[43m(\u001b[49m\u001b[43mimg\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m5\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m5\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[0;32m 9\u001b[0m \u001b[38;5;66;03m# Apply adaptive thresholding to separate background and foreground\u001b[39;00m\n\u001b[0;32m 10\u001b[0m threshold_img \u001b[38;5;241m=\u001b[39m cv2\u001b[38;5;241m.\u001b[39madaptiveThreshold(blurred_img, \u001b[38;5;241m255\u001b[39m, cv2\u001b[38;5;241m.\u001b[39mADAPTIVE_THRESH_GAUSSIAN_C, \n\u001b[0;32m 11\u001b[0m cv2\u001b[38;5;241m.\u001b[39mTHRESH_BINARY, \u001b[38;5;241m11\u001b[39m, \u001b[38;5;241m2\u001b[39m)\n",
16+
"\u001b[1;31merror\u001b[0m: OpenCV(4.10.0) D:\\a\\opencv-python\\opencv-python\\opencv\\modules\\imgproc\\src\\smooth.dispatch.cpp:617: error: (-215:Assertion failed) !_src.empty() in function 'cv::GaussianBlur'\n"
17+
]
18+
}
19+
],
20+
"source": [
21+
"import cv2\n",
22+
"\n",
23+
"# Load the scanned map\n",
24+
"img = cv2.imread('datasets\\\\aalesund\\\\1504200\\\\200.jpg', 0)\n",
25+
"\n",
26+
"# Apply Gaussian Blur to reduce noise\n",
27+
"blurred_img = cv2.GaussianBlur(img, (5, 5), 0)\n",
28+
"\n",
29+
"# Apply adaptive thresholding to separate background and foreground\n",
30+
"threshold_img = cv2.adaptiveThreshold(blurred_img, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, \n",
31+
" cv2.THRESH_BINARY, 11, 2)\n",
32+
"\n",
33+
"# Display the processed image\n",
34+
"cv2.imshow('Processed Image', threshold_img)\n",
35+
"cv2.waitKey(0)\n",
36+
"cv2.destroyAllWindows()\n"
37+
]
38+
}
39+
],
40+
"metadata": {
41+
"kernelspec": {
42+
"display_name": "Python 3",
43+
"language": "python",
44+
"name": "python3"
45+
},
46+
"language_info": {
47+
"codemirror_mode": {
48+
"name": "ipython",
49+
"version": 3
50+
},
51+
"file_extension": ".py",
52+
"mimetype": "text/x-python",
53+
"name": "python",
54+
"nbconvert_exporter": "python",
55+
"pygments_lexer": "ipython3",
56+
"version": "3.12.1"
57+
}
58+
},
59+
"nbformat": 4,
60+
"nbformat_minor": 2
61+
}

0 commit comments

Comments
 (0)