java.util.List<Mat> mixOut = new ArrayList<Mat>(Arrays.asList(new Mat[]{oMatA, oMatBGR})); Core.mixChannels(mixIn, mixOut, new MatOfInt(0, 0, 1, 3, 2, 2, 3, 1)); return oMatBGR; } else if (bImg.getType() == BufferedImage.TYPE_3BYTE_BGR) {
public int[] toArray() { int num = checkVector(_channels, _depth); if(num < 0) throw new RuntimeException("Native Mat has unexpected type or size: " + toString()); int[] a = new int[num * _channels]; if(num == 0) return a; get(0, 0, a); //TODO: check ret val! return a; }
protected MatOfInt(long addr) { super(addr); if( !empty() && checkVector(_channels, _depth) < 0 ) throw new IllegalArgumentException("Incompatible Mat"); //FIXME: do we need release() here? }
public void fromList(List<Integer> lb) { if(lb==null || lb.size()==0) return; Integer ab[] = lb.toArray(new Integer[0]); int a[] = new int[ab.length]; for(int i=0; i<ab.length; i++) a[i] = ab[i]; fromArray(a); }
public List<Integer> toList() { int[] a = toArray(); Integer ab[] = new Integer[a.length]; for(int i=0; i<a.length; i++) ab[i] = a[i]; return Arrays.asList(ab); } }
MatOfInt hull = new MatOfInt(); MatOfPoint tempContour = contours.get(i); Imgproc.convexHull(tempContour, hull, false); // O(N*Log(N)) //System.out.println("hull size: " + hull.size() + " x" + hull.get(0,0).length); //System.out.println("Contour matrix size: " + tempContour.size() + " x" + tempContour.get(0,0).length); int index = (int) hull.get(((int) hull.size().height)-1, 0)[0]; Point pt, pt0 = new Point(tempContour.get(index, 0)[0], tempContour.get(index, 0)[1]); for(int j = 0; j < hull.size().height -1 ; j++){ index = (int) hull.get(j, 0)[0]; pt = new Point(tempContour.get(index, 0)[0], tempContour.get(index, 0)[1]); Core.line(frame, pt0, pt, new Scalar(255, 0, 100), 8); pt0 = pt; }
protected MatOfInt(long addr) { super(addr); if( !empty() && checkVector(_channels, _depth) < 0 ) throw new IllegalArgumentException("Incompatible Mat"); //FIXME: do we need release() here? }
public void fromList(List<Integer> lb) { if(lb==null || lb.size()==0) return; Integer ab[] = lb.toArray(new Integer[0]); int a[] = new int[ab.length]; for(int i=0; i<ab.length; i++) a[i] = ab[i]; fromArray(a); }
public List<Integer> toList() { int[] a = toArray(); Integer ab[] = new Integer[a.length]; for(int i=0; i<a.length; i++) ab[i] = a[i]; return Arrays.asList(ab); } }
public int[] toArray() { int num = checkVector(_channels, _depth); if(num < 0) throw new RuntimeException("Native Mat has unexpected type or size: " + toString()); int[] a = new int[num * _channels]; if(num == 0) return a; get(0, 0, a); //TODO: check ret val! return a; }
protected MatOfInt(long addr) { super(addr); if( !empty() && checkVector(_channels, _depth) < 0 ) throw new IllegalArgumentException("Incompatible Mat"); //FIXME: do we need release() here? }
public static MatOfInt fromNativeAddr(long addr) { return new MatOfInt(addr); }
public void fromList(List<Integer> lb) { if(lb==null || lb.size()==0) return; Integer ab[] = lb.toArray(new Integer[0]); int a[] = new int[ab.length]; for(int i=0; i<ab.length; i++) a[i] = ab[i]; fromArray(a); }
public List<Integer> toList() { int[] a = toArray(); Integer ab[] = new Integer[a.length]; for(int i=0; i<a.length; i++) ab[i] = a[i]; return Arrays.asList(ab); } }
public int[] toArray() { int num = checkVector(_channels, _depth); if(num < 0) throw new RuntimeException("Native Mat has unexpected type or size: " + toString()); int[] a = new int[num * _channels]; if(num == 0) return a; get(0, 0, a); //TODO: check ret val! return a; }
protected MatOfInt(long addr) { super(addr); if( !empty() && checkVector(_channels, _depth) < 0 ) throw new IllegalArgumentException("Incompatible Mat"); //FIXME: do we need release() here? }