第4章 Python 数字图像处理(DIP) - 频率域滤波12 - 选择性滤波 - 带阻

目录

    • 选择性滤波
      • 带阻滤波器和带通滤波器
      • 陷波滤波器

选择性滤波

处理特定的频带的滤波器称为频带滤波器

  • 带阻滤波器

    • 若某个频带中的频率被滤除
  • 带通滤波器

    • 若某个频带中的频率被通过

处理小频率矩形区域的滤波器称为陷波滤波器

  • 陷波带阻滤波器

    • 若某个频带中的频率被拒绝
  • 陷波带通滤波器

    • 若某个频带中的频率被通过

带阻滤波器和带通滤波器

频率域中的带通和带阻滤波器传递函数,可通过组合低通和高通滤波器传递函数来构建。然后高通滤波器也是由低通滤波器推导而来,所以说低通滤波器传递函数是形成高通、带阻、带通滤波器传递函数的基础。

可以由带阻滤波器传递函数获得带通滤波器传递函数

HBP(u,v)=1−HBR(u,v)(4.148)H_{BP}(u, v) = 1 - H_{BR}(u, v) \tag{4.148}HBP(u,v)=1HBR(u,v)(4.148)

高斯带阻滤波器传递函数

H(u,v)=1−e−[(D(u,v)−C0)2W2](4.149)H(u, v) = 1 - e^{-\big[\frac{(D(u, v) - C_0)^2}{W^2} \ \ \big]} \tag{4.149}H(u,v)=1e[W2(D(u,v)C0)2  ](4.149)

低于C0C_0C0时,该函数表现为一个低通高斯函数;等于C0C_0C0时,始终为0;高于C0C_0C0时,表现为一个高通高斯函数。但该函数在原点关不总是1。可以修改为:

H(u,v)=1−e−[D2(u,v)−C02D(u,v)W]2(4.150)H(u, v) = 1 - e^{-\big[\frac{D^2(u, v) - C_0^2}{D(u, v) W} \ \ \big]^2} \tag{4.150}H(u,v)=1e[D(u,v)WD2(u,v)C02  ]2(4.150)

巴特沃斯带阻滤波器传递函数

H(u,v)=11+[D(u,v)WD2(u,v)−C02]2nH(u, v) = \frac{1}{1 + \bigg[\frac{D(u, v) W}{D^2(u, v) - C_0^2} \bigg]^{2n}}H(u,v)=1+[D2(u,v)C02D(u,v)W]2n1

