doc error at cascade_classification.html [closed]

asked 2014-08-13 10:50:01 -0600

jeremyRutman gravatar image

I believe there may be an error in the docs here . In the fifth paragraph, second sentence

"For example, in the case of the third line feature (2c) the response is calculated as the difference between the sum of image pixels under the rectangle covering the whole feature (including the two white stripes and the black stripe in the middle) and the sum of the image pixels under the black stripe multiplied by 3 in order to compensate for the differences in the size of areas."

I think the "multiplied by 3" should be "multiplied by 2" since the black area was counted as white once, so it must be subtracted one time to arrive at the sum of the two white areas, and then must be subtracted again to get white areas minus black areas, in total then requiring subtraction twice and not thrice.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-10-06 07:58:59.637676

Comments

I think if the code calculates the difference between "the sum of image pixels under the rectangle covering the whole feature (including the two white stripes and the black stripe in the middle)" and something else, then it is not implementing Haar-like features correctly (basd on my understanding of Haar-like features). So it may be more serious than a documentation issue. The correct Haar-like feature value would be the white area's sum minus 2x the black area's sum (2x because the white area is 2x the size). Or more generally, for any feature: (white sum / white area) - (black sum / black area). The sum of whole feature area (black + white) is not relevant.

Netsai Chibuku gravatar imageNetsai Chibuku ( 2014-08-19 23:20:14 -0600 )edit