2014-11-10

提取音频

ffmpeg -i input -vn output.mp3

-vn 不需要视频 no video

压缩

ffmpeg -i input -acodec copy -vcodec copy -s 800x600 output

-s scale 压缩后大小

标签: ffmpeg, video
日期: 2016-02-02 17:30:06, 8 years and 348 days ago

感知哈希 Perceptual Hash

  • 缩小图像
  • 灰度化处理
  • 二值化处理
  • 产生图像指纹

特点:速度快,算法简单,但无法匹配变换(如,旋转等)后的图像。

感知哈希算法的详细描述

感知哈希开源库:pHash

感知哈希的另一种实现:dhash

基于特征点比较 Keypoint Matching

  • 生成一系列特征区域
  • 对特征区域进行处理产生特征点
  • 对特征点进行比较,得出结果

特点:标准的图像配准算法,可用于图像匹配,健全性强,计算速度较慢,涉及很多数学知识(本人数学基础巨差,完全看不懂)

代表算法: sirf, surf

直方图匹配 Histogram method

  • 生成多个直方图
  • 比较直方图,得出图像近似度

特点:速度较快,健全性不强,可以通过产生特殊的直方图兼容图像变换

特征点匹配结合决策树 Keypoint and Decision Trees

特征匹配与机器学习相结合

特点:速度快,健全性强,但算法实现复杂

参考

感知哈希算法——找出相似的图片

Dr. Neal Krawetz' Blog

Image comparison - fast algorithm - Stack Overflow

Simple image comparison in .NET

SIFT算法详解

SIFT 特征提取算法总结

特征点检测学习_surf算法

标签: algorithm
日期: 2016-01-22 17:30:06, 8 years and 359 days ago

使用余(正)弦函数公式

y = a * cos(x * b)

其中,a决定幅度,b决定周期。

关键流程

根据余弦公式绘制曲线,形成闭合路径,再填充颜色,做遮罩成去掉无用部分

源代码

Setting environment for using Microsoft Visual Studio 2008 x86 tools.
>cl waterwave.cpp /Zi /link user32.lib gdi32.lib

参考

异形窗口
水波纹效果-iOS实现

标签: windows
日期: 2016-01-16 17:30:06, 9 years ago

Mac键盘上特殊功能键的说明

mackeys.png

标签: xos
日期: 2016-01-08 17:30:06, 9 years and 8 days ago

解决UITableVIewHeaderCell的布局和警告问题

in the custom UITableViewHeaderFooterCell, the width of the reuse view can not be configed in a right way. And there is a warnning 'Setting the background color on UITableViewHeaderFooterView has been deprecated. Please use contentView.backgroundColor instead.' during the running.

the reason that the view that is added to xib is UITableViewCell. instead of UICollectionReusableView, the problems are fixed.

在定制UITableView的section的Footer时,重用的模板view不能正确的布局,width总不能正确匹配并且 程序运行时,总是出现'Setting the background color on UITableViewHeaderFooterView has been deprecated. Please use contentView.backgroundColor instead.'的警告。

原因是,在向xib添加view时,使用的是UITableViewCell,用UICollectionReusableView替换即可可解决问题。

标签: ios, objc, cocoa
日期: 2015-10-23 17:30:06, 9 years and 85 days ago