Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bayer demosaicing functions #936

Merged
merged 8 commits into from
Nov 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions doc/biblio/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -665,3 +665,12 @@ @InProceedings{Bakthavatchalam13a
Year = {2013},
url = {http://rainbow-doc.irisa.fr/pdf/2013_icra_mani.pdf}
}

@article{Malvar2004HighqualityLI,
title = {High-quality linear interpolation for demosaicing of Bayer-patterned color images},
author = {Henrique S. Malvar and Li-wei He and Ross Cutler},
journal = {2004 IEEE International Conference on Acoustics, Speech, and Signal Processing},
year = {2004},
volume = {3},
pages = {iii-485}
}
314 changes: 176 additions & 138 deletions modules/core/include/visp3/core/vpImageConvert.h

Large diffs are not rendered by default.

13 changes: 3 additions & 10 deletions modules/core/include/visp3/core/vpImageTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -829,10 +829,7 @@ void vpImageTools::undistort(const vpImage<Type> &I, vpArray2D<int> mapU, vpArra
*/
template <class Type> void vpImageTools::flip(const vpImage<Type> &I, vpImage<Type> &newI)
{
unsigned int height = 0, width = 0;

height = I.getHeight();
width = I.getWidth();
unsigned int height = I.getHeight(), width = I.getWidth();
newI.resize(height, width);

for (unsigned int i = 0; i < height; i++) {
Expand Down Expand Up @@ -873,15 +870,11 @@ int main()
*/
template <class Type> void vpImageTools::flip(vpImage<Type> &I)
{
unsigned int height = 0, width = 0;
unsigned int i = 0;
unsigned int height = I.getHeight(), width = I.getWidth();
vpImage<Type> Ibuf;

height = I.getHeight();
width = I.getWidth();
Ibuf.resize(1, width);

for (i = 0; i < height / 2; i++) {
for (unsigned int i = 0; i < height / 2; i++) {
memcpy(Ibuf.bitmap, I.bitmap + i * width, width * sizeof(Type));

memcpy(I.bitmap + i * width, I.bitmap + (height - 1 - i) * width, width * sizeof(Type));
Expand Down
Loading