moviepy音视频剪辑:headblur函数遇到的TypeError: integer argument expected, got float错误的解决方案

MoviePy音视频剪辑:解决TypeError: integer argument expected, got float错误的方法 解决这个问题的方法很简单,我们只需要将浮点数参数转换为整数即可。总结一下,当在使用MoviePy进行音视频剪辑时遇到"TypeError: integer argument expected, got float"错误时,我们可以通过将浮点数参数转换为整数来解决。通过这种方式,我们可以避免"TypeError: integer argument expected, got float"错误的出现,并成功进行音视频剪辑。解决这个问题的关键是找到导致错误的代码行,并确定哪个参数需要是整数。 阅读详情
运行环境如下:

python版本:3.7
opencv-python版本:4.2.0.34
numpy版本:1.19.0

错误信息:

在调用moviepy1.03版本的headblur函数执行人脸跟踪和模糊化处理时,报如下错误:

  File "F:/study/python/project/moviepyTest/moviepyTest.py", line 63, in <module>
    clip_blurred = clip.fx(vfx.headblur, tracking.xi, tracking.yi, 30) #进行模糊化处理,圆半径设置为30像素
  File "C:\Program Files\Python37\lib\site-packages\moviepy\Clip.py", line 212, in fx
    return func(self, *args, **kwargs)
  File "C:\Program Files\Python37\lib\site-packages\moviepy\video\fx\headblur.py", line 53, in headblur
    return clip.fl(fl)
  File "C:\Program Files\Python37\lib\site-packages\moviepy\Clip.py", line 136, in fl
    newclip = self.set_make_frame(lambda t: fun(self.get_frame, t))
  File "<decorator-gen-61>", line 2, in set_make_frame
  File "C:\Program Files\Python37\lib\site-packages\moviepy\decorators.py", line 14, in outplace
    f(newclip, *a, **k)
  File "C:\Program Files\Python37\lib\site-packages\moviepy\video\VideoClip.py", line 644, in set_make_frame
    self.size = self.get_frame(0).shape[:2][::-1]
  File "<decorator-gen-11>", line 2, in get_frame
  File "C:\Program Files\Python37\lib\site-packages\moviepy\decorators.py", line 89, in wrapper
    return f(*new_a, **new_kw)
  File "C:\Program Files\Python37\lib\site-packages\moviepy\Clip.py", line 93, in get_frame
    return self.make_frame(t)
  File "C:\Program Files\Python37\lib\site-packages\moviepy\Clip.py", line 136, in <lambda>
    newclip = self.set_make_frame(lambda t: fun(self.get_frame, t))
  File "C:\Program Files\Python37\lib\site-packages\moviepy\video\fx\headblur.py", line 42, in fl
    blurred = cv2.blur(orig, (r_blur, r_blur))
TypeError: integer argument expected, got float

Process finished with exit code 1
解决办法:

以下两种方法任选一种即可:
1、在调用headblur函数时,设置参数值为一个整数;
2、修改headblur函数,将if r_blur is None: r_blur = 2 * r_zone / 3
改为:if r_blur is None: r_blur = int(2 * r_zone / 3)

更多moviepy的介绍请参考《PyQt+moviepy音视频剪辑实战文章目录》或《moviepy音视频开发专栏》。

关于收费专栏

老猿的付费专栏《使用PyQt开发图形界面Python应用》专门介绍基于Python的PyQt图形界面开发基础教程,付费专栏《moviepy音视频开发专栏》详细介绍moviepy音视频剪辑合成处理的类相关方法及使用相关方法进行相关剪辑合成场景的处理,两个专栏加起来只需要19.9元,都适合有一定Python基础但无相关专利知识的小白读者学习。这2个收费专栏都有对应免费专栏,只是收费专栏的文章介绍更具体、内容更深入、案例更多。

对于缺乏Python基础的同仁,可以通过老猿的免费专栏《专栏:Python基础教程目录》从零开始学习Python。

如果有兴趣也愿意支持老猿的读者,欢迎购买付费专栏。

跟老猿学Python、学5G!

