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

Modifying skimage's 'try_all_threshold' function

I am currently working with the try_all_threshold function that comes with the skimage filters package (skimage.filters.try_all_threshold). It applies 8 types of thresholding methods on an image and then plots these 8 generated thresholds next to…
Phil
  • 29
  • 5
0
votes
1 answer

Detecting objects in images using SciKit with python

I have an immage processing problem that im struggling to figure out a solution for the image. here is the image. Basically its a segmentation and counting problem using scikit image in python. Basically i have to write a psudeo code of how i would…
0
votes
2 answers

Finding black stain from gray rectangle

I'm trying to identify whether the gray rectangle in the image shown below contains black stain. Stain Image: Stain Highlighted: import numpy import matplotlib.pyplot as plt import cv2 path = r'F:\stain.tif' img = cv2.imread(path) img_gray =…
0
votes
0 answers

opencv contour get the dark region only

New to Opencv. I converted to grayscale and inverted an image. After applying thresholding to it this is the result. I need to get only the dark (yellow) regions from this image but instead plotting gives me this. This is the code that I'm using…
0
votes
0 answers

How To Put A Threshold Map Over An Image?

Hi so I have used a saliency map alongside thresholding to obtain a threshold map of an image. Below is the original, salience map and threshold image respectively: import cv2 imgpath = r'D:\Documents\University\MSc Data…
Nhyi
  • 373
  • 1
  • 12
0
votes
1 answer

How Can I A Threshold Image of a Salience Map?

I currently have the salience map of an image below, the spectral saliency and fine grained saliency images are below obtained by the following code: import cv2 imgpath = r'Content Image.jpg' image = cv2.imread(imgpath) width = 350 height =…
Nhyi
  • 373
  • 1
  • 12
0
votes
1 answer

Only Using Colours From A Specific Part of a Picture For Style Transfer

I've got a neural style transfer model. I'm currently working on trying to use different parts of an image to transfer different pictures. I'm wondering how can I get the model to just use the colours present in an image. Below is an example: The…
Nhyi
  • 373
  • 1
  • 12
0
votes
1 answer

Adaptive threshold error using python opencv library

I am in a situation where cv2.THRESH_TRUNC suits me well and I want to apply as adaptive threshold but I am facing an unknown error. Here is my basic code: from PIL import Image import pytesseract import cv2 image =…
0
votes
1 answer

How to fix error running local Otsu threshold example on my own images?

I am basically trying to preprocess an image for a better OCR recognition. I've decided to use scikit-image (or should I use maybe something else)? I am following the example shown…
0
votes
1 answer

Numpy: How to find all pixels within a certain distance of a given pixel and weigh them accordingly?

Please take a look at the image A below. Some introduction to my question: My goal is to obtain an accurate coordinate trace of the illustrated DNA molecule. The coordinates of the trace are represented by the blue dots in the image and are…
0
votes
1 answer

Conversion of bool type image to uint8

I used the link below for thresholding of my images. https://github.com/subokita/Sandbox/blob/master/otsu.py but my images was grayscale and I didn't as same as the link. now I want to use the function otsu2 or…
diana
  • 1
  • 2
0
votes
2 answers

OpenCV - Adaptive thresholding / Trackbar manipulation

I am still new to OpenCV(Python) and am trying out cv2.adaptiveThreshold() to draw proper contours with a webcam running when lighting is changing. The main problem is the insane amount of noise I am getting when drawing contours so I tried to set a…
0
votes
1 answer

CV2 binarizing processed image

I am trying to threshold the image and convert it to binarize form (1- foreground and 0- background) of a text image. I have conducted several image processing steps and on final stage I use binary threshold on image. However, it produces completely…
ussrback
  • 491
  • 2
  • 8
  • 22
0
votes
1 answer

Image thresholding with my own min-max value with python

I have an image to threshold. But I dont want to classical methods. I have my own min and max threshold value. How can i apply this threshold values to my image and get a binary mask. For example min is 300 and max is 500 if my pixel value is…
0
votes
1 answer

How to get a better threshold image than Otsu applied to entire image

I have tried to apply Otsu's within ROIs of an image to get a better output. My current iteration of code is shown below where I apply Otsu's to 45x45 ROI segments of an image. The output is still not the best, especially when compared to Adaptive…
Revexr
  • 1
  • 4