Ask Your Question

dpietrek's profile - activity

2020-09-22 13:46:55 -0600 received badge  Student (source)
2020-09-22 13:44:37 -0600 received badge  Popular Question (source)
2016-08-23 04:51:09 -0600 received badge  Necromancer (source)
2016-08-22 09:14:29 -0600 answered a question working hit-or-miss implementation

Morphology in opencv works on set of white pixels. So all dual operations are inverted. If you want classic hit or miss, do this:

Mat kernel; // Define your kernel
Mat negkernel;
bitwise_not(element,negkerne);
negkernel = negkernel- 254;

Mat erode;
Mat negerode;

morphologyEx(img, erode, MORPH_DILATE, kernel);
morphologyEx(negerode, negerode, MORPH_DILATE, negkernel);

Mat output;
bitwise_or(erode,negerode,output);
2016-08-22 09:04:05 -0600 received badge  Supporter (source)
2016-08-22 09:02:42 -0600 commented question Why in open cv morphology operations is inverted?

@berak I know that, but this is not intuitive. Why does opencv prefer white as foreground?

2016-08-22 09:00:41 -0600 commented answer Why in open cv morphology operations is inverted?

It is dilating and eroding white pixels. It should operate on set of black pixels. Bitwise and and or are also inverted.

2016-08-21 20:18:12 -0600 commented answer hit and miss transform

@LorenaGdL In open cv all morphology operation is inverted. We should use dilate instead of erode, and or operator instead of and (&).

2016-08-21 20:15:50 -0600 asked a question Why in open cv morphology operations is inverted?

For example dilate in open cv is erode and vice versa.

2015-08-11 09:22:07 -0600 asked a question Is white pixels value in binary image 255?

Hi i wonder why white pixels value is 255? This is not intuitively.