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

cv2.imshow - RGB values too big #15162

Closed
chiboreache opened this issue Jul 26, 2019 · 14 comments
Closed

cv2.imshow - RGB values too big #15162

chiboreache opened this issue Jul 26, 2019 · 14 comments
Labels
category: highgui-gui category: 3rdparty needs reproducer Provide complete minimal reproducer with input data

Comments

@chiboreache
Copy link

System information (version)
  • OpenCV => 4.1
  • Operating System / Platform => Arch Linux KDE

img

@dkurt dkurt added the invalid label Jul 26, 2019
@dkurt dkurt closed this as completed Jul 26, 2019
@chiboreache
Copy link
Author

chiboreache commented Jul 26, 2019

UI is definitely broken, did you noticed it ?

@dkurt
Copy link
Member

dkurt commented Jul 26, 2019

@chiboreache, Please provide more details: build configuration (cv::getBuildInformation), OS version, code sample to reproduce the problem.

@chiboreache
Copy link
Author

chiboreache commented Jul 26, 2019

Arch Linux is always bleeding edge up to date to the last available versions of core, wm, de, software, etc.

this is simple imshow in Python 3.7.3, with plain image, that I zoomed much

I saw some yt tutor, and I know that every small square must to contain numeric info about every channel, but instead we can see only part, VERY BIG part of it

General configuration for OpenCV 4.1.0 =====================================
  Version control:               unknown

  Extra modules:
    Location (extra):            /build/opencv/src/opencv_contrib-4.1.0/modules
    Version control (extra):     unknown

  Platform:
    Timestamp:                   2019-05-22T18:53:30Z
    Host:                        Linux 5.0.10-arch1-1-ARCH x86_64
    CMake:                       3.14.4
    CMake generator:             Unix Makefiles
    CMake build tool:            /usr/bin/make
    Configuration:               Release

  CPU/HW features:
    Baseline:                    SSE SSE2
      requested:                 SSE3
      required:                  SSE2
      disabled:                  SSE3
    Dispatched code generation:  SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX
      requested:                 SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
      SSE4_1 (13 files):         + SSE3 SSSE3 SSE4_1
      SSE4_2 (1 files):          + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2
      FP16 (0 files):            + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
      AVX (4 files):             + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2 AVX
      AVX2 (27 files):           + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
      AVX512_SKX (2 files):      + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_SKX

  C/C++:
    Built as dynamic libs?:      YES
    C++ Compiler:                /usr/bin/c++  (ver 8.3.0)
    C++ flags (Release):         -march=x86-64 -mtune=generic -O2 -pipe -fno-plt   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
    C++ flags (Debug):           -march=x86-64 -mtune=generic -O2 -pipe -fno-plt   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -fvisibility=hidden -fvisibility-inlines-hidden -g  -DDEBUG -D_DEBUG
    C Compiler:                  /usr/bin/cc
    C flags (Release):           -march=x86-64 -mtune=generic -O2 -pipe -fno-plt   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
    C flags (Debug):             -march=x86-64 -mtune=generic -O2 -pipe -fno-plt   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -fvisibility=hidden -g  -DDEBUG -D_DEBUG
    Linker flags (Release):      -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now  -Wl,--gc-sections  
    Linker flags (Debug):        -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now  -Wl,--gc-sections  
    ccache:                      NO
    Precompiled headers:         YES
    Extra dependencies:          dl m pthread rt
    3rdparty dependencies:

  OpenCV modules:
    To be built:                 aruco bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dpm face features2d flann freetype fuzzy gapi hdf hfs highgui img_hash imgcodecs imgproc java line_descriptor ml objdetect optflow phase_unwrapping photo plot python3 quality reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking video videoio videostab viz xfeatures2d ximgproc xobjdetect xphoto
    Disabled:                    world
    Disabled by dependency:      -
    Unavailable:                 cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv js matlab ovis python2 sfm ts
    Applications:                examples apps
    Documentation:               NO
    Non-free algorithms:         YES

  GUI: 
    GTK+:                        YES (ver 3.24.8)
      GThread :                  YES (ver 2.60.3)
      GtkGlExt:                  NO
    OpenGL support:              NO
    VTK support:                 YES (ver 8.2.0)

  Media I/O: 
    ZLib:                        /lib64/libz.so (ver 1.2.11)
    JPEG:                        /lib64/libjpeg.so (ver 80)
    WEBP:                        /lib64/libwebp.so (ver encoder: 0x020e)
    PNG:                         /lib64/libpng.so (ver 1.6.37)
    TIFF:                        /lib64/libtiff.so (ver 42 / 4.0.10)
    JPEG 2000:                   /lib64/libjasper.so (ver 2.0.16)
    OpenEXR:                     /lib64/libImath.so /lib64/libIlmImf.so /lib64/libIex.so /lib64/libHalf.so /lib64/libIlmThread.so (ver 2.3.0)
    HDR:                         YES
    SUNRASTER:                   YES
    PXM:                         YES
    PFM:                         YES

  Video I/O:
    DC1394:                      YES (2.2.6)
    FFMPEG:                      YES
      avcodec:                   YES (58.35.100)
      avformat:                  YES (58.20.100)
      avutil:                    YES (56.22.100)
      swscale:                   YES (5.3.100)
      avresample:                NO
    GStreamer:                   YES (1.16.0)
    v4l/v4l2:                    YES (linux/videodev2.h)

  Parallel framework:            TBB (ver 2019.0 interface 11005)

  Trace:                         YES (with Intel ITT)

  Other third-party libraries:
    Intel IPP:                   2019.0.0 Gold [2019.0.0]
           at:                   /build/opencv/src/build/3rdparty/ippicv/ippicv_lnx/icv
    Intel IPP IW:                sources (2019.0.0)
              at:                /build/opencv/src/build/3rdparty/ippicv/ippicv_lnx/iw
    Lapack:                      YES (/usr/lib/liblapack.so /usr/lib/libblas.so /usr/lib/libcblas.so)
    Eigen:                       YES (ver 3.3.7)
    Custom HAL:                  NO
    Protobuf:                    build (3.5.1)

  OpenCL:                        YES (no extra features)
    Include path:                /build/opencv/src/opencv-4.1.0/3rdparty/include/opencl/1.2
    Link libraries:              Dynamic load

  Python 3:
    Interpreter:                 /usr/bin/python3 (ver 3.7.3)
    Libraries:                   /lib64/libpython3.7m.so (ver 3.7.3)
    numpy:                       /usr/lib/python3.7/site-packages/numpy/core/include (ver 1.16.3)
    install path:                /usr/lib/python3.7/site-packages

  Python (for build):            /usr/bin/python3

  Java:                          
    ant:                         /bin/ant (ver 1.10.6)
    JNI:                         /usr/lib/jvm/default/include /usr/lib/jvm/default/include/linux /usr/lib/jvm/default/include
    Java wrappers:               YES
    Java tests:                  NO

  Install to:                    /usr
