On 11/11/2015 11:39 PM, Ankur Dubey wrote:
> Hi
>
> I am trying to do the following operation which I have implemented using
> opencv API and worked.
>
> Mat colormask = new Mat(),colormask1 = new Mat();
> Scalar Colour = new Scalar(a.get((a.rows())/2-1,(a.cols())/2-1));
> Core.inRange(b,new Scalar(0,0,0),Colour,colormask);
> Core.inRange(b,new Scalar(0,0,0),new Scalar(a.get(0,0)),colormask1);
Try something like this:
Mat colormask = new Mat(),colormask1 = new Mat();
Mat Colour = new Mat(new double[]
{a.createIndexer().get((a.rows())/2-1,(a.cols())/2-1)});
inRange(b,new Mat(new double[] {0, 0, 0, 0}),Colour,colormask);
inRange(b,new Mat(new double[] {0, 0, 0, 0}),new Mat(new double[]
{a.createIndexer().get(0,0)}),colormask1);
> I didn't understand why different work going on with same name ------one
> with OPENCV API and other one with bytecode opencv. And if there is any
> difference why there is no proper blog with full documentation of changes
> and how to use them. In this example only its visible when there is change
> in from OPENCV API but its not mentioned anywhere that how to use. No
> examples as well for new opencv Mat format.
JavaCPP tends to follow more closely the C++ API, so we should refer to
sample code in C++, not Java.
Of course, more documentation, samples, FAQ, etc are desirable. If you
would like to make a contribution, you could start a wiki article about
this particular issue. It's write accessible to all! Thanks
Samuel