Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

isn't blink... charts looks blinking because you rewrite red,green and blue Mats always but draw lines only if (indFrame != indFramePre). Time to time the if is false and you will show a black image ... final result looks blinking

You could reset the Mats before to draw lines like try this

red = Mat::zeros(300, 2 * MAXTIME, CV_8UC3);
green = Mat::zeros(300, 2 * MAXTIME, CV_8UC3);
blue = Mat::zeros(300, 2 * MAXTIME, CV_8UC3);
circle(red, cv::Point(100, 100), 50, 255, 2); //draw this to check blinking
for (int i = 1; i < ite->second.size(); i++, iteListPre++, iteList++)
{
    line(green, Point(((*iteListPre)[0] - tpsIni)*fAcq,...
...

isn't blink... charts looks blinking because you rewrite red,green and blue Mats always but draw lines only if (indFrame != indFramePre). Time to time the if is false and you will show a black image ... final result looks blinking

You could reset the Mats before to draw lines like try thishere:

red = Mat::zeros(300, 2 * MAXTIME, CV_8UC3);
green = Mat::zeros(300, 2 * MAXTIME, CV_8UC3);
blue = Mat::zeros(300, 2 * MAXTIME, CV_8UC3);
circle(red, cv::Point(100, 100), 50, 255, 2); //draw this to check blinking
for (int i = 1; i < ite->second.size(); i++, iteListPre++, iteList++)
{
    line(green, Point(((*iteListPre)[0] - tpsIni)*fAcq,...
...

isn't blink... charts looks blinking because you rewrite red,green and blue Mats always but draw lines only if (indFrame != indFramePre). Time to time the if if is false and you will show a black image ... final result looks blinking

You could reset the Mats before to draw lines like here:than show images only if needed:

bool redraw = false;
if (indFrame != indFramePre)
{
    ...
    red = Mat::zeros(300, 2 * MAXTIME, CV_8UC3);
 green = Mat::zeros(300, 2 * MAXTIME, CV_8UC3);
 blue = Mat::zeros(300, 2 * MAXTIME, CV_8UC3);
 circle(red, cv::Point(100, 100), 50, 255, 2); //draw this to check blinking
    redraw = true;
    for (int i = 1; i < ite->second.size(); i++, iteListPre++, iteList++)
 {
     line(green, Point(((*iteListPre)[0] - tpsIni)*fAcq,...
        ...
    }
}
mtxFrame.unlock();
if (redraw)
{
    imshow("Red componnent", red);
    ...