Skip to content

Camera preview hangs #2

@dabcmexpertise

Description

@dabcmexpertise

Hello,

Code is great but camera preview hangs. When investigated, I found that this code is causing problem

ScanCardFragment :

` @OverRide
public Mat onCameraFrame(CameraBridgeViewBase2.CvCameraViewFrame inputFrame) {
rgba = inputFrame.rgba();

    if (isScanning && dealRetriever.getDeal().getHand(currentPos).getCards().size() < 32)
    {
        Core.transform(rgba, gray, coefficients);

        /***This line is causing problem***/

        Imgproc.adaptiveThreshold(gray, bw, 255, Imgproc.ADAPTIVE_THRESH_MEAN_C, Imgproc.THRESH_BINARY, 101, 35);

        /***This line is causing problem***/

        cards = detector.detectCardsInImage(bw, rgba);
        cards_set = CardDetector.CardsToSet(cards);
        getActivity().runOnUiThread(new Runnable() {
            public void run() {
                if(dealUpdater !=null && currentPos !=null && cards_set!=null){
                    dealUpdater.addCardsToHand(currentPos, cards_set);
                }


            }
        });
    }
    return rgba;
}`

Can you help me in Imgprov.adaptiveThreshold function?

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