Created
May 17, 2016 19:29
-
-
Save vieirin/e8d1145d55556cf8b918d934fce2f709 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cv::Mat glcm(256, 256, CV_8UC1); | |
int glcmMat[256][256]; | |
for (int i = 0; i < inputImg.rows - 1; ++i) | |
for (int j = 0; j < inputImg.cols - 1; ++j) | |
glcmMat[(int)inputImg.at<uchar>(i,j)][(int)inputImg.at<uchar>(i, j+1)]++; | |
for (int i = 0; i < 256; ++i) | |
for (int j = 0; j < 256; ++j) | |
glcm.at<uchar>(i,j) = (uchar)glcmMat[i][j]; | |
cv::FileStorage fs(filename, cv::FileStorage::WRITE); | |
fs << "glcmMat" << glcm; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment