opencv - Is there any easy way to find the maximum (i.e. white) value for a given Open CV type? -


if have open cv matrix , don't know type (e.g. 8 bit unsigned, 32 bit float), there easy function give me value used represent white (so 255 8 bit unsigned, 1.0 32 bit float, etc)?

on opencv 2.x, take @ mat::depth retrieve (quoting docs):

the identifier of matrix element depth (the type of each individual channel)

from there can calculate value represent white color switch:

switch (image.depth()) {    case cv_8u:         white = scalar(255,255,255); break;    case cv_8s:        ... } 

Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -