Skip to content

Charucoboard initialisation crashes #10

@Andyjk1406

Description

@Andyjk1406

Hi - nice library!

I have a problem initialising a Charucoboard. The following java function works fine to display the yellow opencv Mat and everything builds fine in Eclipse so I think I have the opencv3-android-sdk-with-contrib installed correctly.

But if I try to create a charucoboard the app just closes on the line:
cboard = CharucoBoard.create(10,10,10f,10f,dict);

Am I using this wrong ?

`
public void helloworld() {
// make a mat and draw something
Scalar bg_colour;
bg_colour = new Scalar(255, 255, 0);
Mat m = new Mat(500,1000, CvType.CV_8UC3, bg_colour);

        // CharucoBoard creation
        Size sz = new Size(500,500);
        Dictionary dict = Aruco.getPredefinedDictionary (11);

        CharucoBoard cboard;
        cboard = CharucoBoard.create(10,10,10f,10f,dict);
        //cboard.draw(sz, m);
        
        // convert to bitmap:
        Bitmap bm = Bitmap.createBitmap(m.cols(), m.rows(),Bitmap.Config.ARGB_8888);
        Utils.matToBitmap(m, bm);

        // find the imageview and draw it!
        ImageView iv = (ImageView) findViewById(R.id.imageView1);
        iv.setImageBitmap(bm);
        
    }`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions