【IT专家】背景减除算法之K
- 格式:pdf
- 大小:194.41 KB
- 文档页数:2
去除背景色运算全文共四篇示例,供读者参考第一篇示例:背景色去除运算是一种常见的图像处理操作,它通常用于将图像中的背景颜色去除,以便更好地突出图像中的主体内容。
这种操作在许多应用中都是必不可少的,比如在人脸识别、物体检测、图像分割等领域都有着重要的作用。
背景色去除运算的实现方法有很多种,其中比较常见的有基于像素值的方法和基于颜色模型的方法。
在基于像素值的方法中,通常会通过设定一个阈值来判断某一像素是否为背景色,并将其替换为透明色或其他特定的颜色,从而实现背景色的去除。
而在基于颜色模型的方法中,通常会先对输入图像进行颜色空间转换,然后根据颜色模型的特性来判断某一像素是否为背景色,并进行相应的处理。
在实际应用中,背景色去除运算往往需要结合其他图像处理技术来实现更好的效果。
比如在物体检测中,除了去除背景色之外,还需要进行边缘检测、形态学处理等操作来提取出目标物体的轮廓,从而实现更精确的物体检测。
在人脸识别中,除了去除背景色之外,还需要进行人脸检测、特征提取等操作来识别人脸,并进行相应的处理。
背景色去除运算虽然在许多图像处理应用中都有着重要的作用,但是在实际操作中也存在一些挑战和难点。
其中一个主要的挑战是如何准确地判断背景色,并将其去除而不影响图像中的主体内容。
由于图像中的背景色可能会受到光照、阴影、噪声等因素的影响,因此传统的背景色去除算法往往会出现一些误判或遗漏的情况,导致图像处理结果不够准确。
为了解决这个问题,研究者们提出了许多改进的算法和技术,比如基于深度学习的图像分割方法、基于双边滤波的图像去噪方法等。
这些方法在一定程度上可以提高背景色去除的准确性和鲁棒性,但是也需要更多的计算资源和数据进行训练,因此在实际应用中的成本和效率也是需要考虑的因素。
背景色去除运算是图像处理领域中一项重要的技术,它对于提高图像质量、优化图像分析和识别效果都有着重要的作用。
随着深度学习和计算机视觉技术的不断发展,相信背景色去除运算在未来会有更广泛的应用和更高的研究价值。
信息技术试题(附参考答案)一、单选题(共62题,每题1分,共62分)1.需要设置条件区域进行筛选的是()A、数字筛选B、自定义筛选C、高级筛选D、自动筛选正确答案:C2.通常所说的“裸机”是指计算机仅有()A、硬件系统B、软件C、指令系统D、CPIJ正确答案:A3.下列关于文档表格中常用的函数功能描述不正确的是( )。
A、ABS()表示数字或算式的绝对值,括号内无论是正值还是负值,均取正值B、SUM()表示一组数值或算式值的总和C、AVERAGE()表示一组数值或算式值的平均值D、MAX()表示一组数值中的最小值正确答案:D4.所有s元素都放在一对圆括号中,元素之间用逗号隔开,若元素只有一个,则元素后面的逗号不能省略。
以上特性描述的对象类型是()A、dictB、tupleC、listD、set正确答案:B5.计算机显示器画面的清晰度决定于显示器的()A、色彩B、分辨率C、图形D、亮度正确答案:B6.要把学校行政楼和实验楼的局域网互联,可以通过()实现。
A、路由器B、网卡C、交换机D、Modem正确答案:C7.冯·诺依曼结构计算机的五大基本构件包括运算器、存储器、输入设备、输出设备和()A、硬盘存储器B、鼠标器C、控制器D、显示器正确答案:C8.在文档编辑时,要插入希腊字母β,则应选择的功能区为()A、图片B、公式C、符号D、形状正确答案:C9.以下运算符中,不属于关系运算符的是()。
A、=B、>=C、&D、<正确答案:C10.下列关于系统更新说法错误的是()A、系统更新可以在联网的情况下自动执行B、系统更新后,可以减少病毒的攻击C、主流操作系统一般都自带了更新工具D、所有的更新应及时下载安装,否则系统会迅速崩溃正确答案:D11.可以用()命令查看通过域名访问主机对应的IP地址A、NetB、PingC、tracertD、Telnet正确答案:B12.己知a和b是两个整数,以下程序的作用是( ) r=a if a>=b else b print(r)A、输出变量a的值B、输出a和b较大的那个C、输出变量b的值D、输出a和b较小的那个正确答案:B13.要计算1到10的和,问号处应该填写( ) s=0 for i in range(?): s+=i print(s)A、10B、9C、0D、11正确答案:D14.下面各组设备中,同时包括了输入设备、输出设备和存储设备的是()A、CRT、CPIJ、ROMB、绘图仪、鼠标器、键盘C、鼠标器、绘图仪、光盘D、磁带、打印机、激光印字饥正确答案:C15.在什么视图方式下,能实现在一屏显示多张幻灯片( )A、阅读B、备注页C、幻灯片浏览D、普通正确答案:C16.针对信息系统的人为攻击分为偶然事故和()A、被动攻击B、恶意攻击C、必然事故D、主动攻击正确答案:B17.以下不属于机器人制作与开发划定的三条基本红线的是()。
[ 单项选择]1. 对于UiBot的“数据抓取”功能, 下列说法正确的是:能用来抓取Excel、Windows应用程序、浏览器中的表格只能用来抓取Windows应用程序中的表格只能用来抓取浏览器中的表格只能用来抓取Excel中的表格[ 单项选择]2. Office的“宏”(Macro)功能和RPA有什么区别"宏"只能控制Office, RPA可以操作多个软件“宏”比RPA更安全”宏“不是自动化操作, RPA是自动化操作“宏”比RPA更不安全[ 单项选择]3. 对于有目标命令, 其目标可以用树形结构表示。
在什么情况下, 会认为目标正确匹配了树形结构的一条分支能够匹配树形结构中的所有特征都完全匹配树形结构最里面的一级特征(即叶节点)能够完全匹配树形结构最里面的一级特征(即叶节点)能够匹配至少一个[ 单项选择]4. UiBot Creator的流程图在下列哪种情况下最能发挥作用业务专家和IT专家确定实现方式的时候IT专家后期维护的时候业务专家和用户确认需求的时候IT专家向用户交付的时候[ 单项选择]5. 对于下列语句a=[487, 557, 256] b=a b[0] = 558 运行后, a的值是:[558, 557, 256]558[487, 557, 256][487, 558, 256][ 单项选择]6. 对于语句a = b = c, 两个等号的作用分别是:这个语句是错误的两者都是判断是否相等两者都是赋值前者是赋值, 后者是判断是否相等前者是判断是否相等, 后者是赋值[ 单项选择]7. 为什么不通过几个软件系统之间设计一套数据互通的“数据总线”来解决跨软件难以自动化的问题因为安全原因而无法实现技术上无法实现以前的软件系统没有联网, 现在联网后很容易做到技术上可以实现, 但实际上很难做到[ 单项选择]8. 条件循环的源代码是?For NextNext BreakIf ElseDo Loop[ 单项选择]9. 鼠标模拟滚轮操作, 必选参数中“滚动次数”填写10, 实现的操作是?页面从上往下滚动页面来回滚动页面从下往上滚动不会滚动[ 单项选择]10. 在Windows的屏幕坐标系中, 坐标为(0,0)的点是在屏幕的什么位置?左上角右下角左下角右上角[ 单项选择]11. 用Chrome浏览器打开, 进入登录界面, 并选择“QQ登录”, 会发现网页上有的界面元素可以正确选取, 而QQ账号、密码等界面元素无法选取, 其原因是:没有安装Chrome的扩展程序没有以管理员账号启动UiBot这个网页上有跨域的元素, Chrome无法选取QQ账号、密码等界面元素是采用DirectUI技术绘制的, 无法选取[ 单项选择]12. 可视化视图中的键盘、鼠标等命令, 在源代码视图中表现为什么?启动线程启动流程函数定义函数调用[ 单项选择]13. 可视化编程中判断使用的是以下哪个命令?变量赋值条件分支计次循环条件循环[ 单项选择]14. 为什么UiBot要使用自创的语言, 而不是流行的脚本语言如Python等因为开源协议不允许使用因为技术上无法使用为了避免流行的脚本语言版本太多, 无法统一的问题为了让业务人员(而不是IT人员)更容易学习[ 单项选择]15. 在UiBot语言中, 如果一个函数有3个参数, 其中有1个带有默认值。
可编辑修改精选全文完整版3.2.1算法(2)-粤教版(2019)高中信息技术必修一练习学校:___________姓名:___________班级:___________考号:___________一、选择题1.某算法的部分流程图如第7题图所示。
执行这部分流程后,输出s和i的值分别是()A.-3 5B.-4 5C.-3 6D.-2 6【答案】A【解析】【分析】【详解】本题考查流程图。
Int(X)求不大于X 的最大整数,Int(s/10)=-3,故本题选A。
2.某算法的部分流程图如图所示,执行这部分流程后,变量s的值是()A.26B.30C.14D.10【答案】C【解析】【详解】本题考查流程图。
最终可得s=14,故本题选C。
试卷第2页,总15页3.以下哪个是算法的描述方法?()A.流程图描述法B.枚举法C.顺序法D.列表法【答案】A【解析】【详解】本题考查算法相关知识。
算法是指解题方案的准确而完整的描述,是一系列解决问题的清晰指令,算法代表着用系统的方法描述解决问题的策略机制。
也就是说,能够对一定规范的输入,在有限时间内获得所要求的输出。
如果一个算法有缺陷,或不适合于某个问题,执行这个算法将不会解决这个问题。
不同的算法可能用不同的时间、空间或效率来完成同样的任务。
一个算法的优劣可以用空间复杂度与时间复杂度来衡量。
算法的描述有流程图,自然语言和计算机语言。
故本题选A。
4.关于算法的描述,下列选项中正确的是()A.算法本身就是一种程序设计语言B.算法必须有输入C.算法的步骤可以是无穷的D.算法的每一步骤必须有确切的含义【答案】D【解析】【详解】本题考查的是算法相关知识。
所谓算法就是解题方法的精确描述,由有限个步骤组成,故选项A错误;有0 个或多个输入,故选项B错误;算法的步骤是有穷的,故选项C错误;算法具有确定性,指算法的每一步骤必须有确切的含义,故选项D正确。
5.以下不属于算法基本特征的是()A.可执行性B.确定性C.有穷性D.无限性【答案】D【解析】【详解】本题考查的是算法的特征。
计算机操作员四级考试题+答案一、单选题(共65题,每题1分,共65分)1.1TB表示()字节。
A、2的10次方B、2的20次方C、2的30次方D、2的40次方正确答案:D2.为了避免混淆,八进制数在书写时常在后面加字母()。
A、HB、OC、DD、B正确答案:B3.在Powerpoint2010中,“文件”选项卡可创建()。
A、页眉或页脚B、新文件、打开文件C、动画D、图标正确答案:B4.下面关于域名的说法正确的是()。
A、域名就是网址B、域名可以自己任意取C、域名专指一个服务器的名字D、域名系统按地理域或机构域分层采用层次结构正确答案:D5.在Word的编辑状态,选择四号字后,按新设置的字号显示的文字是()。
A、插入点所在的段落中的文字B、文档中被选择的文字C、插入点所在行中的文字D、文档的全部文字正确答案:B6.在64位高档微机中,一个字长所占的二进制位数为()。
A、32B、8C、16D、64正确答案:D7.UPS主要由()组成。
A、蓄电池B、电阻C、电容D、电感正确答案:A8.将十进制的整数化为N进制整数的方法是()。
A、除以N取余法B、乘以N取余法C、除以N取整法D、乘以N取整法正确答案:A9.当“我的电脑”窗口处于最大化状态,双击标题栏,会使窗口()。
A、最小化B、关闭C、还原D、没变化正确答案:C10.当前较流行的VB、VC等是面向()的程序设计语言。
A、机器B、对象C、结构D、过程正确答案:B11.汉字国标码(GB2312-80)规定,每个汉字用()。
A、一个字节表示B、二个字节表示C、三个字节表示D、四个字节表示12.用Word中进行编辑时,要将选定区域的内容放到的剪贴板上,可单击“开始”功能区中的()按钮。
A、剪切或替换B、剪切或清除C、剪切或粘贴D、剪切或复制正确答案:D13.以下对音频、视频设备的描述中,不正确的是()。
A、视频信息的采集和显示播放是通过视频卡、播放软件和显示设备来实现的B、视频卡可以处理一些相关的音频信息C、视频设备是音、视频输入输出设备的总称D、音频设备既可采集音频信号,也可播放音频信号正确答案:D14.在Windows中,若在某一文档中连续进行了多次剪切操作,当关闭该文档后,“剪贴板”中存放的是()。
中级计算机职称考试试题库(答案解析版)目录1. 数据结构与算法2. 操作系统3. 计算机网络4. 数据库系统5. 软件工程6. 计算机组成原理7. 编译原理8. 计算机图形学9. 计算机辅助设计10. 人工智能11. 信息安全12. 编程语言1. 数据结构与算法题目1:请描述什么是栈,并说明其应用场景。
答案:栈是一种后进先出(Last In First Out, LIFO)的数据结构。
它主要用于解决递归、深度优先搜索、表达式求值等问题。
栈的应用场景包括函数调用栈、浏览器的前进后退功能、括号匹配等。
题目2:请解释什么是时间复杂度和空间复杂度,并给出计算它们的公式。
答案:时间复杂度是评估算法执行时间与输入规模之间关系的量度,通常用大O符号表示。
空间复杂度是评估算法执行过程中所需内存与输入规模之间关系的量度,同样用大O符号表示。
时间复杂度公式:O(f(n))空间复杂度公式:O(g(n))2. 操作系统题目3:请简述进程和线程的区别。
答案:进程是计算机中程序执行的基本单位,每个进程都有独立的内存空间。
线程是进程内部的一个执行流程,线程共享进程的内存空间和其他资源。
进程和线程的主要区别在于资源占用和调度级别。
题目4:请解释什么是内存分页和内存分段,并说明它们的优缺点。
答案:内存分页是将物理内存划分为固定大小的页,与逻辑内存中的页相对应。
内存分段是将逻辑内存划分为可变大小的段,每个段表示程序的不同部分。
内存分页的优点是简化内存管理和实现虚拟内存。
缺点是可能会产生内部碎片。
内存分段的优点是提供更加灵活的内存分配,减少外部碎片。
缺点是内存管理复杂,需要维护段表。
3. 计算机网络题目5:请解释TCP和UDP协议的区别。
答案:TCP(传输控制协议)是一种面向连接、可靠的数据传输协议,它保证了数据的可靠传输和顺序传输。
UDP(用户数据报协议)是一种无连接、不可靠的数据传输协议,它提供了快速的传输,但不保证数据的可靠性和顺序性。
A Peer-to-Peer Spatial Cloaking Algorithm for AnonymousLocation-based Services∗Chi-Yin Chow Department of Computer Science and Engineering University of Minnesota Minneapolis,MN cchow@ Mohamed F.MokbelDepartment of ComputerScience and EngineeringUniversity of MinnesotaMinneapolis,MNmokbel@Xuan LiuIBM Thomas J.WatsonResearch CenterHawthorne,NYxuanliu@ABSTRACTThis paper tackles a major privacy threat in current location-based services where users have to report their ex-act locations to the database server in order to obtain their desired services.For example,a mobile user asking about her nearest restaurant has to report her exact location.With untrusted service providers,reporting private location in-formation may lead to several privacy threats.In this pa-per,we present a peer-to-peer(P2P)spatial cloaking algo-rithm in which mobile and stationary users can entertain location-based services without revealing their exact loca-tion information.The main idea is that before requesting any location-based service,the mobile user will form a group from her peers via single-hop communication and/or multi-hop routing.Then,the spatial cloaked area is computed as the region that covers the entire group of peers.Two modes of operations are supported within the proposed P2P spa-tial cloaking algorithm,namely,the on-demand mode and the proactive mode.Experimental results show that the P2P spatial cloaking algorithm operated in the on-demand mode has lower communication cost and better quality of services than the proactive mode,but the on-demand incurs longer response time.Categories and Subject Descriptors:H.2.8[Database Applications]:Spatial databases and GISGeneral Terms:Algorithms and Experimentation. Keywords:Mobile computing,location-based services,lo-cation privacy and spatial cloaking.1.INTRODUCTIONThe emergence of state-of-the-art location-detection de-vices,e.g.,cellular phones,global positioning system(GPS) devices,and radio-frequency identification(RFID)chips re-sults in a location-dependent information access paradigm,∗This work is supported in part by the Grants-in-Aid of Re-search,Artistry,and Scholarship,University of Minnesota. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on thefirst page.To copy otherwise,to republish,to post on servers or to redistribute to lists,requires prior specific permission and/or a fee.ACM-GIS’06,November10-11,2006,Arlington,Virginia,USA. Copyright2006ACM1-59593-529-0/06/0011...$5.00.known as location-based services(LBS)[30].In LBS,mobile users have the ability to issue location-based queries to the location-based database server.Examples of such queries include“where is my nearest gas station”,“what are the restaurants within one mile of my location”,and“what is the traffic condition within ten minutes of my route”.To get the precise answer of these queries,the user has to pro-vide her exact location information to the database server. With untrustworthy servers,adversaries may access sensi-tive information about specific individuals based on their location information and issued queries.For example,an adversary may check a user’s habit and interest by knowing the places she visits and the time of each visit,or someone can track the locations of his ex-friends.In fact,in many cases,GPS devices have been used in stalking personal lo-cations[12,39].To tackle this major privacy concern,three centralized privacy-preserving frameworks are proposed for LBS[13,14,31],in which a trusted third party is used as a middleware to blur user locations into spatial regions to achieve k-anonymity,i.e.,a user is indistinguishable among other k−1users.The centralized privacy-preserving frame-work possesses the following shortcomings:1)The central-ized trusted third party could be the system bottleneck or single point of failure.2)Since the centralized third party has the complete knowledge of the location information and queries of all users,it may pose a serious privacy threat when the third party is attacked by adversaries.In this paper,we propose a peer-to-peer(P2P)spatial cloaking algorithm.Mobile users adopting the P2P spatial cloaking algorithm can protect their privacy without seeking help from any centralized third party.Other than the short-comings of the centralized approach,our work is also moti-vated by the following facts:1)The computation power and storage capacity of most mobile devices have been improv-ing at a fast pace.2)P2P communication technologies,such as IEEE802.11and Bluetooth,have been widely deployed.3)Many new applications based on P2P information shar-ing have rapidly taken shape,e.g.,cooperative information access[9,32]and P2P spatio-temporal query processing[20, 24].Figure1gives an illustrative example of P2P spatial cloak-ing.The mobile user A wants tofind her nearest gas station while beingfive anonymous,i.e.,the user is indistinguish-able amongfive users.Thus,the mobile user A has to look around andfind other four peers to collaborate as a group. In this example,the four peers are B,C,D,and E.Then, the mobile user A cloaks her exact location into a spatialA B CDEBase Stationregion that covers the entire group of mobile users A ,B ,C ,D ,and E .The mobile user A randomly selects one of the mobile users within the group as an agent .In the ex-ample given in Figure 1,the mobile user D is selected as an agent.Then,the mobile user A sends her query (i.e.,what is the nearest gas station)along with her cloaked spa-tial region to the agent.The agent forwards the query to the location-based database server through a base station.Since the location-based database server processes the query based on the cloaked spatial region,it can only give a list of candidate answers that includes the actual answers and some false positives.After the agent receives the candidate answers,it forwards the candidate answers to the mobile user A .Finally,the mobile user A gets the actual answer by filtering out all the false positives.The proposed P2P spatial cloaking algorithm can operate in two modes:on-demand and proactive .In the on-demand mode,mobile clients execute the cloaking algorithm when they need to access information from the location-based database server.On the other side,in the proactive mode,mobile clients periodically look around to find the desired number of peers.Thus,they can cloak their exact locations into spatial regions whenever they want to retrieve informa-tion from the location-based database server.In general,the contributions of this paper can be summarized as follows:1.We introduce a distributed system architecture for pro-viding anonymous location-based services (LBS)for mobile users.2.We propose the first P2P spatial cloaking algorithm for mobile users to entertain high quality location-based services without compromising their privacy.3.We provide experimental evidence that our proposed algorithm is efficient in terms of the response time,is scalable to large numbers of mobile clients,and is effective as it provides high-quality services for mobile clients without the need of exact location information.The rest of this paper is organized as follows.Section 2highlights the related work.The system model of the P2P spatial cloaking algorithm is presented in Section 3.The P2P spatial cloaking algorithm is described in Section 4.Section 5discusses the integration of the P2P spatial cloak-ing algorithm with privacy-aware location-based database servers.Section 6depicts the experimental evaluation of the P2P spatial cloaking algorithm.Finally,Section 7con-cludes this paper.2.RELATED WORKThe k -anonymity model [37,38]has been widely used in maintaining privacy in databases [5,26,27,28].The main idea is to have each tuple in the table as k -anonymous,i.e.,indistinguishable among other k −1tuples.Although we aim for the similar k -anonymity model for the P2P spatial cloaking algorithm,none of these techniques can be applied to protect user privacy for LBS,mainly for the following four reasons:1)These techniques preserve the privacy of the stored data.In our model,we aim not to store the data at all.Instead,we store perturbed versions of the data.Thus,data privacy is managed before storing the data.2)These approaches protect the data not the queries.In anonymous LBS,we aim to protect the user who issues the query to the location-based database server.For example,a mobile user who wants to ask about her nearest gas station needs to pro-tect her location while the location information of the gas station is not protected.3)These approaches guarantee the k -anonymity for a snapshot of the database.In LBS,the user location is continuously changing.Such dynamic be-havior calls for continuous maintenance of the k -anonymity model.(4)These approaches assume a unified k -anonymity requirement for all the stored records.In our P2P spatial cloaking algorithm,k -anonymity is a user-specified privacy requirement which may have a different value for each user.Motivated by the privacy threats of location-detection de-vices [1,4,6,40],several research efforts are dedicated to protect the locations of mobile users (e.g.,false dummies [23],landmark objects [18],and location perturbation [10,13,14]).The most closed approaches to ours are two centralized spatial cloaking algorithms,namely,the spatio-temporal cloaking [14]and the CliqueCloak algorithm [13],and one decentralized privacy-preserving algorithm [23].The spatio-temporal cloaking algorithm [14]assumes that all users have the same k -anonymity requirements.Furthermore,it lacks the scalability because it deals with each single request of each user individually.The CliqueCloak algorithm [13]as-sumes a different k -anonymity requirement for each user.However,since it has large computation overhead,it is lim-ited to a small k -anonymity requirement,i.e.,k is from 5to 10.A decentralized privacy-preserving algorithm is proposed for LBS [23].The main idea is that the mobile client sends a set of false locations,called dummies ,along with its true location to the location-based database server.However,the disadvantages of using dummies are threefold.First,the user has to generate realistic dummies to pre-vent the adversary from guessing its true location.Second,the location-based database server wastes a lot of resources to process the dummies.Finally,the adversary may esti-mate the user location by using cellular positioning tech-niques [34],e.g.,the time-of-arrival (TOA),the time differ-ence of arrival (TDOA)and the direction of arrival (DOA).Although several existing distributed group formation al-gorithms can be used to find peers in a mobile environment,they are not designed for privacy preserving in LBS.Some algorithms are limited to only finding the neighboring peers,e.g.,lowest-ID [11],largest-connectivity (degree)[33]and mobility-based clustering algorithms [2,25].When a mo-bile user with a strict privacy requirement,i.e.,the value of k −1is larger than the number of neighboring peers,it has to enlist other peers for help via multi-hop routing.Other algorithms do not have this limitation,but they are designed for grouping stable mobile clients together to facil-Location-based Database ServerDatabase ServerDatabase ServerFigure 2:The system architectureitate efficient data replica allocation,e.g.,dynamic connec-tivity based group algorithm [16]and mobility-based clus-tering algorithm,called DRAM [19].Our work is different from these approaches in that we propose a P2P spatial cloaking algorithm that is dedicated for mobile users to dis-cover other k −1peers via single-hop communication and/or via multi-hop routing,in order to preserve user privacy in LBS.3.SYSTEM MODELFigure 2depicts the system architecture for the pro-posed P2P spatial cloaking algorithm which contains two main components:mobile clients and location-based data-base server .Each mobile client has its own privacy profile that specifies its desired level of privacy.A privacy profile includes two parameters,k and A min ,k indicates that the user wants to be k -anonymous,i.e.,indistinguishable among k users,while A min specifies the minimum resolution of the cloaked spatial region.The larger the value of k and A min ,the more strict privacy requirements a user needs.Mobile users have the ability to change their privacy profile at any time.Our employed privacy profile matches the privacy re-quirements of mobiles users as depicted by several social science studies (e.g.,see [4,15,17,22,29]).In this architecture,each mobile user is equipped with two wireless network interface cards;one of them is dedicated to communicate with the location-based database server through the base station,while the other one is devoted to the communication with other peers.A similar multi-interface technique has been used to implement IP multi-homing for stream control transmission protocol (SCTP),in which a machine is installed with multiple network in-terface cards,and each assigned a different IP address [36].Similarly,in mobile P2P cooperation environment,mobile users have a network connection to access information from the server,e.g.,through a wireless modem or a base station,and the mobile users also have the ability to communicate with other peers via a wireless LAN,e.g.,IEEE 802.11or Bluetooth [9,24,32].Furthermore,each mobile client is equipped with a positioning device, e.g.,GPS or sensor-based local positioning systems,to determine its current lo-cation information.4.P2P SPATIAL CLOAKINGIn this section,we present the data structure and the P2P spatial cloaking algorithm.Then,we describe two operation modes of the algorithm:on-demand and proactive .4.1Data StructureThe entire system area is divided into grid.The mobile client communicates with each other to discover other k −1peers,in order to achieve the k -anonymity requirement.TheAlgorithm 1P2P Spatial Cloaking:Request Originator m 1:Function P2PCloaking-Originator (h ,k )2://Phase 1:Peer searching phase 3:The hop distance h is set to h4:The set of discovered peers T is set to {∅},and the number ofdiscovered peers k =|T |=05:while k <k −1do6:Broadcast a FORM GROUP request with the parameter h (Al-gorithm 2gives the response of each peer p that receives this request)7:T is the set of peers that respond back to m by executingAlgorithm 28:k =|T |;9:if k <k −1then 10:if T =T then 11:Suspend the request 12:end if 13:h ←h +1;14:T ←T ;15:end if 16:end while17://Phase 2:Location adjustment phase 18:for all T i ∈T do19:|mT i .p |←the greatest possible distance between m and T i .pby considering the timestamp of T i .p ’s reply and maximum speed20:end for21://Phase 3:Spatial cloaking phase22:Form a group with k −1peers having the smallest |mp |23:h ←the largest hop distance h p of the selected k −1peers 24:Determine a grid area A that covers the entire group 25:if A <A min then26:Extend the area of A till it covers A min 27:end if28:Randomly select a mobile client of the group as an agent 29:Forward the query and A to the agentmobile client can thus blur its exact location into a cloaked spatial region that is the minimum grid area covering the k −1peers and itself,and satisfies A min as well.The grid area is represented by the ID of the left-bottom and right-top cells,i.e.,(l,b )and (r,t ).In addition,each mobile client maintains a parameter h that is the required hop distance of the last peer searching.The initial value of h is equal to one.4.2AlgorithmFigure 3gives a running example for the P2P spatial cloaking algorithm.There are 15mobile clients,m 1to m 15,represented as solid circles.m 8is the request originator,other black circles represent the mobile clients received the request from m 8.The dotted circles represent the commu-nication range of the mobile client,and the arrow represents the movement direction.Algorithms 1and 2give the pseudo code for the request originator (denoted as m )and the re-quest receivers (denoted as p ),respectively.In general,the algorithm consists of the following three phases:Phase 1:Peer searching phase .The request origina-tor m wants to retrieve information from the location-based database server.m first sets h to h ,a set of discovered peers T to {∅}and the number of discovered peers k to zero,i.e.,|T |.(Lines 3to 4in Algorithm 1).Then,m broadcasts a FORM GROUP request along with a message sequence ID and the hop distance h to its neighboring peers (Line 6in Algorithm 1).m listens to the network and waits for the reply from its neighboring peers.Algorithm 2describes how a peer p responds to the FORM GROUP request along with a hop distance h and aFigure3:P2P spatial cloaking algorithm.Algorithm2P2P Spatial Cloaking:Request Receiver p1:Function P2PCloaking-Receiver(h)2://Let r be the request forwarder3:if the request is duplicate then4:Reply r with an ACK message5:return;6:end if7:h p←1;8:if h=1then9:Send the tuple T=<p,(x p,y p),v maxp ,t p,h p>to r10:else11:h←h−1;12:Broadcast a FORM GROUP request with the parameter h 13:T p is the set of peers that respond back to p14:for all T i∈T p do15:T i.h p←T i.h p+1;16:end for17:T p←T p∪{<p,(x p,y p),v maxp ,t p,h p>};18:Send T p back to r19:end ifmessage sequence ID from another peer(denoted as r)that is either the request originator or the forwarder of the re-quest.First,p checks if it is a duplicate request based on the message sequence ID.If it is a duplicate request,it sim-ply replies r with an ACK message without processing the request.Otherwise,p processes the request based on the value of h:Case1:h= 1.p turns in a tuple that contains its ID,current location,maximum movement speed,a timestamp and a hop distance(it is set to one),i.e.,< p,(x p,y p),v max p,t p,h p>,to r(Line9in Algorithm2). Case2:h> 1.p decrements h and broadcasts the FORM GROUP request with the updated h and the origi-nal message sequence ID to its neighboring peers.p keeps listening to the network,until it collects the replies from all its neighboring peers.After that,p increments the h p of each collected tuple,and then it appends its own tuple to the collected tuples T p.Finally,it sends T p back to r (Lines11to18in Algorithm2).After m collects the tuples T from its neighboring peers, if m cannotfind other k−1peers with a hop distance of h,it increments h and re-broadcasts the FORM GROUP request along with a new message sequence ID and h.m repeatedly increments h till itfinds other k−1peers(Lines6to14in Algorithm1).However,if mfinds the same set of peers in two consecutive broadcasts,i.e.,with hop distances h and h+1,there are not enough connected peers for m.Thus, m has to relax its privacy profile,i.e.,use a smaller value of k,or to be suspended for a period of time(Line11in Algorithm1).Figures3(a)and3(b)depict single-hop and multi-hop peer searching in our running example,respectively.In Fig-ure3(a),the request originator,m8,(e.g.,k=5)canfind k−1peers via single-hop communication,so m8sets h=1. Since h=1,its neighboring peers,m5,m6,m7,m9,m10, and m11,will not further broadcast the FORM GROUP re-quest.On the other hand,in Figure3(b),m8does not connect to k−1peers directly,so it has to set h>1.Thus, its neighboring peers,m7,m10,and m11,will broadcast the FORM GROUP request along with a decremented hop dis-tance,i.e.,h=h−1,and the original message sequence ID to their neighboring peers.Phase2:Location adjustment phase.Since the peer keeps moving,we have to capture the movement between the time when the peer sends its tuple and the current time. For each received tuple from a peer p,the request originator, m,determines the greatest possible distance between them by an equation,|mp |=|mp|+(t c−t p)×v max p,where |mp|is the Euclidean distance between m and p at time t p,i.e.,|mp|=(x m−x p)2+(y m−y p)2,t c is the currenttime,t p is the timestamp of the tuple and v maxpis the maximum speed of p(Lines18to20in Algorithm1).In this paper,a conservative approach is used to determine the distance,because we assume that the peer will move with the maximum speed in any direction.If p gives its movement direction,m has the ability to determine a more precise distance between them.Figure3(c)illustrates that,for each discovered peer,the circle represents the largest region where the peer can lo-cate at time t c.The greatest possible distance between the request originator m8and its discovered peer,m5,m6,m7, m9,m10,or m11is represented by a dotted line.For exam-ple,the distance of the line m8m 11is the greatest possible distance between m8and m11at time t c,i.e.,|m8m 11|. Phase3:Spatial cloaking phase.In this phase,the request originator,m,forms a virtual group with the k−1 nearest peers,based on the greatest possible distance be-tween them(Line22in Algorithm1).To adapt to the dynamic network topology and k-anonymity requirement, m sets h to the largest value of h p of the selected k−1 peers(Line15in Algorithm1).Then,m determines the minimum grid area A covering the entire group(Line24in Algorithm1).If the area of A is less than A min,m extends A,until it satisfies A min(Lines25to27in Algorithm1). Figure3(c)gives the k−1nearest peers,m6,m7,m10,and m11to the request originator,m8.For example,the privacy profile of m8is(k=5,A min=20cells),and the required cloaked spatial region of m8is represented by a bold rectan-gle,as depicted in Figure3(d).To issue the query to the location-based database server anonymously,m randomly selects a mobile client in the group as an agent(Line28in Algorithm1).Then,m sendsthe query along with the cloaked spatial region,i.e.,A,to the agent(Line29in Algorithm1).The agent forwards thequery to the location-based database server.After the serverprocesses the query with respect to the cloaked spatial re-gion,it sends a list of candidate answers back to the agent.The agent forwards the candidate answer to m,and then mfilters out the false positives from the candidate answers. 4.3Modes of OperationsThe P2P spatial cloaking algorithm can operate in twomodes,on-demand and proactive.The on-demand mode:The mobile client only executesthe algorithm when it needs to retrieve information from the location-based database server.The algorithm operatedin the on-demand mode generally incurs less communica-tion overhead than the proactive mode,because the mobileclient only executes the algorithm when necessary.However,it suffers from a longer response time than the algorithm op-erated in the proactive mode.The proactive mode:The mobile client adopting theproactive mode periodically executes the algorithm in back-ground.The mobile client can cloak its location into a spa-tial region immediately,once it wants to communicate withthe location-based database server.The proactive mode pro-vides a better response time than the on-demand mode,but it generally incurs higher communication overhead and giveslower quality of service than the on-demand mode.5.ANONYMOUS LOCATION-BASEDSERVICESHaving the spatial cloaked region as an output form Algo-rithm1,the mobile user m sends her request to the location-based server through an agent p that is randomly selected.Existing location-based database servers can support onlyexact point locations rather than cloaked regions.In or-der to be able to work with a spatial region,location-basedservers need to be equipped with a privacy-aware queryprocessor(e.g.,see[29,31]).The main idea of the privacy-aware query processor is to return a list of candidate answerrather than the exact query answer.Then,the mobile user m willfilter the candidate list to eliminate its false positives andfind its exact answer.The tighter the spatial cloaked re-gion,the lower is the size of the candidate answer,and hencethe better is the performance of the privacy-aware query processor.However,tight cloaked regions may represent re-laxed privacy constrained.Thus,a trade-offbetween the user privacy and the quality of service can be achieved[31]. Figure4(a)depicts such scenario by showing the data stored at the server side.There are32target objects,i.e., gas stations,T1to T32represented as black circles,the shaded area represents the spatial cloaked area of the mo-bile client who issued the query.For clarification,the actual mobile client location is plotted in Figure4(a)as a black square inside the cloaked area.However,such information is neither stored at the server side nor revealed to the server. The privacy-aware query processor determines a range that includes all target objects that are possibly contributing to the answer given that the actual location of the mobile client could be anywhere within the shaded area.The range is rep-resented as a bold rectangle,as depicted in Figure4(b).The server sends a list of candidate answers,i.e.,T8,T12,T13, T16,T17,T21,and T22,back to the agent.The agent next for-(a)Server Side(b)Client SideFigure4:Anonymous location-based services wards the candidate answers to the requesting mobile client either through single-hop communication or through multi-hop routing.Finally,the mobile client can get the actualanswer,i.e.,T13,byfiltering out the false positives from thecandidate answers.The algorithmic details of the privacy-aware query proces-sor is beyond the scope of this paper.Interested readers are referred to[31]for more details.6.EXPERIMENTAL RESULTSIn this section,we evaluate and compare the scalabilityand efficiency of the P2P spatial cloaking algorithm in boththe on-demand and proactive modes with respect to the av-erage response time per query,the average number of mes-sages per query,and the size of the returned candidate an-swers from the location-based database server.The queryresponse time in the on-demand mode is defined as the timeelapsed between a mobile client starting to search k−1peersand receiving the candidate answers from the agent.On theother hand,the query response time in the proactive mode is defined as the time elapsed between a mobile client startingto forward its query along with the cloaked spatial regionto the agent and receiving the candidate answers from theagent.The simulation model is implemented in C++usingCSIM[35].In all the experiments in this section,we consider an in-dividual random walk model that is based on“random way-point”model[7,8].At the beginning,the mobile clientsare randomly distributed in a spatial space of1,000×1,000square meters,in which a uniform grid structure of100×100cells is constructed.Each mobile client randomly chooses itsown destination in the space with a randomly determined speed s from a uniform distribution U(v min,v max).When the mobile client reaches the destination,it comes to a stand-still for one second to determine its next destination.Afterthat,the mobile client moves towards its new destinationwith another speed.All the mobile clients repeat this move-ment behavior during the simulation.The time interval be-tween two consecutive queries generated by a mobile client follows an exponential distribution with a mean of ten sec-onds.All the experiments consider one half-duplex wirelesschannel for a mobile client to communicate with its peers with a total bandwidth of2Mbps and a transmission range of250meters.When a mobile client wants to communicate with other peers or the location-based database server,it has to wait if the requested channel is busy.In the simulated mobile environment,there is a centralized location-based database server,and one wireless communication channel between the location-based database server and the mobile。
英文回答:The traditional methodology for background subtraction and shadow detection in video surveillance is a widely employed algorithm for the detection of moving objects. This algorithm is based on the construction of a background model for a given scene, which is then utilized topare each frame of the video in order to discern foreground objects. The initial stage of this algorithm involves the formulation of a background model using statistical techniques such as mean or median pixel intensity. Subsequently, this background model is applied to categorize pixels within each frame as either background, foreground, or shadow.视瓶监控中传统的背景减法和阴影检测法是广泛使用的检测移动对象的算法。
这个算法是基于为给定场景构建一个背景模型,然后利用这个模型对视瓶的每个帧进行拓扑,以便辨别前景对象。
该算法的初始阶段涉及使用平均或中位像素强度等统计技术来制定背景模型。
随后,这个背景模型被用于将每个框架内的像素分类为背景,前景,或者阴影。
So, the first part of this algorithm is all about figuring out what's different between each frame and the background. If a pixel'svalue is a lot different from the background, it's labeled as part of the foreground. But sometimes, the background model gets outdated because of changes in lighting or camera noise, and that can cause mistakes. To fix this, the background model needs to be updated constantly to keep up with changes in the scene. And another important thing is detecting shadows, which can look like moving objects. So, wepare the color and brightness of the foreground with the background to try and spot any potential shadows.这个算法的第一部分,都是为了找出每个框架和背景的不同之处。
背景减除算法之K
2017/12/16 446 Python版本:3.5.2,Opencv版本:3.2.0,网上安装教程很多,在此不再赘述MOG2算法,即高斯混合模型分离算法,是MOG的改进算法。
它基于Z.Zivkovic发布的两篇论文,即2004年发布的“Improved adaptive Gausian mixture model for background subtraction”和2006年发布的“Efficient Adaptive Density Estimation per Image Pixel for the Task of Background Subtraction”中提出。
KNN算法,即K-nearest neigbours - based Background/Foreground Segmentation Algorithm。
2006年,由Zoran Zivkovic 和Ferdinand van der Heijden在论文”Efficient adaptive density estimation per image pixel for the task of background subtraction.”中提出。
下面介绍两种算法的具体实现,实验中所用到的视频为CASIA步态数据库,用以上两种算法分别提取步态轮廓图像步态视频已上传到百度云,步态视频,提取密码:9mt0
(一)MOG2算法实现import numpy as npimport cv2cap=cv2.VideoCapture(‘D:\gait-vedio\gait.avi’)#混合高斯,对每一帧的环境进行学习,常用来对不同帧进行比较,并存储以前的帧,可按时间推移的方法提高运动分析的结果。
fgbg=cv2.createBackgroundSubtractorMOG2() while(1): #默认第一帧为背景图片ret,frame=cap.read() fgmask=fgbg.apply(frame) cv2.imshow(‘frame’,fgmask) k=cv2.waitKey(30) 0xff#按’q’键退出循环if k== ord(‘q’): breakcap.release()cv2.destroyAllWindows() 实验结果,(一)KNN算法实现采用KNN实现视频图像的背景分割算法,并且保存每一帧图像(与视频文件在相同的文件夹)
import cv2#视频文件路径datapath = “D:/test1gait/”bs = cv2.createBackgroundSubtractorKNN(detectShadows = False)#背景减除器,设置阴影检测#训练帧数history=20 bs.setHistory(history)frames=0camera = cv2.VideoCapture(datapath + “gait2.avi”)count = 0#对原始帧进行膨胀去噪,#前景区域二值化,将非白色(0-244)的非前景区域(包含背景以及阴影)均设为0,前景。