Category "image-processing"

divide image into two equal parts python opencv

can someone tell me how to implement a bisection of the image into upper and lower part? so that I could overlap them. for example, I have an image and I should

How to crop face detected via Mediapipe in Python

i have a problem with mediapipe coordinations. What i want to do is crop the box of the detected face. https://google.github.io/mediapipe/solutions/face_detecti

Run time error assigning cv::Mat element value using cv::Mat::at

In the following code I would like to assign a values to elements of a Mat variable in a loop. I get the runtime error below. pair<Mat, Mat> meshgrid(vect

How to use cv::decode (access image) correct?

I need help with the following problem: Task script: read in the message sensor_msgs/PointCloud2, display Bird Eye View image and save (png or jpg). Desired new

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