Ask Your Question

Revision history [back]

Is it possible for me to set a collection of pixels to a (R,G,B) value?

I have been trying to set a collection of pixels to red by doing this:

for(j=0;j<180;j++){
  for(i=0;i<180;i++){
    cv::Vec3b color =frame.at<cv::Vec3b>(j,i);
    color[0]=0;
    color[1]=0;
    color[2]=255;
    frame.at<cv::Vec3b>(j,i) = color;
  }
}

Instead I get rgb style layers like what you would see if you looked at a CRT tv really close. How should I be doing it if I would like to set specific pixels to an RGB value? I'm probably doing something really stupid :( If you think I can provide any more information to help please let me know. I'm very new to this :)