Questions tagged [imread]

Use this tag for questions regarding reading images in OpenCV, Matlab or similar image processing languages.

cv::imread() and cv2.imread() are ways to read images using OpenCV in C++ and Python.

imread(filename) is how you would read the image in Matlab.

273 questions
0
votes
2 answers

sprintf - 4 useless ascii characters before string

I'm working with visual studio 10, qt addin and opecv library. What I want to do is to load multiple files using a for-loop: (I have ui.image_templates_comboBox->currentText() = "cat") for (int i = 1; i <= 15; i++){ string currentText =…
AchiPapakon
  • 328
  • 5
  • 19
0
votes
1 answer

Octave imread support for image IO was disabled

I am trying to read an image using octave 3.8. I installed octave by downloading code and making it on my system. I used imread("oct.png") And got this error error: imread: invalid image file: imfinfo: support for Image IO was disabled when…
Sam
  • 122
  • 7
0
votes
1 answer

MATLAB loop through certain integers and in the order that I specify v2

The normal loop is for i=1:50 end but I want to execute the loop through certain integers in 4 different array simultaneously and in the order that I specify. So in the first loop, Matlab would take the first integer from r1, r2, c1, c2.…
Mr. Meeseeks
  • 239
  • 1
  • 3
  • 12
0
votes
0 answers

matlab url authentication for imread

How can I use the IMREAD function with a URL that requires basic authentication in MATLAB 2014a? (not the old matlab). It works well for matlab R2013a as described in this…
sid
  • 1
0
votes
3 answers

using imread of OpenCV failed when the image is Ok

I encountered a problem when I want to read an image using the OpenCV function imread(). The image is Ok and I can show it in the image display software. But when I use the imdecode() to get the image data, the data returns NULL. I will upload the…
Minhui Wu
  • 15
  • 1
  • 4
-1
votes
1 answer

open cv can not read all files form a path

I am working with a dataset of 72 images and 72 masks. I appended the images into a numpy ndarrayI want the cv2 to read the files from the path corresponding to the files in the numpy ndarray. this is the path to images and masks: images_dir =…
Mo.be
  • 95
  • 2
  • 11
-1
votes
2 answers

OpenCV - How to see which algorithm is used behind a function? (imread)

There are several ways in python to generate a greyscale image from an RGB version. One of those is just to read an image as greyscale using OpenCV. im = cv2.imread(img, 0) While 0 equals cv2.IMREAD_GRAYSCALE There are many different algorithms to…
Jürgen K.
  • 3,427
  • 9
  • 30
  • 66
-1
votes
1 answer

Open cv is not reading image

Here is my piece of code. But every time it shows data cannot be read. I have tried multiple formates of writing path to image but that did not worked. Any one else facing same problem? #include #include #include…
saqib
  • 11
  • 2
-1
votes
1 answer

C++ OpenCV imread file path format for windows

I've tried to google this to no avail. Please help me understand what is wrong with this file path: Mat lena = imread("C:\Users\dasboomer\Desktop\Building-Computer-Vision-Projects-with-OpenCV4-and-CPlusPlus-master\Chapter03/lena.jpg"); I've tried…
Das Boomer
  • 25
  • 5
-1
votes
2 answers

imread always return "None"

I am struggling to read a picture from certain directory. img = cv2.imread('/Users/myname/Desktop/traindog.8011.jpg', cv2.IMREAD_COLOR) print (img) I just simplified my code to make sure the issue and understand above. And even when I put the full…
TIshow
  • 918
  • 4
  • 12
  • 27
-1
votes
1 answer

module object has no attribute imread and imshow

I have installed OpenCV in Python 3.6(64 bit), but whenever I compile the below code, it is throwing an error of module object has no attribute imread and imshow. This happens while doing in the python idle but when trying in the command-line…
Aj_kumar
  • 11
  • 2
  • 2
-1
votes
1 answer

Working on more than one image in Matlab

I started to learn Matlab newly. I am trying to learn about classification. I will make classification for my 23 images. In my function file I am using I = imread('img.jpg'); a = rgb2gray(I); bw = double(imread('mask_img.jpg'))/255; b =…
cinemaniac
  • 23
  • 10
-1
votes
2 answers

Can not read image in opencv

I am new to opencv and I am starting to make a simple code to read and display image in gui ,I am working in qt IDE, first I wirte this block of code #include #include int main() { cv::Mat…
Barq
  • 3
  • 1
  • 6
-2
votes
2 answers

Trying to use multiple images in opencv imread function but not getting

import pprint as pp original_img = cv2.imread("/content/drive/My Drive/images/image1.jpg") #here i want to use multiple images atleast 250 images. original_img = cv2.cvtColor(original_img, cv2.COLOR_BGR2RGB) results =…
Chaideo
  • 3
  • 4
-2
votes
1 answer

c++ read and write files simultaneously

I am trying to read all .png files in a folder then get their gray scale and rewrite them in a new folder (with the same name). my path_in files : 1.png, 2.png, ... (different number of total files everytime) so by the end, path_out should…
Santa
  • 47
  • 14
1 2 3
18
19