title: Is there implicit limit for DNN input size of OpenCV Android?
body: <p>I trained a Caffe model which does NOT specify input sizes. Then I ran it on Android using OpenCV. The code is like below.</p>
  
  <pre><code>private void runEntireImageTest(Mat inY) {
      float scaleFactor = 1.0f / 255.0f;
      Scalar mean = new Scalar(0);
      Mat resized = new Mat();
  
      // (550, 441) runs OK. (smaller sized runs also fine)
      // (551, 441), (550, 442) crash.
      // (441, 550) crashes
  
      Imgproc.resize(inY, resized, new Size(550, 441));
      Mat segBlob = Dnn.blobFromImage(resized, scaleFactor, resized.size(), mean, false, false);
      mNet.setInput(segBlob);
  
      // if input size is above some value, crash will happen here
      Mat lastLayer = mNet.forward();
      Mat outY = lastLayer.reshape(1, 1);
  }
  </code></pre>
  
  <p>As it is written in the comment, there seems to be some <em>intrinsic</em>, or <em>implicit</em> limitation for the input size. <code>(550, 441)</code> ran okay, but <code>(551, 441)</code> will cause <code>SIGSEGV</code>:</p>
  
  <p><code>A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x6d494bd744 in tid 19693 (myappname), pid 19661 (myappname)</code></p>
  
  <p>I think it's not a memory problem because <code>(550, 441)</code> runs fine but <code>(441, 550)</code> will crash. What is the cause of this problem?</p>