mirror of
https://github.com/status-im/qzxing.git
synced 2025-02-23 16:18:08 +00:00
changed the calculation of grayscale since there is a very slight persentage increment of succeeded tests. To be reviewed.
This commit is contained in:
parent
66ef3add5a
commit
5de6bf853f
@ -73,7 +73,9 @@ QImage* CameraImageWrapper::grayScaleImage(const QImage *origin)
|
|||||||
{
|
{
|
||||||
for(int j=0; j<origin->height(); j++)
|
for(int j=0; j<origin->height(); j++)
|
||||||
{
|
{
|
||||||
int pix = qGray(origin->pixel(QPoint(i,j)));
|
QRgb pixel = origin->pixel(QPoint(i,j));
|
||||||
|
QRgb pix = (qRed(pixel) + qGreen(pixel) + qBlue(pixel)) / 3;
|
||||||
|
//qGray(origin->pixel(QPoint(i,j)));
|
||||||
tmp->setPixel(i,j, qRgb(pix ,pix,pix));
|
tmp->setPixel(i,j, qRgb(pix ,pix,pix));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user