☞ ░ 前往老猿Python博文目录 ░
HBuilderx 坑 之前没问题 改了几行代码 小程序上传报分包大小超过限制 Error: 分包大小超过限制,main package source size 4199KB exceed max limit 2MB [20221213 10:08:06][wx432abdb518bdc1eb]下面的我提示是都没超过2M,却提示我超过限制,代码改了不到20行吧,之前是正常上传的.....,比如这类,要压缩的,前提是没压缩过的,但是我肯定提交的时候是压缩的,没勾选此项的要注意,如果本文解决了你的困扰 来波666不为过吧! 阅读详情

相关推荐

Vmware 17保姆级教程:从零部署华为enspPro模拟器(附镜像下载+配置优化)

本文提供了一份详尽的Vmware 17部署华为eNSP Pro模拟器的保姆级教程。内容涵盖从镜像下载、虚拟机导入、网络配置到深度性能调优的全过程,并针对常见启动失败、设备卡顿等故障提供了实用的排查方案,旨在帮助网络工程师和华为认证备考者快速搭建稳定高效的实验环境。

arduino9maker的博客 651

报错:run.py: error: the following arguments are required: --model

在运行代码时报错了,这个错误原因主要是需要缺乏配置参数,需要进行相关配置,最开始错误为 按照网上教程,在pycharm里找到了编辑设置,加上了--model,按照自己实际报错进行添加,以为可以大功告成,but新的报错出现了。。。run.py: error: argument --model: expected one argument 经过反思,我并没有给定义的model指定文件,所以正确操作为 1.找到编辑设置: 2.找到对应文件的参数,在后面添加上你所需要的文件就可以啦 ..

weixin_47907823的博客 9342

【Allegro学习笔记】常规标贴封装创建-0402封装创建实例

摘要 本文主要介绍如何使用Allegro制作表面贴装封装。 所使用的软件 使用Allegro制作常规贴片封装主要使用的软件有Pad Designer和Allegro 1 0402类封装制作 1.1 0402类封装焊盘分析 0402封装尺寸图如图1...

Honglong 1万+

报错:pytest: error: argument -m: expected one argument (via addopts config)

报错:pytest: error: argument -m: expected one argument (via addopts config)

qq_20878673的博客 862

QMI8658A和QMC5883L传感器校准全攻略:从零偏校准到椭球拟合

本文详细解析了QMI8658A和QMC5883L传感器的校准方法,从零偏校准到椭球拟合,涵盖了9轴运动传感器的核心误差来源及补偿技术。通过实战案例和数学建模,帮助开发者提升传感器精度,适用于无人机、AR/VR等智能硬件应用。

weixin_29189381的博客 163

workbench拓扑优化教程_拓扑优化实例-轮毂的优化

拓扑优化实例-轮毂的优化ANSYS Workbench的新版本集成了topology optimization模块,为用户的拓扑优化提供的很好的应用。通过拓扑优化topology optimization模块的使用可以对拓扑有较好的理解,该模块拓扑优化可以简单概括为一句话:如何在合适的位置去除确定的材料使用量,而相应的刚度变化影响最小。本例以汽车轮毂为例,来确定轮毂的辐条形状。1.建立模型DM中可...

weixin_39581739的博客 3050

python错误TypeError: integer argument expected, got float解决方法--map()函数用法,帮助文档

在使用python进行多种插值方法进行图像旋转遇到的问题。

swilder__218的博客 1万+

CGAL AlphaShape算法(自适应Alpha值,二维版本)

CGAL AlphaShape算法(自适应Alpha值,二维版本)

dayuhaitang1的博客 2329

TypeError: integer argument expected, got float

TypeError: integer argument expected, got float 解析:类型错误,大概意思是说:需要的是整型,但输出的是一个浮点型 去看看哪里有相除的运算,给他前面加个int或者将/改成// 之后就不会出现问题了

qq_38335768的博客 1734

使用 Python 爬虫抓取 IMDb 电影信息 - 评分、评论与基本信息抓取教程

