computer-vision

How can I add Rayleigh noise to an image in python?

How can I add Rayleigh noise to an image in python? Question: I am doing the following image processing using cv2: import numpy as np import cv2 image = cv2.imread(‘./tomatoes.png’,cv2.IMREAD_GRAYSCALE) noise_std = 0.1 noise = np.random.rayleigh(noise_std, image.shape) noisy_image = image + noise cv2.imwrite(‘noisy_image.jpg’, noisy_image) cv2.imshow(‘Noisy Image’, noisy_image) cv2.waitKey(0) The problem is: I only receive a …

Total answers: 1

opencv dnn disable detecting coco dataset for some categories and enable for others

opencv dnn disable detecting coco dataset for some categories and enable for others Question: I am using the code in this repository https://github.com/salar-dev/python-object-detection-opencv but I want to disable detecting the coco dataset for some categories and enable it for others I tryed to delete some of the ssd_mobilenet nodes but the program stopped Asked By: …

Total answers: 1

Error with __len__(self) function while creating Custom Dataset Object in Pytorch

Error with __len__(self) function while creating Custom Dataset Object in Pytorch Question: I am following a video course for image classification and therein I have created a custom Dataset Class as follows: from torch.utils.data import Dataset class ChestXRayDataSet(Dataset): def __init__(self, image_dirs, transform): # Initialize the Object def get_image(class_name): # define a function to get images …

Total answers: 1

Projection of a 3D circle onto a 2D camera image

Projection of a 3D circle onto a 2D camera image Question: Asked this on math.stackexchange, but no responses so trying here, hopefully the computer vision people are more able to help out. Assume that I have a 3D circle with a center at (c1, c2, c3) in the circle coordinate frame C. The radius of …

Total answers: 1

How could I add my deep learning model to a web application?

How could I add my deep learning model to a web application? Question: I am planning to create a ml model the recognizes some stuff in real time video, it will be a deep learning model, What I would like to know is how could I apply that model into my web app and what …

Total answers: 2

Can't add other metrics than accuracy on ViT model

Can't add other metrics than accuracy on ViT model Question: I am a begginer in machine learning and i am trying to train a ViT model to categorical classes with my own dataset. I am following this code: https://keras.io/examples/vision/image_classification_with_vision_transformer/ It’s working fine when I use the accuracy metric, but I want to use recall and …

Total answers: 1

yolo v8: does segment contain point?

yolo v8: does segment contain point? Question: I’m using yolo v8 to detect subjects in pictures. It’s working well, and can create quite precise masks over subjects. from ultralytics import YOLO model = YOLO(‘yolov8x-seg.pt’) for output in model(‘image.jpg’, return_outputs=True): for segment in output[‘segment’]: print(segment) The code above works, and generates a series of "segments", which …

Total answers: 1

How to convert the OpenCV GetPerpectiveTransform Matrix into a CSS Matrix?

How to convert the OpenCV GetPerpectiveTransform Matrix into a CSS Matrix? Question: I have a matrix from the Python Open-CV library: M = cv2.getPerspectiveTransform(source_points, points) But it is completely different from the CSS Transform Matrix Even though it has the same shape I think open-cv does some kind of other translations to x and y …

Total answers: 1

How to apply Connected Component Analysis left to right order in openCV

How to apply Connected Component Analysis left to right order in openCV Question: i am using connected component analysis to recognize characters from the image. for that i am using cv2.connectedComponentsWithStats() function. As the output it is getting the characters but without a order. num_labels, labels, stats, centroids = cv2.connectedComponentsWithStats(img, 8, cv2.CV_32S) after getting the …

Total answers: 1