Estoy usando marcos en formato jpg obtenidos de opencv, ¿cómo puedo cambiar la imagen al formato rgb?
#includelt;opencv2/opencv.hppgt;
#includelt;iostreamgt;
usando?namespace?std;
usando?namespace?cv;
int?main()
{
Mat?img=imread("f:/1.jpg");
int?height =img.rows;
int?width=img.cols;
for(int?i=0;ilt;.height;i)
{
unsigned?char?*data=img.data i*width*img.channels();
for(int?j=0;jlt;width;j) p> p>
{
int ?r=*(datos j*img.channels());
int?g=*(datos j*img.channels () 1);
int?b=*(datos j*img.channels() 2);
int?channels() 2);
coutlt ;lt;r lt;lt;"?" lt;lt;glt;lt;"?" lt;lt;blt;lt;endl;
}
} p>
img.release();
sistema("pausa");
¿regresar?;
}