向着曙光前进的博客

新手上路,请大佬笔下留情

swystoj(OpenCV(0272))
OpenCV (Open Source Computer Vision) is a library of programming functions for real time computer vision. OpenCV is released under a BSD license, it is free for both academic and commercial use. Example applications of the OpenCV library are Human-Computer Interaction (HCI); Object Identification, Segmentation and Recognition; Face Recognition; Gesture Recognition; Camera and Motion Tracking, Ego Motion, Motion Understanding; Structure From Motion (SFM); Stereo and Multi-Camera Calibration and Depth Computation; Mobile Robotics.
Recently ,Phillip has learnt about how to use OpenCV to solve some image problems. Doctor Jiang wants him find the moving items from the given video files. Since using OpenCV can easily deal with such problems, Phillip wants to use his own code to make it out. As we kwon images are saved as a lot of pixels in the computer.
The algorithm that Phillip use is below:
First, we find the different pixels between current image and the previous one image(in this problem we only care the different pixels) .
Second, we record the maximum different number .
Description
The first line are two integers r (row)and c(column) which describe the size of one image. (1 < r, c < 200 );
The second Line is n which is the total number of images (1 < n < 100)
Then n*r lines follow, each line contain exactly c numbers which are pixels of the image in the range of 0 to 255.
Input
One line with the maximum differenct number you have found.
Output

4 4
3
255 0 0 255
223 221 220 190
10 11 12 13
0 0 0 0
255 1 1 255
245 221 220 100
11 11 0 13
1 1 1 1
255 0 0 255
245 221 220 100
11 11 0 13
1 1 1 1
Sample Input

10
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include<iostream>
using namespace std;
struct node
{
	int a[201][201];
}b[101];

int main()
{
	int n, m, l;
	while (cin>>n>>m>>l)
	{
		int ans = 0;
		for (int i = 0; i < l; i++)
		{
			int count = 0;
			for (int j = 0; j < n; j++)
			{
				for (int k = 0; k < m; k++)
				{
					cin >> b[i].a[j][k];
					if (i&&b[i].a[j][k] != b[i - 1].a[j][k])
						count++;//在输入是判断,减少时间。
				}
			}
			if (count > ans)
				ans = count;
		}
		cout << ans << endl;
	}
	return 0;
}

阅读更多
版权声明:本文为博主原创文章,转载注明出处 https://blog.csdn.net/qq_38271800/article/details/70172233
个人分类: swustoj
想对作者说点什么? 我来说一句

OpenCV入门

2018年01月22日 63.2MB 下载

OPENCV参考手册

2011年08月18日 25KB 下载

opencv 资料 opencv 资料

2011年09月09日 29.37MB 下载

OpenCv视频采集

2009年11月26日 193KB 下载

opencv手册

2018年01月25日 43.9MB 下载

opencv视频文件肤色检测

2013年06月11日 3KB 下载

Learning OpenCV 3 PDF

2018年05月21日 116B 下载

人脸识别OpenCV

2009年10月10日 6.86MB 下载

OpenCV训练分类器

2009年04月03日 82KB 下载

OPenCV入门教程

2017年12月08日 1.61MB 下载

没有更多推荐了,返回首页

不良信息举报

swystoj(OpenCV(0272))

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