我输入网络摄像头视频处理列表中的每个帧1乘8坐标值。
值如下:
points=[33,12,3,2,54,222,44,54]
points=[54,32,1,1,33,44,54,21]
points=[64,443,2,2,2,44,3,5]
这是我的代码:
public class Sample {
private List<List<Integer>> matrix; //Getter and Setter Method
public List<List<Integer>> getMatrix() {
return matrix;
}
public Sample setMatrix(List<<Integer>> matrix) {
this.matrix = matrix;
return this;
}
public void list_method(List<Integer> points) {
Sample sample = new Sample(); //Class object
sample.getMatrix().add();
System.out.println(sample);
}
}
我的结果如
matrix = [33,12,3,2,54,222,44,54]
matrix = [33,12,3,2,54,222,44,54 ,54,32,1,1,33,44,54,21]
matrix =[33,12,3,2,54,222,44,54 ,54,32,1,1,33,44,54,21,64,443,2,2,2,44,3,5 ]
但我希望它的形式如下:
matrix = [33,12,3,2,54,222,44,54]
matrix = [33,12,3,2,54,222,44,54], [54,32,1,1,33,44,54,21]
matrix = [33,12,3,2,54,222,44,54], [54,32,1,1,33,44,54,21], [64,443,2,2,2,44,3,5]
答案 0 :(得分:0)
在list_method
中,您只需要撰写matrix.add(points);
我不知道这是否是拼写错误,但public Sample setMatrix(List<<Integer>> matrix) {
应为public Sample setMatrix(List<List<Integer>> matrix) {