c# - Object reference not set to an instance of an object. using Emgu CV -


please guys me resolving issue in following statement:

mcvavgcomp[][] detector = imagegray.detecthaarcascade(face, 2.1, 10,   emgu.cv.cvenum.haar_detection_type.do_canny_pruning, new size(20, 20));" 

after debugging solution compiler show me following error:

object reference not set instance of object.

because you're dealing haar cascade logic, imagegray looks gray scale image of type

image<gray, byte> imagegray; 

ensure correctly initialized or converted rightly frame. check not null.

and in line:

imagegray.detecthaarcascade(face, 2.1, 10, emgu.cv.cvenum.haar_detection_type.do_canny_pruning, new size(20, 20)); 

face variable initialized like:

var face = new haarcascade("haarcascade_some_tree.xml"); 

ensure face not null.

if both variables not null, detecthaarcascade method expects fields in face object non-null , finding null.

ensure if face object fields non-null. (some key ones once variable initialized)


Comments

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -