0

I am following a tutorial for an assignment and I am getting a NullReferenceException error while following the exact steps of the video. I am new to coding and have no idea how to resolve this. Specific help in OpenCV plus and Unity would be appreciated.

var faces = cascade.DetectMultiScale(frame, 1.1, 2, HaarDetectionType.ScaleImage);
  • Welcome to Stack Overflow! [Please do not upload images of code/errors when asking a question.](https://meta.stackoverflow.com/q/285551/8967612) – 41686d6564 stands w. Palestine May 11 '21 at 02:26
  • 1
    In debug mode, the program should stop at the error, where you can hover over each variable in the code to see which one is null. That should give you a better idea as to what is causing the null reference. – Alan May 11 '21 at 02:46
  • @Alan I see where the null reference is coming from but I don't know how to fix it. (sorry I am new to coding and may not be clear in what I actually need help with ) – Osiris Adrian St. Brown May 11 '21 at 03:09
  • Likely that cascade is null, or frame is null. faces would be null because it has not been assigned a value yet due to the null reference error so can ignore that. When you find which of the other two is null, it will help to find the cause. – Alan May 11 '21 at 03:56

0 Answers0