-----------------------------------------------------------------

@mshabunin
Copy link
Contributor

this is simple imshow in Python 3.7.3, with plain image, that I zoomed much

PYTHONPATH=build/lib/python3 python3 -c 'import cv2; m = cv2.imread("opencv/samples/data/lena.jpg"); cv2.imshow("win", m); cv2.waitKey(0);'

Can not reproduce in Ubuntu 18 (GTK+ 3.22.30). Please add more details: how do you install OpenCV and how do you zoom in?

@chiboreache
Copy link
Author

@mshabunin
ргб значения пикселей видно только если картинка имеет низкое разрешение

цифры имеют статик сайз и скейлятся вместе с зумом, мне кажется это брейкинг бихевиор

т.к на нормальных больших изображениях эти цифры получаются слишком большими

устанавливал и через пип и через пакман(офф репка арч линукса)

имдж

@mshabunin
Copy link
Contributor

@chiboreache , please use English here.

I asked how do you make zoom in, because AFAIK this feature works only with Qt highgui backend, but your configuration shows that you use GTK:

  GUI: 
    GTK+:                        YES (ver 3.24.8)
      GThread :                  YES (ver 2.60.3)
      GtkGlExt:                  NO
    OpenGL support:              NO
    VTK support:                 YES (ver 8.2.0)

@chiboreache
Copy link
Author

meh..

that was home pc, here is my pc at work

GUI: QT: YES (ver 4.8.7 EDITION = OpenSource) QT OpenGL support: NO

