Я пытаюсь создать очень простую программу, которая инвертирует положение пикселей с помощью Opencv. Однако, кажется, что код не вычисляется по какой-то причине, я заметил много файлов с отсутствующими PDB, и я провел небольшое исследование, но я не могу найти ничего, что могло бы помочь мне решить проблему
я использую VS 2010 с OpenCV 2.2
#include "stdafx.h"
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
#include <iostream>
using namespace std ;
int _tmain(int argc, _TCHAR* argv[]){
IplImage *image = cvLoadImage("mra.jpg");
if (!image) {
cout<<"Error: Couldn't open the image file.\n"<<endl ;
return 1;
}
IplImage *new_image = cvCreateImage(cvGetSize(image) , image->depth , 1 );
CvScalar pix ;
int position = 0 ;
for(int i = 0 ; i < image->height ; i++ ){
for (int j = 0 ; j < image->width ; j++ ){
pix = cvGet2D(image , i , j ) ;
if ( i = 0 ){
position = image->height - 1 ;
}else if ((position >= 2)) {
position = position - 2 ;
}
cvSet2D(new_image , position , j , pix );
}
}
cvNamedWindow("1111", CV_WINDOW_AUTOSIZE);
cvNamedWindow("2222", CV_WINDOW_AUTOSIZE);
cvShowImage("1111", image);
cvShowImage("2222", new_image);
// Wait for the user to press a key in the GUI window.
cvWaitKey(0);
// Free the resources.
cvDestroyAllWindows ;
cvReleaseImage(&image);
cvReleaseImage(&new_image);
return 0;
}
спасибо заранее