Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 1117

Squaring elements of a matrix and summing them

$
0
0
I am new to java and opencv . I have a matrix(destination) and now I want to square every element of it and add all of them together after squaring. how can I do that? Mat destination = new Mat(footGrayMat.rows(),footGrayMat.cols(),footGrayMat.type()); Mat kernel = new Mat(5,5, CvType.CV_32F); float[] data = {-1,-3,-4,-3,-1,-3,0,6,0,-3,-4,6,20,6,-4,-3,0,6,0,-3,-1,-3,-4,-3,-1}; kernel.put(0,0,data); Imgproc.filter2D(footGrayMat, destination, -1, kernel);

Viewing all articles
Browse latest Browse all 1117

Trending Articles