Ask Your Question

amourreux's profile - activity

2013-12-16 04:55:31 -0600 answered a question opencv IOS - MacTypes.h, ambiguous references

you have to use namespace like this;

for example You will use Point;

define in cv namespace

namespace cv{
    Point maxLoc;
}

And use it like this;

minMaxLoc(histForRed, 0, 0, 0, &maxLoc);

NSLog(@"R x: %d", maxLoc.x);
NSLog(@"R y: %d", maxLoc.y);
2013-12-13 07:21:38 -0600 received badge  Editor (source)
2013-12-13 07:19:08 -0600 asked a question Getting dominant colour value from HSV Histogram

I am creating a hsv histogram from an image like below.

- (void)processImageWithHsv:(Mat&)image;
{
    Mat image_hsv;

    cvtColor(image, image_hsv, CV_BGR2HSV);

    int hbins = 50, sbins = 60;
    int histSize[] = {hbins, sbins};

    float hranges[] = { 0, 360 };
    float sranges[] = { 0, 256 };

    const float* ranges[] = { hranges, sranges };
    MatND hist;

    int channels[] = {0, 1};

    calcHist( &image_hsv, 1, channels, Mat(), // do not use mask
             hist, 2, histSize, ranges,
             true, // the histogram is uniform
             false );

    double maxVal = 0;
    minMaxLoc(hist, 0, &maxVal, 0, 0);

    // ???: HOW Convert this information to colour value

}

But i have no idea to get most dominant color value from that hist?

2013-12-13 03:49:41 -0600 commented answer calcHist() usage for RGB histogram...?

@lucas i am having same problem on ios framework too.

2013-12-11 07:15:55 -0600 received badge  Supporter (source)