Ask Your Question

nosocks's profile - activity

2021-07-19 02:29:50 -0600 received badge  Popular Question (source)
2016-01-04 23:35:01 -0600 received badge  Student (source)
2015-04-20 08:50:33 -0600 received badge  Editor (source)
2015-04-20 08:48:56 -0600 commented question Problem with cv::reduce when trying to sum both columns and rows

@berak Yeah, I get the same behaviour with cv::Mat

2015-04-16 12:54:38 -0600 asked a question Problem with cv::reduce when trying to sum both columns and rows

I have a binary image that I want to project onto a vector v such that v[i] = 1 if the image has at least one pixel in row i with a value > 0, otherwise v[i] = 0. To accomplish this, I plan on using cv::reduce to get the sum of all pixels in a row, then use a ceiling function to return a maximum value of 1.

I am running into a problem with using cv::reduce to sum all rows in an image. Here is the code I am running:

// mask is a cv::Mat of `uint8_t`
std::vector<uint8_t> reduced;
cv::reduce(mask, reduced, 1, CV_REDUCE_SUM);

This crashes with an access violation exception. However, if I sum over columns instead:

// mask is a cv::Mat of `uint8_t`
std::vector<uint8_t> reduced;
cv::reduce(mask, reduced, 0, CV_REDUCE_SUM);

this works without issue. How am I misusing cv::reduce? This is a core piece of OpenCV, so surely I am just misusing the library :)

2015-04-02 13:49:06 -0600 asked a question HOG detector for overhead person detection

OpenCV comes with a person detector out of the box, through HOGDescriptor::getDefaultPeopleDetector(). This model does not seem to be trained on images of people from overhead. Is there a pre-trained HOG detector for overhead person detection?