- 博客(13)
- 收藏
- 关注
原创 折半查找_Java
public class Search002 {public static void main(String [] args){int [] a={1,2,3,4,5,6,7,8,9};int num=8;int res=search(a,7);System.out.println(res);}public static int search(int [] a,int
2017-05-15 15:09:00 211
原创 顺序查找_Java
public class Search001 {public static void main(String [] args){int [] a={1,5,6,7,8,2,3,9};int num=8;int res=search(a,8);System.out.println(res);}public static int search(int [] a,int nu
2017-05-15 15:07:56 227
转载 堆排序_Java
public class Sort007 {public static void main(String[] args) { int[] data5 = new int[] { 5, 3, 6, 2, 1, 9, 4, 8, 7 }; System.out.println("原数组:"); print(data5);
2017-05-15 15:06:34 240
原创 希尔排序_Java
public class Sort006 {public static void shellSort(int [] a){int gap = a.length/2; while(gap >0){ for(int i=0;i for(int j=i+gap;j if(a[j
2017-05-15 10:03:58 184
转载 快速排序_Java
public class Sort005 {public static int getMiddle(int[] numbers, int low,int high) {int temp = numbers[low]; //数组的第一个作为中轴 while(low while(low temp) high--;
2017-05-15 10:02:32 146
原创 归并排序_Java
public class Sort004 {public static int[] sort(int[] nums, int low, int high) { int mid = (low + high) / 2; if (low sort(nums, low, mid); sort(nums
2017-05-15 10:01:09 251
原创 冒泡排序_Java
public class Sort003 {public static void BubbleSort(int [] a){int temp=0;for(int i=0;ifor(int j=0;jif(a[j+1]>a[j]){temp=a[j];a[j]=a[j+1];a[j+1]=temp;}}}}public static void ma
2017-05-15 09:59:41 184
原创 插入排序_Java
public class Sort002 {public static void insertSort(int [] a){if(a!=null){for(int i=1;iint temp=a[i];int j=i;if(a[j-1]>temp){while(j>=1 && a[j-1]>temp){a[j]=a[j-1];j--;}}a[j]=t
2017-05-15 09:57:38 148
原创 选择排序_Java
public class Sort001 {public static void selectSort(int [] a){int temp=0;int flag=0;for(int i=0;itemp=a[i];flag=i;for(int j=i+1;jif(temp>a[j]){temp=a[j];flag=j;}}if(flag!=i){
2017-05-15 09:55:41 189
原创 OpenCvSharp_Canny边缘检测
public static void edgeCanny() { IplImage src = new IplImage(@"D:\num1\1.jpg", LoadMode.GrayScale); IplImage dst = new IplImage(src.Size, BitDepth.U8, 1)
2016-11-26 16:29:08 2745
原创 OpenCvSharp_帧间差分
public static void frameDifference() { const double threshold = 140; IplImage backImage = new IplImage(@"D:\model\m1.jpg", LoadMode.GrayScale); IplImage
2016-11-26 16:24:10 997
转载 Opencvsharp_Threshold
public static double Threshold(CvArr src, CvArr dst, double threshold, double maxValue, ThresholdType thresholdType);第一个参数,InputArray类型的src,输入数组,填单通道 , 8或32位浮点类型的Mat即可。第二个参数,OutputArray类型的ds
2016-11-18 13:56:06 1722
原创 OpenCvSharp_Mat和IplImage
OpenCvSharp中两种图像输入并显示方法:1,MatMat img = new Mat(@"D:\num1\1.jpg");Cv2.ImShow("image", img);2,IplImageIplImage img = Cv.LoadImage(@"D:\num1\1.jpg");Cv.NamedWindow("image");Cv.ShowImage
2016-11-18 11:00:44 2664
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人