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
## This reader is code written for the personal use of @IngIeoAnd0Spare. | |
## Unauthorized modification and use without permission is prohibited. |
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 json | |
import os | |
import numpy as np | |
from skimage import measure | |
from shapely.geometry import Polygon, MultiPolygon | |
from PIL import Image | |
from tqdm import tqdm | |
# input your segmentation image dir | |
context_path = "" |
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 matplotlib.pyplot as plt | |
import matplotlib as mpl | |
import matplotlib.font_manager as fm | |
%matplotlib inline | |
%config InlineBackend.figure_format = 'retina' | |
!apt -qq -y install fonts-nanum | |
fontpath = '/usr/share/fonts/truetype/nanum/NanumBarunGothic.ttf' |
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
public void drawTestLine(XDOInfo xdoInfo){ | |
float radiusRatio = 10000 / (float)6378137; | |
// convert : -y , z, -x | |
double min_x = (double)xdoInfo.boundMinY * -1 * radiusRatio; | |
double min_y = (double)xdoInfo.boundMinZ * radiusRatio; | |
double min_z = (double)xdoInfo.boundMinX * -1 * radiusRatio; | |
double max_x = (double)xdoInfo.boundMaxY * -1 * radiusRatio; | |
double max_y = (double)xdoInfo.boundMaxZ * radiusRatio; |
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
## url 접속을 위한 실습 | |
import urllib | |
import json | |
import folium | |
geo_url_context = "http://api.vworld.kr/req/address?service=address&request=getcoord&version=2.0" | |
## url 주기 |
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
using System.IO; | |
// list init for file info dto | |
List<TargetFileInfoDTO> fileInfoList = new List<TargetFileInfoDTO>(); | |
// root file path (dds, jpg file root path) | |
string ROOT_FILE_PATH = @"FILE_PATH"; | |
// search option dict |
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
private (double, double) convertWsg84Coordinate(double x, double y, double z) | |
{ | |
double lat = Math.Asin(z / Math.Sqrt(x * x + y * y + z * z)) * (180 / Math.PI); | |
double lot = -Math.Atan2(y, x) * (180 / Math.PI); | |
return (lat, lot); | |
} | |
//wsg84 coordinate | |
public (string, string) calculateTileIdLatLot(double lat, double lot, int level) | |
{ |
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 cv2 | |
def transBg(self, img): | |
tmp = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) | |
_,alpha = cv2.threshold(tmp,0,255,cv2.THRESH_BINARY) | |
b, g, r = cv2.split(img) | |
rgba = [b,g,r, alpha] | |
dst = cv2.merge(rgba,4) | |
return dst |
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 os | |
import base64 | |
def main(): | |
startSvgTag = """<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" | |
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> | |
<svg version="1.1" | |
xmlns="http://www.w3.org/2000/svg" | |
xmlns:xlink="http://www.w3.org/1999/xlink" |
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
## file metadata module | |
import os.path | |
import shutil | |
from os import listdir | |
from os.path import isfile, join | |
BYNARY_FILE_PATH = 'E:\\map_tile_checker\\train_data' | |
TEST_FILE_PATH = 'E:\\map_tile_checker\\test_data' | |
LABEL_ARRAY = ['dispersion', 'line', 'square', 'unspecified_shapes'] |
NewerOlder