在图像滤波和形态学运算中,我们用得最多的是圆形结构元素(Circle)或者方形结构元素,例如: ① 圆形结构元素 opening_circle (Region, RegionOpening, 3.5)erosion_circle (Region, RegionErosion, 3.5) ② 方形结构 ...
分类:
其他好文 时间:
2019-11-23 12:24:07
阅读次数:
119
目标 ? 学习使用 OpenCV 绘制不同几何图形 ? 你将会学习到这些函数:cv2.line(),cv2.circle(),cv2.rectangle() ,cv2.ellipse() ,cv2.putText() 等。 代码上面所有的这些绘图函数需要设置下面这些参数: ? img:你想要绘制图形 ...
分类:
其他好文 时间:
2019-11-22 13:55:57
阅读次数:
74
Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. Example: Input: 1 0 1 0 0 1 0 1 1 1 ...
分类:
其他好文 时间:
2019-11-20 12:37:11
阅读次数:
65
Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. Example ...
分类:
其他好文 时间:
2019-11-18 09:20:14
阅读次数:
59
要求返回一个m x n的vector<vector<int>>数组,数组中的元素为0至m x n -1,要求沿着斜线排列,如下所示[0 1 5 6 ][2 4 7 10][3 8 9 11] class Solution { public: vector<vector<int> > print_re ...
分类:
其他好文 时间:
2019-11-10 11:53:14
阅读次数:
97
Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the hist ...
分类:
其他好文 时间:
2019-11-10 10:13:49
阅读次数:
82
先上一个效果图: 使用Python3.7+OpenCV 3.x. 需要引入 numpy库。 以下是具体实现代码。 # -*- coding:utf-8 -*- ''' Python: 3.5.7 opencv 3.x 在图上用鼠标左键和右键标记前景和后景即可. 如果需要重新标记图像,关闭程序重新运行 ...
分类:
编程语言 时间:
2019-11-09 20:07:51
阅读次数:
198
题目描述 Due to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= ...
分类:
其他好文 时间:
2019-11-08 16:30:54
阅读次数:
109
面向对象的一个重要目标就是对代码重用的支持。支持这个目标的一个重要机制就是泛型机制(generic mechanism):如果出去对象的基本类型外,实现方法是相同的,就可以用泛型实现(generic implementation)来描述这种基本功能。在Java 1.5版本以前,Java并不直接支持泛 ...
分类:
编程语言 时间:
2019-11-06 15:00:22
阅读次数:
106
https://loj.ac/problem/10050 题目描述 给出$n$个整数,求选出两个数使它们的异或值最大。 思路 解决异或问题也是字典树的常用作用之一。我们考虑对于一个数$x$,我们如何求出它的异或值最大的另一个数。异或的定义是每一位相同为 ...
分类:
其他好文 时间:
2019-11-03 18:28:55
阅读次数:
71