- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Hi,
According to the image processing documentation, functional results are often "rounded to the nearest integer". I am finding this not to be the case. For example, the following code demonstrates what I'm finding.
BYTE* boo = new BYTE[ 1 * 3 ];
IppiSize boo_roi;
boo_roi.height = 1;
boo_roi.width = 3;
boo[0] = 113;
boo[1] = 134;
boo[2] = 115;
BYTE* bood = new BYTE[ 1 * 1];
ippiRGBToGray_8u_C3C1R( boo, 3, bood, 1, boo_roi);
printf("TEST RGB TO GRAY on (113,134,115) = %d yet math = %.4f ",bood[0],
0.299*113 + 0.587*134 + 0.114*115);
Output is the following :
TEST RGB TO GRAY on (113,134,115) = 125 yet math = 125.5550
So if the floating point value of one-pixel rgb image if 125.550, shouldn't the nearest integer be 126, not 125?
Thanks
Matt
According to the image processing documentation, functional results are often "rounded to the nearest integer". I am finding this not to be the case. For example, the following code demonstrates what I'm finding.
BYTE* boo = new BYTE[ 1 * 3 ];
IppiSize boo_roi;
boo_roi.height = 1;
boo_roi.width = 3;
boo[0] = 113;
boo[1] = 134;
boo[2] = 115;
BYTE* bood = new BYTE[ 1 * 1];
ippiRGBToGray_8u_C3C1R( boo, 3, bood, 1, boo_roi);
printf("TEST RGB TO GRAY on (113,134,115) = %d yet math = %.4f ",bood[0],
0.299*113 + 0.587*134 + 0.114*115);
Output is the following :
TEST RGB TO GRAY on (113,134,115) = 125 yet math = 125.5550
So if the floating point value of one-pixel rgb image if 125.550, shouldn't the nearest integer be 126, not 125?
Thanks
Matt
링크가 복사됨
2 응답
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Hi Matt,
you are right, it was an issue in IPP 5.1. We have fixed it in IPP 5.2 beta
Regards,
Vladimir
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Ops, just double-check with developer, the more correct statement is that we provide +/- 1 precision in that function because of performance tradeoff. Please let us know if this is critical issue for you.
Vladimir
