Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

"Iwant to implement a simple thresholding algorithm" - please use the builtin threshold() function, do not reinvent the wheel. writing "per-pixel loops" is absolutely an anti-pattern.

"Iwant "I want to implement a simple thresholding algorithm" - please use the builtin threshold() function, do not reinvent the wheel. writing "per-pixel loops" is absolutely an anti-pattern.

(the error also complains, that one of the Mat's (probably "gray") is not initialized at all)

"I want to implement a simple thresholding algorithm" - please use the builtin threshold() function, do not reinvent the wheel. writing "per-pixel loops" is absolutely an anti-pattern.

(the error also complains, that one of the Mat's (probably "gray") is not initialized at all)

(if your gray Mat is invalid, so will be the binary one. please check size() before)

"I want to implement a simple thresholding algorithm" - please use the builtin threshold() function, do not reinvent the wheel. writing "per-pixel loops" is absolutely an anti-pattern.

(the error also complains, that one of the Mat's (probably "gray") is not initialized at all)

(if your gray Mat is invalid, so will be the binary one. please check size() before)

last, j <= mat.cols will be out of bounds. again, please do not write such loops.

"I want to implement a simple thresholding algorithm" - please use the builtin threshold() function, do not reinvent the wheel. writing "per-pixel loops" is absolutely an anti-pattern.

(the error also complains, that one of the Mat's (probably "gray") is not initialized at all)

(if your gray Mat is invalid, so will be the binary one. please check size() before)

last, both : ì <= rows and j <= mat.colscols will be out of bounds. again, please do not write such loops.

"I want to implement a simple thresholding algorithm" - please use the builtin threshold() function, do not reinvent the wheel. writing "per-pixel loops" is absolutely an anti-pattern.

(the error also complains, that one of the Mat's (probably "gray") is not initialized at all)

(if your gray Mat is invalid, so will be the binary one. please check size() before)

last, both : ì <= rows and j <= cols will be out of bounds. again, please do not write such loops.