def idea_band_resistant_filter(source, center, radius=10, w=5):"""create idea band resistant filter param: source: input, source imageparam: center: input, the center of the filter, where is the lowest value, (0, 0) is top left corner, source.shape[:2] is center of the source imageparam: radius: input, int, the radius of circle of the band pass filter, default is 10param: w:      input, int, the width of the band of the filter, default is 5return a [0, 1] value band resistant filter"""    M, N = source.shape[1], source.shape[0]u = np.arange(M)v = np.arange(N)u, v = np.meshgrid(u, v)D = np.sqrt((u - center[1]//2)**2 + (v - center[0]//2)**2)D0 = radiushalf_w = w / 2kernel_1 = D.copy()assert radius > half_w, "radius must greater than W/2"#==================piecewise================kernel = np.piecewise(kernel_1, [kernel_1 <= D0 + half_w, kernel_1 <= D0 - half_w], [1, 0])kernel = 1 - kernel#==================where==================
#     kernel = np.where(kernel_1 > D0 + half_w, 1, kernel_1)
#     kernel = np.where(kernel <= D0 - half_w, 1, kernel)
#     kernel = np.where(kernel != 1, 0, kernel)# =================公式法================
#     kernel_2 = D.copy()
#     kernel_1[D >  D0 + half_w] = 1
#     kernel_1[D <= D0 + half_w] = 0
#     kernel_2[D > D0 - half_w] = 1
#     kernel_2[D <= D0 - half_w] = 0
#     kernel = kernel_1 - kernel_2 return kernel
def gauss_band_resistant_149(source, center, radius=10, w=5):"""create gaussian band resistant filter, equation 4.149param: source: input, source imageparam: center: input, the center of the filter, where is the lowest value, (0, 0) is top left corner, source.shape[:2] is center of the source imageparam: radius: input, int, the radius of circle of the band pass filter, default is 10param: w:      input, int, the width of the band of the filter, default is 5return a [0, 1] value gaussian band resistant filter"""    N, M = source.shape[:2]u = np.arange(M)v = np.arange(N)u, v = np.meshgrid(u, v)D = np.sqrt((u - center[1]//2)**2 + (v - center[0]//2)**2)C0 = radiuskernel = 1 - np.exp(-(D - C0)**2 / (w**2))return kernel
def gauss_band_resistant_filter(source, center, radius=10, w=5):"""create gaussian band resistant filter, equation 4.150param: source: input, source imageparam: center: input, the center of the filter, where is the lowest value, (0, 0) is top left corner, source.shape[:2] is center of the source imageparam: radius: input, int, the radius of circle of the band pass filter, default is 10param: w:      input, int, the width of the band of the filter, default is 5return a [0, 1] value gaussian band resistant filter"""    N, M = source.shape[:2]u = np.arange(M)v = np.arange(N)u, v = np.meshgrid(u, v)D = np.sqrt((u - center[1]//2)**2 + (v - center[0]//2)**2)C0 = radiuskernel = 1 - np.exp(-((D**2 - C0**2) / (D * w))**2)return kernel
def butterworth_band_resistant_filter(source, center, radius=10, w=5, n=1):"""create butterworth band resistant filter, equation 4.150param: source: input, source imageparam: center: input, the center of the filter, where is the lowest value, (0, 0) is top left corner, source.shape[:2] is center of the source imageparam: radius: input, int, the radius of circle of the band pass filter, default is 10param: w:      input, int, the width of the band of the filter, default is 5param: n:      input, int, order of the butter worth fuction, return a [0, 1] value butterworth band resistant filter"""    N, M = source.shape[:2]u = np.arange(M)v = np.arange(N)u, v = np.meshgrid(u, v)D = np.sqrt((u - center[1]//2)**2 + (v - center[0]//2)**2)C0 = radiustemp = (D * w) / (D**2 - C0**2)kernel = 1 / (1 + temp ** (2*n)) return kernel
# 带阻滤波器传递函数
img_temp = np.zeros([1000, 1000])
C0 = 100# 1理想带阻滤波器
IBRF = idea_band_resistant_filter(img_temp, img_temp.shape, radius=C0, w=100)
hx_i = IBRF[500:, 500].flatten()# 2由高斯低通和高斯高通滤波器函数相加形成的带阻传递函数,最小值不是0,并且与C0不重合
GHPF = gauss_high_pass_filter(img_temp, img_temp.shape, radius=C0)
GLPF = gauss_low_pass_filter(img_temp, img_temp.shape, radius=C0/2)
GLPF = GHPF + GLPF
hx_g = GLPF[500:, 500].flatten()# 3由式4.149得到的,原点处的值不是1
GBRF_149 = gauss_band_resistant_149(img_temp, img_temp.shape, radius=C0, w=100)
hx_g149 = GBRF_149[500:, 500].flatten()# 4由式4.150得到的
GBRF = gauss_band_resistant_filter(img_temp, img_temp.shape, radius=C0, w=100)
hx_gbrf = GBRF[500:, 500].flatten()fig = plt.figure(figsize=(16, 3))
ax_1 = fig.add_subplot(1, 4, 1)
ax_1.plot(hx_i), ax_1.set_yticks([0, 1.0]), ax_1.set_xticks([100, 500]), ax_1.set_ylim(0, 1.1), ax_1.set_xlim(0, 500)ax_2 = fig.add_subplot(1, 4, 2)
ax_2.plot(hx_g), ax_2.set_yticks([0.75, 1.0]), ax_2.set_xticks([100, 500]), ax_2.set_ylim(0.75, 1.1), ax_2.set_xlim(0, 500)ax_3 = fig.add_subplot(1, 4, 3)
ax_3.plot(hx_g149), ax_3.set_yticks([0, 1.0]), ax_3.set_xticks([100, 500]), ax_3.set_ylim(0, 1.1), ax_3.set_xlim(0, 500)ax_3 = fig.add_subplot(1, 4, 4)
ax_3.plot(hx_gbrf), ax_3.set_yticks([0, 1.0]), ax_3.set_xticks([100, 500]), ax_3.set_ylim(0, 1.1), ax_3.set_xlim(0, 500)plt.tight_layout()
plt.show()

在这里插入图片描述

# 理想、高斯、巴特沃斯带阻传递函数
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import cmimg_temp = np.zeros([512, 512])
center = img_temp.shaperadius = 128
w = 60
IBRF = idea_band_resistant_filter(img_temp, img_temp.shape, radius=radius, w=w)
GBFR = gauss_band_resistant_filter(img_temp, img_temp.shape, radius=radius, w=w)
BBRF = butterworth_band_resistant_filter(img_temp, img_temp.shape, radius=radius, w=w, n=1)filters = ['IBRF', 'GBFR', 'BBRF']
# 用来绘制3D图
M, N = img_temp.shape[1], img_temp.shape[0]
u = np.arange(M)
v = np.arange(N)
u, v = np.meshgrid(u, v)fig = plt.figure(figsize=(15, 15))for i in range(len(filters)):ax_1 = fig.add_subplot(3, 3, i*3 + 1, projection='3d')plot_3d(ax_1, u, v, eval(filters[i]))ax_2 = fig.add_subplot(3, 3, i*3 + 2)ax_2.imshow(eval(filters[i]),'gray'), ax_2.set_title(filters[i]), ax_2.set_xticks([]), ax_2.set_yticks([])h_1 = eval(filters[i])[img_temp.shape[0]//2:, img_temp.shape[1]//2]ax_3 = fig.add_subplot(3, 3, i*3 + 3)ax_3.plot(h_1), ax_3.set_xticks([0, radius//2]), ax_3.set_yticks([0, 1]), ax_3.set_xlim([0, 320]), ax_3.set_ylim([0, 1.2])
plt.tight_layout()
plt.show()

在这里插入图片描述

陷波滤波器

陷波滤波器是最有用的选择性滤波

零相移滤波器必须关于原点(频率矩形中心)对称,中以为(u0,v0)(u_0, v_0)(u0,v0)的陷波滤波器传递函数在(−u0,−v0)(-u_0, -v_0)(u0,v0)位置必须有一个对应的陷波。陷波带阻滤波器传递函数可用中心被平移到陷波滤波中心的高通滤波器函数的乘积来产生

HNR(u,v)=∏k=1QHk(u,v)H−k(u,v)(4.151)H_{NR}(u, v) = \prod_{k=1}^Q H_k(u, v) H_{-k}(u, v) \tag{4.151}HNR(u,v)=k=1QHk(u,v)Hk(u,v)(4.151)

每个滤波器的距离计算公式为
Dk(u,v)=[(u−M/2−uk)2+(v−N/2−vk)2]1/2(4.152)D_{k}(u, v) = \big[(u - M / 2 - u_{k})^2 + (v - N / 2 - v_{k})^2 \big]^{1/2} \tag{4.152}Dk(u,v)=[(uM/2uk)2+(vN/2vk)2]1/2(4.152)
D−k(u,v)=[(u−M/2+uk)2+(v−N/2+vk)2]1/2(4.153)D_{-k}(u, v) = \big[(u - M / 2 + u_{k})^2 + (v - N / 2 + v_{k})^2 \big]^{1/2} \tag{4.153}Dk(u,v)=[(uM/2+uk)2+(vN/2+vk)2]1/2(4.153)

nnn阶巴特沃斯带阴滤波器
HNR(u,v)=∏k=13[11+[D0k/Dk(u,v)]n][11+[D0k/D−k(u,v)]n](4.154)H_{NR}(u, v) = \prod_{k=1}^3\bigg[ \frac{1}{1 + [D_{0k}/D_{k}(u,v)]^n} \bigg] \bigg[ \frac{1}{1 + [D_{0k}/D_{-k}(u,v)]^n} \bigg] \tag{4.154}HNR(u,v)=k=13[1+[D0k/Dk(u,v)]n1][1+[D0k/Dk(u,v)]n1](4.154)

常数D0kD_{0k}D0k对每对陷波是相同的,但对不同的陷波对,它可以不同。

陷波带通滤波器传递函数可用陷波带阻滤波器得到
HNP(u,v)=1−HNR(u,v)(4.155)H_{NP}(u, v) = 1 - H_{NR}(u, v) \tag{4.155}HNP(u,v)=1HNR(u,v)(4.155)

def butterworth_notch_resistant_filter(img, uk, vk, radius=10, n=1):"""create butterworth notch resistant filter, equation 4.155param: img:    input, source imageparam: uk:     input, int, center of the heightparam: vk:     input, int, center of the widthparam: radius: input, int, the radius of circle of the band pass filter, default is 10param: w:      input, int, the width of the band of the filter, default is 5param: n:      input, int, order of the butter worth fuction, return a [0, 1] value butterworth band resistant filter"""   M, N = img.shape[1], img.shape[0]u = np.arange(M)v = np.arange(N)u, v = np.meshgrid(u, v)DK = np.sqrt((u - M//2 - uk)**2 + (v - N//2 - vk)**2)D_K = np.sqrt((u - M//2 + uk)**2 + (v - N//2 + vk)**2)D0 = radiuskernel = (1 / (1 + (D0 / (DK+1e-5))**n)) * (1 / (1 + (D0 / (D_K+1e-5))**n))return kernel
# 巴特沃斯带阻陷波滤波器 BNRF
img_temp = np.zeros([512, 512])
BNF_1 = butterworth_notch_resistant_filter(img_temp, radius=10, uk=30, vk=40, n=3)
BNF_2 = butterworth_notch_resistant_filter(img_temp, radius=10, uk=30, vk=80, n=3)
BNF_3 = butterworth_notch_resistant_filter(img_temp, radius=10, uk=-30, vk=80, n=3)plt.figure(figsize=(16, 12))
plt.subplot(141), plt.imshow(BNF_1, 'gray'), plt.title('BNF_1')
plt.subplot(142), plt.imshow(BNF_2, 'gray'), plt.title('BNF_2')
plt.subplot(143), plt.imshow(BNF_3, 'gray'), plt.title('BNF_3')BNF_dst = BNF_1 * BNF_2 * BNF_3plt.subplot(144), plt.imshow(BNF_dst, 'gray'), plt.title('BNF_dst')plt.tight_layout()
plt.show()

在这里插入图片描述

# 使用陷波滤波删除数字化印刷图像中的莫尔模式
img_ori = cv2.imread("DIP_Figures/DIP3E_Original_Images_CH04/Fig0464(a)(car_75DPI_Moire).tif", 0)M, N = img_ori.shape[:2]# 填充
fp = pad_image(img_ori, mode='reflect')
# 中心化
fp_cen = centralized_2d(fp)
# 正变换
fft = np.fft.fft2(fp_cen)# 频谱
spectrum = spectrum_fft(fft)
# 对频谱做对数变换
spectrum_log = np.log(1 + spectrum)# 巴特沃斯陷波带阻滤波器
BNRF_1 = butterworth_notch_resistant_filter(fp, radius=9, uk=60, vk=80, n=4)
BNRF_2 = butterworth_notch_resistant_filter(fp, radius=9, uk=-60, vk=80, n=4)
BNRF_3 = butterworth_notch_resistant_filter(fp, radius=9, uk=60, vk=160, n=4)
BNRF_4 = butterworth_notch_resistant_filter(fp, radius=9, uk=-60, vk=160, n=4)BNRF = BNRF_1 * BNRF_2 * BNRF_3 * BNRF_4 fft_filter = fft * BNRF# 滤波后的频谱
spectrum_filter = spectrum_fft(fft_filter)
spectrum_filter_log = np.log(1 + spectrum_filter)# 傅里叶反变换
ifft = np.fft.ifft2(fft_filter)# 去中心化反变换的图像,并取左上角的图像
img_new = centralized_2d(ifft.real)[:M, :N]
img_new = np.clip(img_new, 0, img_new.max())
img_new = np.uint8(normalize(img_new) * 255)fig = plt.figure(figsize=(10, 14))ax_1 = fig.add_subplot(2, 2, 1)
ax_1.imshow(img_ori, 'gray'), ax_1.set_title('Original'), ax_1.set_xticks([]), ax_1.set_yticks([])ax_2 = fig.add_subplot(2, 2, 2)
ax_2.imshow(spectrum_log, 'gray'), ax_2.set_title('Spectrum Before Filter'), ax_2.set_xticks([]), ax_2.set_yticks([])ax_3 = fig.add_subplot(2, 2, 3)
ax_3.imshow(spectrum_filter_log, 'gray'), ax_3.set_title('Spectrum After Filter'), ax_3.set_xticks([]), ax_3.set_yticks([])ax_4 = fig.add_subplot(2, 2, 4)
ax_4.imshow(img_new, 'gray'), ax_4.set_title('Denoising'), ax_4.set_xticks([]), ax_4.set_yticks([])plt.tight_layout()
plt.show()

在这里插入图片描述

使用陷波滤波去除周期干扰

def narrow_notch_filter(img, w=5, opening=10, vertical=True, horizontal=False):"""create narrow notch resistant filter, using opencvparam: img:        input, source imageparam: w:          input, int, width of the resistant, value is 0, default is 5param: opening:    input, int, opening of the resistant, value is 1, default is 10param: vertical:   input, boolean, whether vertical or not, default is "True"param: horizontal: input, boolean, whether horizontal or not, default is "False"return a [0, 1] value butterworth band resistant filter"""      dst = np.ones(img.shape, dtype=np.uint8) * 255c_height, c_width = img.shape[0] // 2, img.shape[1] // 2if vertical:cv2.rectangle(dst, ((img.shape[1] - w)//2, 0), (c_width + w//2, img.shape[0]), (0), -1)cv2.rectangle(dst, (0, (img.shape[0] - opening)//2), (img.shape[1], c_height + opening//2), (255), -1)horizontal_ = np.ones(img.shape, dtype=np.uint8) * 255if horizontal:        cv2.rectangle(horizontal_, (0, (img.shape[0] - w)//2), (img.shape[1], c_height + w//2), (0), -1)cv2.rectangle(horizontal_, ((img.shape[1] - opening)//2, 0), (c_width + opening//2, img.shape[0]), (255), -1)dst = dst * horizontal_dst = dst / dst.max()return dst
def narrow_notch_filter(img, w=5, opening=10, vertical=True, horizontal=False):"""create narrow notch resistant filterparam: img:        input, source imageparam: w:          input, int, width of the resistant, value is 0, default is 5param: opening:    input, int, opening of the resistant, value is 1, default is 10param: vertical:   input, boolean, whether vertical or not, default is "True"param: horizontal: input, boolean, whether horizontal or not, default is "False"return a [0, 1] value butterworth band resistant filter"""       assert w > 0, "W must greater than 0"w_half = w//2opening_half = opening//2img_temp = np.ones(img.shape[:2])N, M = img_temp.shape[:]img_vertical = img_temp.copy()img_horizontal = img_temp.copy()if horizontal:img_horizontal[M//2 - w_half:M//2 + w - w_half, :] = 0img_horizontal[:, N//2 - opening_half:N//2 + opening - opening_half] = 1if vertical:img_vertical[:, N//2 - w_half:N//2 + w - w_half] = 0img_vertical[M//2 - opening_half:M//2 + opening - opening_half, :] = 1img_dst = img_horizontal * img_verticalreturn img_dst
# NNF narrow_notch_filter
img_temp = np.zeros([512, 512])
NNF = narrow_notch_filter(img_temp, 5, 20, vertical=True, horizontal=False)
plt.figure(figsize=(10, 8))
plt.imshow(NNF,'gray'),plt.title('NNF')
plt.show()

在这里插入图片描述

# 使用陷波滤波去除周期干扰
img_ori = cv2.imread("DIP_Figures/DIP3E_Original_Images_CH04/Fig0465(a)(cassini).tif", 0)M, N = img_ori.shape[:2]# 填充为'constant'可得到跟书上一样的频谱,这里使用'reflect'
fp = pad_image(img_ori, mode='constant')
# 中心化
fp_cen = centralized_2d(fp)
# 正变换
fft = np.fft.fft2(fp_cen)# 频谱
spectrum = spectrum_fft(fft)
# 对频谱做对数变换
spectrum_log = np.log(1 + spectrum)# 巴特沃斯陷波带阻滤波器
NRF = narrow_notch_filter(fp, w=8, opening=20, vertical=True, horizontal=False)fft_filter = fft * NRF# 滤波后的频谱
spectrum_filter = spectrum_fft(fft_filter)
spectrum_filter_log = np.log(1 + spectrum_filter)# 傅里叶反变换
ifft = np.fft.ifft2(fft_filter)# 去中心化反变换的图像,并取左上角的图像
img_new = centralized_2d(ifft.real)[:M, :N]
img_new = np.uint8(normalize(img_new) * 255)fig = plt.figure(figsize=(10, 10))ax_1 = fig.add_subplot(2, 2, 1)
ax_1.imshow(img_ori, 'gray'), ax_1.set_title('Original'), ax_1.set_xticks([]), ax_1.set_yticks([])ax_2 = fig.add_subplot(2, 2, 2)
ax_2.imshow(spectrum_log, 'gray'), ax_2.set_title('Spectrum Before Filter'), ax_2.set_xticks([]), ax_2.set_yticks([])ax_3 = fig.add_subplot(2, 2, 3)
ax_3.imshow(spectrum_filter_log, 'gray'), ax_3.set_title('Spectrum After Filter'), ax_3.set_xticks([]), ax_3.set_yticks([])ax_4 = fig.add_subplot(2, 2, 4)
ax_4.imshow(img_new, 'gray'), ax_4.set_title('Denoising'), ax_4.set_xticks([]), ax_4.set_yticks([])plt.tight_layout()
plt.show()

在这里插入图片描述

# 周期干扰的空间模式
img_ori = cv2.imread("DIP_Figures/DIP3E_Original_Images_CH04/Fig0465(a)(cassini).tif", 0)
M, N = img_ori.shape[:2]# 填充为'constant'可得到跟书上一样的频谱,这里使用'reflect'
fp = pad_image(img_ori, mode='constant')
# 中心化
fp_cen = centralized_2d(fp)
# 正变换
fft = np.fft.fft2(fp_cen)# # 频谱
# spectrum = spectrum_fft(fft)
# # 对频谱做对数变换
# spectrum_log = np.log(1 + spectrum)# 巴特沃斯陷波带阻滤波器
NRF = narrow_notch_filter(fp, w=8, opening=20, vertical=True, horizontal=False)
NRF = 1 - NRF
fft_filter = fft * NRF# 滤波后的频谱
spectrum_filter = spectrum_fft(fft_filter)
spectrum_filter_log = np.log(1 + spectrum_filter)# 傅里叶反变换
ifft = np.fft.ifft2(fft_filter)# 去中心化反变换的图像,并取左上角的图像
img_new = centralized_2d(ifft.real)[:M, :N]
img_new = np.uint8(normalize(img_new) * 255)fig = plt.figure(figsize=(10, 10))# ax_1 = fig.add_subplot(2, 2, 1)
# ax_1.imshow(img_ori, 'gray'), ax_1.set_title('Original'), ax_1.set_xticks([]), ax_1.set_yticks([])# ax_2 = fig.add_subplot(2, 2, 2)
# ax_2.imshow(spectrum_log, 'gray'), ax_2.set_title('Spectrum Before Filter'), ax_2.set_xticks([]), ax_2.set_yticks([])ax_3 = fig.add_subplot(2, 2, 3)
ax_3.imshow(NRF, 'gray'), ax_3.set_title('Spectrum After Filter'), ax_3.set_xticks([]), ax_3.set_yticks([])ax_4 = fig.add_subplot(2, 2, 4)
ax_4.imshow(img_new, 'gray'), ax_4.set_title('Noise'), ax_4.set_xticks([]), ax_4.set_yticks([])plt.tight_layout()
plt.show()

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/260684.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

python打包工具报错_python打包生成exe报错

如图所示 如果出现的是这个问题可以可以考虑以下方法 首先卸载原先下载的 Pyinstaller pip uninstall pyinstaller 再执行以下代码&#xff0c;去github上下载 pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip 注释&#xff1a;再次打包&#xff…

去除lcd图片的摩尔纹_宝妈时尚产后有妊娠纹怎么办?教你这三招,轻松修复肚皮!...

产后肚子上长妊娠纹&#xff0c;相信是很多妈妈的痛点。首先我们来介绍一下什么是妊娠纹。由于妊娠期荷尔蒙的影响&#xff0c;加之腹部膨隆使皮肤的弹力纤维与胶原纤维损伤或断裂&#xff0c;腹部皮肤变薄变细&#xff0c;出现一些宽窄不同、长短不一的粉红色或紫红色的波浪状…

anaconda 换清华镜像源 windows

方法1 Windows 下安装好Anaconda 应该会有如下这些应用&#xff0c;我们打开如下图anaconda Prompt(下面简称prompt)&#xff0c;(当然CMD也可以&#xff0c;只是我比较喜欢用prompt) 打开如下图 使用下面命令&#xff0c;即可以添加清华镜像 conda config --add channels …

提高表格可读性的一些技巧

表格的应用由于工作原因&#xff0c;经常接触到表格。我们发现&#xff0c;表格不但广泛的运用在各类数据收集和分析&#xff0c;同时通过表格这样一种二维矩阵来整理和陈列信息时&#xff08;即便最后的展示方式并非一个典型的表格样式&#xff09;&#xff0c;能够很好的表达…

分页第一页用0还是1_如何设计api分页

常规的分页方式API处理分页看似简单&#xff0c;实际上暗藏危机。最常见的分页方式&#xff0c;大概是下面这样的/users/?page1&limit5//服务端返回最理想的情况下&#xff0c;客户端请求第一页的5条数据&#xff0c;服务端如常返回&#xff0c;比如下图:拿Twitter的图用一…

数据挖掘肿瘤预测_科研套路不嫌多,数据挖掘发3分

解螺旋公众号陪伴你科研的第2003天如何复现一篇3分生信研究做科研需要先学习套路&#xff0c;才能超越套路。今天给大家介绍的套路文献是今年发表在《Oncology reports》(IF 3.041)上的一篇文章。文章的标题虽然看上去比较泛&#xff0c;但也让读者一眼就能知道主题了&#xff…

Jupyter notebook 导出PDF的3种方法

很多用Jupyter notebook的都想导出PDF&#xff0c;但是我们点击Download as PDF via LaTex. 然后呢&#xff1f; Ohzzzzzzzzz 出现下图的错误&#xff0c;看到这里感觉糟糕透啦。虽然可以根据提供的方法解决这个问题。下面我说说我的方法吧。 方法1 打开jupyter notebook&a…

mybatis中的#{value}和${value}的区别

2019独角兽企业重金招聘Python工程师标准>>> 1. #{value}将传入的数据都当成一个字符串&#xff0c;会对自动传入的数据加一个双引号。 2. ${value}将传入的数据直接显示生成在sql中。 3. #{value}方式能够很大程度防止sql注入。  4.${value}方式无法防止Sql注入。…

数据库备份失败问题

备份对于服务器“服务器名”失败。&#xff08;Microsoft.SqlServer.Smo&#xff09; 其他信息&#xff1a;System.Data.SqlClient.SqlError:无法打开备份设备c:\abc.bak。出现操作系统错误5(拒绝访问。)。(Microsoft.SqlServer.Smo&#xff09; 解决办法&#xff1a; Sql Serv…

pandas 在jupyter notebook时候能用,但在vscode, pycharm不能用

先看错误。 AttributeError: partially initialized module ‘pandas’ has no attribute ‘Series’ (most likely due to a circular import) 分一下这种错误 ‘…’ has no attribute ‘…’ 库没有 ’…’ 这种问题&#xff0c;要么库没有装好&#xff0c;或者装的库的…

解决 IDEA 调用其他类的时候自动加上包路径和类名的情况_idea 快捷键汇总(转)...

1.IDEA常用快捷键Alt回车 导入包,自动修正CtrlN 查找类CtrlShiftN 查找文件CtrlAltL 格式化代码CtrlAltO 优化导入的类和包AltInsert 生成代码(如get,set方法,构造函数等)CtrlE或者AltShiftC 最近更改的代码CtrlR 替换文本CtrlF 查找文本CtrlShiftSpace 自动补全代码Ctrl空格 代…

8位可控加减法器_自主可控:QTouch在军工道系统上的应用

自主可控&#xff1a;QTouch在军工道系统上的应用一、系统介绍"道系统"操作系统是一款面向各领域的嵌入式实时操作系统&#xff0c;支持单核及多核CPU硬件配置&#xff0c;可替换相关领域的VxWorks 6.8/6.9操作系统二、产品特性 具备自主知识产权的嵌入式实时操作系统…

iOS - Frame 项目架构

前言 iOS 常见的几种架构&#xff1a; 标签式 Tab Menu列表式 List Menu抽屉式 Drawer瀑布式 Waterfall跳板式 Springborad陈列馆式 Gallery旋转木马式 Carousel点聚式 Plus1、标签式 优点&#xff1a; 1、清楚当前所在的入口位置2、轻松在各入口间频繁跳转且不会迷失方向3、直…

Windows 10下,anaconda (conda) 虚拟环境的创建,jupyter notebook如何使用虚拟环境

手把手教您创建conda 虚拟环境 1 安装好anaconda后&#xff0c;会出现如下所示&#xff0c;这些都是anaconda集成啦&#xff0c;不需要再安装了。我们在如下所指的anaconda Prompt右键&#xff0c;以管理员运行 2 打开后&#xff0c;这就是prompt&#xff0c;我们输入pyth…

python下载文件传到服务器_python实现FTP文件传输的方法(服务器端和客户端)

用python实现FTP文件传输&#xff0c;包括服务器端和客户端&#xff0c;要求 &#xff08;1&#xff09;客户端访问服务器端要有一个验证功能 &#xff08;2&#xff09;可以有多个客户端访问服务器端 &#xff08;3&#xff09;可以对重名文件重新上传或下载 FTP&#xff08;F…

vscode 里 Import “numpy“ count not be resolved

问题如下&#xff1a; 我们分析一下这个问题&#xff0c;这里的问题。问题的翻译是&#xff1a;导入"numpy"不能被解决。 这可能有几个问题&#xff0c;1&#xff1a;vscode的python插件没有安装&#xff0c;2: vscode的python的解析器没有设置好。 按照这个思路&…

xdocument查找节点值_二叉查找树(java)

一棵二叉查找树(BST)是一颗二叉树&#xff0c;其中每个节点都含有一个Comparable的键且每个节点的键(以及相关的值)都大于其左子树中的任意节点的键而小于右子树的任意结点的键。数据表示和链表一样&#xff0c;我们嵌套定义了一个私有类来表示二叉查找树上的一个节点。每个节点…

三角形 画_CAD入门基础第3节:直角三角形的圆及如何修剪

这个软件&#xff0c;仔细想想&#xff0c;无非就两个命令&#xff0c;一是直线命令&#xff0c;二&#xff0c;就是圆。直线&#xff0c;无非也就是两种&#xff0c;一&#xff0c;是水平直线和垂直于水平直线的竖线&#xff0c;二&#xff0c;就是各种斜线。第一种直线&#…

windows 10下搭建pyspark与遇到的一些问题的解决方法

目录windows 10 下 搭建 pyspark所需要的工具过程与步骤windows 10 下 搭建 pyspark 所需要的工具 Java JDK 1.8.0 spark-2.2.0-bin-hadoop2.7 hadoop-2.7.3 winutils.exe 还需要有python环境&#xff0c;我用的是Anaconda 3&#xff08;默认你已经装好此环境&#xff09;。…

Linux VNC server 安装配置

1.安装vnc server[rootpxe ~]# yum install tigervnc-server -y2.设置 vnc server 开机启动[rootpxe ~]# chkconfig vncserver on3.修改vncserver 配置文件[rootpxe ~]# vi /etc/sysconfig/vncservers在配置文件后添加以下内容VNCSERVERS"2:root"VNCSERVERARGS[2]&qu…