Questions tagged [python-imageio]

Imageio is a Python library that provides an easy interface to read and write a wide range of image data including animated images, volumetric data, and scientific formats. Make to use this tag for question related to it.

191 questions
0
votes
1 answer

Why is the last frame always excluded, when converting images into a video?

I have a folder with 225 pictures of maps. So, I compiled it to an mp4 file using imageio. Whether it's compiling 10 maps, 150, or all 225, the last picture is always not included in the video. import os from natsort import humansorted import…
BallpenMan
  • 185
  • 1
  • 12
0
votes
0 answers

my gif constructor code is too slow matplotlib

I am doing my final thesis and I need to create some gifs for a lot of different systems, the problem is that my code is REALLY slow and I need a way to increase the speed, I'm using imageio to do it fig,ax=plt.subplots() plt.title("Variacion…
DaniDm
  • 3
  • 2
0
votes
2 answers

too many values to unpack (while reading image's shape)

I am trying to run this code snippet: from scipy.stats import wasserstein_distance from imageio import imread import numpy as np def get_histogram(img): h, w = img.shape hist = [0.0] * 256 for i in range(h): for j in range(w): …
x89
  • 2,798
  • 5
  • 46
  • 110
0
votes
1 answer

RuntimeError: Frame is 0 bytes, but expected 691200

Running the code in google colab to detect object in a video but following error occurred: RuntimeError Traceback (most recent call last) /usr/local/lib/python3.7/dist-packages/imageio/plugins/ffmpeg.py in…
0
votes
1 answer

How to handle "ValueError: Could not find a format to read the specified file in single-image mode"?

Source code link: https://github.com/rndbrtrnd/udacity-deep-learning/blob/master/1_notmnist.ipynb I am working with some of the existing code already written to read image's data as part of deep-learning course using ndimage.imread which is…
Kasid Khan
  • 639
  • 2
  • 8
  • 23
0
votes
2 answers

Pipe numpy array to virtual video device

I want to pipe images to a virtual video device (e.g. /dev/video0), the images are created inside a loop with the desired frame rate. In this minimal example i only two arrays which alternate in the cv2 window. Now i look for a good solution to pipe…
sre
  • 31
  • 5
0
votes
1 answer

how to convert a nift folder to png images?

*library there is a mostly known library imported from NumPy and imageio import NumPy as np import os import nibabel as nib import imageio // method where I have I write code to convert a nift to png Method convert a nift(.nii) image to png…
Sir Mayur
  • 1
  • 1
  • 1
0
votes
2 answers

Inverting Colors in an Image using ImageIO

I'm currently trying to write a function that inverts an image using ImageIO and no loops but I'm having a hard time. This is the code I have so far: def inverted_color(img): img = imageio.imread(img) print(img.shape) img =…
ppboi
  • 13
  • 4
0
votes
1 answer

Unable to download 'libfreeimage-3.16.0-osx10.6.dylib' using imageio.plugins.freeimage.download()

I am trying to read *.hdr image using imageio python library. I am using the free image plugin for imageio in order to do this. imageio.plugins.freeimage.download() However I get the following error even though I am connected to the…
0
votes
1 answer

Image not showing properly when reading the image using PIL instead of imagio library

I have this code that converts an image from RGB space to HSI space: import numpy as np import imageio from matplotlib import pyplot as plt def RGB_TO_HSI(img): with np.errstate(divide='ignore', invalid='ignore'): rgb =…
0
votes
1 answer

How to animate just the last six newest images as a GIF?

I need to create a GIF from the last seven newest images from a directory. The directory is constantly updating and adding new images every 10 minutes, so I already could make the code to create the GIF including all the files in the directory, but…
dchaco95
  • 5
  • 4
0
votes
1 answer

imageio(imsave) ValueError: Max value == min value, ambiguous given dtype

I want to change the images in format .nii into .png but I get this error from the function imageio.imsave: ValueError: Max value == min value, ambiguous given dtype Here is a part of the code: import numpy, shutil, os, nibabel import sys,…
Amir
  • 1
0
votes
1 answer

Why does imageio.imread sometimes return an `imageio.core.util.Array` instead of a numpy array?

In the docs for imageio it says that imageio.imread returns a numpy array. This has been my experience most of the time, but sometimes it returns an imageio.core.util.Array object. imageio.core.util.array is only mentioned once in the imageio…
jss367
  • 4,759
  • 14
  • 54
  • 76
0
votes
1 answer

python imageio.get_reader() returns format error

import imageio reader = imageio.get_reader("./t.mp4") As shown above, with python 3.6.10, it returns: >>> reader = imageio.get_reader("../") Traceback (most recent call last): File "", line 1, in File…
tristan_jia
  • 93
  • 1
  • 1
  • 9
0
votes
1 answer

Py: imageio.imread vs scipy.misc.imread

So, i have a script that should convert a number into an array that i can feed into my AI. But a book that I am using for that tells me, to do so: img_array = scipy.misc.imread("picofannumber.png", flatten = True) img_data = 255.0 -…
Heatsreef
  • 113
  • 1
  • 1
  • 8