欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

Python實現(xiàn)PS濾鏡特效之扇形變換效果示例-創(chuàng)新互聯(lián)

本文實例講述了Python實現(xiàn)PS濾鏡特效之扇形變換效果。分享給大家供大家參考,具體如下:

尼河口ssl適用于網(wǎng)站、小程序/APP、API接口等需要進行數(shù)據(jù)傳輸應用場景,ssl證書未來市場廣闊!成為創(chuàng)新互聯(lián)的ssl證書銷售渠道,可以享受市場價格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:18982081108(備注:SSL證書合作)期待與您的合作!

這里用 Python 實現(xiàn) PS 濾鏡中的一種幾何變換特效,稱為扇形變換,將圖像扭曲成一個扇形,具體的算法原理和效果圖可以參考附錄說明

import numpy as np
from skimage import img_as_float
import matplotlib.pyplot as plt
from skimage import io
import math
import numpy.matlib
file_name2='D:/Visual Effects/PS Algorithm/4.jpg'
img=io.imread(file_name2)
img = img_as_float(img)
# control the radius of the inner circle
radius = 150
# control the distance between the inner circle and outer circle
high = 200
angle = 0
spreadAngle = math.pi
# set the center of the circle, proportion of the image size
centerX = 0.5
centerY = 1.0
row, col, channel = img.shape
icenterX = col * centerX
icenterY = row * centerY
img_out = img * 0
xx = np.arange (col)
yy = np.arange (row)
x_mask = numpy.matlib.repmat (xx, row, 1)
y_mask = numpy.matlib.repmat (yy, col, 1)
y_mask = np.transpose(y_mask)
xx_dif = x_mask - icenterX
yy_dif = y_mask - icenterY
theta = np.arctan2(-yy_dif, -xx_dif+0.0001)
r = np.sqrt(xx_dif*xx_dif + yy_dif * yy_dif)
theta = np.mod(theta, 2 * math.pi)
x1_mask = col * theta/(spreadAngle+0.00001)
y1_mask = row * (1-(r-radius)/(high+0.00001))
'''
mask = x1_mask < 0
x1_mask = x1_mask * (1 - mask)
mask = x1_mask > (col - 1)
x1_mask = x1_mask * (1 - mask) + (x1_mask * 0 + col -2) * mask
mask = y1_mask < 0
y1_mask = y1_mask * (1 - mask)
mask = y1_mask > (row -1)
y1_mask = y1_mask * (1 - mask) + (y1_mask * 0 + row -2) * mask
'''
int_x = np.floor (x1_mask)
int_x = int_x.astype(int)
int_y = np.floor (y1_mask)
int_y = int_y.astype(int)
for ii in range(row):
  for jj in range (col):
    new_xx = int_x [ii, jj]
    new_yy = int_y [ii, jj]
    if x1_mask [ii, jj] < 0 or x1_mask [ii, jj] > col -1 :
      continue
    if y1_mask [ii, jj] < 0 or y1_mask [ii, jj] > row -1 :
      continue
    img_out[ii, jj, :] = img[new_yy, new_xx, :]
plt.figure (1)
plt.title('www.jb51.net')
plt.imshow (img)
plt.axis('off')
plt.figure (2)
plt.title('www.jb51.net')
plt.imshow (img_out)
plt.axis('off')
plt.show()

另外有需要云服務器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。

分享文章:Python實現(xiàn)PS濾鏡特效之扇形變換效果示例-創(chuàng)新互聯(lián)
標題鏈接:http://aaarwkj.com/article16/ccjpgg.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站內(nèi)鏈、網(wǎng)站收錄品牌網(wǎng)站制作、域名注冊、外貿(mào)網(wǎng)站建設、網(wǎng)站導航

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

h5響應式網(wǎng)站建設
国产精品欧美日韩高清| 欧美成人一区二区三区片| 99久久精品国产熟女拳交| 91免费人成网站在线观看| 欧美日韩国产特级性生活| 亚洲毛片一区在线播放| 日本中文字幕在线一区| 夜夜操狠狠操天天摸| 国产亚洲精品精品国产亚洲| 国产精品毛片在线看不卡| 激情亚洲欧美日韩精品| 深夜福利在线观看97| 麻豆精品新av中文字幕| 亚洲精品一区二区三区高清| 91极品气质女神长腿翘臀| 亚洲精品日本一区二区| 国产日产亚洲综合一区| 亚洲国产精品一区二区成人| 快播av手机在线播放| 中文日韩av在线免费播放| 日本在线最新视频一区二区三区| 精品久久久久久亚洲野狼| 黄色录像免费看中文字幕| 亚洲国产精品成人女人| 色婷婷狠狠久久综合中文一本| 99精品欧美一区二区三区视频| 夫妻过性生活视频播放| 视频播放一区二区三区毛片| 久久99久久久久久精品| 人妻免费精品久久一区| 天堂av在线免费观看| 女人被爽到高潮呻吟免费看| 日韩成人手机视频在线观看| 91人妻精品丰满少妇区| 亚洲精品中文字幕乱码三区91| 99久久免费中文字幕| 人妻中文字幕精品系列| 丰满人妻被黑人猛烈进入免费| 欧美黄片网站在线观看| 九九热九九热九九热九| 自拍国语对白在线视频|