06 2017 档案
摘要:最近做实验,需要一些人体关节点的ground truth,需要自己手动标定,于是尝试使用OpenCV的鼠标键盘回调函数实现。 期间遇到不少问题,记录一下。 首先就是鼠标回调函数注册, 其中onMouse为处理鼠标事件的函数。里面需要用的一个索引selectIndex来标记当前鼠标选择的关节点是哪一个
阅读全文
摘要:Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a g
阅读全文
摘要:Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the pers
阅读全文
摘要:A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive and negative. The
阅读全文
摘要:Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. For example, given n = 12,
阅读全文
摘要:Given an unsorted array of integers, find the length of longest increasing subsequence. For example,Given [10, 9, 2, 5, 3, 7, 101, 18],The longest inc
阅读全文
摘要:Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloon
阅读全文
摘要:Given two integers n and k, find how many different arrays consist of numbers from 1 to n such that there are exactly k inverse pairs. We define an in
阅读全文
摘要:There are n different online courses numbered from 1 to n. Each course has some duration(course length) t and closed on dth day. A course should be ta
阅读全文
摘要:Given an integer array, find three numbers whose product is maximum and output the maximum product. Example 1: Example 2: Note: 思路: 首先排序,然后分别判断数组元素最大值
阅读全文
摘要:You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you nee
阅读全文
摘要:Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target.
阅读全文
摘要:Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be
阅读全文
摘要:Given a string s and a string t, check if s is subsequence of t. You may assume that there is only lower case English letters in both s and t. t is po
阅读全文
摘要:Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum pro
阅读全文
摘要:Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. Example:Given n = 2, return 91. (The answer should be the
阅读全文
摘要:In the computer world, use restricted resource you have to generate maximum benefit is what we always want to pursue. For now, suppose you are a domin
阅读全文
摘要:1.OpenCV 与 CodeBlocks 的安装都比较简单,好多教程。 参考http://www.cnblogs.com/lyutian/p/4425956.html 安装opencv。 Codeblocks安装参考http://blog.csdn.net/xinyunyishui/article
阅读全文
摘要:Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both
阅读全文
摘要:Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and t
阅读全文
摘要:You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose o
阅读全文
摘要:转载自:http://www.cnblogs.com/jeromeblog/p/3396494.html 图形是呈现数据的一种直观方式,在用Matlab进行数据处理和计算后,我们一般都会以图形的形式将结果呈现出来。尤其在论文的撰写中,优雅的图形无疑会为文章加分。本篇文章非完全原创,我的工作就是把见到
阅读全文
摘要:Given a list of non-negative numbers and a target integer k, write a function to check if the array has a continuous subarray of size at least 2 that
阅读全文
摘要:安装opencv时,在opencv的安装路径下, sources\samples\cpp\ 路径里面提供了好多经典的例子,很值得学习。 这次的例子是利用inpaint函数进行图像修复。 其中 InputArray src 表示要修复的图像, InputArray inpaintMask表示修复模板,
阅读全文
摘要:Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", the lo
阅读全文
摘要:Given an unsorted integer array, find the first missing positive integer. For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2. Your algorithm s
阅读全文
摘要:Given a positive integer a, find the smallest positive integer b whose multiplication of each digit equals to a. If there is no answer or the answer i
阅读全文
摘要:Given the root of a binary tree, then value v and depth d, you need to add a row of nodes with value v at the given depth d. The root node is at depth
阅读全文
摘要:Given m arrays, and each array is sorted in ascending order. Now you can pick up two integers from two different arrays (each array picks one) and cal
阅读全文
摘要:Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1...n. For example,Given n = 3, your program should
阅读全文
摘要:Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example,Given n = 3, there are a total of 5 unique BST'
阅读全文
摘要:Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. For exampl
阅读全文
摘要:Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. Each num
阅读全文
摘要:There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the hor
阅读全文
摘要:Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-space characters. Please note that the string
阅读全文
摘要:Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between iand j equals
阅读全文
摘要:Given a string s, find the longest palindromic subsequence's length in s. You may assume that the maximum length of s is 1000. Example 1:Input: Output
阅读全文
摘要:Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters. This
阅读全文
摘要:Given an array consists of non-negative integers, your task is to count the number of triplets chosen from the array that can make triangles if we tak
阅读全文
摘要:Design and implement a data structure for a compressed string iterator. It should support the following operations: next and hasNext. The given compre
阅读全文
摘要:Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are n
阅读全文
摘要:一直对视频或者图像添加水印很感兴趣,查找资料后用OpenCV尝试了一下。 记录下来。 1.首先是打开摄像头。 找到OpenCV官方文档给出的例子。 例子中实现的是,打开摄像头,并对画面进行高斯滤波,使用canny算子检测直线边缘。 2.打开摄像头后,接下来是想在画面上添加水印,图片之类。类似于电视画
阅读全文
摘要:用到了rgb转灰度图功能,查到两个函数,发现名字很像,功能也一样,但是参数类型不一样。 记录一下。 可以看声明,cvCvtColor是c语言风格接口。 而cvtColor是c++语言风格接口。 //InputArray:接口类可以是Mat、Mat_<T>、Mat_<T, m, n>、vector<T
阅读全文
摘要:There are N students in a class. Some of them are friends, while some are not. Their friendship is transitive in nature. For example, if A is a direct
阅读全文
摘要:Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements
阅读全文
摘要:转载自:http://blog.sina.com.cn/s/blog_90444ed201016iq6.html http://blog.csdn.net/zb1165048017/article/details/52785177 前言 最近要看一些论文做一下笔记,所以准备使用一下比较流行的Texl
阅读全文
摘要:Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. Examples: Note: You may assume the
阅读全文
摘要:Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function
阅读全文
摘要:转载自: http://blog.csdn.net/dengjianqiang2011/article/details/8753807 MATLAB矩阵操作大全 一、矩阵的表示在MATLAB中创建矩阵有以下规则:a、矩阵元素必须在”[ ]”内;b、矩阵的同行元素之间用空格(或”,”)隔开;c、矩阵的
阅读全文
摘要:转载自:增广拉格朗日乘子法(Augmented Lagrange Method) 增广拉格朗日乘子法的作用是用来解决等式约束下的优化问题, 假定需要求解的问题如下: minimize f(X) s.t.: h(X)=0 其中,f:Rn->R; h:Rn->Rm 朴素拉格朗日乘子法的解决方案是: L(
阅读全文
摘要:Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbers sums
阅读全文
摘要:Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telepho
阅读全文
摘要:Follow up for N-Queens problem. Now, instead outputting board configurations, return the total number of distinct solutions. 思路: 典型8皇后,回溯法,验证是否能放皇后位置,
阅读全文
摘要:The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, return all
阅读全文
摘要:Given an array of integers sorted in ascending order, find the starting and ending position of a given target value. Your algorithm's runtime complexi
阅读全文
摘要:You may assume no duplicates in the array. Here are few examples. [1,3,5,6], 5 → 2 [1,3,5,6], 2 → 1 [1,3,5,6], 7 → 4 [1,3,5,6], 0 → 0
阅读全文
摘要:Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the
阅读全文
摘要:You need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way. The null node needs to be rep
阅读全文
摘要:Suppose you have a long flowerbed in which some of the plots are planted and some are not. However, flowers cannot be planted in adjacent plots - they
阅读全文
摘要:Given a collection of integers that might contain duplicates, nums, return all possible subsets.Note: The solution set must not contain duplicate subs
阅读全文
摘要:Given a set of distinct integers, nums, return all possible subsets.Note: The solution set must not contain duplicate subsets.For example,If nums = [1
阅读全文
摘要:Given a string s and a non-empty string p, find all the start indices of p's anagrams in s.Strings consists of lowercase English letters only and the
阅读全文
摘要:Given two strings s and t, write a function to determine if t is an anagram of s.For example,s = "anagram", t = "nagaram", return true.s = "rat", t =
阅读全文
摘要:Given an array of strings, group anagrams together.For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"], Return:[ ["ate", "eat","tea"], ["na
阅读全文
摘要:Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red,
阅读全文
摘要:Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted f
阅读全文
摘要:Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. For example, Given n = 3, You should return the follow
阅读全文
摘要:Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. For example,Given the following matrix: [ [ 1
阅读全文
摘要:转载自: http://blog.csdn.net/txwh0820/article/details/46392293 矩阵的迹求导法则 1. 复杂矩阵问题求导方法:可以从小到大,从scalar到vector再到matrix 2. x is a column vector, A is a matri
阅读全文
摘要:拉格朗日乘数 在数学中的最优化问题中,拉格朗日乘数法(以数学家约瑟夫·拉格朗日命名)是一种寻找多元函数在其变量受到一个或多个条件的约束时的极值的方法。这种方法可以将一个有n个变量与k个约束条件的最优化问题转换为一个解有n + k个变量的方程组的解的问题。这种方法中引入了一个或一组新的未知数,即拉格朗
阅读全文


浙公网安备 33010602011771号