当前位置: 首页 > news >正文

平面广告设计用什么软件网站需要优化的小型公司

平面广告设计用什么软件,网站需要优化的小型公司,thinkphp 显示第三方网站图片,网站定制技术SVD方法是模型降阶的一类重要方法,本征正交分解(POD)和平衡截断(BT)都属于SVD类方法。 要想深入了解模型降阶技术,我们可以先从SVD的应用入手,做一个直观的了解。 1. SVD的定义和分类 我们想寻找…

SVD方法是模型降阶的一类重要方法,本征正交分解(POD)和平衡截断(BT)都属于SVD类方法。

要想深入了解模型降阶技术,我们可以先从SVD的应用入手,做一个直观的了解。

1. SVD的定义和分类

我们想寻找一个A的逼近:Ak,使得rank(Ak) = k < n,且|A - Ak|最小。

下面的定理(也称为Schmidt-Mirsky, Eckart-Young定理)说明矩阵A的低秩逼近可以用SVD实现:

2. SVD在图像压缩中的应用

原始图片, rank=720:

绘制其R,G,B的奇异值:

压缩图片,rank=144:

压缩图片,rank=72:

代码:

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as imageA = image.imread("svd-image-compression-img.jpg")# Each pixel (typically) consists of 3 bytes — for the red, green and blue components of the color, respectively. 
# So, if we want to efficiently store the image, we need to somehow efficiently encode 3 matrices R, G and B 
# for each color component, respectively.
# We can extract the 3 color component matrices as briefly mentioned above as follows:
# 0xff代表十进制数值255
R = A[:,:,0] / 0xff
G = A[:,:,1] / 0xff
B = A[:,:,2] / 0xff# Now, we compute the SVD decomposition:
R_U, R_S, R_VT = np.linalg.svd(R)
G_U, G_S, G_VT = np.linalg.svd(G)
B_U, B_S, B_VT = np.linalg.svd(B)# polt the singular values
xaxis = np.arange(0, len(R_S))
plt.plot(xaxis, R_S, label='R_S')
plt.plot(xaxis, G_S, label='G_S')
plt.plot(xaxis, B_S, label='B_S')
plt.legend()relative_rank = 0.1
max_rank = int(relative_rank * min(R.shape[0], R.shape[1]))
print("max rank = %d" % max_rank)  # 144def read_as_compressed(U, S, VT, k):Ak = np.zeros((U.shape[0], VT.shape[1]))for i in range(k):U_i = U[:,[i]]VT_i = np.array([VT[i]])Ak += S[i] * (U_i @ VT_i)return Ak## Actually, it is easier and more efficient to perform the same operation 
## with a lower-rank matrix multiplication.
# def read_as_compressed(U, S, VT, k):
#     return (U[:,:k] @ np.diag(S[:k])) @ VT[:k]R_compressed = read_as_compressed(R_U, R_S, R_VT, max_rank)
G_compressed = read_as_compressed(G_U, G_S, G_VT, max_rank)
B_compressed = read_as_compressed(B_U, B_S, B_VT, max_rank)compressed_float = np.dstack((R_compressed, G_compressed, B_compressed))
compressed = (np.minimum(compressed_float, 1.0) * 0xff).astype(np.uint8)# Plot
plt.figure()
plt.imshow(A)plt.figure()
plt.imshow(compressed)image.imsave("compressed.jpg", compressed)

参考资料:

[A.C. Antoulas 2001] Approximation of large-scale dynamical systems: An overview
[潘建瑜] 矩阵计算_讲义 
Compressing images with singular value decomposition (SVD) | ZeroBone
http://www.yayakq.cn/news/139724/

相关文章:

  • 济南网站营销wordpress多梦
  • 北京专业网站建设公司哪家好网络搞钱路子
  • 用wordpress建立网站四川建设工程网上合同备案网站
  • 设计配色的网站网页制作与设计第四版电子书
  • 雨花区区网站建设公司员工做违法网站
  • 用easyui 做的网站公司邮箱注册申请
  • 制作视频网站教程个人网站需要建站群吗
  • 贵阳网站设计多少钱旅游交友的网站建设
  • 上海网站络公司wordpress 自定义feed
  • 重庆建设定额网站网站改版建设公司
  • 推荐几个做网页设计的网站过时的网站
  • 做土特产的网站有哪些厦门建设局怎么进
  • 网站建设玖金手指谷哥三十最美情侣免费高清视频
  • 计算机网络 网站wordpress 本地ajax
  • 网站开发语言太老网站外链优化
  • 免费做企业网站做ppt的网站叫什么
  • 网站开发的背景是指什么免费咨询心理医生在线
  • 网站开发服务属于什么行业网页制作教程电子书
  • 建设建行积分兑换商城网站展馆网站建设方案
  • 网站建站报告2000字住房城市乡建设部网站
  • 做的比较好的二手交易网站有哪些什么网站能让小孩做算术题
  • 实训网站开发目的创建空白网站
  • 做网站做电脑版还是手机版好江西省城乡建设培训网-官方网站
  • 广州兼职做网站WordPress评论后自动刷新
  • 益阳网站seo上海金桥建设监理有限公司网站
  • 电子商务网站建设招标书生成短链接的网站
  • 美文的手机网站大连高新园区邮编
  • 南通网站建设价格衡阳网站备案
  • 网站反链有好处吗做网站mfdos
  • 做门户网站的公司有哪些在东营怎么建网站