Code Monkey home page Code Monkey logo

Comments (6)

tobyhodges avatar tobyhodges commented on September 10, 2024 1

Ok, I believe this issue thread provides an explanation for the behaviour you're observing: imageio/imageio#877

I need to spend some time reading through it, and then I think it will need to be raised with the rest of the Maintainer team, and potentially the Curriculum Advisors, to figure out how we will handle this consistently throughout the lesson.

from image-processing.

tobyhodges avatar tobyhodges commented on September 10, 2024

Thanks for reporting this and the other issues, @gcapes - you are finding wrinkles that it is very helpful to iron out!

That said, I'm afraid I have not been able to reproduce this one.

editing image object

Could you share the whole code block and output please, so we can try to figure out what is going on here?

from image-processing.

gcapes avatar gcapes commented on September 10, 2024

MWE:

import numpy as np
import matplotlib.pyplot as plt
import ipympl
import imageio.v3 as iio
import skimage
%matplotlib widget

"""
* Python script to ignore low intensity pixels in an image.
*
"""
import imageio.v3 as iio

# read input image
image = iio.imread(uri="data/maize-root-cluster.jpg")

# display original image
fig, ax = plt.subplots()
plt.imshow(image)

image

# keep only high-intensity pixels
image[image < 128] = 0

# display modified image
fig, ax = plt.subplots()
plt.imshow(image)

image

from image-processing.

tobyhodges avatar tobyhodges commented on September 10, 2024

Hmmm. Can confirm this works with no errors on my end. I will go looking for an explanation of why this might be happening to you elsewhere on the Internet...

from image-processing.

uschille avatar uschille commented on September 10, 2024

I can reproduce this. Will dig into it while addressing #252.

from image-processing.

uschille avatar uschille commented on September 10, 2024

Based on the discussions in imageio/imageio#877 and python-pillow/Pillow#6581, image = np.array(image) may be a quick fix. A downside of this is the added cognitive load of thinking about writeable/non-writeable images. Maybe this is unavoidable in view of how the imageio backend works.

@mkcor Do you have any better suggestions?

from image-processing.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.