Quantcast
Viewing all articles
Browse latest Browse all 41027

Unable to store stort[] array in Matrix object : OpenCV Java

Hi, I am trying to store a short[1280*1024] 1D array in Mat object and and trying to create an image out of it. Below is code: Mat mat1=new Mat(); mat1.create(1280, 1024, CvType.CV_16UC1); mat1.put(1280, 1024,pix); //pix is short[1280*1024] Imgcodecs.imwrite("/../pic.png", mat1); The put() function is not able to store all the [1280*1024] elements in the cells of the matrix. Only around 1/4th of the data seems to be stored. The rest are all 0s. I would be grateful if anyone can throw some light on this and tell if this is the right way to store the array into Matrix object.

Viewing all articles
Browse latest Browse all 41027

Trending Articles



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