Initial commit
new file: Copy_of_Exz_with_hamamatsu.m new file: Exz_mod.m new file: Exz_with_hamamatsu.m new file: GS.m new file: MRAF.m new file: MRAF_8bit.bmp new file: PSF of spherical aberration/Exz.m new file: PSF of spherical aberration/Thumbs.db new file: PSF of spherical aberration/josaa-12-10-2136.pdf new file: PSF of spherical aberration/josaa-12-2-325.pdf new file: PSF of spherical aberration/main.m new file: "PSF of spherical aberration/\351\207\215\350\246\201psf\346\226\207\347\214\256.pdf" new file: Spherical_aberration_SiminCao.m new file: gen_m.m new file: gen_rectangle.m new file: hamamatsu.m new file: m.tif new file: m2.tif new file: photo/50-30.BMP new file: photo/8bit_50-30.BMP new file: photo/8bit_ellipse.BMP new file: photo/convert_8bit.exe new file: photo/ellipse.BMP new file: rect_MRAF_SiminCao.m new file: rectangle.tif new file: size/.vscode/settings.json new file: size/black_c_20THSize_4f_1.064lamda.bmp new file: size/black_c_30THSize_4f_61.064lamda.bmp new file: size/black_output.bmp new file: size/black_rect_30THSize_4f_1.064lamda.bmp new file: size/black_rect_30THSize_4f_6_1.064lamda.bmp new file: size/c_20THSize_4f_1.064lamda.bmp new file: size/c_20THSize_4f_1.064lamda_resize.bmp new file: size/c_30THSize_4f_61.064lamda.bmp new file: size/c_30THSize_4f_61.064lamda_resize.bmp new file: size/noisy_output.bmp new file: size/output.bmp new file: size/rect_30THSize_4f_1.064lamda.bmp new file: size/rect_30THSize_4f_1.064lamda_resize.bmp new file: size/rect_30THSize_4f_6_1.064lamda.bmp new file: size/rect_30THSize_4f_6_1.064lamda_resize.bmp new file: size/resize_4.7z new file: size/resize_black.7z new file: size/size copy.py new file: size/size.py new file: size/wave.7z new file: sp.m new file: to8bit.m new file: trans_8bit.zip new file: wavef/A.bmp new file: wavef/B_linear.bmp new file: wavef/PHA SID230828-2003.csv new file: wavef/PHA_bilinear_1280_1024.csv new file: wavef/PHA_bilinear_reversal.csv new file: wavef/PHA_output_1280_1024.csv new file: wavef/Untitled-1.py new file: wavef/filled.bmp new file: wavef/from PIL import Image.py new file: wavef/matrix_filled.csv new file: wavef/output.bmp new file: wavef/output.csv new file: wavef/output2.bmp new file: wavef/pha_wavef copy.py new file: wavef/pha_wavef.py new file: wavef/pha_wavef_step.py new file: wavef/wavef.zip new file: wavef/xy_values.csv new file: "wavef/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/matrix.csv" new file: "wavef/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/matrix_filled.csv"
6
size/.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"[python]": {
|
||||
"editor.defaultFormatter": "ms-python.autopep8"
|
||||
},
|
||||
"python.formatting.provider": "none"
|
||||
}
|
||||
BIN
size/black_c_20THSize_4f_1.064lamda.bmp
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
size/black_c_30THSize_4f_61.064lamda.bmp
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
size/black_output.bmp
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
size/black_rect_30THSize_4f_1.064lamda.bmp
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
size/black_rect_30THSize_4f_6_1.064lamda.bmp
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
size/c_20THSize_4f_1.064lamda.bmp
Normal file
|
After Width: | Height: | Size: 729 KiB |
BIN
size/c_20THSize_4f_1.064lamda_resize.bmp
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
size/c_30THSize_4f_61.064lamda.bmp
Normal file
|
After Width: | Height: | Size: 729 KiB |
BIN
size/c_30THSize_4f_61.064lamda_resize.bmp
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
size/noisy_output.bmp
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
size/output.bmp
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
size/rect_30THSize_4f_1.064lamda.bmp
Normal file
|
After Width: | Height: | Size: 729 KiB |
BIN
size/rect_30THSize_4f_1.064lamda_resize.bmp
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
size/rect_30THSize_4f_6_1.064lamda.bmp
Normal file
|
After Width: | Height: | Size: 729 KiB |
BIN
size/rect_30THSize_4f_6_1.064lamda_resize.bmp
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
size/resize_4.7z
Normal file
BIN
size/resize_black.7z
Normal file
56
size/size copy.py
Normal file
@@ -0,0 +1,56 @@
|
||||
from PIL import Image
|
||||
import numpy as np
|
||||
|
||||
# 读取原始图像
|
||||
path = "output.bmp"
|
||||
original_image = Image.open(path)
|
||||
original_width, original_height = original_image.size
|
||||
|
||||
|
||||
# 定义裁剪后的新高度
|
||||
new_height = original_height - 400 # 上下各裁剪200像素
|
||||
|
||||
# 裁剪图像,上下各裁剪200像素
|
||||
# 左上角坐标为(0, 200),右下角坐标为(width, height-200)
|
||||
cropped_image = original_image.crop(
|
||||
(0, 200, original_width, original_height-200))
|
||||
cropped_image.show()
|
||||
|
||||
# 创建目标图像(1280x1024像素,灰度模式)
|
||||
target_width, target_height = 1280, 1024
|
||||
target_image = Image.new("L", (target_width, target_height), color=0)
|
||||
|
||||
# 计算图像放置位置
|
||||
x_offset = (target_width - original_width) // 2
|
||||
y_offset = (target_height - new_height) // 2
|
||||
|
||||
# 将原始图像放置在目标图像中央
|
||||
target_image.paste(cropped_image, (x_offset, y_offset))
|
||||
|
||||
# 将目标图像转换为NumPy数组
|
||||
target_array = np.array(target_image)
|
||||
|
||||
# # 在周围填充随机噪声
|
||||
# noise_level = 256 # 随机噪声的灰度级别
|
||||
# noise = np.random.randint(
|
||||
# 0, noise_level, (target_height, target_width)).astype(np.uint8)
|
||||
# target_array = np.where(target_array == 0, noise, target_array)
|
||||
|
||||
# # 创建包含噪声的新图像
|
||||
# noisy_image = Image.fromarray(target_array.astype(np.uint8))
|
||||
|
||||
# # 保存为位图(BMP)图像
|
||||
# noisy_image.save("black_"+path)
|
||||
|
||||
# 创建黑色填充
|
||||
black_color = 0 # 黑色像素值为0
|
||||
target_array[:y_offset, :] = black_color # 上方填充
|
||||
target_array[y_offset + original_height:, :] = black_color # 下方填充
|
||||
target_array[:, :x_offset] = black_color # 左侧填充
|
||||
target_array[:, x_offset + original_width:] = black_color # 右侧填充
|
||||
|
||||
# 创建包含黑色填充的新图像
|
||||
padded_image = Image.fromarray(target_array)
|
||||
|
||||
# 保存为位图(BMP)图像
|
||||
padded_image.save("black_"+path)
|
||||
46
size/size.py
Normal file
@@ -0,0 +1,46 @@
|
||||
from PIL import Image
|
||||
import numpy as np
|
||||
|
||||
# 读取原始图像
|
||||
path = "c_30THSize_4f_61.064lamda.bmp"
|
||||
original_image = Image.open(path)
|
||||
original_width, original_height = original_image.size
|
||||
|
||||
# 创建目标图像(1280x1024像素,灰度模式)
|
||||
target_width, target_height = 1280, 1024
|
||||
target_image = Image.new("L", (target_width, target_height), color=0)
|
||||
|
||||
# 计算图像放置位置
|
||||
x_offset = (target_width - original_width) // 2
|
||||
y_offset = (target_height - original_height) // 2
|
||||
|
||||
# 将原始图像放置在目标图像中央
|
||||
target_image.paste(original_image, (x_offset, y_offset))
|
||||
|
||||
# 将目标图像转换为NumPy数组
|
||||
target_array = np.array(target_image)
|
||||
|
||||
# # 在周围填充随机噪声
|
||||
# noise_level = 256 # 随机噪声的灰度级别
|
||||
# noise = np.random.randint(
|
||||
# 0, noise_level, (target_height, target_width)).astype(np.uint8)
|
||||
# target_array = np.where(target_array == 0, noise, target_array)
|
||||
|
||||
# # 创建包含噪声的新图像
|
||||
# noisy_image = Image.fromarray(target_array.astype(np.uint8))
|
||||
|
||||
# # 保存为位图(BMP)图像
|
||||
# noisy_image.save("black_"+path)
|
||||
|
||||
# 创建黑色填充
|
||||
black_color = 0 # 黑色像素值为0
|
||||
target_array[:y_offset, :] = black_color # 上方填充
|
||||
target_array[y_offset + original_height:, :] = black_color # 下方填充
|
||||
target_array[:, :x_offset] = black_color # 左侧填充
|
||||
target_array[:, x_offset + original_width:] = black_color # 右侧填充
|
||||
|
||||
# 创建包含黑色填充的新图像
|
||||
padded_image = Image.fromarray(target_array)
|
||||
|
||||
# 保存为位图(BMP)图像
|
||||
padded_image.save("black_"+path)
|
||||