本文介绍了如何使用 Python 爬虫技术抓取 IMDb 电影评分、评论和基本信息。我们分别展示了通过IMDb API和两种方法抓取数据,并进行了数据存储、分析与可视化。在未来,我们还可以基于这些数据开发电影推荐系统、情感分析工具等,进一步丰富电影数据的应用场景。通过这些实践,您不仅学会了如何抓取和存储数据,还可以通过这些基础来构建自己的数据分析应用,获取更丰富的电影数据。

2201_76125261的博客 605

2023年12月机器人技术等级考试试卷(三级理论) 试题解析

2023年12月机器人技术等级考试试卷(三级理论) 试题解析

http://www.cierobot.com 4104

Python OpenCV TypeError: integer argument expected, got float

本系列文章只供记录 Python 日常开发过程中 偶遇 BUG,提供给学生作为参考数据与解决方案用,属于记录型博客,有缘分看到的读者希望可解决你的问题。在 OpenCV 中,有些函数需要整数类型的参数,例如对于调整图像大小的函数,它需要指定新图像的宽和高,而这些参数必须是整数。这个错误信息按照字面翻译是 提示函数调用中使用了一个浮点数类型的参数,而函数预期的是一个整数类型的参数。,例如,要将图像大小调整为宽度为 200 像素,高度为 100 像素,则应使用。该错误为类型错误,例如下述代码就会报错。

梦想橡皮擦,专栏100例写作模式先行者,现象级专栏 《Python 爬虫 100 例》作者、《滚雪球学 Python 专栏》原创者 2万+

1.4 KFD 设备文件的获取与驱动握手协议

本文分析了OpenClose模块中libhsakmt与KFD内核驱动建立通信的过程。首先通过hsaKmtOpenKFD()函数打开/dev/kfd设备文件,建立用户态与内核态的通信通道。随后通过AMDKFD_IOC_GET_VERSION ioctl命令完成版本握手,确认双方的接口兼容性。KFD驱动采用Major.Minor二级版本号体系,当前主要版本为1,从1.1演进到1.19不断添加新功能。整个过程构成了用户态与内核态之间的"建连协议",是所有后续GPU操作的基础前提。

图形/计算GPU的驱动与虚拟化技术分享园地 634

Appinum:main.js: error: argument "--app": Expected one argument. null 运行错误解决

运行appuim 后报 main.js: error: argument "--app": Expected one argument. null 解决:Application Path 需要填值appuim参数说明 setting 分析:报这个错误是因为--app 参数值为空照成的 ,主要是由于把Application Path打钩了而未填值,赋值后就可以了。直接App...

紫色飞鱼儿的博客 1万+

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Numpy出现TypeError: integer argument expected, got float的分析与解决

Numpy出现TypeError: integer argument expected, got float的分析与解决

zorchp 1840

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

关于TypeError: integer argument expected, got float错误如何解决

今天在运行一个小代码关于人脸识别识别的时候出现了以下情况。TypeError: integer argument expected, got floa再来看看源代码附上错误截图其实主要的错误是因为 因为cv2.resize内的参数是要求为整数所以把上面图中的“/”改为“//”运算,最后成功...

qq_40979622的博客 3万+

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

moviepy音视频剪辑:headblur的参数r_blur卷积核以及fx、fy、r_zone的功能作用及用途

☞ ░ 前往老猿Python博文目录 ░ 在moviepy1.03版本中,headblur的调用语法为:headblurbak(clip,fx,fy,r_zone,r_blur=None) 其中参数fx和fy是两个函数,该函数带参数t,用于确认t时刻需要模糊化范围的中心点位置,moviepy将对以中心点为圆心半径r_zone的圆范围内的图像进行模糊化处理。 r_blur参数在moviepy中的解释是“the intensity of the blurring”,翻译成中文是“模糊化的强度”,老猿才开始猜测

老猿Python 1846

moviepy音视频剪辑:视频变换处理与内容相关的变换函数headblur、mask_and/or、mirror_x/y、rotate、painting、scroll介绍

