42,199 questions
1
vote
0
answers
45
views
Media Foundation: Why does setting MF_MT_DEFAULT_STRIDE on a RGB24 output type prevent vertical flipping?
I am relatively new to Media Foundation and I’m working with a video processing pipeline consisting of several IMFTransform components.The last stage in this pipeline converts an NV12 stream into ...
Best practices
0
votes
7
replies
69
views
How to extract contours for each stacked bag (web sling) in a depth image using OpenCV?
I’m working on an image-processing task in Python/OpenCV and I’m stuck on how to segment each “web sling” (stacked bag group) as an individual contour.
What I’m trying to achieve:
Detect each web ...
0
votes
0
answers
93
views
OpenCV producing completely black mask from image
I'm attempting to narrow a screenshot of an app to a specific section of the UI for later processing by Tesseract; in particular, the X Battle ratings located in the lower half of the image.
I did a ...
Tooling
0
votes
1
replies
78
views
Is it possible to train and run a small AI model on a Raspberry Pi 5 to solve text-based CAPTCHAs?
I’m trying to understand whether it’s actually feasible to train and run a small AI model on a Raspberry Pi 5 (16 GB RAM) that can solve simple text-based CAPTCHAs, the kind that contain a few letters ...
Best practices
1
vote
4
replies
154
views
Is there a way to remove the gray background from the image and just to keep the rainbow?
Rainbow diffraction pattern
I have this image that I try to process and want to keep only the visible rainbows and have the background black instead of this grayish color. Is it possible?
I tried ...
-1
votes
1
answer
158
views
ImportError: cannot import name 'skeletonize_3d' from 'skimage.morphology'
I am trying to use the skeletonize_3d function in my code but it kept giving the same error. I tried to install the latest version of scikit-image-0.25.2, Then also the error persist. I want to use ...
-1
votes
1
answer
86
views
Having trouble adjusting Gaussian blur strength and understanding 1D Gaussian kernel generation [closed]
I’m implementing a Gaussian filter, but I’m struggling with a few parts of the process. Here’s my code so far:
def convolve(img, kernel):
#Get properties
row, column = img.shape
diff = ...
5
votes
1
answer
152
views
Rotating an image, how to fix "Index Error: image index out of range"?
I'm attempting to rotate an image in python by copying each individual pixel into a new blank image, (I know, probably not the best way to do it but this is what I have the theoretical knowledge basis ...
Tooling
0
votes
2
replies
94
views
How to remove colors from image keeping black, white and gray
PaddleSharp is used to find orientation and get text form image below:
using Mat imgSrc = Mat.FromImageData(image);
PaddleRotationDetector detector = new(RotationDetectionModel....
0
votes
0
answers
46
views
gdal2tiles: alpha value flattened
I have a tif image(RGBA) with following stats for alpha channel:
Band 4 Block=829x2 Type=Byte, ColorInterp=Alpha
Min=1.000 Max=255.000
Minimum=1.000, Maximum=255.000, Mean=202.508, StdDev=46.463
...
1
vote
0
answers
131
views
How to fix this python code to count duplicate sample in the images?
I want to count samples in the image and measure the length of each sample as I show below. But I am facing a big problem that when sample is overlapping it cannot make an accurate count, for example ...
-1
votes
1
answer
44
views
Pretrained ESRGAN (.pb) gives reddish or purple image — is this a preprocessing issue or model issue?
I'm trying to use a pretrained ESRGAN model that I downloaded in .pb format.
The model runs without errors, but the output image has a noticeable reddish/purple tint instead of the correct colors.
...
1
vote
0
answers
61
views
raster image with missing no-data information rendering with no-data parts in qgis
I have a raster image. I run 'gdalinfo -stats' command for it, and I get:
Band 1 Block=256x256 Type=Float32, ColorInterp=Gray
Description = NDVI
Min=-0.768 Max=0.859
Minimum=-0.768, Maximum=0....
2
votes
0
answers
64
views
How to get rid of no-data pixels in tif,png
I have a gis image file in tif format which I convert to png based tiles using gdal.
gdalinfo command for tif file shows:
Band 1 Block=1652x2 Type=Byte, ColorInterp=Gray
Min=1.000 Max=255.000
...
7
votes
0
answers
229
views
Why should images not be cylindrically warped before homography estimation in an image stitching pipeline?
I am working on an image stitching pipeline for video feeds but am still missing some key insights. I am for example using Szeliski's Image Alignment and Stitching: A Tutorial for a general ...
-1
votes
1
answer
195
views
How to remove background from all sides of bill photo
Tried to remove background from bill photo using OpenCvSharp GrabCut method:
static Mat Grabcut(Mat imageMat) {
Mat result = new(imageMat.Size(),MatType.CV_8UC1);
OpenCvSharp.Rect rect = ...
1
vote
2
answers
159
views
How to make image white outside of contour in OpenCvSharp
Looking for a method to set image color to white outside single contour.
Answer in
Fill the outside of contours OpenCV
outside-of-contours-opencv
contains python code for this:
import cv2
import numpy
...
-1
votes
2
answers
184
views
How to find printed document in image
Image contains single document printed in white paper. Background of image can be different.
Tried to get document using code from https://scanbot.io/techblog/document-edge-detection-with-opencv/ with ...
1
vote
1
answer
71
views
How to control neighbor connectivity in ImageJ Analyze Particles?
I’m using the Analyze Particles tool in ImageJ to detect particles and calculate their centers in a binary image. In my setup, black pixels represent the background and white pixels represent ...
0
votes
2
answers
145
views
How can I automatically crop and rotate a large number of images to be upright?
I have a large number of scanned discs like this:
Actual image is 600 DPI, 7400x7400, 48 bit TIFF.
I want to convert them to a JPEG like this:
Same DPI, but cropped, and rotated so that it is ...
-1
votes
1
answer
111
views
Why does my log transformation output only black? [closed]
Here is my original code:
# Formula: s = c * log(1 + r)
c = 255 / np.log(1 + np.max(image))
log_transformed = c * np.log(1 + image.astype(np.float32))
log_transformed = np.clip(log_transformed, 0, 255)...
-1
votes
1
answer
75
views
How can I detect T/X junctions but ignore 90° angled lines (L-turns) in OpenCV?
I'm trying to distinguish between 90° angled lines (L-turns) and true junctions (T and X intersections) in OpenCV.
I'm using morphological opening to extract long horizontal and vertical line segments,...
0
votes
0
answers
96
views
OpenCV edge detection on PNG image with Canny
I am new to OpenCV with linux. I am currently working on tube rack's bounding detection. But as you can see, one of rack's bounding is blurred by shadow.
Despite having used histogram equalization to ...
1
vote
0
answers
101
views
Removing frame/outside of the text from red LED dotted display
I am building a MAUI app and need to preprocess photos of a red dotted LED display so OCR can read the digits. The photos often include a bezel/frame, screw holes around the LEDs. I must remove that ...
2
votes
1
answer
213
views
Tesseract OCR cannot read dotted LED digits on MAUI/Xamarin
I am trying to extract numbers from dotted LED-style digits (0–9) using Tesseract OCR in a MAUI/Xamarin app on Android and iOS, fully offline. My boss wants a local solution that works on mobile ...
1
vote
1
answer
179
views
Is it possible to extract character-level coordinates from EasyOCR?
I am trying to extract text from documents using ocr, but for my use case I need character-level coordinates.
I am getting following output from EasyOCR:
[
[
[
60,
...
-1
votes
1
answer
94
views
How to compute the same surface area as regionprops3 without using regionprops3?
I need to compute the sphericity of a 3D object (binary mask) in MATLAB, especially for non-isotropic voxel spacing. To do this, I need an accurate surface area measurement.
I compared two methods (...
0
votes
1
answer
103
views
How to obtain the cutting point using OpenCV methods?
Background: Currently, I need to crop the head or tail of the grayscale image of the steel, but this image has problems such as uneven grayscale distribution. How can I find this cutting point?
My ...
1
vote
1
answer
53
views
Assign values from array 1 to array 2 with different grid based on nearest lonlat coordinate in Python
I have two NetCDF4 files with different grids and dimensions (but both approximately cover the same area, see images below). One has information on land-use, the other on topography.
I now want to ...
-1
votes
1
answer
145
views
How to identify contours using OpenCV or traditional methods? [closed]
Background: I currently have many grayscale images of steel. Some of them have high brightness, while others have uneven brightness. As shown in the figure below, how can I better extract their ...
4
votes
1
answer
171
views
Identifying outliers from openCV contours based on curvature?
I'm processing a photo of the Earth from the Moon, as seen here.
What I want to do is get the contour points that correspond to the edge of the Earth that is not in shadow. (e.g., the areas that ...
1
vote
0
answers
42
views
Not able to get stereo calibration when tilting camera
enter image description here: this is 2d coordinate graph
enter image description here i am getting a curvature in 3d graph
enter image description here another view of 3d graph
I am creating a stereo ...
0
votes
0
answers
57
views
What is the difference between using cv2.imread(path) with cvtColor vs cv2.imread(path, cv2.IMREAD_GRAYSCALE) in OpenCV? [duplicate]
I came across two ways to convert an image to grayscale, and I want to understand the difference between them:
# Method 1
image = cv2.imread('image.png')
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
...
1
vote
0
answers
115
views
cv2 findChessboardCornersSB not working, detects only some corners
I have pictures of my checkerboard, but findChessboardCornersSB() or findChessboardCorners() cannot detect all corners, only some of them, or none, regardless of checkerboard dimensions that I input.
...
0
votes
1
answer
91
views
How to deal with boundary points when upscaling with linear interpolation
I have a list of numbers that needs to be interpolated for the purpose of upscaling an image. I am using bilinear interpolation. The boundary must be of "clamp" type. Now consider the a ...
0
votes
0
answers
79
views
Different versions of opencv-python detecting different number of lines for the same grayscale image
Two versions of opencv-python, ver. 3.4.5.20 (Python 2.7.18) and ver. 4.11.0.86 (Python 3.12.0) were used for line segment detection
Both version of opencv-python implements the following paper (...
2
votes
1
answer
142
views
Different Pillow versions yielding different grayscale values for the same image
While converting PNG (RGB) to grayscale using two different versions of Pillow and Python, different grayscale values were observed.
I used Pillow version 5.4.1 on Python 2.7.18,
and Pillow version 11....
4
votes
1
answer
79
views
opencv cv2.drawcontours contour argument: contour vs [contour] [duplicate]
my input :
my code :
# import the necessary packages
import numpy as np
import argparse
import imutils
import cv2
print("Your OpenCV version: {}".format(cv2.__version__))
print("Are ...
2
votes
1
answer
79
views
Detecting inflection points/local minima in openCv Python contours objects to differentiate shapes
I am trying to answer Detecting circular/elliptical shape with Python openCv (or any other lib).
In trying to get the best results I would like to find a way to differentiate between the following two ...
2
votes
2
answers
108
views
Smooth edge of piece
This is the code where I perform thresholding on an image to detect the piece and I would like to be able to smooth the edge even more.
I've never worked with Python, but I'd be interested in doing ...
0
votes
3
answers
216
views
Looking for method of extracting stripes from image
This is an example image of what i am trying to analyze:
The yellow line is the line tool in imageJ. I would take a "plot profile" which would give me the value of the pixels over the line.
...
3
votes
3
answers
298
views
Image detection with rotation (2D)
I try to find the best way to detect images with the rotation. Without rotation cv2.matchTemplate works pretty fine, but I found no function for rotated images.
I need the position and angle of the ...
2
votes
2
answers
231
views
Cleaning up scanned book page edges with OpenCV
I have several scanned book images that I'm trying to clean up. They've been thresholded and partially cleaned with OpenCV, but there are artifacts around the edges that I've been struggling to remove....
1
vote
1
answer
50
views
Combining two ImageMagick commands for dynamic masking [closed]
I want to combine these two ImageMagick commands, the first one creates a greyscale mask by drawing and combining two gradients, then, combines the merged gradients with the extracted alpha channel ...
3
votes
2
answers
326
views
Detecting circular/elliptical shape with python OpenCV (or any other lib)
I have microscopy images of some bacterial cells, and I am trying to detect the count and color of those cells, removing the biology part. Basically I want to detect them on the basis of shape and ...
0
votes
2
answers
63
views
How to overlay transparent shape with contour? [closed]
I have these 2 input images shown below. img1.png has a car in black and the rest transparent.
img1.png
background.png
I and like to fill img1.png with the background.png image to get this output, ...
0
votes
1
answer
85
views
Skeletonized microglial cell branches not reconnecting after binarization, and background structures not removed
I'm working on a Python script for processing immunohistochemistry microscopy images of microglial cells. The goal is to:
Extract the green channel.
Apply CLAHE for contrast enhancement.
Perform Otsu ...
1
vote
1
answer
64
views
Why do results from adjustable quadratic Volterra filter mapping not enhance dark/bright regions as in the paper?
Based on this paper Adjustable quadratic filters for image enhancement, Reinhard Bernstein, Michael Moore and Sanjit Mitra, 1997, I am trying to reproduce the image enhancement results. I followed the ...
0
votes
0
answers
79
views
Trouble implementing a super resolution algorithm with a frequency method
I'm currently trying to implement the following algorithm for image super resolution https://ieeexplore.ieee.org/document/56062 (doi:10.1109/29.56062) (there is a paywall but it's available on scihub)
...
0
votes
1
answer
256
views
Getting counts from job.result() PrimitiveResult qiskit 2025
I'm implementing quantum edge detection, and to do so i need to get the counts after running in the real hardware. I am trying to run throught qiskit-ibm-runtime, but the result I obtain is in ...