bob.ip.base issueshttps://gitlab.idiap.ch/bob/bob.ip.base/-/issues2022-04-26T11:49:18Zhttps://gitlab.idiap.ch/bob/bob.ip.base/-/issues/15Deprecation2022-04-26T11:49:18ZTiago de Freitas PereiraDeprecationHi guys,
As you may know, we are on a deprecation wave of C++ code, and this image processing library is implemented mostly in this language.
Follow bellow a list of functionalities this package has.
Does anyone **uses and wants to kee...Hi guys,
As you may know, we are on a deprecation wave of C++ code, and this image processing library is implemented mostly in this language.
Follow bellow a list of functionalities this package has.
Does anyone **uses and wants to keep** some of its features?
Please let me know, by marking with a cross, as soon as possible.
@amohammadi, @ydayer, @flavio.tarsetti, @lcolbois, @sebastien.marcel, @mguenther, @andre.anjos, @ageorge
# Classes
- [x] bob.ip.base.GeomNorm ---> I have a pure python counterpart
- [x] bob.ip.base.FaceEyesNorm ---> I have a pure python counterpart
- [x] bob.ip.base.LBP
- [ ] bob.ip.base.LBPTop
- [ ] bob.ip.base.DCTFeatures
- [ ] bob.ip.base.TanTriggs
- [ ] bob.ip.base.Gaussian
- [ ] bob.ip.base.WeightedGaussian
- [ ] bob.ip.base.GradientMagnitude
- [ ] bob.ip.base.BlockNorm
- [ ] bob.ip.base.HOG
- [ ] bob.ip.base.GLCMProperty
- [ ] bob.ip.base.GLCM
# Functions
- [ ] bob.ip.base.flip
- [ ] bob.ip.base.flop
- [ ] bob.ip.base.crop
- [ ] bob.ip.base.shift
- [ ] bob.ip.base.scale
- [ ] bob.ip.base.scaled_output_shape
- [ ] bob.ip.base.rotate
- [ ] bob.ip.base.rotated_output_shape
- [ ] bob.ip.base.angle_to_horizontal
- [ ] bob.ip.base.block
- [ ] bob.ip.base.block_output_shape
- [ ] bob.ip.base.block_generator
- [ ] bob.ip.base.crop
- [ ] bob.ip.base.shift
- [ ] bob.ip.base.extrapolate_mask
- [ ] bob.ip.base.max_rect_in_mask
- [ ] bob.ip.base.angle_to_horizontal
- [ ] bob.ip.base.histogram
- [ ] bob.ip.base.lbphs
- [ ] bob.ip.base.lbphs_output_shape
- [ ] bob.ip.base.histogram_equalization
- [ ] bob.ip.base.gamma_correction
- [ ] bob.ip.base.integral
- [ ] bob.ip.base.zigzag
- [ ] bob.ip.base.median
- [ ] bob.ip.base.sobelhttps://gitlab.idiap.ch/bob/bob.ip.base/-/issues/14GeomNorm and extrapolate_mask require different mask types2021-02-24T10:43:10ZManuel Günthersiebenkopf@googlemail.comGeomNorm and extrapolate_mask require different mask typesWhen looking at the two functions `GeomNorm.process` and `extrapolate_mask` for color images, two different mask types are required:
- `GeomNorm` takes a 3D mask: https://gitlab.idiap.ch/bob/bob.ip.base/-/blob/a9109e06264f2e28ece3b131da...When looking at the two functions `GeomNorm.process` and `extrapolate_mask` for color images, two different mask types are required:
- `GeomNorm` takes a 3D mask: https://gitlab.idiap.ch/bob/bob.ip.base/-/blob/a9109e06264f2e28ece3b131da9babb0365b6f36/bob/ip/base/include/bob.ip.base/GeomNorm.h#L99 (implementation here: https://gitlab.idiap.ch/bob/bob.ip.base/-/blob/a9109e06264f2e28ece3b131da9babb0365b6f36/bob/ip/base/include/bob.ip.base/GeomNorm.h#L166)
- `extrapolate_mask` takes a 2D mask: https://gitlab.idiap.ch/bob/bob.ip.base/-/blob/a9109e06264f2e28ece3b131da9babb0365b6f36/bob/ip/base/include/bob.ip.base/Affine.h#L445
This is a bit inconsequent. I am not sure, why `GeomNorm` requires a 3D mask for color images. Each pixel will have the same visibility independent of the color channel. Thus, I would propose to reduce the mask for `GeomNorm` to 2D. We can also have the possibility to have both 2D and 3D masks, in case you require backward compatibility (which I could understand).Manuel Günthersiebenkopf@googlemail.comManuel Günthersiebenkopf@googlemail.comhttps://gitlab.idiap.ch/bob/bob.ip.base/-/issues/13conda build is not using bob-devel2018-07-06T12:55:09ZTiago de Freitas Pereiraconda build is not using bob-develSame issue as in bob.measure#55
https://gitlab.idiap.ch/bob/bob.ip.base/-/jobs/142232
I need help. Probably the solution is simple
ping @amohammadi @andre.anjos
thanksSame issue as in bob.measure#55
https://gitlab.idiap.ch/bob/bob.ip.base/-/jobs/142232
I need help. Probably the solution is simple
ping @amohammadi @andre.anjos
thankshttps://gitlab.idiap.ch/bob/bob.ip.base/-/issues/12Documentation does not include the C++ API2022-04-04T11:36:55ZManuel Günthersiebenkopf@googlemail.comDocumentation does not include the C++ APIThe online documentation includes only the Python API, but not the C++ API provided in/exported from https://gitlab.idiap.ch/bob/bob.ip.base/tree/master/bob/ip/base/include/bob.ip.base
Also, the first sentence in the online documentatio...The online documentation includes only the Python API, but not the C++ API provided in/exported from https://gitlab.idiap.ch/bob/bob.ip.base/tree/master/bob/ip/base/include/bob.ip.base
Also, the first sentence in the online documentation ```This Python module contains base functionality from Bob bound to Python, available in the C++ counter-part bob::ip::base.``` does not make sense since this package contains both the C++ and the Python functionality.Manuel Günthersiebenkopf@googlemail.comManuel Günthersiebenkopf@googlemail.comhttps://gitlab.idiap.ch/bob/bob.ip.base/-/issues/11Getting the blocks of an image using a generator2018-05-05T00:12:49ZAmir MOHAMMADIGetting the blocks of an image using a generatorI am trying to generate blocks from images (using `bob.ip.base.block`) but since all blocks are output at once, I run out of memory.
Is there a way to get these blocks one-by-one instead?I am trying to generate blocks from images (using `bob.ip.base.block`) but since all blocks are output at once, I run out of memory.
Is there a way to get these blocks one-by-one instead?https://gitlab.idiap.ch/bob/bob.ip.base/-/issues/10Matploblib requirement2018-05-03T18:24:40ZSamuel GAISTMatploblib requirementCurrently matplotlib is a hard requirement for this package however it's only used in the documentation.
This should be modified to make it mandatory only when building the documentation.Currently matplotlib is a hard requirement for this package however it's only used in the documentation.
This should be modified to make it mandatory only when building the documentation.Samuel GAISTSamuel GAISThttps://gitlab.idiap.ch/bob/bob.ip.base/-/issues/9Color channels changed after rotation2018-02-20T11:05:16ZGuillaume HEUSCHColor channels changed after rotationLooks like there is a problem with color channels when rotating an image (looks like a negative)
Here's the code to reproduce
```python
>>> import bob.ip.base
>>> from bob.io.base.test_utils import datafile
>>> import bob.io.image
>>> ...Looks like there is a problem with color channels when rotating an image (looks like a negative)
Here's the code to reproduce
```python
>>> import bob.ip.base
>>> from bob.io.base.test_utils import datafile
>>> import bob.io.image
>>> import bob.io.base
>>> path = datafile('grace_hopper.png', 'bob.io.image')
>>> img = bob.io.base.load(path)
>>> rotated_shape = bob.ip.base.rotated_output_shape(img, 90)
>>> rotated = numpy.ndarray(rotated_shape, dtype = numpy.float64 )
>>> bob.ip.base.rotate(image, rotated, 90)
>>> from matplotlib import pyplot
>>> pyplot.imshow(numpy.rollaxis(numpy.rollaxis(rotated, 2),2))
>>> pyplot.show()
```
![rotated_example](/uploads/f31369aca9813cef9eaa43df86906246/rotated_example.png)https://gitlab.idiap.ch/bob/bob.ip.base/-/issues/8extrapolate_mask only considers 2D images and cannot be applied to color images2017-08-02T08:57:02ZManuel Günthersiebenkopf@googlemail.comextrapolate_mask only considers 2D images and cannot be applied to color imagesCurrently, the `extrapolate_mask` function only takes 2D (gray) images, but no color images. Many other related functions, for example, `rotate` works on color images.
Currently, I use a work-around for color images, for example:
```
# ...Currently, the `extrapolate_mask` function only takes 2D (gray) images, but no color images. Many other related functions, for example, `rotate` works on color images.
Currently, I use a work-around for color images, for example:
```
# get data
import numpy, bob.ip.base
image = numpy.ndarray((100,100), numpy.uint8)
rotated = numpy.ndarray(bob.ip.base.rotated_output_shape(image, 45))
imask = numpy.ones((100,100), numpy.bool)
omask = numpy.ones(rotated.shape, numpy.bool)
# rotate image
bob.ip.base.rotate(image, imask, rotated, omask, 45)
# extrapolate border
for i in range(3):
bob.ip.base.extrapolate_mask(omask, rotated)
```
However, this does not work for the second way of extrapolation, where random noise is added.
When adding this noise to the three color components individually, weired color effects might occur.
Having a function to only modify the intensity of the color might be a better solution.Manuel Günthersiebenkopf@googlemail.comManuel Günthersiebenkopf@googlemail.comhttps://gitlab.idiap.ch/bob/bob.ip.base/-/issues/7GeomNorm bindings cannot be used with color images2017-07-25T12:29:33ZManuel Günthersiebenkopf@googlemail.comGeomNorm bindings cannot be used with color imagesIn the bindings of `GeomNorm`, both gray and color images are allowed: https://gitlab.idiap.ch/bob/bob.ip.base/blob/master/bob/ip/base/geom_norm.cpp#L315
However, only the gray level version is called: https://gitlab.idiap.ch/bob/bob.ip...In the bindings of `GeomNorm`, both gray and color images are allowed: https://gitlab.idiap.ch/bob/bob.ip.base/blob/master/bob/ip/base/geom_norm.cpp#L315
However, only the gray level version is called: https://gitlab.idiap.ch/bob/bob.ip.base/blob/master/bob/ip/base/geom_norm.cpp#L256
This results in an unreadable error message, when I try to use a color image:
```
>>> import bob.ip.base, numpy
>>> img = numpy.ndarray((3,128,128), numpy.uint8)
>>> res = numpy.ndarray((3,64,64), numpy.float64)
>>> geom = bob.ip.base.GeomNorm(0., 1., (128,128), (64,64))
>>> geom.process(img, res, (64,64))
RuntimeError: bob.ip.base.GeomNorm - cannot process image: C++ exception caught: 'array dimensions do not match 0 != 128'
```
The bindings need to be fixed.Manuel Günthersiebenkopf@googlemail.comManuel Günthersiebenkopf@googlemail.comhttps://gitlab.idiap.ch/bob/bob.ip.base/-/issues/6floating point exception (core dump) in DCTFeatures when block_size and block...2018-08-18T15:19:01ZAmir MOHAMMADIfloating point exception (core dump) in DCTFeatures when block_size and block_overlap are equalTo reproduce:
```python
>>> from bob.ip.base import DCTFeatures
>>> extractor = DCTFeatures(10, (14,14), (14,14), False, False)
>>> from bob.io.base.test_utils import datafile
>>> import bob.io.image
>>> import bob.io.base
>>> path = dat...To reproduce:
```python
>>> from bob.ip.base import DCTFeatures
>>> extractor = DCTFeatures(10, (14,14), (14,14), False, False)
>>> from bob.io.base.test_utils import datafile
>>> import bob.io.image
>>> import bob.io.base
>>> path = datafile('grace_hopper.png', 'bob.io.image')
>>> img = bob.io.base.load(path)
>>> import bob.ip.color
>>> gray = bob.ip.color.rgb_to_gray(img)
>>> gray.shape
(600, 512)
>>> dct = extractor(gray)
```https://gitlab.idiap.ch/bob/bob.ip.base/-/issues/5Cannot compile on Arch Linux2018-08-18T15:19:01ZAndré AnjosCannot compile on Arch Linux*Created by: 183amir*
I am getting this error:
bob/ip/base/affine.cpp: In function ‘PyObject* PyBobIpBase_scale(PyObject*, PyObject*, PyObject*)’:
bob/ip/base/affine.cpp:134:26: error: ‘isnan’ was not declared in this scope
...*Created by: 183amir*
I am getting this error:
bob/ip/base/affine.cpp: In function ‘PyObject* PyBobIpBase_scale(PyObject*, PyObject*, PyObject*)’:
bob/ip/base/affine.cpp:134:26: error: ‘isnan’ was not declared in this scope
if (!isnan(scale_factor)){
^
bob/ip/base/affine.cpp:134:26: note: suggested alternatives:
In file included from /home/amir/miniconda3/envs/_build/gcc/include/c++/complex:44:0,
from /home/amir/miniconda3/envs/_build/lib/python2.7/site-packages/bob.blitz-2.0.8-py2.7-linux-x86_64.egg/bob/blitz/include/bob.blitz/cppapi.h:14,
from bob/ip/base/main.h:11,
from bob/ip/base/affine.cpp:11:
/home/amir/miniconda3/envs/_build/gcc/include/c++/cmath:632:5: note: ‘std::isnan’
isnan(_Tp __x)
^
/home/amir/miniconda3/envs/_build/gcc/include/c++/cmath:632:5: note: ‘std::isnan’
In file included from /home/amir/miniconda3/envs/_build/include/boost/lexical_cast/detail/inf_nan.hpp:35:0,
from /home/amir/miniconda3/envs/_build/include/boost/lexical_cast/detail/converter_lexical_streams.hpp:63,
from /home/amir/miniconda3/envs/_build/include/boost/lexical_cast/detail/converter_lexical.hpp:54,
from /home/amir/miniconda3/envs/_build/include/boost/lexical_cast/try_lexical_convert.hpp:42,
from /home/amir/miniconda3/envs/_build/include/boost/lexical_cast.hpp:32,
from /home/amir/miniconda3/envs/_build/include/boost/date_time/string_parse_tree.hpp:13,
from /home/amir/miniconda3/envs/_build/include/boost/date_time/period_parser.hpp:14,
from /home/amir/miniconda3/envs/_build/include/boost/date_time/date_facet.hpp:23,
from /home/amir/miniconda3/envs/_build/include/boost/date_time/gregorian/gregorian_io.hpp:16,
from /home/amir/miniconda3/envs/_build/include/boost/date_time/gregorian/gregorian.hpp:31,
from /home/amir/miniconda3/envs/_build/include/boost/date_time/posix_time/time_formatters.hpp:12,
from /home/amir/miniconda3/envs/_build/include/boost/date_time/posix_time/posix_time.hpp:24,
from /home/amir/miniconda3/envs/_build/lib/python2.7/site-packages/bob.core-2.1.0-py2.7-linux-x86_64.egg/bob/core/include/bob.core/logging.h:20,
from /home/amir/miniconda3/envs/_build/lib/python2.7/site-packages/bob.core-2.1.0-py2.7-linux-x86_64.egg/bob/core/include/bob.core/api.h:14,
from bob/ip/base/main.h:13,
from bob/ip/base/affine.cpp:11:
/home/amir/miniconda3/envs/_build/include/boost/math/special_functions/fpclassify.hpp:592:14: note: ‘boost::math::isnan’
inline bool (isnan)(T x)
^
error: command 'gcc' failed with exit status 1
Command failed: /bin/bash -x -e /home/amir/git/bob.conda/bob.ip.base/build.sh
conda build --python=2.7 bob.bio.video 114.84s user 5.11s system 95% cpu 2:05.31 total
https://gitlab.idiap.ch/bob/bob.ip.base/-/issues/3SIFT not found in debian2018-08-18T15:19:01ZAndré AnjosSIFT not found in debian*Created by: siebenkopf*
It seems that bob.ip.base.VLFEAT is not created. I have traced it down to the fact that the file
/usr/include/vl/sift.h
is not on our system.
Maybe the header files of the libvlfeat-dev package (which is ins...*Created by: siebenkopf*
It seems that bob.ip.base.VLFEAT is not created. I have traced it down to the fact that the file
/usr/include/vl/sift.h
is not on our system.
Maybe the header files of the libvlfeat-dev package (which is installed in the machines) have changed?https://gitlab.idiap.ch/bob/bob.ip.base/-/issues/2Post DCT normalization is not correct with 3D outputs2018-08-18T15:19:01ZAndré AnjosPost DCT normalization is not correct with 3D outputs*Created by: laurentes*
As noticed by Elie, there is a difference in the outputs values when we select resp. 2D and 3D outputs when the option post DCT normalization is selected for the DCT extraction:
```python
>>> import bob, nump...*Created by: laurentes*
As noticed by Elie, there is a difference in the outputs values when we select resp. 2D and 3D outputs when the option post DCT normalization is selected for the DCT extraction:
```python
>>> import bob, numpy, numpy.random
>>> a = numpy.random.randn(10,10)
>>> o = bob.ip.DCTFeatures(3,3,1,1,5,True,False,False)
>>> (o(a, False).flatten() == o(a, True).flatten()).all()
True
>>> o = bob.ip.DCTFeatures(3,3,1,1,5,True,True,False)
>>> (o(a, False).flatten() == o(a, True).flatten()).all()
False
```
The blitz reduction seems to be wrong for the 3D case in https://github.com/idiap/bob/blob/1.2/src/ip/cxx/DCTFeatures.cc (last ten lines of code). https://gitlab.idiap.ch/bob/bob.ip.base/-/issues/1Inconsistent use of standard deviation / variance in Gaussian vs. WeightedGau...2018-08-18T15:19:01ZAndré AnjosInconsistent use of standard deviation / variance in Gaussian vs. WeightedGaussian*Created by: siebenkopf*
During porting the bindings of the bob.ip.base.Gaussian and bob.ip.base.WeightedGaussian classes, I found a difference in the usage of the variance.
While in the former, sigma is used as standard deviation, the...*Created by: siebenkopf*
During porting the bindings of the bob.ip.base.Gaussian and bob.ip.base.WeightedGaussian classes, I found a difference in the usage of the variance.
While in the former, sigma is used as standard deviation, the latter uses sigma2, i.e., the variance.
Apart from the inconsistency, this is not yet an issue.
But, while porting the bob.ip.base.MultiscaleRetinex algorithm, which uses several Gaussians, and the bob.ip.base.SelfQuotientImage, which uses WeightedGaussians, I found that a formula is used to compute Gaussians or WeightedGaussians in different scales:
// size of the kernel
size_t s_size = m_size_min + s * m_size_step;
// sigma of the kernel
double s_sigma2 = m_sigma2 * s_size / m_size_min;
// Initialize the Gaussian
m_wgaussians[s].reset(s_size, s_size, s_sigma2, s_sigma2, m_conv_border);
Interestingly, this formula is **the same** for both Gaussians and WeightedGaussians **except** that one uses sigma and one uses sigma2.
I tried to read the referenced papers, but I couldn't find this formula in neither of the papers. So, we have to decide, which version is correct. I assume that the version with sigma is better since the size of the Gaussian should be scaled with its standard deviation, and not with its variance.
@laurentes : Should we unify this?