Solved Efficient way to extract pixels from image
-
what is the efficient way to extract pixels from image and need to find greatest pixel intensity value and mark that point with red colour from the mouse selected region
-
I would start from QImage, and maybe use the QtConcurrent namespace to extract the intensity for instance. Then a simple max search should allow to determine the pixel you're interested in.
-
Thank you.
QPixmap bw = QPixmap(":/dialog/C:/Users/123/Desktop/28-11-2015/crop.png");
QImage image = bw.toImage();
ui->dialog_crop->setPixmap(QPixmap::fromImage(image));
image = image.convertToFormat(QImage::Format_RGB888);
uchar *bits = image.bits();
for (int i = 0; i < (image.width() * image.height() * 3); i++)
{
if(bits[0]<bits[i])
{
bits[0]=bits[i];
}
}
qDebug()<<"maximum intensity pixel="<<bits[0];Here in bits[0] is having entire image maximum intensity pixel ,now i need to select with mouse one perticuler region in that region i need to find greatest intensity pixel can anyone please suggest .