SaveImage.docx - #include #include...

This preview shows page 1 - 3 out of 3 pages.

#include <iostream> #include <fstream> #include "cv.h" #include "highgui.h" //#include "cl_Texture.h" using namespace std; std::string IntToString(int i) { char* buffer = new char[100]; sprintf(buffer, "E:/output/image%d.jpg", i); string s = string(buffer); delete[] buffer; return s; } int main(int argc, char** argv) { IplImage* pImg; IplImage* gray; string imagePath; int count_steps = 4; const int StepDirections[] = { 0, 1, -1, 1, -1, 0, -1, -1 }; cl_Texture* texture = new cl_Texture(); cl_Texture::GLCM* glcm; double d0, d1, d2, d3; // store the features in this array double * features = new double[4 * count_steps]; // to change the ROI int x = 0, y = 0; ofstream myfile("glcm.txt", ios::out | ios::app);
Image of page 1

Subscribe to view the full document.

if (!myfile.is_open()) cout << "Unable to open file"; imagePath = "E:/output/GPdata.jpg"; pImg = cvLoadImage(imagePath.c_str(), 1); if (pImg == 0) { cout << "Error!!" << endl; return -1; } // convert it to gray image gray = cvCreateImage(cvSize(pImg->width, pImg->height), pImg->depth, 1); cvCvtColor(pImg, gray, CV_RGB2GRAY); // set the ROI in the image cvSetImageROI(gray, cvRect(86 + x, 75 + y, 75, 62)); // buid the GLCM glcm = texture->CreateGLCM(gray, 1, StepDirections, count_steps,
Image of page 2
Image of page 3
  • Winter '13
  • dsfcv
  • Dopamine receptor, GLCM, double d0

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern