書上的例子執行不出來,有誰可以解答下阿

2021-05-25 08:09:02 字數 1550 閱讀 9815

#include

#include

#include

#include 

iplimage *igray=0, *it = 0, *iat;

int main( int argc, char** argv )

//command line

double threshold = (double)atof("100");

int threshold_type = atoi("0") ?

cv_thresh_binary : cv_thresh_binary_inv;

int adaptive_method = atoi("0") ?

cv_adaptive_thresh_mean_c : cv_adaptive_thresh_gaussian_c;

int block_size = atoi("100");

double offset = (double)atof("100");

//read in gray image

if((igray = cvloadimage( filename1, cv_load_image_grayscale)) == 0)

// create the grayscale output images

it = cvcreateimage(cvsize(igray->width,igray->height),

ipl_depth_8u, 1);

iat = cvcreateimage(cvsize(igray->width,igray->height),

ipl_depth_8u, 1);

//threshold

cvthreshold(igray,it,threshold,255,threshold_type);

cvadaptivethreshold(igray, iat, 255, adaptive_method,

threshold_type, block_size, offset);

//put up 2 windows

cvnamedwindow("raw",1);

cvnamedwindow("threshold",1);

cvnamedwindow("adaptive threshold",1);

//show the results

cvshowimage("raw",igray);

cvshowimage("threshold",it);

cvshowimage("adaptive threshold",iat);

cvwaitkey(0);

//clean up

cvreleaseimage(&igray);

cvreleaseimage(&it);

cvreleaseimage(&iat);

cvdestroywindow("raw");

cvdestroywindow("threshold");

cvdestroywindow("adaptive threshold");

return(0);

}

為什麼執行不出來啊

description 輸入n和m兩個整數,並求出n之後的第m個素數。該功能要求用函式實現,函式原型為 int prime int n,int m input 正整數n和m。output n後的第m個素數。sample input 4 5sample output 17 include includ...

成績表!!錯誤!執行不出來了!!

程式的版權和版本宣告部分 檔名稱 x.cpp 完成日期 2012年 12 月7 日 版本號 v1.0 輸入描述 問題描述 成績排序 程式輸出 成績排序 include include using namespace std const int n 12 不變數 void pmscore double...

我這改不出來的錯誤!!!

include include include define max 10 define n 5 define ok 1 define error 0 typedef int status typedef struct studentstud stud chengji n status assert...