Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Opening large image files
Forum Updated to NodeBB v4.3 + New Features

Opening large image files

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 4 Posters 957 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    john_hobbyist
    wrote on last edited by
    #1

    This is the method:

    def getFrame(self, path):
            print("178")
            if os.path.isfile(path):
                print("179")
                frame = cv2.imread(path, 1)
                print("180")
                if not np.shape(frame) == ():
                    print("181")
                    self.img = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
                    print("182")
                else:
                    print("183")
                    print("Error!")
                    print("184")
                    frame = cv2.imread(path, cv2.IMREAD_UNCHANGED)
                    print("185")
                    self.img = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
                    print("186")
            else:
                print("187")
                self.openFile()
                print("188")
    

    When I load a normal .tiff image (color or blackandwhite) it is displayed just fine. When I try to load a black/white .tiff image around ~2 GB. I get this kind of message:

    WARN:0] OpenCV TIFF: TIFFRGBAImageOK: Sorry, can not handle images with 64-bit samples
    Error!
    imread_('/home/john/Desktop/code/IMAGES/UAV_image.tif'): can't read data: OpenCV(3.4.14) /tmp/pip-req-build-m7h7rfem/opencv/modules/imgcodecs/src/grfmt_tiff.cpp:483: error: (-215:Assertion failed) ((uint64_t)tile_width0 * tile_height0 * ncn * std::max(1, (int)(bpp / bitsPerByte)) < MAX_TILE_SIZE) && "TIFF tile size is too large: >= 1Gb" in function 'readData'
    
    . . .
    
     File "code.py", line 417, in getFrame
       self.img = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
    cv2.error: OpenCV(3.4.14) /tmp/pip-req-build-m7h7rfem/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'
    

    Any idea?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Looking here
      https://github.com/opencv/opencv/blob/master/modules/imgcodecs/src/grfmt_tiff.cpp
      line 491
      It seems that the tile size is too big. > 1 GB and
      the image is 2 Gb.

      JonBJ J 2 Replies Last reply
      3
      • mrjjM mrjj

        Hi
        Looking here
        https://github.com/opencv/opencv/blob/master/modules/imgcodecs/src/grfmt_tiff.cpp
        line 491
        It seems that the tile size is too big. > 1 GB and
        the image is 2 Gb.

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by JonB
        #3

        @mrjj
        ...which is why the assertion error message the OP posted includes

         && "TIFF tile size is too large: >= 1Gb" in function 'readData'
        
        

        :-)

        1 Reply Last reply
        2
        • mrjjM mrjj

          Hi
          Looking here
          https://github.com/opencv/opencv/blob/master/modules/imgcodecs/src/grfmt_tiff.cpp
          line 491
          It seems that the tile size is too big. > 1 GB and
          the image is 2 Gb.

          J Offline
          J Offline
          john_hobbyist
          wrote on last edited by
          #4

          @mrjj What do I do on situations like this?

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi,

            You bring that question to the OpenCV folks since you are using their library to handle such files. They will be better equipped to answer about the limitations of their framework.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            2

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved