title: OpenCV HOGDescriptor Errors
body: <p>I am running OpenCV 2.4.3 on Mac OS X 10.8.
  I am trying to use the cv::HOGDescriptor to get pedestrians in a video sequence.</p>
  
  <p>This is the code I am using to do the detection and paint a bounding box.</p>
  
  <pre><code>  cv::VideoCapture input("file.avi");
    assert(input.isOpened());
    cv::HOGDescriptor body;
    assert(body.load("hogcascade_pedestrians.xml"));
    cv::Mat frame, gray;
    cv::namedWindow("video");
  
    while (input.read(frame)) {
      vector&lt;cv::Rect&gt; rects;
      cv::cvtColor(frame, gray, cv::COLOR_RGB2GRAY);
      cv::equalizeHist(gray, gray);
  
      body.detectMultiScale(gray, rects);
      for (unsigned int i=0;i&lt;rects.size();i++) {
        cv::rectangle(frame, cv::Point(rects[i].x, rects[i].y),
            cv::Point(rects[i].x+rects[i].width, rects[i].y+rects[i].height),
            cv::Scalar(255, 0, 255));
      }
      cv::imshow("video", frame);
    }
  </code></pre>
  
  <p>However, when the execution reaches the line <code>body.detectMultiScale(gray, rects);</code>, I get the an error and the whole application crashes</p>
  
  <pre><code>libc++abi.dylib: terminate called throwing an exception
  [1]    92156 abort      ../bin/DetectPedestrians
  </code></pre>
  
  <p>What is going wrong? I cannot seem to get any new information from the <code>gdb</code> or <code>lldb</code> outputs. I am compiling with the code with a CMake build, so I guess this isn't a problem with the linking.</p>
  
  <p>Here is a stack trace from the thread that crashed -</p>
  
  <pre><code>Thread 0 Crashed:: Dispatch queue: com.apple.root.default-priority
  0   libsystem_kernel.dylib          0x00007fff8c001212 __pthread_kill + 10
  1   libsystem_c.dylib               0x00007fff8e7afaf4 pthread_kill + 90
  2   libsystem_c.dylib               0x00007fff8e7f3dce abort + 143
  3   libc++abi.dylib                 0x00007fff94096a17 abort_message + 257
  4   libc++abi.dylib                 0x00007fff940943c6 default_terminate() + 28
  5   libobjc.A.dylib                 0x00007fff8e11f887 _objc_terminate() + 111
  6   libc++.1.dylib                  0x00007fff96b0b8fe std::terminate() + 20
  7   libobjc.A.dylib                 0x00007fff8e11f5de objc_terminate + 9
  8   libdispatch.dylib               0x00007fff8c4ecfa0 _dispatch_client_callout2 + 28
  9   libdispatch.dylib               0x00007fff8c4ed686 _dispatch_apply_serial + 28
  10  libdispatch.dylib               0x00007fff8c4e80b6 _dispatch_client_callout + 8
  11  libdispatch.dylib               0x00007fff8c4ebae8 _dispatch_sync_f_invoke + 39
  12  libopencv_core.2.4.3.dylib      0x0000000101d5d900 cv::parallel_for_(cv::Range const&amp;, cv::ParallelLoopBody const&amp;, double) + 116
  13  libopencv_objdetect.2.4.3.dylib 0x000000010257fa21 cv::HOGDescriptor::detectMultiScale(cv::Mat const&amp;, std::vector&lt;cv::Rect_&lt;int&gt;, std::allocator&lt;cv::Rect_&lt;int&gt; &gt; &gt;&amp;, std::vector&lt;double, std::allocator&lt;double&gt; &gt;&amp;, double, cv::Size_&lt;int&gt;, cv::Size_&lt;int&gt;, double, double, bool) const + 559
  14  libopencv_objdetect.2.4.3.dylib 0x000000010257fdc2 cv::HOGDescriptor::detectMultiScale(cv::Mat const&amp;, std::vector&lt;cv::Rect_&lt;int&gt;, std::allocator&lt;cv::Rect_&lt;int&gt; &gt; &gt;&amp;, double, cv::Size_&lt;int&gt;, cv::Size_&lt;int&gt;, double, double, bool) const + 80
  15  DetectPedestrians               0x0000000101a7886c main + 2572 (detect.cpp:41)
  16  libdyld.dylib                   0x00007fff8d89f7e1 start + 1
  </code></pre>
  
  <p>On a Linux system, the same code gives me an error saying -</p>
  
  <pre><code>OpenCV Error: Assertion failed (dsize.area() || (inv_scale_x &gt; 0 &amp;&amp; inv_scale_y &gt; 0)) in resize, file /home/subho/OpenCV/OpenCV-2.4.3/modules/imgproc/src/imgwarp.cpp, line 1726
  terminate called after throwing an instance of 'tbb::captured_exception'
    what():  /home/subho/OpenCV/OpenCV-2.4.3/modules/imgproc/src/imgwarp.cpp:1726: error: (-215) dsize.area() || (inv_scale_x &gt; 0 &amp;&amp; inv_scale_y &gt; 0) in function resize
  </code></pre>