How to get Mat with a drawable input in Android using OpenCV

前端 未结 1 415
独厮守ぢ
独厮守ぢ 2020-12-31 12:15

I have some image files in the drawable folder. And now, I want to convert them into opencv Mat object. I\'ve found a function:

Mat img = Highgui.imread(inFi         


        
相关标签:
1条回答
  • 2020-12-31 13:04

    This should do

    Mat img = Utils.loadResource(context, refrenceimgID, Highgui.CV_LOAD_IMAGE_COLOR);
    Imgproc.cvtColor(img, gryimg, Imgproc.COLOR_RGB2BGRA);
    
    0 讨论(0)
提交回复
热议问题