You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem I encountered was that I used tif images with a size of 1g, using cv2.imshow, it showed an error, when I used small images, there was no such error
code
import os
os.environ["OPENCV_IO_MAX_IMAGE_PIXELS"] = pow(2, 40).__str__()
import numpy
import cv2
img = cv2.imread('G04002.tif', 1)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) # siva slika
cv2.imshow('gray', gray)
vis = img.copy()
ret, thresh = cv2.threshold(gray, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)
cv2.imshow('thresh', thresh)
mser = cv2.MSER_create()
#mser = cv2.MSER_create(_min_area=2, _max_area=1000)
regions = mser.detectRegions(thresh)
hulls = [cv2.convexHull(p.reshape(-1, 1, 2)) for p in regions[0]]
cv2.polylines(vis, hulls, 1, (0, 255, 0))
cv2.imshow('mser', vis)
cv2.waitKey(0)
The text was updated successfully, but these errors were encountered:
OpenCV uses int for matrix size (rows and cols). The OPENCV_IO_MAX_IMAGE_PIXELS limitation was introduced to cover it. If the image dimension is more than 1^31 then OpenCV definitely cannot handle it. It's design limitation and cannot be easily fixed.
The problem I encountered was that I used tif images with a size of 1g, using cv2.imshow, it showed an error, when I used small images, there was no such error
code
The text was updated successfully, but these errors were encountered: