Note that there are some explanatory texts on larger screens.

plurals
  1. POOpenCV Error: Unsupported format or combination of formats
    primarykey
    data
    text
    <p>I am developing an application in whitch i have to take a picture from camera and after that Detect the Edge Square(Like Document page.) in the picture...After a long searching i found OpenCV library to achieve this, i have succesfully imported the java library for android, But problem is that when i call the method of opencv to detect Square(The method is </p> <p><strong>Imgproc.findContours(converted, contours,hierarchy,Imgproc.CHAIN_APPROX_SIMPLE,Imgproc.RETR_LIST)</strong>)..it give me the </p> <p>exception...<strong><em>OpenCV Error:</em></strong> Unsupported format or combination of formats (FindContours support only 8uC1 and 32sC1 images) in _CvContourScanner* cvStartFindContours(void*, CvMemStorage*, int, int, int, CvPoint), file /home/reports/ci/slave/50-SDK/opencv/modules/imgproc/src/contours.cpp, line 196</p> <p>I am sending u some piece of code-----------------------------------------------------</p> <p>public void convertImage() {</p> <pre><code> Mat ori = new Mat(); Mat converted = new Mat(200, 200, CvType.CV_8UC1, new Scalar(0)); try { ori = Utils.loadResource(MainActivity.this, R.drawable.ic_launcher, Highgui.CV_LOAD_IMAGE_COLOR); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } Imgproc.cvtColor(ori, converted, Imgproc.COLOR_RGB2GRAY, 4); // convert Image to grayscale Imgproc.threshold(ori, converted, 50, 250, Imgproc.ADAPTIVE_THRESH_MEAN_C); // threshold the image List&lt;MatOfPoint&gt; contours = new ArrayList&lt;MatOfPoint&gt;(10); Mat hierarchy = new Mat(200, 200, CvType.CV_32FC1, new Scalar(0)); Imgproc.findContours(converted, contours, hierarchy,Imgproc.CHAIN_APPROX_SIMPLE,Imgproc.RETR_LIST); ImageView frame = (ImageView) findViewById(R.id.imageView1); Imgproc.cvtColor(converted, converted, Imgproc.COLOR_GRAY2RGBA, 4); // convert Image back to RGB Bitmap bmp = Bitmap.createBitmap(converted.cols(), converted.rows(), Bitmap.Config.ARGB_8888); frame.setImageBitmap(bmp); } </code></pre> <p>Any Help will be apreciated------------------ Thanks in advance</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload