Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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 :-)

click to hide/show revision 2
retagged

updated 2014-03-20 05:36:44 -0600

berak gravatar image

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 :-)