Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to sort mat format faster???

I want to sort all element of mat but my kernel size(kernel_size=61) is very large. Now i use

///* For each window row */
for ( iwr = wr_begin; iwr < wr_end; iwr++ )
 {
   /* For each window column */
    memcpy(p+k*win_size,src2.data+(ic-c_begin)+(ir-r_begin+iwr-wr_begin)*num_cols,sizeof(win_size));
   k+=1;
}

 //cv::Rect roi(ic-c_begin,ir-r_begin,win_size,win_size);
//Mat roi_image=src2(roi);
//roi_image
std::sort(p,p+win_count);
median_value=p[pos] ;

Is any faster method?? pls tell me, thanks:)

click to hide/show revision 2
No.2 Revision

How to faster sort mat format faster???matrix?

I want to sort all element of mat but my kernel size(kernel_size=61) is very large. Now i use

///* For each window row */
for ( iwr = wr_begin; iwr < wr_end; iwr++ )
 {
   /* For each window column */
    memcpy(p+k*win_size,src2.data+(ic-c_begin)+(ir-r_begin+iwr-wr_begin)*num_cols,sizeof(win_size));
   k+=1;
}

 //cv::Rect roi(ic-c_begin,ir-r_begin,win_size,win_size);
//Mat roi_image=src2(roi);
//roi_image
std::sort(p,p+win_count);
median_value=p[pos] ;

Is any faster method?? pls tell me, thanks:)