c
LIZhang2016
本人从事于机器视觉,主要是关于机器识别技术,用到opencl加速,opencv,和图像处理的算法,以及音视频相关技术
展开
-
通用性链表代码
// 头文件#ifndef _LIST_H_#define _LIST_H_#include <stdio.h>#include <stdlib.h>#include <stddef.h>typedef struct list_s List, *Plist;struct list_s{ Plist prev, next;};//初始化 h:头节点指针 #define Lis原创 2016-06-16 18:28:03 · 328 阅读 · 0 评论 -
Fast 角点提取c++代码
本人近来研究opencv的Fast 的源码,发现opencv 对Fast 的算法写的有优化,并不方便初学者来理解代码,本人根据Fast 算法的原理,写了一个相对非常好理解的Fast 算法,在速度上不如opencv, 但是在代码的理解和简洁上绝对是更胜一抽,希望能帮助更多学习Fast 算法的同学们,请大家相信,本程序Fast 的结果经过验证和opencv 结果一样,请大家放心使用。 下面是头文件st原创 2017-06-16 17:06:42 · 2223 阅读 · 1 评论 -
均值滤波代码 C代码
// 本函数是实现 3 * 3 均值滤波//函数的的当前点的像素 = 3 * 3 范围的平均值// @para src 输入图像数据// @para srcW 输入图形宽// @para srcH 输入图像的高// @para channels 通道数 // @para dest 输出图像 , 输出图像的大小和输入一样 int MeanFilter(unsigned char *原创 2017-07-15 21:04:02 · 6491 阅读 · 1 评论 -
用c语言写 成一个vector
头文件#ifndef __BlockVector_H_#define __BlockVector_H_#define BLOCK_VECTOR_DEF(Type) \ struct jdaVector##Type { \ int size; \ int capacity; \ Type *data; \ }#define BLOCK_VECTOR(Ty原创 2017-07-15 21:10:43 · 1249 阅读 · 0 评论 -
线性插值 c代码.....
int clamp_s(int value, int m_min, int m_max){ int mm_ret = value; if (value < m_min) { mm_ret = m_min; } else if (value > m_max) { mm_ret = m_max; } ret原创 2017-03-14 12:15:13 · 6052 阅读 · 0 评论 -
NV12 数据的抠图
// src 原始数据 是nv12 的YUV数据,直接从手机摄像头采集的数据// dest 截取的数据 开辟的空间大小为(x1 - x0 + 1) * (y1 - y0 + 1)包含两边的点// srcW 原始数据的宽// srcH 原始数据的高// x0 y0 左上角的坐标点 (必须是偶数)// x1 y1 右下角的坐标点 (必须是奇数)int nv12CutImage(unsigne原创 2017-04-17 18:46:27 · 1736 阅读 · 0 评论 -
多线程条件变量的用法
这里写链接内容转载 2017-09-27 11:09:37 · 295 阅读 · 0 评论 -
Windows下C语言的Socket编程例子(TCP和UDP)
本文来至:http://blog.csdn.net/ssun125/article/details/8525823原创 2017-05-05 23:41:25 · 942 阅读 · 0 评论 -
TCP/UDP传输摄像头采集的数据(opencv)
// TcpRecv.cpp : 定义控制台应用程序的入口点。//#include <stdio.h> #include <winsock2.h> #pragma comment(lib,"ws2_32.lib") #include "opencv2/opencv.hpp"using namespace cv;typedef struct socket_info{ SOCK原创 2017-09-19 16:49:30 · 6939 阅读 · 3 评论 -
最简单的双向环形链表
// NewList.cpp : 定义控制台应用程序的入口点。//#include "string.h"#include "stdlib.h"#include <stdio.h>// 链表节点typedef struct _Node_{ int id; char name[256]; _Node_ * pre; _Node_ * next;}Node;原创 2018-04-16 16:00:39 · 833 阅读 · 0 评论 -
图像积分图代码实现(c代码)
// src 输入图像,灰度图(单通道)// width 输入图像的宽// height输入图像的高// dest 输出的积分图(外部开空间为 (width + 1)* (height + 1) * sizeof(int))// dest结果的第一行第一列都为0int integral(unsigned char * src, int width, int height, int * de原创 2017-06-05 15:14:33 · 2593 阅读 · 0 评论 -
H264视频码流分解为NALU数据代码
// 贴出 雷晓骅的代码#include <stdio.h> #include <stdlib.h> #include <string.h> typedef enum { NALU_TYPE_SLICE = 1, NALU_TYPE_DPA = 2, NALU_TYPE_DPB = 3, NALU_TYPE_DPC = 4, NALU_TYPE_ID转载 2017-04-26 17:00:40 · 1831 阅读 · 0 评论 -
卡尔曼滤波(一阶和二阶)
kalman_filter.h/* * FileName : kalman_filter.h * Author : xiahouzuoxin @163.com * Version : v1.0 * Date : 2014/9/24 20:37:01 * Brief : * * Copyright (C) MICL,USTB */#ifndef _KALMA转载 2017-05-08 17:45:35 · 10469 阅读 · 11 评论 -
提取路径中的文件名
// ExtractName.cpp : 定义控制台应用程序的入口点。//// 提取路径中的文件名 如: "C:\\ProgramData\\AMD\\KDB\\123.bmp"; 提取123#include <stdio.h>#include <string.h>#include <malloc.h>static char * fileName;int retName(char * f原创 2016-08-18 18:54:34 · 1543 阅读 · 0 评论 -
打印系统当前时间(精确到毫秒)
#include <time.h>#ifdef WIN32# include <windows.h>#else# include <sys/time.h>#endif#ifdef WIN32int gettimeofday(struct timeval *tp, void *tzp){ time_t clock; struct tm tm; SYSTE原创 2016-08-24 15:09:24 · 6530 阅读 · 0 评论 -
rtp打包发送H264文件
// MPEG2RTP.h#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/socket.h>//#include "mem.h"//#define PACKET_BUFFER_END (unsigned int)0x00000000#define MAX_RTP_PKT_LENG翻译 2016-09-18 23:46:05 · 577 阅读 · 0 评论 -
Makefile 简单模板
// 生成testxlog 的可执行文件和.so 库testxlog: testxlog.o libxlog.so g++ testxlog.o -o testxlog -lxlog -L./testxlog.o: testxlog.cpp g++ testxlog.cpp -c -I../xloglibxlog.so:../xlog/xlog.cpp ../x原创 2017-01-24 16:29:50 · 257 阅读 · 0 评论 -
GDB 调试笔记
chmod 777 * -R // 给权限包括子目录下的所有文件ls -l //显示文件的权限大小时间等信息break 5 // 在第五行打断点break Test // 在函数Test 打断点 info break // 显示所有断点 i bdelete 2 // 删除第二个断点list // 显示代码list 1 // 从第一行向下显示list Test // list 简写为 l原创 2017-01-24 16:34:51 · 199 阅读 · 0 评论 -
ubuntu 虚拟机安装 samba 配置
1.安装sambasudo apt-get install samba2.备份并配置smb.conf允许网络用户访问代码:sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup sudo vi /etc/samba/smb.conf3.搜寻这一行文字(命令:/security)代码:security = user用下面这几行取代代码:secur转载 2017-01-24 18:12:58 · 857 阅读 · 0 评论 -
NV12 图像数据的旋转
/img 原始数据destImg 目的数据m_width 原始数据的宽,旋转后可能改变m_height 原始数据的高m_cammer 0 前置摄像头 1 后置摄像头m_angle 角度看程序决定图像右旋还是左旋还有镜像/static int imgRotationNew(unsigned char *img, unsigned char *destImg, int * m_width,原创 2017-03-22 11:08:25 · 1555 阅读 · 1 评论 -
NV12 和 NV21的区别
手机从摄像头采集的预览数据一般都是NV21 NV21 的存储格式是,以4 X 4 图片为例子 占用内存为 4 X 4 X 3 / 2 = 24 个字节Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y V U V U V U V UNV12 的存储格式是,以4 X 4 图片为例子 Y Y Y Y原创 2017-04-21 15:00:30 · 42653 阅读 · 4 评论 -
NV21转BGR图像
#undef clamp_g#define clamp_g(x, minValue, maxValue) ((x) < (minValue) ? (minValue) : ((x) > (maxValue) ? (maxValue) : (x)))int NV12ToBGR(unsigned char * srcYVU, unsigned char * destBGR, int width, in原创 2017-03-21 17:46:34 · 2814 阅读 · 1 评论 -
NV12 图像数据的插值时候旋转
static int ChangeWH(int angle, int destW, int destH, int * afterW, int * afterH){ if ((angle == 0 || angle == 180)) { *afterW = destH; *afterH = destW; } else {原创 2017-03-22 17:04:37 · 625 阅读 · 0 评论 -
c++生成java接口,jni技术
c++ 生成java 接口最本质的方法是通过jni 技术,jni 技术可以实现java 和c++的互相调用那么生成so 具体用什么方法好呢?我所知道的有四种方式1: 写andorid 的android.mk 文件,之前在eclipse 中使用过,mk 文件就相当于Makefile2: SWIG 技术,一个工具,c++ 语言生成各种其他语言的工具,java,c#,python 等都支持,中文...原创 2018-12-17 20:21:15 · 2419 阅读 · 0 评论