一、引言 在《moviepy音视频剪辑:moviepy中的剪辑基类Clip详解》介绍了剪辑基类的fl、fl_time、fx方法,在《moviepy音视频剪辑:视频剪辑基类VideoClip的属性及方法详解》介绍了fl_image和subfx方法, 在《Python+moviepy音视频剪辑:视频帧数据的本质、Clip的fl方法进行变换处理的原理以及滚屏案例》及《moviepy音视频剪辑:使用fl_time进行诸如快播、慢播、倒序播放等时间特效处理的原理和可能遇到的坑》分别介绍了fl和fl_time进行视频剪

老猿Python 2574

moviepy中区域模糊函数moviepy.video.fx.all.headblur无法使用

当我们需要尽在视频中模糊某个人的脸部或者其他我们需要隐藏的东西时,我们可以使用这个函数 但是我们在调用这个函数的时候有时候会说我们调用不了,查阅官方文档可以看到 所以,我们首先需要安装OpenCV的库才能使用这个函数。 具体参考一下安装步骤: https://blog.csdn.net/qq_37541097/article/details/77374160 参考链接: http://zulko....

qq_34795683的博客 1408

Python——数字类型及常见问题总结

Python 提供了丰富的数字类型,包括整数、浮点数、复数和布尔型,每种类型都有其特定的用途和特性。这些类型使得 Python 成为进行各种数学和科学计算的强大工具。

weixin_45720999的博客 928

关于TypeError: integer argument expected, got float问题的解决办法

  今天打算使用主成分分析法对MNSIT数据集进行降维,其中有一函数的目的是将每个手写数字图片拼接起来,组成一个大图。结果函数写好后,调用时没出现了下述错误: TypeError: integer argument expected, got float   截图如下:   于是查看了源代码:   主要的问题就是paste函数中的参数要求为正数,将(i / col) * each_width改为(i // col) * each_width即可解决问题。   拼接后的结果如下图所示: ...

bwqiang的博客 2967

python TypeError: integer argument expected, got float 解决办法

pycharm 运行python程序中, cv2.line()和cv2.putText() 报错 TypeError: integer argument expected, got float 及解决办法 原代码: 错误: 原因: 因为cv2.line(),cv2.putText(),cv2.resize()等内的参数要求为整数,所以要将“ / ”改为“ // ”运算,修改后: 成功运行! ...

JCjunior的博客 3808

TypeError: integer argument expected got float' Python 3.6

运行python代码时报错: Traceback (most recent call last): File "D:/PycharmProjects/3D_SD/video_action/video_resize.py", line 34, in <module> video_resize(video) File "D:/PycharmProjects/3D_SD/v...

jiangsujiangjiang的博客 1万+

if cv2.waitKey(100/12) & 0xff == ord("q"): TypeError: integer argument expected, got float

  if cv2.waitKey(100/12) &amp; 0xff == ord("q"):TypeError: integer argument expected, got float这个错误困恼了我好几天,终于查找资料找到原因错误截图''' 在进行测试例子的时候,总是出现TypeError 主要原因是因为cv2.resize内的参数是要求为整数 而python3中的 '/'(除法),最...

qq_37161280的博客 6175

在借用GitHub上人群密度估计的mcnn实现例子时的TypeError: integer argument expected, got float

在进行测试例子的时候,总是出现TypeError主要原因是因为cv2.resize内的参数是要求为整数而python3中的'/'(除法),最后的结果自动转为浮点数所以使用'//'运算,最后成功附上错误截图...

wobuzixun 7436

python——适用于py3的pillow图像处理模块&plist组图分割

首先说明一下PIL库,PIL(Python Imaging Library)是Python一个强大方便的图像处理库,之前的博客也有用到过PIL模块的demo http://blog.csdn.net/sm9sun/article/details/53538579 不过可惜的是PIL库只支持到Python 2.7。python3以后,我们可以用pillow模块来代替PIL,pillow是PI

九日王朝 5919
上一篇: 老猿学5G专栏完结说明
下一篇: moviepy音视频剪辑:headblur函数遇到的ValueError assignment destination is read-only问题及解决办法
LaoYuanPython
LaoYuanPython 2020年博客之星Top3 2020年博客之星Top3 领域专家: Python技术领域 领域专家: Python技术领域
博客等级 码龄8年 15万+粉丝 1324原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

LaoYuanPython

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址