Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

why is this circle only black?

Im trying out the drawing functions, but having difficulty getting the colour I want. The circle appears, on some values, but not others, for color, but only ever shows up as black. What am I doing wrong? I have read the the documentation for the circle function.

#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <iostream>
using namespace std;
using namespace cv;
int main(int argc, char ** argv){

    Mat md0, md1, md2, md3;
    md0 = Mat::zeros(100,200,CV_32F);
    md1 = Mat::ones(100,200,CV_32F);

    pyrUp(md1,md2);

//drawing function
    Point2f p(77, 100);
    circle( md2, p,50,0xFFFF00,2,8,0);

    imshow("Double Ones", md2);

    waitKey(0);
    return 0;
    }

why is this circle only black?

Im trying out the drawing functions, but having difficulty getting the colour I want. The circle appears, on some values, but not others, for color, but only ever shows up as black. What am I doing wrong? I have read the the documentation for the circle function.

I am using opencv 3.2, have tried Scalar(255,255,0) in lieu of a Hex Value. The circle is being drawn, but only in black, or white. When I switch to the all zeros Matrix, i can see a white circle on a black background.

#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <iostream>
using namespace std;
using namespace cv;
int main(int argc, char ** argv){

    Mat md0, md1, md2, md3;
    md0 = Mat::zeros(100,200,CV_32F);
    md1 = Mat::ones(100,200,CV_32F);

    pyrUp(md1,md2);

//drawing function
    Point2f p(77, 100);
    circle( md2, p,50,0xFFFF00,2,8,0);

    imshow("Double Ones", md2);

    waitKey(0);
    return 0;
    }