使用C ++将.raw灰度图像加载到2d数组

时间:2015-06-14 14:10:00

标签: c++ arrays image

我对C ++很陌生。我试图用C ++读取.raw图像并将其存储在2D数组中以进行进一步修改。我使用以下代码:

var id_counter = 0; 

if ( valid ) {function increment(){id_counter++;}   increment();
        var $task = $("<div class='taskList'  id='"+ id_counter +"'><ul class='taskScreen2'><tr>" 
            + "<td><h1>" + type.val() + "</h1></td>"
            + "<td class='title'><h3>" +  title.val() + "</h3></td>"  
            + "<td>" + wordcount.val() + "</td>"  
            + "<td><p>" + description.val() + "</p></td>"  
            + "<td>" + deadline.val() + "</td>"
            +"<td><button onclick='edit("+id_counter+")'>"+"edit"+"</button></td>"
            + "</tr></ul></div>"
        ).appendTo("#tasks2 tbody");

例如,显示int dimX = 192; int dimY = 256; unsigned char bufferImage[256][192]; FILE * pFile; pFile = fopen("D:\\T1MapAnalysis\\heartroi_Contour.raw", "r"); fread(&bufferImage[0][0], dimX,dimY , pFile); 中的存储值 bufferimage应与bufferimage[114][67]='ÿ';对应。 当我想检查以下255

bool

我收到了不同基本类型的错误。 我不知道如何将unsigned char val = bufferImage[114][67]; bool k = (val == 'ÿ') bool k = (val == '255') 值与不同的灰度值(0到255)进行比较。 感谢。

0 个答案:

没有答案
相关问题