Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

@StevenPuttemans, @thdrksdfthmn, thanks for the help and ideas.. Debugged and worked. Here is the code for anybody from the forum to refer. Let me know if there are issues from my code below.

Mat newdata = Mat::zeros(1,1025,CV_32F); //change accordingly the total of value Mat data = frame_gray.reshape(1,1); // change the frame_gray original mat to the 1X1 matriks data.convertTo(data, CV_32F); data.setTo(1, data>1);

   for (int g = 0; g <1024;g++)
{
    newdata.at<float>(0,g) = data.at<float>(0,g);
}
    newdata.at<float>(0,1024)= whitepix;  // additional information need to be added at the last place
click to hide/show revision 2
No.2 Revision

@StevenPuttemans, @thdrksdfthmn, thanks for the help and ideas.. Debugged and worked. Here is the code for anybody from the forum to refer. Let me know if there are issues from my code below.

Mat newdata = Mat::zeros(1,1025,CV_32F); //change accordingly the total of value
Mat data = frame_gray.reshape(1,1); // change the frame_gray  original mat to the 1X1 matriks
         data.convertTo(data, CV_32F); 
         data.setTo(1, data>1);

data>1);
    for (int g = 0; g <1024;g++)
 {
     newdata.at<float>(0,g) = data.at<float>(0,g);
 }
     newdata.at<float>(0,1024)= whitepix;  // additional information need to be added at the last place