【发布时间】:2014-04-03 11:38:33
【问题描述】:
我正在尝试从图像中选择一个 3x3 不重叠的感兴趣区域,然后选择该 3x3 的最大值,然后对其进行处理。现在处理后,我想将新处理的值保存在原始图像像素位置,从该位置选择最大值,而不是在 3x3 的 ROI 区域中。我正在尝试但无法正确执行。 minMaxLoc 给出最大值位置,但它在 3x3 区域中,不在原始图像中,任何人都可以帮忙。会很感激。
int totalRowsMAx = totalRows-receptiveField+1;
for(int rowsInd=0;rowsInd<totalRowsMAx;rowsInd+=receptiveField){
int jj=0;
int totalColsMAx = totalCols-receptiveField+1;
for(int colsInd=0;colsInd<totalColsMAx;colsInd+=receptiveField){
Mat imgROI1 = img1(cv::Rect(colsInd,rowsInd,receptiveField,receptiveField));
if(maxpooling==true){
minMaxLoc( imgROI1, &minVal, &maxVal, &minLoc, &maxLoc );
cout<<"maxVa adress with and sign "<<&maxLoc<<endl;
cout<<"maxValue in ROI"<<imgROI1.at<double>(maxLoc)<<endl;
cout<<"maxValue address without and sign"<<maxLoc<<endl;
cout<<"maxValue in full image "<<img1.at<double>(maxLoc)<<endl; } } }
【问题讨论】:
标签: visual-c++ opencv artificial-intelligence neural-network backpropagation