Questions tagged [image-thresholding]

To be used with regards to converting any image to a binary image having two values 0 and 1. It is a simple elementary image segmentation step.

For details on various methods used visit THIS WIKI PAGE

189 questions
0
votes
1 answer

Change pixel RGB values individually according to a threshold in Python

I would like to change the RGB values of an image according to a threshold. For example I would like a value in an image to become 0 if it's less than 0.5 and to become 1 if it's equal or greater than 0.5. Here's an example: A pixel of values [0.3,…
0
votes
0 answers

detect horizontal & vertical straight line or bar with OpenCV

I intend to use OpenCV Canny & Threshold algorithm to detect the vertical pols and horizontal lines in the vinery farm, however, I can not distinguish between different counters to select the proper zone with drawContours function my question is…
0
votes
1 answer

Select pixel position for image segmentation based on threshold value

I am writing a function to segment an image in MATLAB. I want to do a simple segmentation where I first sum up elements along columns and select pixel position which is greater than threshold and display only those pixels from the original[![enter…
0
votes
0 answers

How to solve Threshold Otsu in OpenCV

squareKern = cv2.getStructuringElement(cv2.MORPH_RECT, (3, 3)) light = cv2.morphologyEx(gray, cv2.MORPH_CLOSE, squareKern) light,th1 = cv2.threshold(light, 0, 255, cv2.THRESH_BINARY |…
0
votes
0 answers

Image segmentation based on thresholding noise

I have images of bonemarrow biopsy and I've been trying to segment the bones as a pre-processing step for a detection network. Bones are textured and mostly homogenous. I applied entropy with disk(6) and after examining the histogram, I've concluded…
0
votes
1 answer

Python find the long axis of a 3D point cloud or 3D hull

I am trying to find the 'long axis' of a 3D object (described as a 3D boolean or label array), which passes through (or near) the centroid of that object. I would like to think I could simply iterate over every pair of points in the object and pick…
Zac
  • 362
  • 1
  • 4
  • 16
0
votes
0 answers

How to find best threshold for an image using connected region method

In theory the best threshold value is a mean of grasyscale interval which number of connected regions do not change but how to find it in matlab?
slaihgg
  • 39
  • 6
0
votes
0 answers

How to draw bounding box around symbols in binery image?

I have an binary image as shown below: Now I want to draw bounding box around each character. The best I could do using opencv contours is shown below but it is not that much accurate. as you can see this is a pure clutter? Apart from drawing…
0
votes
1 answer

Tesseract - Preprocessing that Doesn't Affect Final Image

I'm using the latest version of Tesseract (5.0), and I'm trying to determine whether or not I can insert some preprocessing steps that will -not- affect the form of the final image. For example, I might start out with an image such as this. There…
prednizone
  • 41
  • 3
0
votes
1 answer

how to isolate yellow part of the picture and make black other parts?

This is the image: I want to turn all the colours to black except yellow and tried this code but showing an error can anyone please help? import cv2 as cv import numpy as np img = cv.imread('Screenshot 2022-04-10 at 10.02.19 AM.png',1) if(img.any()…
0
votes
1 answer

Why does thresholding on image give a different result compared to when it is in an image with other things?

I have an image that when I apply a binary threshold on it, it gives a different result compared to when it is in an image with other things. I'm not sure if I'm setting the parameters for the thresholding function incorrectly as I took the example…
0
votes
1 answer

SimpleITK thresholding based on ratio

I am trying to do some basic thresholding on brain images. I'm trying to find the tumor to brain ratio and then use do some basic filtering based on the following ratio: the intensity of every pixel/contralateral brain tissue intensity Is there a…
nibs
  • 63
  • 6
0
votes
1 answer

How can I separate objects in a binary image?

I have a binary image that I create in scikit-image like so: img = image_to_process from skimage.filters import threshold_li thresh = threshold_li(img) thresh_image = grayscale > thresh On the resulting thresh_image (binary), I want to run a…
0
votes
1 answer

Skimage binary image with boolean

I am working within the scikit-image package to analyse medical images. For that, I want to create binary images and only count the number of white pixels in the images. I do as follows: Create a grayscale image Run a threshold on it…
Phil
  • 29
  • 5
0
votes
2 answers

What settings in cv2.threshold() to threshold this image?

I would like to convert this image to gray scale in OpenCV and then find the settings to threshold it. I want to threshold the black spaces inside of the skull. Can someone write out a Python script using OpenCV? I convert to grayscale with: gray =…