@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
@ -0,0 +1 @@
|
||||
图像风格迁移.py
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/output/time.txt" charset="GBK" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,6 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8" project-jdk-type="Python SDK" />
|
||||
<component name="PythonCompatibilityInspectionAdvertiser">
|
||||
<option name="version" value="3" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/数字图像处理.iml" filepath="$PROJECT_DIR$/.idea/数字图像处理.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
@ -0,0 +1,55 @@
|
||||
import sys
|
||||
|
||||
import numpy as np
|
||||
import cv2
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
|
||||
def judge(w0, h0, w, h):
|
||||
a = img[h0: h0 + h, w0: w0 + w]
|
||||
ave = np.mean(a)
|
||||
std = np.std(a, ddof=1)
|
||||
count = 0
|
||||
total = 0
|
||||
for i in range(w0, w0 + w):
|
||||
for j in range(h0, h0 + h):
|
||||
if abs(img[j, i] - ave) < 1 * std:
|
||||
count += 1
|
||||
total += 1
|
||||
if (count / total) < 0.95:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
def Merge(w0, h0, w, h):
|
||||
for i in range(w0, w0 + w):
|
||||
for j in range(h0, h0 + h):
|
||||
if img[j, i] > 125:
|
||||
img[j, i] = 255
|
||||
else:
|
||||
img[j, i] = 0
|
||||
|
||||
|
||||
def function(w0, h0, w, h):
|
||||
if judge(w0, h0, w, h) and (min(w, h) > 5):
|
||||
function(w0, h0, int(w / 2), int(h / 2))
|
||||
function(w0 + int(w / 2), h0, int(w / 2), int(h / 2))
|
||||
function(w0, h0 + int(h / 2), int(w / 2), int(h / 2))
|
||||
function(w0 + int(w / 2), h0 + int(h / 2), int(w / 2), int(h / 2))
|
||||
else:
|
||||
draw(w0, h0, w, h)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
img = cv2.imread(sys.argv[1], 0)
|
||||
img_input = cv2.imread(sys.argv[1], 0)#备份
|
||||
|
||||
height, width = img.shape
|
||||
|
||||
function(0, 0, width, height)
|
||||
|
||||
cv2.imwrite("./output/split_and_merge.jpg",img)
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 818 KiB |
After Width: | Height: | Size: 718 KiB |
After Width: | Height: | Size: 414 KiB |
After Width: | Height: | Size: 312 KiB |
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 9.2 MiB |
After Width: | Height: | Size: 1.5 MiB |
After Width: | Height: | Size: 48 KiB |
After Width: | Height: | Size: 5.0 MiB |
After Width: | Height: | Size: 570 KiB |
After Width: | Height: | Size: 54 KiB |
After Width: | Height: | Size: 640 KiB |
After Width: | Height: | Size: 412 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 507 KiB |
After Width: | Height: | Size: 998 KiB |
After Width: | Height: | Size: 274 KiB |
After Width: | Height: | Size: 400 KiB |
After Width: | Height: | Size: 123 KiB |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 400 KiB |
After Width: | Height: | Size: 420 KiB |
After Width: | Height: | Size: 701 KiB |
After Width: | Height: | Size: 48 KiB |
After Width: | Height: | Size: 933 KiB |
After Width: | Height: | Size: 1.4 MiB |
After Width: | Height: | Size: 2.3 MiB |
After Width: | Height: | Size: 1.4 MiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 68 KiB |
After Width: | Height: | Size: 60 KiB |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 1.3 MiB |
After Width: | Height: | Size: 205 KiB |
After Width: | Height: | Size: 416 KiB |
After Width: | Height: | Size: 418 KiB |
After Width: | Height: | Size: 951 KiB |
After Width: | Height: | Size: 1.4 MiB |
After Width: | Height: | Size: 510 KiB |
After Width: | Height: | Size: 64 KiB |
After Width: | Height: | Size: 159 KiB |
After Width: | Height: | Size: 4.3 MiB |
After Width: | Height: | Size: 2.9 MiB |
After Width: | Height: | Size: 57 KiB |
After Width: | Height: | Size: 597 KiB |
@ -0,0 +1 @@
|
||||
识别出来的时间为: 11:20:40
|
After Width: | Height: | Size: 1.5 MiB |
After Width: | Height: | Size: 1.4 MiB |
After Width: | Height: | Size: 970 KiB |
After Width: | Height: | Size: 53 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 263 KiB |
After Width: | Height: | Size: 739 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 112 KiB |
After Width: | Height: | Size: 246 KiB |
After Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 431 KiB |
After Width: | Height: | Size: 1.1 MiB |
After Width: | Height: | Size: 233 KiB |
After Width: | Height: | Size: 864 KiB |
After Width: | Height: | Size: 775 KiB |
After Width: | Height: | Size: 228 KiB |
After Width: | Height: | Size: 242 KiB |