Skip to content

Extend cudaimgproc::demosaicing for f32#3836

Open
apbr wants to merge 2 commits intoopencv:4.xfrom
apbr:cuda-demosaicing-f32
Open

Extend cudaimgproc::demosaicing for f32#3836
apbr wants to merge 2 commits intoopencv:4.xfrom
apbr:cuda-demosaicing-f32

Conversation

@apbr
Copy link
Copy Markdown

@apbr apbr commented Nov 28, 2024

Extend cudaimgproc::demosaicing to also allow images with f32 values.

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work -> not applicable
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@llschloesser
Copy link
Copy Markdown

@apbr please see #3777

It seems like adding 32f to that PR would be easier than deconflicting with this one and we might get all functionality merged sooner. Can I ask what sensor you are using where you have 32f raw pixels?

@apbr
Copy link
Copy Markdown
Author

apbr commented Apr 3, 2025

@llschloesser #3777 was merged 1 hour after your comment. So I'll just rebase my PR.

Can I ask what sensor you are using where you have 32f raw pixels?

We do some image processing steps before the debayering. Their resulting datatype is f32. So it's not directly from the sensor.

@apbr apbr force-pushed the cuda-demosaicing-f32 branch from ec24b9c to ddb96cd Compare April 3, 2025 13:47
@llschloesser
Copy link
Copy Markdown

If you follow the template pattern of the earlier PR you'll get 32f to gray and 4 channel, there is no need to restrict to 3 channel.

@apbr apbr force-pushed the cuda-demosaicing-f32 branch from ddb96cd to d498de9 Compare April 3, 2025 14:49
@apbr
Copy link
Copy Markdown
Author

apbr commented Apr 3, 2025

If you follow the template pattern of the earlier PR you'll get 32f to gray and 4 channel, there is no need to restrict to 3 channel.

Good point, I'll rework and test it.

@apbr apbr force-pushed the cuda-demosaicing-f32 branch from d498de9 to 5ffd0d6 Compare February 10, 2026 09:27
@apbr
Copy link
Copy Markdown
Author

apbr commented Feb 10, 2026

Reworked the changes.

@asmorkalov
Copy link
Copy Markdown
Contributor

@apbr Could you add simple test for the new feature?

@apbr
Copy link
Copy Markdown
Author

apbr commented Feb 11, 2026

@apbr Could you add simple test for the new feature?

@asmorkalov I could give it a try. Should they be in here?

@asmorkalov
Copy link
Copy Markdown
Contributor

Yes, as shortcut you can use existing demosaic test and reference data for u8, but scale it for larger range. I just want to be sure that the template implementation does not lead to overflows or other arithmetical issues.

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