General configuration for OpenCV 4.1.0 =====================================
  Version control:               4.1.0

  Extra modules:
    Location (extra):            /io/opencv_contrib/modules
    Version control (extra):     4.1.0

  Platform:
    Timestamp:                   2019-04-11T17:10:39Z
    Host:                        Linux 4.4.0-101-generic x86_64
    CMake:                       3.9.0
    CMake generator:             Unix Makefiles
    CMake build tool:            /usr/bin/gmake
    Configuration:               Release

  CPU/HW features:
    Baseline:                    SSE SSE2 SSE3
      requested:                 SSE3
    Dispatched code generation:  SSE4_1 SSE4_2 FP16 AVX AVX2
      requested:                 SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
      SSE4_1 (13 files):         + SSSE3 SSE4_1
      SSE4_2 (1 files):          + SSSE3 SSE4_1 POPCNT SSE4_2
      FP16 (0 files):            + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
      AVX (4 files):             + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
      AVX2 (27 files):           + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2

  C/C++:
    Built as dynamic libs?:      NO
    C++ Compiler:                /usr/lib/ccache/compilers/c++  (ver 4.8.2)
    C++ flags (Release):         -Wl,-strip-all   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-comment -Wno-missing-field-initializers -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
    C++ flags (Debug):           -Wl,-strip-all   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-comment -Wno-missing-field-initializers -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
    C Compiler:                  /usr/lib/ccache/compilers/cc
    C flags (Release):           -Wl,-strip-all   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wuninitialized -Winit-self -Wno-comment -Wno-missing-field-initializers -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
    C flags (Debug):             -Wl,-strip-all   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wuninitialized -Winit-self -Wno-comment -Wno-missing-field-initializers -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
    Linker flags (Release):      -L/root/ffmpeg_build/lib  -Wl,--gc-sections  
    Linker flags (Debug):        -L/root/ffmpeg_build/lib  -Wl,--gc-sections  
    ccache:                      YES
    Precompiled headers:         NO
    Extra dependencies:          ade /opt/Qt4.8.7/lib/libQtGui.so /opt/Qt4.8.7/lib/libQtTest.so /opt/Qt4.8.7/lib/libQtCore.so /lib64/libz.so /opt/libjpeg-turbo/lib64/libjpeg.a dl m pthread rt
    3rdparty dependencies:       ittnotify libprotobuf libwebp libpng libtiff libjasper IlmImf quirc

  OpenCV modules:
    To be built:                 aruco bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dpm face features2d flann fuzzy gapi hfs highgui img_hash imgcodecs imgproc line_descriptor ml objdetect optflow phase_unwrapping photo plot python3 quality reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking video videoio videostab xfeatures2d ximgproc xobjdetect xphoto
    Disabled:                    world
    Disabled by dependency:      -
    Unavailable:                 cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv freetype hdf java js matlab ovis python2 sfm ts viz
    Applications:                -
    Documentation:               NO
    Non-free algorithms:         NO

  GUI: 
    QT:                          YES (ver 4.8.7 EDITION = OpenSource)
      QT OpenGL support:         NO
    GTK+:                        NO
    VTK support:                 NO

  Media I/O: 
    ZLib:                        /lib64/libz.so (ver 1.2.3)
    JPEG:                        /opt/libjpeg-turbo/lib64/libjpeg.a (ver 62)
    WEBP:                        build (ver encoder: 0x020e)
    PNG:                         build (ver 1.6.36)
    TIFF:                        build (ver 42 - 4.0.10)
    JPEG 2000:                   build (ver 1.900.1)
    OpenEXR:                     build (ver 1.7.1)
    HDR:                         YES
    SUNRASTER:                   YES
    PXM:                         YES
    PFM:                         YES

  Video I/O:
    DC1394:                      NO
    FFMPEG:                      YES
      avcodec:                   YES (58.47.106)
      avformat:                  YES (58.26.101)
      avutil:                    YES (56.26.100)
      swscale:                   YES (5.4.100)
      avresample:                NO
    GStreamer:                   NO
    v4l/v4l2:                    YES (linux/videodev2.h)

  Parallel framework:            pthreads

  Trace:                         YES (with Intel ITT)

  Other third-party libraries:
    Lapack:                      NO
    Eigen:                       NO
    Custom HAL:                  NO
    Protobuf:                    build (3.5.1)

  OpenCL:                        YES (no extra features)
    Include path:                /io/opencv/3rdparty/include/opencl/1.2
    Link libraries:              Dynamic load

  Python 3:
    Interpreter:                 /opt/python/cp37-cp37m/bin/python (ver 3.7.2)
    Libraries:                   libpython3.7m.a (ver 3.7.2)
    numpy:                       /opt/python/cp37-cp37m/lib/python3.7/site-packages/numpy/core/include (ver 1.14.5)
    install path:                python

  Python (for build):            /opt/python/cp37-cp37m/bin/python

  Java:                          
    ant:                         NO
    JNI:                         NO
    Java wrappers:               NO
    Java tests:                  NO

  Install to:                    /io/_skbuild/linux-x86_64-3.7/cmake-install
