Category "image-processing"

Extract misclassified images using CNN keras

I am having difficulties extracting misclassified images, I tried to use the following line of code: inc= np.nonzero(model.predict_classes(test_data).reshape(-

how to modify resnet 50 with 4 channels as input using pre-trained weights in Pytorch?

I would like to change the resnet50 so that I can switch to 4 channel input, use the same weights for the rgb channels and initialize the last channel with a no

Create Random Pixel Images in Swift

I want to create a random pixel generator in swift. How would I be able to create something like the below codes in swift? Java program to demonstrate creatio

When applying Gaussian filter the image becomes dark

When I run the following code the output result is blurred but the image gets darker as I increase the value of sigma. Imports import numpy as np import cv2 i

How is the smooth dice loss differentiable?

I am training a U-Net in keras by minimizing the dice_loss function that is popularly used for this problem: adapted from here and here def dsc(y_true, y_pred)

How to convert NumPy array into OpenCV (cv2) image

I have attached the image of the code here for better understanding, this would help you figure out what I am actually doingI am working on a project in which I

Fabric JS clipPath: how to fit the image to the canvas after cropping?

I implemented image cropping using FabricJS and clipPath property. The question is how do I make the image fit the canvas after cropping? I want the cropped im

Fabric JS clipPath: how to fit the image to the canvas after cropping?

I implemented image cropping using FabricJS and clipPath property. The question is how do I make the image fit the canvas after cropping? I want the cropped im

How to fill a polygon in OpenCV?

The Python code given below draws a triangle, how can I fill it with a color inside? Or another easier way to draw a triangle in OpenCV? pts = np.array([[100,3

How to convert PNG to JPG in Python?

I'm trying to compare two images, one a .png and the other a .jpg. So I need to convert the .png file to a .jpg to get closer values for SSIM. Below is the code

Use pytesseract OCR to recognize text from an image

I need to use Pytesseract to extract text from this picture: and the code: from PIL import Image, ImageEnhance, ImageFilter import pytesseract path = 'pic.gif'

Keep bins between 5% and 95% of a histogram in OpenCV/Python

I am intending to skip some histograms of an image in the extreme points of the distribution of any gray image. The extreme points to the left are represented b

How to get the location of all text present in an image using OpenCV?

I have this image that contains text (numbers and alphabets) in it. I want to get the location of all the text and numbers present in this image. Also I want to

Reading pattern from file and create a bmp image of that in C

I want to read an text file Using C Language.Here's the file:- You see there is some pattern in the text content on the file. 0 means nothing. 9 means blac

How to automatically determine the background color of an RGBA image with highest contrast?

Background I have a bunch of RGBA images. Imagine icons, logos or similar images that I would like to display. These images can be of any color. Please also not

Threshold for pHash Image Similarity

I am trying find similar images using pHash comparison. pHash of an image is 64-bit number. What I am doing is comparing hashes of two images and then count the

problems with computing normal for organized point cloud

Now I want using PCA method to compute normal for the organized point cloud transformed from the depth image.Here is what I do: pcl::NormalEstimation<pcl::P

problems with computing normal for organized point cloud

Now I want using PCA method to compute normal for the organized point cloud transformed from the depth image.Here is what I do: pcl::NormalEstimation<pcl::P

How to get the color of a pixel in python as fast as possible?

I'm on ubuntu and I want to check every 0.1sec the color of a specific pixel on my screen. How can I do that? I know about PIL but this would need a full scree

View .bin file (YCbCr 4:2:2 format)

I am given a .bin file. I know that the elements in this file correspond to Y Cb Cr values (4:2:2). Also, the data type is 8 bits. How can I view this? I foun