Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

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 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>