![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
文章平均质量分 51
cxmsmgr
这个作者很懒,什么都没留下…
展开
-
图像处理(黑白,模糊,浮雕,圆角,镜像,底片,油画,灰白,加旧,哈哈镜,放大镜)
http://www.devba.com/index.php/archives/5523.html转载 2015-09-28 11:57:47 · 477 阅读 · 0 评论 -
Matrix 转 四元数 已验证
方法一:float qw,qx,qy,qz;float tr = pose[0] + pose[5] + pose[10]; if (tr > 0) { float S = sqrt(tr+1.0) * 2; // S=4*qw qw = 0.25 * S;原创 2016-01-20 11:54:26 · 423 阅读 · 0 评论 -
BGRA转灰度数据
使用neon优化,iPhone4s 上测试时间在3ms,直接上代码,需要的朋友拿去#include void neon_asm_convert_BGRA_to_gray(uint8_t * __restrict dest, uint8_t * __restrict src, int numPixels){ #if defined(__arm64__) //64原创 2016-07-04 14:12:40 · 497 阅读 · 0 评论 -
矩阵转四元素的方法-已验证
//矩阵转四元素的方法// float mat[3][4] = { 00 01 02// 10 11 12// 20 21 22// }Quaternion convert3x3MatrixToQuaternion2(float mat[3][3]){ floa...原创 2018-04-23 11:51:56 · 1109 阅读 · 0 评论 -
四元素取逆-Quaternion Inverse - 已验证
四元素取逆其实就是xyz的值分别取反q = {x,y,z,w}q_inverse = {-x,-y,-z ,w}同时旋转矩阵取逆的方法如下:// float mat[3][3] = { 00 01 02// 10 11 12// 20 21 22// }float m3_de...原创 2018-04-23 11:58:39 · 6673 阅读 · 1 评论 -
四元素的乘法-注意左乘和右乘是有区别的
SCNQuaternion QuaternionMult(SCNQuaternion lhs,SCNQuaternion rhs){ SCNQuaternion v = {lhs.w * rhs.x + lhs.x * rhs.w + lhs.y * rhs.z - lhs.z * rhs.y, lhs.w * rhs.y + lhs.y * rhs.w + lhs.z * rhs.x ...原创 2018-04-23 12:01:29 · 5400 阅读 · 0 评论 -
四元素与点的乘法-得到的是空间点做旋转后的点的坐标-AR开发常用
SCNVector3 QuaternionMultVector(SCNQuaternion rotation, SCNVector3 point){ float num = rotation.x * 2; float num2 = rotation.y * 2; float num3 = rotation.z * 2; float num4 = rotation....原创 2018-04-23 12:03:08 · 552 阅读 · 0 评论 -
旋转矩阵的乘法
这个高数里学过,就是左行分别乘右列,然后相加。void mtxMultMatrixf(float M[3][3], float T[3][3]){ float M0[3][3]; for (int j = 0; j < 3; j++){ for (int i = 0; i < 3; i++){ M0[j][i] = T...原创 2018-04-23 12:06:06 · 3648 阅读 · 0 评论 -
四元素进行多次运算操作后需要规范化
最近被一个问题困扰了几天,刚才终得解决,在此纪录一下:问题表现:我的AR算法计算出的矩阵转换成四元数在unity里面使用时,会在某些角度出现大幅度不规律的飘、闪动问题思路:刚开始以为ICP运算时点的变化太大,导致旋转矩阵变化太大,把点值变化和矩阵变化都输入查看后,发现变化都在很小的范围 0.000X,绝对不足以造成这么大的波动。于是把问题锁定在旋转矩阵转四元素的计算方法上出了问题,但查了很...原创 2018-11-29 15:35:56 · 961 阅读 · 0 评论