Questions tagged [opencv]

OpenCV (Open Source Computer Vision Library) is an open source computer vision and machine learning software library.

Filter by
Sorted by
Tagged with
0 votes
0 answers
22 views

Using OpenCV on float32 rasters

I would like to use OpenCV adaptive thresholding (Otsu's Binarization) on a float32 GeoTIFF in Python. Normally OpenCV examples are working on 0-255 greyscale images. Is it possible to use them ...
user avatar
1 vote
0 answers
32 views

Shape width estimation from raster

I want to estimate the measurements of a shape present in a given raster image and I want to know what is the proper way of handling the measurement dependence on the projection. More specifically, I ...
user avatar
2 votes
1 answer
129 views

How to copy coordinates from a .tif that has coordinates to a .tif that does not have coordinates?

So I have done some RGB-channel extraction from a .tif file, meaning I took UAV_image.tif and I have extracted R,G,B channels on three different .tif files. Next, I did some calculations such as ...
user avatar
2 votes
1 answer
105 views

.tif image is really dark when opening with cv2 but bright in QGIS

I have some tif sattelite images, when I read them in with cv2 they are super dark, i checked and the mean pixel value is 6 ish. The maximum is 166, image viewers also show the images as super dark, ...
user avatar
  • 195
0 votes
0 answers
84 views

How to change extent of GeoTiff image using gdal

I am trying to blend satellite imagery with hillshade imagery using opencv. Once the blending is done, I save the result as tif file. But the output tif file doesn't show the same extent/coordinates/...
user avatar
0 votes
0 answers
235 views

Why do images in Open CV template matching get matched to the templates more than once?

The following code reads the set of input tiff files under tiffile and template tiff files under files and performs template matching on them. After the image gets matched, opencv contour extracts the ...
user avatar
2 votes
0 answers
420 views

Cropland field delineation using OpenCV and Google Earth Engine

I want to follow the methodology in the following article in order to find field boundary delineation automatically: "Multi-Temporal Crop Type and Field Boundary Classification with Google Earth ...
user avatar
1 vote
0 answers
98 views

Count the polygons of the raster given by the kmeans algorithm

I am struggling with a Python problem. My plan is to compute the clustering of the kmeans algorithm for an image and to create polygons from this classification. My goal is to get the total number of ...
user avatar
  • 11
1 vote
0 answers
63 views

OpenCV array is totally different from raster values of my TIFF in QGIS? [closed]

I have a a GeoTIFF that I need to binarize. OpenCV is of course the choice program for the job, but I am having major issues. Below, you will see a typical range for RGBnIR values in QGIS of my image: ...
user avatar
  • 187
3 votes
0 answers
110 views

Is it possible to proceed direct geo-referencing and ortho-rectification for a GeoTIFF with GDAL/OpenCV in one step

I work under Debian Linux and want to ortho-rectify and geo-reference images aquired by a tilted twin camera system using: the attitude parameter (roll, ptich and heading) of the gyro-stabilized ...
user avatar
  • 3,453
2 votes
2 answers
772 views

Rasterio and OpenCV reads JPEG differently

I realise a very similar question was asked as Rasterio and OpenCV shows two different pixel arrays for same image. However my situation is slightly different and I only wish to know why this ...
user avatar
2 votes
1 answer
691 views

Rasterio and OpenCV shows two different pixel arrays for same image [closed]

I am using Rasterio to open a panchromatic GeoTiff image file. The syntax I used to open the GeoTIFF file using Rasterio: import rasterio src = rasterio.open('...
user avatar
  • 31
0 votes
0 answers
106 views

Anaconda Python Library with QGIS

I'm currently thinking about ways to develop scripts with openCV library and use with QGIS. I've installed python directly from Anaconda distribution and installed new packages from it (never had a ...
user avatar
4 votes
1 answer
490 views

Fitting circles to crescent shaped clusters in raster data automatically

I have mobile lidar scanner (MLS) that was collected in a forest with big, mature trees. My research involves fitting circles to tree stems to estimate their diameters at different heights. Once I ...
user avatar
  • 2,404
2 votes
1 answer
1k views

Using OpenCV function in PyQGIS - Module not found

I would like to write a code using the OpenCV function cv2.bitwise_and, and run it in the Python console on QGIS. To do so, I start my code with import cv2. QGIS is returning the following error : ...
user avatar
0 votes
0 answers
64 views

Best way to correct UAS imagery sun glint over a water surface

I have a challenge of where there is a sun glint which includes both specular and non-specular brightening of a water surface on Unmanned Aerial Vehicle (UAS) imagery. Please see the raw image below ...
user avatar
  • 1,273
2 votes
0 answers
67 views

Use edge detection to segment images

I have an RGB from which I detected the edges and I'm curious if I can use it to optimize a segmentation or as a mask to improve the segmentation to identify cultivated fields. Could you do that? If ...
user avatar
  • 365
1 vote
0 answers
202 views

Use OpenCV in PyQGIS

I developing QGIS module and I have a question, how to capture QgsMapCanvas window with OpenCV for shoving in different frame or different application? Part of the code: class MainWindow( QtWidgets....
user avatar
3 votes
1 answer
525 views

How to change a numpy array's dimensions [closed]

I'm using GDAL Python API to read a raster into a NumPy array, it will return a array's shape like [bands, rows, cols], if we want to use OpencCV to deal with this array, it will cause some problem, ...
user avatar
  • 67
3 votes
4 answers
2k views

How to save raster with projection into Python

I applied a raster processing that is already in a known coordinate system with this code, import cv2 import numpy as np from matplotlib import pyplot as src img = cv2.imread(r'E:\2_PROJETS_DISK_E\...
user avatar
  • 41
4 votes
1 answer
112 views

Adding up several rasters to show the change

I want to add several images such that their change is shown in different colors. Such as the following in which I simply added two images in their grayscale. But I would like to have a colored ...
user avatar
  • 561
0 votes
1 answer
163 views

How do I contribute to opencv-python? [closed]

I have an implementation of a computer vision algorithm in python. I would like to contribute this to opencv-python. This is my first time contributing to FOSS. How should I go about it?
user avatar
2 votes
1 answer
483 views

Is there a GDAL function similar to OpenCV's WarpPerspective?

I't trying to mosaic a GeoTiff raster against another. Initially, they were both georeferenced in WGS-84 CRS. Using OpenCV, I calculated a homography transformation (a 3x3 projection matrix), that ...
user avatar
1 vote
1 answer
1k views

Converting Digital Number (DN) to reflectance in order to analyze NDVI

I'm working with a mapir nir + red camera meaning that its blue band captures nir light and its red captures red normally. I understand that NDVI is calculated using reflectance values. How do I ...
user avatar
  • 11
1 vote
1 answer
502 views

Visualizing NDVI values?

Currently, I have the NDVI values, and I transformed it from [-1, 1] to [0, 255]. Now my question is how do I visualize either of these value? My first thought is to make a color map similar to the ...
user avatar
  • 11
0 votes
1 answer
2k views

Importing cv2 on Python 2.7 gives error [closed]

When importing cv2 on Python 2.7 I got this error: Traceback (most recent call last): File "<pyshell#1>", line 1, in <module> import cv2 ImportError: DLL load failed: The specified ...
user avatar
  • 1
2 votes
1 answer
849 views

Seeking Open Source implementation of Majority Filter?

I am performing postprocessing on Landsat GeoTIFF images and want to use the Majority Filter as mentioned in the book on Image Analysis, Classification and Change Detection in Remote Sensing and ...
user avatar
1 vote
0 answers
788 views

Raster alignment

I have a problem with raster aligning. Given: Two rasters that need to be aligned. Rasters a little bit shifted, scaled and rotated. Two arrays of matched keypoints. Transformation is wrong, so ...
user avatar
  • 182
0 votes
2 answers
5k views

How to save numpy array as single band image?

I'm working on MODIS NDVI composite data (single band). I converted the image to a numpy array and performed filtering operations. When i'm saving the new numpy array as an image I get a 3 band image ...
user avatar
1 vote
0 answers
897 views

How to loop the kernel for covering all pixels from a raster in 5x5 convolution window by using OpenCV? [closed]

Here, I have python code which is helping me in selecting 5 by 5 window from upper left corner of a raster (.tif). I want a process to automate through entire image in 5 by 5 convolution window. ...
user avatar
1 vote
0 answers
432 views

Reading 13 bands (Sentinel 2A) .tif image in cv::Mat (opencv C++) [closed]

I want to read 13 bands of a .tif image in separate cv::Mat objects for processing. I have tried reading it with opencv imread() function but it fails to load it. Also, I have used libtiff but I am ...
user avatar
6 votes
2 answers
6k views

Detecting overlapping blobs in image?

I have read the following two posts related to my question; however, my problem is slightly different and I'm having a hard time solving it. Finding if two polygons Intersect in python? Getting ...
user avatar
  • 163
1 vote
1 answer
2k views

GDAL, python: How to create a GDAL dataset object from a numpy array

I am working on a program that uses both OpenCV and GDAL to perform different tasks. OpenCV stores its images as numpy arrays. I would like to be able to go directly from this numpy array to a dataset ...
user avatar