(int[] x, int[] y, int n)
| 466 | } |
| 467 | |
| 468 | float[] getCurvature(int[] x, int[] y, int n) { |
| 469 | float[] x2 = new float[n]; |
| 470 | float[] y2 = new float[n]; |
| 471 | for (int i=0; i<n; i++) { |
| 472 | x2[i] = x[i]; |
| 473 | y2[i] = y[i]; |
| 474 | } |
| 475 | ImageProcessor ipx = new FloatProcessor(n, 1, x2, null); |
| 476 | ImageProcessor ipy = new FloatProcessor(n, 1, y2, null); |
| 477 | ipx.convolve(kernel, kernel.length, 1); |
| 478 | ipy.convolve(kernel, kernel.length, 1); |
| 479 | float[] indexes = new float[n]; |
| 480 | float[] curvature = new float[n]; |
| 481 | for (int i=0; i<n; i++) { |
| 482 | indexes[i] = i; |
| 483 | curvature[i] = (float)Math.sqrt((x2[i]-x[i])*(x2[i]-x[i])+(y2[i]-y[i])*(y2[i]-y[i])); |
| 484 | } |
| 485 | return curvature; |
| 486 | } |
| 487 | |
| 488 | PolygonRoi trimFloatPolygon(PolygonRoi roi, double length) { |
| 489 | FloatPolygon poly = roi.getFloatPolygon(); |
no test coverage detected