- 浏览: 22448 次
- 性别:
- 来自: 北京
最新评论
转载:http://blog.csdn.net/iosevanhuang/article/details/14488239
CABasicAnimation类的使用方式就是基本的关键帧动画。
所谓关键帧动画,就是将Layer的属性作为KeyPath来注册,指定动画的起始帧和结束帧,然后自动计算和实现中间的过渡动画的一种动画方式。
CABasicAnimation的基本使用顺序
1.引用QuartzCore.framework
将"QuartzCore.framework"这个库添加到项目中。并且在需要使用CABaseAnimation类的地方import头文件。
[objc] view plaincopy在CODE上查看代码片派生到我的代码片
#import <QuartzCore/QuartzCore.h>
2.CABaseAnimation的实例化以及关键路径的注册
使用"animationWithKeyPath:"方法进行CABasicAnimation的实例化,并指定Layer的属性作为关键路径来注册。
[objc] view plaincopy在CODE上查看代码片派生到我的代码片
// 指定position属性
CABasicAnimation *animation =
[CABasicAnimation animationWithKeyPath:@"position"];
3.设定动画
设定动画的属性。以下是属性及其对应的说明:
属性 说明
duration 动画时长(秒为单位)(注:此处与原文有出入)
repeatCount 重复次数。永久重复的话设置为HUGE_VALF。
beginTime 指定动画开始时间。从开始指定延迟几秒执行的话,请设置为
「CACurrentMediaTime() + 秒数」的形式。
timingFunction 设定动画的速度变化
autoreverses 动画结束时是否执行逆动画 例:
[objc] view plaincopy在CODE上查看代码片派生到我的代码片
animation.duration = 2.5; // 动画持续时间
animation.repeatCount = 1; // 不重复
animation.beginTime = CACurrentMediaTime() + 2; // 2秒后执行
animation.autoreverses = YES; // 结束后执行逆动画
// 动画先加速后减速
animation.timingFunction =
[CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseInEaseOut];
4.设定动画的开始帧和结束帧
设定动画开始和结束帧时的状态。设定的值会变为KeyPath所指定的属性的值。
属性 说明
fromValue 开始值
toValue 终了值(絶対値)
byValue 终了值(相对值) 例:
[objc] view plaincopy在CODE上查看代码片派生到我的代码片
// 指定position属性(移动)
CABasicAnimation *animation =
[CABasicAnimation animationWithKeyPath:@"position"];
・・・
// 设定动画起始帧和结束帧
animation.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, 0)]; // 起始点
animation.toValue = [NSValue valueWithCGPoint:CGPointMake(320, 480)]; // 终了点
5.添加动画
为Layer添加设置完成的动画,可以给Key指定任意名字。
[objc] view plaincopy在CODE上查看代码片派生到我的代码片
[myView.layer addAnimation:animation forKey:@"move-layer"];
其他.动画结束后回到初始状态的现象的解决方法
用CABasicAnimation执行动画,在动画结束后会回归动画开始前的状态。想要解决的话,必须设置“removedOnCompletion”和“fillMode”这两个属性。
[objc] view plaincopy在CODE上查看代码片派生到我的代码片
// 动画终了后不返回初始状态
animation.removedOnCompletion = NO;
animation.fillMode = kCAFillModeForwards;
CABasicAnimation的使用示例
实际上CABasicAnimation有很多种使用方法,以下将一一列举。
移动动画
移动动画的代码如下:
[objc] view plaincopy在CODE上查看代码片派生到我的代码片
/* 移动 */
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"position"];
// 动画选项的设定
animation.duration = 2.5; // 持续时间
animation.repeatCount = 1; // 重复次数
// 起始帧和终了帧的设定
animation.fromValue = [NSValue valueWithCGPoint:myView.layer.position]; // 起始帧
animation.toValue = [NSValue valueWithCGPoint:CGPointMake(320, 480)]; // 终了帧
// 添加动画
[myView.layer addAnimation:animation forKey:@"move-layer"];
旋转动画
旋转动画的代码如下:
[objc] view plaincopy在CODE上查看代码片派生到我的代码片
/* 旋转 */
// 对Y轴进行旋转(指定Z轴的话,就和UIView的动画一样绕中心旋转)
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.y"];
// 设定动画选项
animation.duration = 2.5; // 持续时间
animation.repeatCount = 1; // 重复次数
// 设定旋转角度
animation.fromValue = [NSNumber numberWithFloat:0.0]; // 起始角度
animation.toValue = [NSNumber numberWithFloat:22 * M_PI]; // 终止角度
// 添加动画
[myView.layer addAnimation:animation forKey:@"rotate-layer"];
缩放动画
缩放动画的代码如下:
[objc] view plaincopy在CODE上查看代码片派生到我的代码片
/* 放大缩小 */
// 设定为缩放
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
// 动画选项设定
animation.duration = 2.5; // 动画持续时间
animation.repeatCount = 1; // 重复次数
animation.autoreverses = YES; // 动画结束时执行逆动画
// 缩放倍数
animation.fromValue = [NSNumber numberWithFloat:1.0]; // 开始时的倍率
animation.toValue = [NSNumber numberWithFloat:2.0]; // 结束时的倍率
// 添加动画
[myView.layer addAnimation:animation forKey:@"scale-layer"];
组合动画
使用CAAnimationGroup类进行复数动画的组合。代码如下:
[objc] view plaincopy在CODE上查看代码片派生到我的代码片
/* 动画1(在X轴方向移动) */
CABasicAnimation *animation1 =
[CABasicAnimation animationWithKeyPath:@"transform.translation.x"];
// 终点设定
animation1.toValue = [NSNumber numberWithFloat:80];; // 終点
/* 动画2(绕Z轴中心旋转) */
CABasicAnimation *animation2 =
[CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
// 设定旋转角度
animation2.fromValue = [NSNumber numberWithFloat:0.0]; // 开始时的角度
animation2.toValue = [NSNumber numberWithFloat:44 * M_PI]; // 结束时的角度
/* 动画组 */
CAAnimationGroup *group = [CAAnimationGroup animation];
// 动画选项设定
group.duration = 3.0;
group.repeatCount = 1;
// 添加动画
group.animations = [NSArray arrayWithObjects:animation1, animation2, nil nil];
[myView.layer addAnimation:group forKey:@"move-rotate-layer"];
捕获动画开始时和终了时的事件
博主:设定委托对象,实现委托方法,如下:
[objc] view plaincopy在CODE上查看代码片派生到我的代码片
/* 移动 */
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.translation.y"];
animation.delegate = self; // 指定委托对象
// 设定动画选项
animation.duration = 2.5; // 动画时长
animation.repeatCount = 1; // 重复次数
// 终点设定
animation.toValue = [NSNumber numberWithFloat:100];; // 终点
// 添加动画
[myView.layer addAnimation:animation forKey:@"move-layer"];
・・・
/**
* 动画开始时
*/
- (void)animationDidStart:(CAAnimation *)theAnimation
{
NSLog(@"begin");
}
/**
* 动画结束时
*/
- (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag
{
NSLog(@"end");
}
CABasicAnimation使用时候的注意点
CABasicAnimation正在进行动画的时候,点击了Home按钮后再回到app的时候,动画会被清空。
Objective-C的示例程序
使用CABasicAnimation实现关键帧动画的示例程序如下:
[objc] view plaincopy在CODE上查看代码片派生到我的代码片
- (void)viewDidLoad
{
[super viewDidLoad];
// 图像显示
UIImage *image = [UIImage imageNamed:@"image01.png"];
UIImageView *imageView = [[UIImageView alloc]initWithImage:image];
imageView.center = CGPointMake(160, 240);
[self.view addSubview:imageView];
/* 移动 */
CABasicAnimation *animation1 =
[CABasicAnimation animationWithKeyPath:@"transform.translation.y"];
// 起止点的设定
animation1.toValue = [NSNumber numberWithFloat:100];; // 終点
/* 旋转 */
CABasicAnimation *animation2 =
[CABasicAnimation animationWithKeyPath:@"transform.rotation.x"];
// 绕x轴转3圈
animation2.toValue = [NSNumber numberWithFloat:66 * M_PI]; // 结束时的角度
/* 动画组 */
CAAnimationGroup *group = [CAAnimationGroup animation];
group.delegate = self;
group.duration = 5.0;
group.repeatCount = 1;
// 动画结束后不变回初始状态
group.removedOnCompletion = NO;
group.fillMode = kCAFillModeForwards;
// 添加动画
group.animations = [NSArray arrayWithObjects:animation1, animation2, nil nil];
[imageView.layer addAnimation:group forKey:@"move-rotate-layer"];
}
/**
* 动画开始时
*/
- (void)animationDidStart:(CAAnimation *)theAnimation
{
NSLog(@"begin");
}
/**
* 动画结束时
*/
- (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag
{
NSLog(@"end");
}
CABasicAnimation类的使用方式就是基本的关键帧动画。
所谓关键帧动画,就是将Layer的属性作为KeyPath来注册,指定动画的起始帧和结束帧,然后自动计算和实现中间的过渡动画的一种动画方式。
CABasicAnimation的基本使用顺序
1.引用QuartzCore.framework
将"QuartzCore.framework"这个库添加到项目中。并且在需要使用CABaseAnimation类的地方import头文件。
[objc] view plaincopy在CODE上查看代码片派生到我的代码片
#import <QuartzCore/QuartzCore.h>
2.CABaseAnimation的实例化以及关键路径的注册
使用"animationWithKeyPath:"方法进行CABasicAnimation的实例化,并指定Layer的属性作为关键路径来注册。
[objc] view plaincopy在CODE上查看代码片派生到我的代码片
// 指定position属性
CABasicAnimation *animation =
[CABasicAnimation animationWithKeyPath:@"position"];
3.设定动画
设定动画的属性。以下是属性及其对应的说明:
属性 说明
duration 动画时长(秒为单位)(注:此处与原文有出入)
repeatCount 重复次数。永久重复的话设置为HUGE_VALF。
beginTime 指定动画开始时间。从开始指定延迟几秒执行的话,请设置为
「CACurrentMediaTime() + 秒数」的形式。
timingFunction 设定动画的速度变化
autoreverses 动画结束时是否执行逆动画 例:
[objc] view plaincopy在CODE上查看代码片派生到我的代码片
animation.duration = 2.5; // 动画持续时间
animation.repeatCount = 1; // 不重复
animation.beginTime = CACurrentMediaTime() + 2; // 2秒后执行
animation.autoreverses = YES; // 结束后执行逆动画
// 动画先加速后减速
animation.timingFunction =
[CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseInEaseOut];
4.设定动画的开始帧和结束帧
设定动画开始和结束帧时的状态。设定的值会变为KeyPath所指定的属性的值。
属性 说明
fromValue 开始值
toValue 终了值(絶対値)
byValue 终了值(相对值) 例:
[objc] view plaincopy在CODE上查看代码片派生到我的代码片
// 指定position属性(移动)
CABasicAnimation *animation =
[CABasicAnimation animationWithKeyPath:@"position"];
・・・
// 设定动画起始帧和结束帧
animation.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, 0)]; // 起始点
animation.toValue = [NSValue valueWithCGPoint:CGPointMake(320, 480)]; // 终了点
5.添加动画
为Layer添加设置完成的动画,可以给Key指定任意名字。
[objc] view plaincopy在CODE上查看代码片派生到我的代码片
[myView.layer addAnimation:animation forKey:@"move-layer"];
其他.动画结束后回到初始状态的现象的解决方法
用CABasicAnimation执行动画,在动画结束后会回归动画开始前的状态。想要解决的话,必须设置“removedOnCompletion”和“fillMode”这两个属性。
[objc] view plaincopy在CODE上查看代码片派生到我的代码片
// 动画终了后不返回初始状态
animation.removedOnCompletion = NO;
animation.fillMode = kCAFillModeForwards;
CABasicAnimation的使用示例
实际上CABasicAnimation有很多种使用方法,以下将一一列举。
移动动画
移动动画的代码如下:
[objc] view plaincopy在CODE上查看代码片派生到我的代码片
/* 移动 */
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"position"];
// 动画选项的设定
animation.duration = 2.5; // 持续时间
animation.repeatCount = 1; // 重复次数
// 起始帧和终了帧的设定
animation.fromValue = [NSValue valueWithCGPoint:myView.layer.position]; // 起始帧
animation.toValue = [NSValue valueWithCGPoint:CGPointMake(320, 480)]; // 终了帧
// 添加动画
[myView.layer addAnimation:animation forKey:@"move-layer"];
旋转动画
旋转动画的代码如下:
[objc] view plaincopy在CODE上查看代码片派生到我的代码片
/* 旋转 */
// 对Y轴进行旋转(指定Z轴的话,就和UIView的动画一样绕中心旋转)
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.y"];
// 设定动画选项
animation.duration = 2.5; // 持续时间
animation.repeatCount = 1; // 重复次数
// 设定旋转角度
animation.fromValue = [NSNumber numberWithFloat:0.0]; // 起始角度
animation.toValue = [NSNumber numberWithFloat:22 * M_PI]; // 终止角度
// 添加动画
[myView.layer addAnimation:animation forKey:@"rotate-layer"];
缩放动画
缩放动画的代码如下:
[objc] view plaincopy在CODE上查看代码片派生到我的代码片
/* 放大缩小 */
// 设定为缩放
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
// 动画选项设定
animation.duration = 2.5; // 动画持续时间
animation.repeatCount = 1; // 重复次数
animation.autoreverses = YES; // 动画结束时执行逆动画
// 缩放倍数
animation.fromValue = [NSNumber numberWithFloat:1.0]; // 开始时的倍率
animation.toValue = [NSNumber numberWithFloat:2.0]; // 结束时的倍率
// 添加动画
[myView.layer addAnimation:animation forKey:@"scale-layer"];
组合动画
使用CAAnimationGroup类进行复数动画的组合。代码如下:
[objc] view plaincopy在CODE上查看代码片派生到我的代码片
/* 动画1(在X轴方向移动) */
CABasicAnimation *animation1 =
[CABasicAnimation animationWithKeyPath:@"transform.translation.x"];
// 终点设定
animation1.toValue = [NSNumber numberWithFloat:80];; // 終点
/* 动画2(绕Z轴中心旋转) */
CABasicAnimation *animation2 =
[CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
// 设定旋转角度
animation2.fromValue = [NSNumber numberWithFloat:0.0]; // 开始时的角度
animation2.toValue = [NSNumber numberWithFloat:44 * M_PI]; // 结束时的角度
/* 动画组 */
CAAnimationGroup *group = [CAAnimationGroup animation];
// 动画选项设定
group.duration = 3.0;
group.repeatCount = 1;
// 添加动画
group.animations = [NSArray arrayWithObjects:animation1, animation2, nil nil];
[myView.layer addAnimation:group forKey:@"move-rotate-layer"];
捕获动画开始时和终了时的事件
博主:设定委托对象,实现委托方法,如下:
[objc] view plaincopy在CODE上查看代码片派生到我的代码片
/* 移动 */
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.translation.y"];
animation.delegate = self; // 指定委托对象
// 设定动画选项
animation.duration = 2.5; // 动画时长
animation.repeatCount = 1; // 重复次数
// 终点设定
animation.toValue = [NSNumber numberWithFloat:100];; // 终点
// 添加动画
[myView.layer addAnimation:animation forKey:@"move-layer"];
・・・
/**
* 动画开始时
*/
- (void)animationDidStart:(CAAnimation *)theAnimation
{
NSLog(@"begin");
}
/**
* 动画结束时
*/
- (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag
{
NSLog(@"end");
}
CABasicAnimation使用时候的注意点
CABasicAnimation正在进行动画的时候,点击了Home按钮后再回到app的时候,动画会被清空。
Objective-C的示例程序
使用CABasicAnimation实现关键帧动画的示例程序如下:
[objc] view plaincopy在CODE上查看代码片派生到我的代码片
- (void)viewDidLoad
{
[super viewDidLoad];
// 图像显示
UIImage *image = [UIImage imageNamed:@"image01.png"];
UIImageView *imageView = [[UIImageView alloc]initWithImage:image];
imageView.center = CGPointMake(160, 240);
[self.view addSubview:imageView];
/* 移动 */
CABasicAnimation *animation1 =
[CABasicAnimation animationWithKeyPath:@"transform.translation.y"];
// 起止点的设定
animation1.toValue = [NSNumber numberWithFloat:100];; // 終点
/* 旋转 */
CABasicAnimation *animation2 =
[CABasicAnimation animationWithKeyPath:@"transform.rotation.x"];
// 绕x轴转3圈
animation2.toValue = [NSNumber numberWithFloat:66 * M_PI]; // 结束时的角度
/* 动画组 */
CAAnimationGroup *group = [CAAnimationGroup animation];
group.delegate = self;
group.duration = 5.0;
group.repeatCount = 1;
// 动画结束后不变回初始状态
group.removedOnCompletion = NO;
group.fillMode = kCAFillModeForwards;
// 添加动画
group.animations = [NSArray arrayWithObjects:animation1, animation2, nil nil];
[imageView.layer addAnimation:group forKey:@"move-rotate-layer"];
}
/**
* 动画开始时
*/
- (void)animationDidStart:(CAAnimation *)theAnimation
{
NSLog(@"begin");
}
/**
* 动画结束时
*/
- (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag
{
NSLog(@"end");
}
发表评论
-
RunLoop
2015-06-10 11:38 534转载:http://www.cocoachina.com/io ... -
GCD使用注意
2015-05-11 10:27 501转载:http://www.cocoachina.com/io ... -
Method Swizzling
2015-03-25 15:41 504转载:http://www.cocoachina.com/io ... -
NSOperation, NSOperationQueue
2015-03-23 14:55 506转载:http://greenchiu.github.io/b ... -
ios申请真机调试( xcode 5)详细解析
2015-03-20 14:28 383转载:http://my.oschina.net/u/1245 ... -
一个苹果证书怎么多次使用——导出p12文件
2015-03-20 14:27 1185转载:http://my.oschina.net/u/1245 ... -
iOS申请证书,Certificates, Identifiers &Profiles 简介
2015-03-20 14:26 1028转载:http://my.oschina.net/u/1245 ... -
GCD 深入理解
2015-03-19 15:30 751转载:http://www.cocoachina.com/io ... -
发布iOS应用(xcode5)到App Store(苹果商店) 详细解析
2015-03-17 15:22 384转载:http://my.oschina.net/u/1245 ... -
Objective-C Runtime
2015-03-13 16:52 404转载:http://www.cocoachina.com/io ... -
ScrollView 与 Autolayout
2015-03-04 15:45 427http://www.cocoachina.com/ios/2 ... -
初探 ios 8 Size Class
2015-02-13 10:12 572转载:http://blog.csdn.net/please ... -
ios 8通知中心快速回复
2015-02-12 11:32 443转载:http://www.cocoachina.com/i ... -
StoryBoard
2015-02-09 12:54 350storyboard 学习资料1 http://www. ... -
Autolayout
2015-02-03 14:36 468推荐的链接: ios 自动布局教程(1) http:/ ...
相关推荐
简单利用UIBezierPath和CABaseAnimation实现按钮点击效果
简单讲就是通过插件将AE中画的动画转换成json文件,然后按照特定规则转换到页面上通过CABaseAnimation来实现。明确需求基本的聊天气泡,随文本大小变化气泡大小并保证边界圆角等形状不变动态气泡,气泡内容会能动态...
天然气汽车供气系统减压装置毕业设计(cad+设计方案)
PHP+SQL考勤系统安全性实现(源代码+论文+答辩PPT+指导书)
NumPy 的用途是什么
毕业设计 基于javaweb的在线答题平台
基于MATLAB的pca人脸识别.zip
课设毕设基于SSM的系统源码可运行
JAVAWML信息查询与后端信息发布系统实现——WML信息查询设计(源代码+LW)
毕业设计[整站程序]情感家园站 v3.0 For 个人版_qgweb30fp.zip
可以自动刷课,执行重复的脚本工作,内有详细操作教程。支持WIN7---WIN10系统。
Java项目之实验室计算机故障报修系统(源码) 开发语言:Java 框架:ssm 技术:JSP JDK版本:JDK1.8 服务器:tomcat7 数据库:mysql 5.7(一定要5.7版本) 数据库工具:Navicat11 开发软件:eclipse/myeclipse/idea Maven包:Maven3.3.9
协同过滤算法(Collaborative Filtering)是一种经典的推荐算法,其基本原理是“协同大家的反馈、评价和意见,一起对海量的信息进行过滤,从中筛选出用户可能感兴趣的信息”。它主要依赖于用户和物品之间的行为关系进行推荐。 协同过滤算法主要分为两类: 基于物品的协同过滤算法:给用户推荐与他之前喜欢的物品相似的物品。 基于用户的协同过滤算法:给用户推荐与他兴趣相似的用户喜欢的物品。 协同过滤算法的优点包括: 无需事先对商品或用户进行分类或标注,适用于各种类型的数据。 算法简单易懂,容易实现和部署。 推荐结果准确性较高,能够为用户提供个性化的推荐服务。 然而,协同过滤算法也存在一些缺点: 对数据量和数据质量要求较高,需要大量的历史数据和较高的数据质量。 容易受到“冷启动”问题的影响,即对新用户或新商品的推荐效果较差。 存在“同质化”问题,即推荐结果容易出现重复或相似的情况。 协同过滤算法在多个场景中有广泛的应用,如电商推荐系统、社交网络推荐和视频推荐系统等。在这些场景中,协同过滤算法可以根据用户的历史行为数据,推荐与用户兴趣相似的商品、用户或内容,从而提高用户的购买转化率、活跃度和社交体验。 未来,协同过滤算法的发展方向可能是结合其他推荐算法形成混合推荐系统,以充分发挥各算法的优势。
JAVAWEB校园二手平台项目,基本功能包括:个人信息、商品管理;交易商品板块管理等。本系统结构如下: (1)本月推荐交易板块: 电脑及配件:实现对该类商品的查询、用户留言功能 通讯器材:实现对该类商品的查询、用户留言功能 视听设备:实现对该类商品的查询、用户留言功能 书籍报刊:实现对该类商品的查询、用户留言功能 生活服务:实现对该类商品的查询、用户留言功能 房屋信息:实现对该类商品的查询、用户留言功能 交通工具:实现对该类商品的查询、用户留言功能 其他商品:实现对该类商品的查询、用户留言功能 (2)载入个人用户: 用户登陆 用户注册 (3)个人平台: 信息管理:实现对商品的删除、修改、查询功能 添加二手信息:实现对新商品的添加 修改个人资料:实现对用户个人信息的修改 注销
协同过滤算法(Collaborative Filtering)是一种经典的推荐算法,其基本原理是“协同大家的反馈、评价和意见,一起对海量的信息进行过滤,从中筛选出用户可能感兴趣的信息”。它主要依赖于用户和物品之间的行为关系进行推荐。 协同过滤算法主要分为两类: 基于物品的协同过滤算法:给用户推荐与他之前喜欢的物品相似的物品。 基于用户的协同过滤算法:给用户推荐与他兴趣相似的用户喜欢的物品。 协同过滤算法的优点包括: 无需事先对商品或用户进行分类或标注,适用于各种类型的数据。 算法简单易懂,容易实现和部署。 推荐结果准确性较高,能够为用户提供个性化的推荐服务。 然而,协同过滤算法也存在一些缺点: 对数据量和数据质量要求较高,需要大量的历史数据和较高的数据质量。 容易受到“冷启动”问题的影响,即对新用户或新商品的推荐效果较差。 存在“同质化”问题,即推荐结果容易出现重复或相似的情况。 协同过滤算法在多个场景中有广泛的应用,如电商推荐系统、社交网络推荐和视频推荐系统等。在这些场景中,协同过滤算法可以根据用户的历史行为数据,推荐与用户兴趣相似的商品、用户或内容,从而提高用户的购买转化率、活跃度和社交体验。 未来,协同过滤算法的发展方向可能是结合其他推荐算法形成混合推荐系统,以充分发挥各算法的优势。
Java游戏设计打飞机程序(源代码+LW)
Matlab实现CoMP多用户注水算法在最最基础的注水算法的基础上,实现了在功率受限速率受限的情况下CoMP多用户的功率分配.zip
自己写代码实现 Eigenface 人脸识别的训练与识别过程,纯手工实现 假设每张人脸图像只有一张人脸,且两只眼睛位置已知(即可人工标注给出)。每张图像的眼睛位置存在相应目录下的一个与图像文件名相同但后缀名为 txt 的文本文件里,文本文件中用一行、以空格分隔的 4 个数字表示,分别对应于两只眼睛中心在图像中的位置; 实现两个程序过程(两个执行文件),分别对应训练与识别; 自己构建一个人脸库(至少 40 人,包括自己),课程主页提供一个人脸库可选用; 不能直接调用 OpenCV 里面与 Eigenface 相关的一些函数,特征值与特征向量求解函数可以调用;只能用 C/C++/Python,不能用其他编程语言;GUI 只能用 OpenCV 自带的 HighGUI,不能用 QT 或其他的;平台可以用 Win/Linux/MacOS,建议 Win 优先;
有源电力滤波器的控制在MATLAB下的发展。三相电源电压是基于hysterezis正弦电流调节器.zip
BCH码的MATLAB程序源代码.zip