Hi guys, i have this snipped code
coeffs.<Double>at(0,0) = ((value1 * 1.0 / alphaMax) - 0.5) * 2 * 3 * Math.sqrt(pca.eigenvalues.<Double>at(0,0));
and i want to write it in java language. based on what i have read, if above code i write into java it will become like this
//coeffs is CV_64f
double coeffsBuff[] = new double[(int) (coeffs.total() * coeffs.channels())];
double pcaEigenvalueBuff[] = new double[(int) (pcaEigenvalue.total() * pcaEigenvalue.channels())];
Mat pcaEigenvalue = new Mat();
Mat pcaEigenvactor = new Mat();
Core.eigen(pca, true, pcaEigenvalue, pcaEigenvactor);
coeffs.get(0, 0, coeffsBuff);
pcaEigenvalue.get(0, 0, pcaEigenvalueBuff);
coeffsBuff = ((value1 * 1.0 / alphaMax) - 0.5) * 2 * 3 * Math.sqrt(pcaEigenvalue.get(0, 0, pcaEigenvalueBuff));
i got an error because coeffsBuff require double value meanwhile ((value1 * 1.0 / alphaMax) - 0.5) * 2 * 3 * Math.sqrt(pcaEigenvalue.get(0, 0, pcaEigenvalueBuff))
return double[] value.
can anybody tell me how to convert those code into java?