0

How do i handle large (>15000x15000) images without resizing?

What i need to achieve is: get the pixel value (x,y,r,g,b) on mouse hover. Therefore resizing the image to fit the screen is not an option.

I tried to find an option to add scrollbars, but found none. I also had the idea to show a fixed window size with 100% sized image and drag the image around, but i have no idea how to accomplish that.

I also tried to build OpenCV with QT (as seen here), but failed miserably (uncountable CMake warnings).

Environment: Win 7, VS2013, C++, OpenCV 3.0

4
  • cmake warnings are not compiler errors. Did you try to compile it? Commented Oct 15, 2014 at 10:50
  • both configure and generate failed (i use the GUI) Commented Oct 15, 2014 at 12:22
  • 1
    Opencv highgui isnt meant to be used as a solution for each problem, but a quick and dirty gui to test your stuff. Use some real gui library for your displaying task or learn winapi to modify your opencv window for your needs. Commented Oct 15, 2014 at 12:44
  • @Micka but he mentions that OpenCV with Qt won't work. So the answer would be to use Qt by getting it to work first. Commented Oct 15, 2014 at 13:49

1 Answer 1

2

This isn't really an OpenCV problem. My suggestion is that you use the GUI framework of your choice to solve this. Qt would be a very suitable option and it has the nice benefit that integration between OpenCV and Qt is good.

  1. Try to build OpenCV with Qt included. You don't provide details on what went wrong and the link doesn't mention installation at all. But searching for the CMake warnings, or trying to find out how to install Qt on Windows should not be too difficult.
  2. Look into displaying very large images with Qt. It has everything you need already. A quick search found this SO answer which recommends QGraphicsView.

  3. If you have enough memory to store your 15k x 15k image in it, you don't need to use a QGraphicsView and tiling. As mentioned here you should probably be using a QPixmap and then look up the RGB coordinates by a second method.

If memory is an issue

Here is an entry (a bit old) on how to load an image only partially, i.e. not completely into memory. Be aware of the existence of QImageReader.

Sign up to request clarification or add additional context in comments.

3 Comments

i followed these steps: answers.opencv.org/question/22816/… and it build successfully. what do i do now? my current program still displays no QT UI
"...and it build successfully. what do i do now? my current program still displays no QT UI" You don't expect me to be able to answer that, do you?
well, that was horrible to make+build, but it finally worked. also somehow #include <cv.h> overwrites the qt gui with the default

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.