I am trying to teach myself some basics of Signal Theory, more specifically Image Processing however I am trying to just get the hang of it from first principles (mostly). I have access to an Academic license for Matlab however I would like to learn the principles using C/C++ (as it is free to use) hence my IDE of choice is Qt.
My current project is to read in an image using QImage
and then display the red, green and blue "image parts". However I am not sure how to do this using Qt. My idea is as follows; when displaying the red part set all Green and Blue values for all pixels to zero and display the output and then repeat for each colour component.
QImage my_original_image;
my_original_image.load(":/pic.png");
ui->img_label->setPixmap(QPixmap::fromImage(my_original_image));
The above code snippet is what I use to read in an image and display it onto a label and it works for me.
for (int row=0; row<my_original_image.width(); row++)
{
for (int col=0; col<my_original_image.height(); col++)
{
int r = qRed(my_original_image.pixel(row,col));
qDebug() << "red " << r <<endl;
std::cout << r << std::endl;
}
}
The above code snippet is what I have managed to put together from other forums and all it does is display the red value for all the pixels in the picture.
Herewith my question: How can I modify the above code in order to display the red, green and blue "image parts" into a label similar to the 1st code snippet?