-----------------------------------------------------------------

@mshabunin
Copy link
Contributor

Did you try to build with Qt 5? Is it version from pip?
You can try prebuilt version with Qt5 from conda-forge: conda create -c conda-forge -n my-opencv-env opencv

@chiboreache
Copy link
Author

chiboreache commented Aug 2, 2019

how I supposed to use it?

↪ sudo conda init fish
no change     /usr/condabin/conda
no change     /usr/bin/conda
no change     /usr/bin/conda-env
needs sudo    /usr/bin/activate
needs sudo    /usr/bin/deactivate
needs sudo    /usr/etc/profile.d/conda.sh
needs sudo    /usr/etc/fish/conf.d/conda.fish
needs sudo    /usr/shell/condabin/Conda.psm1
needs sudo    /usr/shell/condabin/conda-hook.ps1
needs sudo    /usr/lib/python3.7/site-packages/xontrib/conda.xsh
needs sudo    /usr/etc/profile.d/conda.csh
modified      /root/.config/fish/config.fish

==> For changes to take effect, close and re-open your current shell. <==

Operation failed.



# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "/usr/lib/python3.7/site-packages/conda/cli/main.py", line 138, in main
        return activator_main()
      File "/usr/lib/python3.7/site-packages/conda/activate.py", line 996, in main
        print(activator.execute(), end='')
      File "/usr/lib/python3.7/site-packages/conda/activate.py", line 180, in execute
        return getattr(self, self.command)()
      File "/usr/lib/python3.7/site-packages/conda/activate.py", line 168, in hook
        with open(self.hook_source_path) as fsrc:
    FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/python3.7/site-packages/conda/shell/etc/fish/conf.d/conda.fish'

`$ /usr/bin/conda shell.fish hook`

  environment variables:
                 CIO_TEST=<not set>
               CONDA_ROOT=/usr
              CONDA_SHLVL=0
                     PATH=/usr/condabin:/opt/unreal-engine/Engine/Binaries/Linux/:/opt/google-
                          cloud-sdk/bin:/opt/google-cloud-sdk/bin:/usr/local/sbin:/usr/local/bin
                          :/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/
                          usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
       REQUESTS_CA_BUNDLE=<not set>
            SSL_CERT_FILE=<not set>
            XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
         XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1

     active environment : None
            shell level : 0
       user config file : /home/userbest/.condarc
 populated config files : 
          conda version : 4.7.10.r67.g5c6630670
    conda-build version : 3.18.2
         python version : 3.7.4.final.0
       virtual packages : 
       base environment : /usr  (read only)
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /usr/pkgs
                          /home/userbest/.conda/pkgs
       envs directories : /home/userbest/.conda/envs
                          /usr/envs
               platform : linux-64
             user-agent : conda/4.7.10.r67.g5c6630670 requests/2.22.0 CPython/3.7.4 Linux/5.2.5-arch1-1-ARCH arch/ glibc/2.29
                UID:GID : 1000:985
             netrc file : None
           offline mode : False


An unexpected error has occurred. Conda has prepared the above report.

If submitted, this report will be used by core maintainers to improve
future releases of conda.
Would you like conda to send this report to the core maintainers?


@chiboreache
Copy link
Author

could you provide screenshot that all pixels shows proper channel numbers on large image

@mshabunin
Copy link
Contributor

Windows + OpenCV 4.1.1 from conda-forge:
image

@mshabunin
Copy link
Contributor

Ubuntu 18 + OpenCV 4.1.1 from conda-forge:
image

@chiboreache
Copy link
Author

ok, I get it, I'll try to report about problem into pacman community

@chiboreache
Copy link
Author

chiboreache commented Nov 15, 2019

works perfectly fine now!

Screenshot_20191115_112114

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: highgui-gui category: 3rdparty needs reproducer Provide complete minimal reproducer with input data
Projects
None yet
Development

No branches or pull requests

4 participants