自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(15)
  • 资源 (3)
  • 收藏
  • 关注

原创 算法编程-求数组中和为0的最长子串(非连续最长子串+连续最长子串)

输入:int 型数组由正数、负数、0组成输出:最长和为0的子序列分析:1)连续子串2)非连续子串void findTargetLen1(vector<int>nums,int sum,int len,int& maxLen,int start){//非连续子串长度 if (start == nums.size()) return; if (su...

2018-10-14 19:36:37 955

原创 OpenGL第九版第一章-入门认识最简单的OpenGL程序

OpenGL渲染管线OpenGL实现了渲染管线(rendering pipeline),实际上是一系列处理数据的过程,将应用程序的数据转换到最终渲染的图像。OpenGL首先接收用户提供的几何数据(顶点数据和图元数据,一般是顶点数据),将其输入到一系列的着色器中进行处理,这些着色器一共有6个阶段,一般刚需的有两个着色器:点着色器(vertex shader)和片元着色器(fragment shade...

2018-06-03 16:41:14 1577

转载 C/C++中带空格的字符串的输入

转自:https://blog.csdn.net/circle2015/article/details/70880072问题一:带空格的字符串输入(c++)对于字符数组方法一:getline()读入整行数据,使用回车键输入的换行符来确定输入结尾。调用方法:cin.getline(str, len)第一个参数str用来存储输入行的数组名称,第二个参数是要读取的字符数。方法二:cin.get(str,...

2018-05-20 17:19:35 498

转载 C++ typedef用法及剖析

转自:C++ typedef用法小结 (※不能不看※)自己整理了一下,多了一点排版,看起来好看一丢丢,主要为了自己看,还没有整理完,后面再接续理解+整理,不喜欢看我整理的可以去原博客看~typedef的四个用途一 定义一种类型的别名typedef定义一种类型的别名,可以用作同时声明指针型的多个对象,可以减少粗心大意引起定义一连串指针变量引起的错误。#define则是简单的宏替换。我们简单看个例子:...

2018-05-20 14:27:02 326

原创 牛客网-美丽的项链

题目:妞妞参加了Nowcoder Girl女生编程挑战赛, 但是很遗憾, 她没能得到她最喜欢的黑天鹅水晶项链。 于是妞妞决定自己来制作一条美丽的项链。一条美丽的项链需要满足以下条件: 1、需要使用n种特定的水晶宝珠 2、第i种水晶宝珠的数量不能少于li颗, 也不能多于ri颗 3、一条美丽的项链由m颗宝珠组成 妞妞意识到满足条件的项链种数可能会很多, 所以希望你来帮助她...

2018-03-17 19:07:50 417

原创 LeetCode- Search in Rotated Sorted ArrayII旋转有序数组查找目标数

题目:Follow up for "Search in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-time complexity? How and why?意思是假设数组中有重复元素,比如[1,3,1,1,1],这样的就很难用二分的中间点来区分target在哪里了。那就只能将star...

2018-03-14 10:31:21 148

原创 LeetCode- Search in Rotated Sorted Array旋转有序数组查找目标数

题目:33. Search in Rotated Sorted ArraySuppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a targ...

2018-03-14 10:04:06 209

原创 LeetCode-Remove duplicates from sorted array II 去重元素,结果至少有两个重复

题目:Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?For example,Given sorted array nums = [1,1,1,2,2,3],Your function should return length = 5, with the first five elemen...

2018-03-14 08:52:59 166

原创 LeetCode-Remove duplicates from sorted array有序数组移除重复元素

这个题目比较简单就是找到相邻重复的下一个元素的位置,将其复制到前一个重复元素的第二个位置,以此类推,最后后面的那些元素已经废了,返回去重过后的数组的长度。以下是三个版本的去重函数,更多解答参考leetcode题解分享,很精简的解答,都是非常值得学习的代码。/*线性表题目主要考察线性表操作,如数组、单链表、双向链表题目1、Remove duplicates from sorted array从有...

2018-03-13 17:11:57 199

原创 剑指offer-旋转数组中的最小数字

题目描述:把一个数组最开始的若干个元素搬到数组的末尾,我们称之为数组的旋转。 输入一个非递减排序的数组的一个旋转,输出旋转数组的最小元素。 例如数组{3,4,5,1,2}为{1,2,3,4,5}的一个旋转,该数组的最小值为1。 NOTE:给出的所有元素都大于0,若数组大小为0,请返回0。这个题目比较考察思路全面性,首先它问的是数组中最小值,那我直接上去就用了STL的函数整个数组整体求min_ele...

2018-03-11 09:18:21 321

原创 剑指offer-两个栈来实现一个队列

问题描述:用两个栈来实现一个队列,完成队列的Push和Pop操作。 队列中的元素为int类型。这个是在是最简单的编程问题了,以前没做过练习,然后去面试的时候,题目让两个栈实现队列,都蒙了,现在感觉就是。。思路:入队列的时候非常简单,就是用一个栈stack1存储入队的元素即可,出队列的话就和栈不太一样了,我们知道栈是FILO,先进后出,而我们要实现的队列是先进先出FIFO,因此我们需要用另一个栈st...

2018-03-10 22:10:35 101

原创 剑指offer-重建二叉树(中序遍历+前序遍历)

问题描述:输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。例如输入前序遍历序列{1,2,4,7,3,5,6,8}和中序遍历序列{4,7,2,1,5,3,8,6},则重建二叉树并返回。思路:实际上是之前看过LeetCode上面的解法,二叉树的总体解法思想都用递归比较稳妥,改题目考查的是前序遍历和中序遍历的结构,前序遍历的第一个值是根节点...

2018-03-10 21:48:07 234

原创 剑指offer-从尾到头打印链表

问题描述:输入一个链表,从尾到头打印链表每个节点的值。比较简单代码如下: vector<int> printListFromTailToHead(ListNode* head) { vector<int> result; if(!head) return result; while(head!=NULL) ...

2018-03-10 20:31:53 121

原创 剑指offer--替换空格

题目描述:请实现一个函数,将一个字符串中的空格替换成“%20”。例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。思路为:循环字符串,遇到空格,将后面的暂时保存,将空格位置空“\0”,前面的字符串链接一个“%20”,再链接上后面的字符,重复该操作,代码如下:void replaceSpace(char *str,int length) {    ...

2018-03-10 20:05:11 99

原创 构造函数和析构函数及类中指针成员变量的new和delete

一直对于C++的继承机制非常疑惑,今天专门研究了一下继承过程中构造函数、虚构函数、以及对于构造函数初始化的一些问题。入的坑,还望大家少走弯路。构造函数中new内存分配及析构函数delete 大家都知道,当程序中创建一个类指针对象并将其初始化的时候,只要该类有指针成员变量,且在构造函数中利用new操作符为该指针变量分配堆块上的内存时,我们就需要实时注意需要手动管理该段内存的释放。函数中用de

2017-12-31 15:39:29 6078 3

Python+Web

将Python应用于Web2.0的讲义,介绍很详尽;将Python应用于Web2.0的讲义,介绍很详尽;

2018-03-24

learning OPENCV

opencv源代码 # EXAMPLES OF HOW TO RUN THE PROGRAMS ASSUMING YOU ARE IN THEIR DIRECTORY # On Linux, make the files using "make" (which will invoke Makefile in the directory) # If you just copy programs from the pdf of the book, watch out that the # quote characters aren't special characters. # # I put a calibration pattern, OpenCV_Chessboard.png in this directory # print it out and tape it to any rigid object like a book or binder. It's # for use with the camera calibration programs in Chapter 11. # #------------------------------------------------------------------------# #CHAPTER 2 PROGRAMS: ./ch2_ex2_1 stuff.jpg ./ch2_ex2_2 test.avi ./ch2_ex2_3 test.avi ./ch2_ex2_4 stuff.jpg ./ch2_ex2_5 stuff.jpg ./ch2_ex2_6 stuff.jpg ./ch2_ex2_7 stuff.jpg ./ch2_ex2_8 stuff.jpg # With video camera: ./ch2_ex2_9 # Using movie file: ./ch2_ex2_9 test.avi # Writing won't work if you are using gstreamer. Use ffmpeg but might have to have developer libs from ffmpeg ./ch2_ex2_10 test.avi log_polar_out.avi #------------------------------------------------------------------------# #CHAPTER 3 PROGRAMS: ch3_ex3_1.txt [not a program] ch3_ex3_2.txt [not a program] ./ch3_ex3_3 ./ch3_ex3_4 ./ch3_ex3_5 ch3_ex3_6.txt [not a program] ch3_ex3_7.txt [not a program] ch3_ex3_8.txt [not a program] ./ch3_ex3_9 ch3_ex3_10.txt [not a program] ./ch3_ex3_11 stuff.jpg ./ch3_ex3_12 stuff.jpg 50 100 300 200 100 ./ch3_ex3_13 stuff.jpg 50 100 300 200 100 ./ch3_ex3_14 stuff.jpg adrian.jpg 50 100 300 200 0.5 0.5 ./ch3_ex3_15 ch3_ex3_16.txt [not a program] ./ch3_ex3_17 ch3_ex3_18.xml [not a program] ./ch3_ex3_19 ./ch3_ex3_20 #------------------------------------------------------------------------# #CHAPTER 4 PROGRAMS ./ch4_ex4_1 ./ch4_ex4_2 test.avi ./ch4_ex4_3 test.avi #------------------------------------------------------------------------# #CHAPTER 5 PROGRAMS ./ch5_ex5_1 stuff.jpg ./ch5_ex5_2 adrian.jpg ./ch5_ex5_3 adrian.jpg ./ch5_ex5_4 15 1 1 71 15 adrian.jpg #------------------------------------------------------------------------# #CHAPTER 6 ./ch6_ex6_1 stuff.jpg ./ch6_ex6_2 stuff.jpg ./ch6_ex6_3 adrian.jpg ./ch6_ex6_4 stuff.jpg 100 ./ch6_ex6_5 #------------------------------------------------------------------------# #CHAPTER 7 ./ch7_ex7_1 adrian.jpg ch7_ex7_2.txt [not a program] ./ch7_ex7_3_expanded HandIndoorColor.jpg HandOutdoorSunColor.jpg HandOutdoorColor.jpg adrian.jpg ch7_ex7_4.txt [not a program] ./ch7_ex7_5_HistBackProj BlueCup.jpg adrian.jpg 0 ./ch7_ex7_5 faceTemplate.jpg faceScene.jpg #------------------------------------------------------------------------# #CHAPTER 8 ch8_ex8_1.txt [not a program] ./ch8_ex8_2 adrian.jpg ./ch8_ex8_3 faceTemplate.jpg #------------------------------------------------------------------------# #CHAPTER 9 ./ch9_ex9_1 test.avi # The background demo shows 2 background modeling methods: Averaging and YUV Codebook # I've set the parameters to work well with tree.avi == we learn the model for 50 frames # The parameters following tree.avi below are optional, but pretty good for that sequence # You can adjust them on the fly. Best to pause "p", adjust, single step a bit with "s" # and then resume running with "r" or "p". To adjust, the video window and NOT the consul # window must be active. I put a built in pause in the short tree.avi sequence so you # can experiment with parmeters as you single step "s", adjust" and step "s" along. -- Gary ./ch9_background 1 50 tree.avi 9 2 35 16 2 15 11 16 # Copy of watershed.cpp in samples/c directory is also here ./ch9_watershed fruits.jpg #This one isn't a stand alone program, it is a function that does frame differencing as in the book ch9_backgroundDiff.cpp [not built as a program] #This is a potentially add on function to ch9_backgroundAVG.cpp -- it clears stale codebook entries ch9_ClearStaleCB_Entries.cpp [not built as a program] #------------------------------------------------------------------------# #CHAPTER 10 ./ch10_ex10_1 # Decided to do the same example, except using the Horn-Schunck algorithm ./ch10_ex10_1b_Horn_Schunck # For fun, here's motion template code copied from samples/c. Uses a video camera. Point the camera # away from you. Start the program, wait a few seconds until it goes black. Then move in front # of the camera. ./ch10_motempl ./ch10_ex10_2 #------------------------------------------------------------------------# #CHAPTER 11 # Calibration using video camera # Parameters are chessboard_width height num_to_collect wait_frames # The num_to_collect is how many valid chessboard captures we should use to calibrate # The wait_frames is how many frames to skip before attempting to find a chessboard (this allows you to move it around). # NOTE: The "9 6" work with OpenCV_Chessboard.png which you can print out and use for this. ./ch11_ex11_1 9 6 10 60 # We can also calibrate from a list of images on disk. You will need to run this in order for the birdseye demo to work. ./ch11_ex11_1_fromdisk 12 12 ch11_chessboards.txt #------------------------------------------------------------------------# #CHAPTER 12 ./ch12_ex12_1 12 12 Intrinsics.xml Distortion.xml ch12_birdseye.jpg # Just a belabored example of computing the fundamental matrix # NOTE: The "9 6" work with OpenCV_Chessboard.png which you can print out and use for this. ./ch12_ex12_2 9 6 8 40 # Stereo calibration, rectification and depth ./ch12_ex12_3 ./ch12_ex12_4 #------------------------------------------------------------------------# #CHAPTER 13 ./ch13_ex13_1 ./ch13_ex13_2 ./ch13_ex13_3 ./ch13_ex13_4 #------------------------------------------------------------------------# #CHAPTER 14 # You fill in these

2015-12-15

MATLAB图像处理

图像处理应用MATLAB的不错的参考,对于图像处理的MATLAB基础代码实现具有比较好的帮助和引导作用

2015-07-14

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除