image

Fractal dimension with the Mass-radius method

Fractal dimension with the Mass-radius method Question: I have some images for which I want to calculate the Mass-Radius dimension to determine the fractal characteristics in the image. Here is one of them : Ottawa.png: The mass dimension defines the relationship between the area located within a certain radius and the size of this radius …

Total answers: 1

How to resize image data using numpy?

How to resize image data using numpy? Question: I want to resize image data in python, but a simple numpy.resize does not seem to work. I read the image, and try to resize it using the following script. To check I write the file which results in an unexpected outcome. from PIL import Image import …

Total answers: 4

For Django project (using VS Code), dynamic images not loading. Possible issue with baseURL

For Django project (using VS Code), dynamic images not loading. Possible issue with baseURL Question: I’ve started a Django project based off of a (Telusko/Travello) tutorial but using my own files. There’s data defined on Views.py for title, description, images for courses. It should populate containers in a row on homepage. Everything is getting populated …

Total answers: 1

Displaying a RGB image in float64

Displaying a RGB image in float64 Question: I have an image with data type uint8. I want to convert it to the data type float64 and display it. I expected to see the image as I displayed it with data type uint8. But the result is this: My original image is like this: Why is …

Total answers: 1

How to make these PIL text centered properly

How to make these PIL text centered properly Question: For context, I’m trying to make a spinnergif. The text options here are just for show, by right i wish to make the number of options flexible. I’m trying to make the text centered nicely within each pieslice, but for some reason only some are centered …

Total answers: 1

How to center an image in the tkinter Text widget?

How to center an image in the tkinter Text widget? Question: A button on the main application opens a help file that is a text file imported from the file system. Before the text I want to display an image. This code places the image properly before the text BUT I can’t center it. Here’s …

Total answers: 1

Sort a vector in PyTorch

Sort a vector in PyTorch Question: I am performing a prediction using an input image and a pre-trained classifier on ImageNet using PyTorch. What I would like to do is to calculate the value for each for the class and returned the highest 10 values. My code looks like: img = imread_img(‘image.png’) input = pre_processing(img) …

Total answers: 2

Image padding with reflect (mirror) in Python

Image padding with reflect (mirror) in Python Question: I have an image loaded in python as an np.array with shape (7, 7). I need to apply a filtering process to the image. For this I need to apply a kernel that will convolve the 2D image (like a moving window). However, to get an output …

Total answers: 1

How to save image with same name with python?

How to save image with same name with python? Question: I have image folder as below : |——dir–| | |—- input–|– 1.jpg | | |– 2.jpg .. … … … where I want to do random rotation for input folder and save the results in output folder I tryied the fillowing script : import torch …

Total answers: 1

What is the difference of opening a mask image with PIL and cv2?

What is the difference of opening a mask image with PIL and cv2? Question: Say, I am opening an image file which is a mask image of a specific 3-channels RGB image. Above is the mask image (msk.png) I’m trying to use in my segmentation model. When I open this file with PIL library in …

Total answers: 1