⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmv_test.c

📁 足球机器人自动程序
💻 C
字号:
#include <stdio.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <sys/mman.h>#include <unistd.h>#include "global.h"#include "cmv.h"int main() {	cmv_init("colors.txt");	int fd = open("ball.yuv", O_RDONLY);	if (fd < 0) {		perror("open");		return -1;	}	unsigned char *src = (unsigned char *)mmap(NULL, YUV_SIZE, PROT_READ, MAP_SHARED, fd, 0);	if (src == MAP_FAILED) {		perror("mmap");		return -1;	}	cmv_process(src, 0);	int i = 0;	for (; i<MAX_COLORS; ++i) {		if (clist[i] > 0) {			printf("color=%d n=%d\n", i+1, clist[i]);			int j = 0;			for (; j< clist[i]; ++j) {				printf("\t(%d, %d)\n", ctable[i][j]->cx, ctable[i][j]->cy);			}		}	}	return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -