OpenCV Android crashes on Imgproc.cvtColor()
<p>I have a problem with OpenCV4Android.</p>

<blockquote>
  <p>java.lang.RuntimeException: Unable to start activity
  ComponentInfo{com.example.camtime/com.fognature.develop.smp.CameraActivity}:
  CvException [org.opencv.core.CvException: cv::Exception:
  /hdd2/buildbot/slaves/slave_ardbeg1/50-SDK/opencv/modules/imgproc/src/color.cpp:3739:
  error: (-215) scn == 3 || scn == 4 in function void
  cv::cvtColor(cv::InputArray, cv::OutputArray, int, int)
                                                                           ]
                                                                               at
  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2320)
                                                                               at
  android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2380)
                                                                               at android.app.ActivityThread.access$800(ActivityThread.java:151)
                                                                               at
  android.app.ActivityThread$H.handleMessage(ActivityThread.java:1285)
                                                                               at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                               at android.os.Looper.loop(Looper.java:135)
                                                                               at android.app.ActivityThread.main(ActivityThread.java:5289)
                                                                               at java.lang.reflect.Method.invoke(Native Method)
                                                                               at java.lang.reflect.Method.invoke(Method.java:372)
                                                                               at
  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
                                                                               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
                                                                            Caused by: CvException [org.opencv.core.CvException: cv::Exception:
  /hdd2/buildbot/slaves/slave_ardbeg1/50-SDK/opencv/modules/imgproc/src/color.cpp:3739:
  error: (-215) scn == 3 || scn == 4 in function void
  cv::cvtColor(cv::InputArray, cv::OutputArray, int, int)
                                                                           ]
                                                                               at org.opencv.imgproc.Imgproc.cvtColor_1(Native Method)
                                                                               at org.opencv.imgproc.Imgproc.cvtColor(Imgproc.java:4598)
                                                                               at
  com.fognature.develop.smp.CameraActivity.onCreate(CameraActivity.java:108)
                                                                               at android.app.Activity.performCreate(Activity.java:6018)
                                                                               at
  android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
                                                                               at
  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2273)
                                                                                ... 10 more</p>
</blockquote>

<p>On this code part:</p>

<pre><code>Mat sec;

@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        sec = new Mat();
        setContentView(R.layout.activity_camera);
    File photo = new File(Environment.getExternalStorageState()


+File.separator+"SMP"+File.separator+getIntent().getStringExtra("c_name")+File.separator+getIntent().getStringExtra("last_photo"));
                sec = Highgui.imread(photo.getAbsolutePath());
                Imgproc.cvtColor(sec, sec, Imgproc.COLOR_RGBA2GRAY);
        }
</code></pre>

<p>It always crash on <strong>Imgproc.cvtColor(sec, sec, Imgproc.COLOR_RGBA2GRAY);</strong></p>