CvPoint pts = new CvPoint(6);
pts.position(0).put(cvPoint(3, 0));
pts.position(1).put(cvPoint(1, 5));
pts.position(2).put(cvPoint(2, 9));
pts.position(3).put(cvPoint(1, 15));
pts.position(4).put(cvPoint(0, 9));
pts.position(5).put(cvPoint(1, 5));
for(int i=0; i<6; i++){
System.out.println(pts.position(i).x()+", "+pts.position(i).y());
vSeqPush(seq, pts.position(i));
}
for(int i=0; i<6; i++){
System.out.println(cvGetSeqElem(seq, i));
CvPoint v = new CvPoint(cvGetSeqElem(seq, i));
System.out.println("Seq: "+v.x()+", "+v.y());
}
And its output is:
3, 0
1, 5
2, 9
1, 15
0, 9
1, 5
com.googlecode.javacpp.Pointer[address=0x7f84300f3e40,position=0,limit=0,capacity=0,deallocator=null]
Seq: 3, 0
com.googlecode.javacpp.Pointer[address=0x7f84300f3e48,position=0,limit=0,capacity=0,deallocator=null]
Seq: 3, 0
com.googlecode.javacpp.Pointer[address=0x7f84300f3e50,position=0,limit=0,capacity=0,deallocator=null]
Seq: 3, 0
com.googlecode.javacpp.Pointer[address=0x7f84300f3e58,position=0,limit=0,capacity=0,deallocator=null]
Seq: 3, 0
com.googlecode.javacpp.Pointer[address=0x7f84300f3e60,position=0,limit=0,capacity=0,deallocator=null]
Seq: 3, 0
com.googlecode.javacpp.Pointer[address=0x7f84300f3e68,position=0,limit=0,capacity=0,deallocator=null]
Seq: 3, 0
I can't figure out why the points in my CvSeq behave this way. It seems just Point1 is being pushed to the sequence.