本文整理匯總了Java中org.opencv.core.Mat.row方法的典型用法代碼示例。如果您正苦於以下問題:Java Mat.row方法的具體用法?Java Mat.row怎麽用?Java Mat.row使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.opencv.core.Mat
的用法示例。
在下文中一共展示了Mat.row方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: main
import org.opencv.core.Mat; //導入方法依賴的package包/類
public static void main(String[] args) {
System.out.println("Welcome to OpenCV " + Core.VERSION);
Mat m = new Mat(5, 10, CvType.CV_8UC1, new Scalar(0));
System.out.println("OpenCV Mat: " + m);
Mat mr1 = m.row(1);
mr1.setTo(new Scalar(1));
Mat mc5 = m.col(5);
mc5.setTo(new Scalar(5));
System.out.println("OpenCV Mat data:\n" + m.dump());
}
示例2: subspaceProject
import org.opencv.core.Mat; //導入方法依賴的package包/類
public static Mat subspaceProject(Mat W, Mat mean, Mat src) {
int n = src.rows();
int d = src.cols();
Mat X = new Mat();
Mat Y = new Mat();
src.convertTo(X, W.type());
if(!mean.empty()) {
for(int i = 0; i < n; i ++) {
Mat r_i = X.row(i);
Core.subtract(r_i, mean.reshape(1, 1), r_i);
}
}
Core.gemm(X, W, 1.0, new Mat(), 0.0, Y);
return Y;
}
示例3: subspaceReconstruct
import org.opencv.core.Mat; //導入方法依賴的package包/類
public static Mat subspaceReconstruct(Mat W, Mat mean, Mat src) {
int n = src.rows();
int d = src.cols();
Mat X = new Mat();
Mat Y = new Mat();
src.convertTo(Y, W.type());
Core.gemm(Y, W, 1.0, new Mat(), 0.0, X, 2);
if(!mean.empty()) {
for(int i = 0; i < n; i ++) {
Mat r_i = X.row(i);
Core.add(r_i, mean.reshape(1, 1), r_i);
}
}
return X;
}