-1

I have already developed an application in iOS which uses this algorithm to detect a sheet of paper and I am translating the algorithm to an Android port.

How should I translate this one into Java?

mixChannels(&blurred, 1, &gray0, 1, ch, 1);

Where blurred and gray0 are cv::Mat.

Community
  • 1
  • 1
fernandospr
  • 2,541
  • 1
  • 18
  • 37

2 Answers2

2

Use cvMixChannels function. Here's description of parameters.

ArtemStorozhuk
  • 8,542
  • 4
  • 30
  • 52
0

This is how you would do it:

MatOfInt fromto = new MatOfInt(ch);
List<Mat> blurredlist = new ArrayList<Mat>();
List<Mat> graylist = new ArrayList<Mat>();
blurredlist.add(0, blurred);
graylist.add(0, gray0);
Core.mixChannels(blurredlist, graylist, fromto);

Look at this implementation for more examples: https://code.google.com/p/scope-ocr/

Paito
  • 1,578
  • 1
  • 15
  • 22