Reputation: 616
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
Upvotes: 0
Views: 2087
Reputation: 16248
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.
Look into displaying very large images with Qt. It has everything you need already. A quick search found this SO answer which recommends QGraphicsView
.
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.
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.
Upvotes: 2