Reputation: 21
I am working on Closed/open eye-detection project using OpenCV
libraries in Eclipse
for android latest version. I retrieve a part of detected face and then save it in a Mat
variable.
I am getting problem in how to display all the values( gray-scale
pixel values). These are the methods I tried:
System.out.println()
don't work in Android
.Log.i()
function to display all pixel values in two for-loops, but it is showing limited values, means I am not able to see starting values.Mat_Variable.dump()
function to display all the values of Mat variable, but I am not able to see any the output.How can I display all the values present in Mat_variable?
Plus, is there any way to see all the values of Mat variable in Matrix-format (because System.out.println()
doesn't work, otherwise I could use System.out.println()
to display values in Matrix-format)?
Upvotes: 0
Views: 1056
Reputation: 699
What about writing the values to a file?
If that'd be a solution for you, you could try the following:
// Create access to the file
cv::FileStorage file("mat.yml", cv::FileStorage::WRITE);
cv::Mat myMat;
// Write myMat to file!
file << myMat;
If you're having troubles with write-permissions
have a look at the answers over here
I'm very sorry to not have looked more closely at the tags you specified. There are two ways to proceed. The first way would be to write the Mat
to a file by hand following this approach. The second approach is to use Android-NDK
. As I am not familiar with Android-NDK
I can just point out some code sample for you.
Upvotes: 2