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
Abbreviation | Description | |
---|---|---|
ldpi | Low-density screens ~120dpi. (actually ppi) | |
mdpi | Medium-density screens ~160dpi. (actually ppi) | |
hdpi | High-density screens ~240dpi. (... ppi) | |
xhdpi | Extra-high-density screens ~320dpi. (... ppi) | |
xxhdpi | Extra-extra-high-density screens ~480dpi. (...) | |
xxxhdpi | Extra-extra-extra-high-density (launcher icon only) ~640dpi. | |
tvdpi | Screens between mdpi and hdpi; ~213dpi. Not a primary density group. |
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 | |
import numpy as np | |
image = cv2.imread('images_09_03/Lot1_RT.jpeg', 1) | |
img_gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) | |
# apply adaptive gaussian thresholding | |
thresh = cv2.adaptiveThreshold(img_gray,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY,11,2) | |
cv2.imshow('primary', image) | |
cv2.imshow('gray', img_gray) |
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 | |
import numpy as np | |
# https://learnopencv.com/read-display-and-write-an-image-using-opencv/ | |
# https://learnopencv.com/contour-detection-using-opencv-python-c/ | |
image = cv2.imread('foot2.jpeg', 1) # 1 for color, 0 for greyscale | |
# stored as <class 'numpy.ndarray'> | |
img_gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) | |
# apply binary thresholding |
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 | |
image = cv2.imread('foot2.jpeg', 1) # 1 for color, 0 for greyscale | |
img_gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) | |
# ******** # | |
# Dilation # | |
# ******** # | |
from skimage.morphology import (erosion, dilation) | |
from skimage.morphology import disk | |
footprint = disk(1) |
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 socket | |
import socket | |
import time | |
HOST = 'data.pr4e.org' | |
PORT = 80 | |
mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
mysock.connect((HOST, PORT)) | |
mysock.sendall(b'GET http://data.pr4e.org/cover3.jpg HTTP/1.0\r\n\r\n') | |
count = 0 |