Draw Waveform from Mat
Hi,
I'd like to draw a waveform Diagram from cv:Mat.
So I use the line()-Function with Point(int x, int y) inside.
I try it with:
Code:
line(waveY,Point(bin_w * (i - 1),wave_h) ,Point(bin_w * (i), ycrcb_planes[0].row(i).col(0)), Scalar(128, 128, 128), 2, 8, 0);
The Problem is, that cv Point need int x and int y. So I have to convert every single "Pixel" from
Matrix into an int value.
I need something like that:
Code:
int value = (int) ycrcb_planes[0].row(i).col(0)
Does anyone knows a solution for that?
I would be very happy :-)
row() and col() make a copy from the resp. matrix column / row.
you probably wanted: uchar value = ycrcb_planes[0].at<uchar>(i,0);
That works, thank you very much!