drawContours from dataset [closed]
Hi,
I got a dataset (from excel csv file). I need to draw contours from this data set.
Basically, i can read the data file, and create an array of data either one or two dimensional array.
The confusing part is: input for drawContours is a list of MatOfPoint. MatOfPoint is in fact a list Point. Each point will require the x and y coordinate. However, in my data set, each point is a value. I don't know how to make it become a Point. Because we can convert from x and y coordinate to a value (length of the vector) but i can't convert from value to vector.
Could you help me out? this is done in java. assume my data
row1: |4, 5, 6, 7, 8, 8 |
row2: |5, 5, 0, 0, 0, 0|
....
thank you for your help,
Long
As long as you do not have an x and y coordinate in your csv file, you will simply not get a contour, because as said, it is a collection/vector of Point elements, which have an x and y coordinate. I am still not grasping why you would want to push a single value into a point ...
maybe you can "zip" the x y values in excel already to a single line with alternating x,y values.