/src/Period.java
https://bitbucket.org/yan_chen/pc-image-processing · Java · 129 lines · 86 code · 26 blank · 17 comment · 19 complexity · 5d88164ad7eddb9b81f48b512e3594c9 MD5 · raw file
- import static com.googlecode.javacv.cpp.opencv_core.*;
- import static com.googlecode.javacv.cpp.opencv_imgproc.*;
- import static com.googlecode.javacv.cpp.opencv_highgui.*;
- import java.io.File;
- import java.util.Scanner;
-
- public class Period{
- public static void main (String[] args)throws Exception,NullPointerException
- {
- int location[][] = new int[16][4];
- long click[][] = new long[1000][2];
-
- File key = new File(("C:/Users/chens_000/Desktop/3.txt"));
-
- long timestample[] = new long[1000];
- Scanner keys = new Scanner(key);
-
- keys.useDelimiter("\\s+|,|\\n|:|;|\\(|\\)| ");
-
- String b[] = new String[200000];
-
- int ii = 0;
- String c = null;
- int jj = 0;
- b[0] = null;
-
- while (keys.hasNext())
- {
- b[ii] = keys.next();
- if((b[ii].equals("Period")) && (b[ii-1].equals("Relea")))
- {
- timestample[jj] = Long.parseLong(keys.next());
- System.out.println(timestample[jj]+" ");
- jj++;
- }
- ii++;
-
-
- }
-
-
- int k = 0;
- int l=0;
- int m;
-
- int nn=0;
- int mm=8;
- long cc[] = new long[16];
- int dian = 0;
-
- /*
- long xy[][][]= new long[16][10000][2];
- IplImage src = cvLoadImage("C:/Users/chens_000/Desktop/new2/click.jpg",0);
- // IplImage gray = cvCreateImage(cvGetSize(src), IPL_DEPTH_32F, 1);
- int radius = 1;
- l=0;
- int lo=0;
- for(lo=0;lo<dian;lo++)
- {
- CvPoint center = cvPointFrom32f(new CvPoint2D32f(click[lo][0],click[lo][1]));
- cvCircle(src, center, radius, CvScalar.GREEN, 6, CV_AA, 0);
-
- }
- cvSaveImage("C:/Users/chens_000/Desktop/new2/click1.jpg", src);
- cvShowImage("Result",src);
- cvWaitKey(0);
- */
-
- }
-
- public static int taskorder(String i){
-
-
- int j = 0;
-
- if(i.equals("task1.jpg"))
- j=0;
- if(i.equals("task2.jpg"))
- j=1;
- if(i.equals("task3.jpg"))
- j=2;
- if(i.equals("task3a.jpg"))
- j=3;
- if(i.equals("task3b.jpg"))
- j=4;
- if(i.equals("task3c.jpg"))
- j=5;
- if(i.equals("task3d.jpg"))
- j=6;
- if(i.equals("task4.jpg"))
- j=7;
- if(i.equals("task5.jpg"))
- j=8;
- if(i.equals("task6.jpg"))
- j=9;
- if(i.equals("task7.jpg"))
- j=10;
- if(i.equals("task8.jpg"))
- j=11;
- if(i.equals("task9.jpg"))
- j=12;
- if(i.equals("task10.jpg"))
- j=13;
- if(i.equals("task11.jpg"))
- j=14;
- if(i.equals("task12.jpg"))
- j=15;
-
-
-
- return j;
-
- }
-
- public static boolean isParsableToInt(String i) {
-
- try
- {
- Long.parseLong(i);
- return true;
- }
- catch (NumberFormatException nfe)
- {
- return false;
- }
- }
-
-
- }