Maximum pixel value of the tiff image is 481. But it is showing maximum is 1.So how to read properly.
1 | initial version |
Maximum pixel value of the tiff image is 481. But it is showing maximum is 1.So how to read properly.
2 | No.2 Revision |
Maximum pixel value of the tiff image is 481. But it is showing maximum is 1.So how to read properly.
3 | No.3 Revision |
Maximum pixel value of the tiff image is 481. But it is showing maximum is 1.So how to read properly.
using namespace std; using namespace cv;
Mat IMG(5620, 4894, CV_8UC3, Scalar(0, 0, 0)); int main() { /* Input Image of 4894*5620 size */ Mat image = imread("C:\Users\IIST\Desktop\Madi\NRSC_OCT\a.tif",IMREAD_ANYDEPTH); //Mat image = imread("D:\SC15M053\PROGRAM AND OUTPUTS\NRSC\post_image\53N07_cl.img", IMREAD_ANYDEPTH); int ch = image.channels(); int R = image.rows; int C = image.cols; cout << "Channles : " << ch << endl << "Rows are : " << R << endl << "Cols are : " << C << endl; int max = image.at<vec3b>(0, 0)[0];; //int max = image.at<vec3b>(258, 519)[2]; for (int i = 0; i < R; i++) { for (int j = 0; j < C; j++) { if (max < image.at<vec3b>(i, j)[0]) max = image.at<vec3b>(i, j)[0]; } } cout << "Maximum value of band : " << max << endl; cin.get(); return(0); }
Exception: Unhandled exception at 0x000007FFFF05AEA8 in FirstOpencv2.exe: Microsoft C++ exception: cv::Exception at memory location 0x00000034A04EF4E0.
4 | No.4 Revision |
Maximum pixel value of the tiff image is 481. But it is showing maximum is 1.So how to read properly.
#include <opencv2/core/core.hpp>
#include <opencv2\highgui\highgui.hpp>
#include <opencv2\imgproc\imgproc.hpp>
#include <opencv2\nonfree\features2d.hpp>
#include <iostream>
using namespace std;
using namespace Exception: Unhandled exception at 0x000007FFFF05AEA8 in FirstOpencv2.exe: Microsoft C++ exception: cv::Exception at memory location 0x00000034A04EF4E0.