Fork me on GitHub

11 2017 档案

摘要:最近用到KNN方法,学习一下OpenCV给出的demo。 demo大意是随机生成两团二维空间中的点,然后在500*500的二维空间平面上,计算每一个点属于哪一个类,然后用红色和绿色显示出来每一个点 如下是一系demo里用到的相关函数。 运行效果: 红色背景应该是表示每一个像素的类别标签和红色的点的标 阅读全文
posted @ 2017-11-29 16:59 hellowOOOrld 阅读(1107) 评论(0) 推荐(0)
摘要:A self-dividing number is a number that is divisible by every digit it contains. For example, 128 is a self-dividing number because 128 % 1 == 0, 128 阅读全文
posted @ 2017-11-25 22:55 hellowOOOrld 阅读(257) 评论(0) 推荐(0)
摘要:Given an array of integers nums, write a method that returns the "pivot" index of this array. We define the pivot index as the index where the sum of 阅读全文
posted @ 2017-11-13 14:31 hellowOOOrld 阅读(274) 评论(0) 推荐(0)
摘要:最近需要读取一些格式化路径的文件。路径文件名字最后是数字从0开始到100结束,但是占了4位,即0000到0100这样。 需要将int转成string的同时加上前缀0. 方法一: 用sprintf()函数。 方法二: 使用c++的stringstream 。 添加头文件 #include <iostr 阅读全文
posted @ 2017-11-09 18:31 hellowOOOrld 阅读(17441) 评论(0) 推荐(2)