Skip to content

Bayer VNG Demosaicing Fix #2#15086

Merged
mshabunin merged 2 commits intoopencv:3.4from
dcouwenh:dcouwenh-vng-demosaicing-fix2
Jul 30, 2019
Merged

Bayer VNG Demosaicing Fix #2#15086
mshabunin merged 2 commits intoopencv:3.4from
dcouwenh:dcouwenh-vng-demosaicing-fix2

Conversation

@dcouwenh
Copy link
Copy Markdown
Contributor

Fixed calculation of Bs for non-green pixels.

resolves #15011

This pullrequest changes

In file modules\imgproc\src\demosaicing.cpp, the Bs values for non-green cells were being calculated incorrectly in the NW and SE gradients. I fixed the math in both the SSE2 accelerated and non-accelerated code blocks.

Fixed calculation of Bs for non-green pixels.
@dcouwenh dcouwenh changed the title Update demosaicing.cpp Bayer VNG Demosaicing Fix #2 Jul 18, 2019
@mshabunin
Copy link
Copy Markdown
Contributor

Looks like there are failing tests:

Imgproc_ColorBayerVNG.regression : 
/build/precommit_linux64/3.4/opencv/modules/imgproc/test/test_color.cpp:1889: Failure
Expected equality of these values:
  0
  countNonZero(diff.reshape(1) > 1)
    Which is: 139600
Imgproc_ColorBayerVNG_Strict.regression : 
/build/precommit_linux64/3.4/opencv/modules/ts/src/ts.cpp:589: Failure
Failed

	failure reason: Bad accuracy
	test case #499
	seed: 6b745577e9e8e727
-----------------------------------
	SUM: 
Count non zero in absdiff: 41039

-----------------------------------
	CONSOLE: ............................................................
-----------------------------------

It seems that reference images should be regenerated:

Please note that you should create separate PR to the opencv/opencv_extra repository using same branch name as in this PR (dcouwenh-vng-demosaicing-fix2), then both PRs will be tested together.

@dcouwenh
Copy link
Copy Markdown
Contributor Author

dcouwenh commented Jul 19, 2019

@mshabunin , I have regenerated the reference images in the opencv/opencv_extra repository to reflect the change to the bayer VNG demosaicing code in opencv/opencv, and created a pull request for the opencv_extra repository with the same branch name (dcouwenh-vng-demosaicing-fix2) opencv/opencv_extra#641

@mshabunin
Copy link
Copy Markdown
Contributor

@dcouwenh , looks like these files were used in another test: opencv_perf_imgproc. And now it is failing because it expects different values.

You need to replace this line:

SANITY_CHECK(dst, 1);

With SANITY_CHECK_NOTHING();

@mshabunin mshabunin merged commit d3cf0d2 into opencv:3.4 Jul 30, 2019
@alalek alalek mentioned this pull request Aug 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants