Ask Your Question

AA's profile - activity

2017-07-13 05:27:31 -0600 commented question Error in reading and displaying image in open cv.

If it did not load i would have gotten an error like 'NoneType' etc.. but the error is some funky stuff.

2017-07-13 05:19:33 -0600 commented question Error in reading and displaying image in open cv.

Your previous lesson was about declaring the directory. Well i have mentioned it. Whats the problem? Also how can it be a duplicate the errors are totally different (when looked up i don't know what they actually mean)?

2017-07-13 05:12:06 -0600 commented question Error in reading and displaying image in open cv.

It not duplicate i did add the directory the cv2.imshow('gghhs',img) is just the name the window will have will displaying img

2017-07-13 05:01:18 -0600 asked a question Error in reading and displaying image in open cv.

here is the code:

import numpy as np
import cv2

img = cv2.imread('/home/Pi/Exp/result.jpg',0)
cv2.imshow('gghhss',img)

cv2.waitkey(0)
cv2.destroyAllWindows()

And the error:

Traceback (most recent call last):
  File "/home/pi/Exp/opcv.py", line 5, in <module>
    cv2.imshow('gghhss',img)
error: /build/opencv-ISmtkH/opencv-2.4.9.1+dfsg/modules/highgui/src/window.cpp:269: error: (-215) size.width>0 && size.height>0 in function imshow

This is from opencv tutorial here in the read image.

Thanks :) P.S. I did google and did not find anything. Please donot downvote,

2017-07-13 03:13:18 -0600 commented answer image ROIs in python

Ok i got your point but suppose i want to copy a portion of an image how do i pinpoint the coordinates(it may not be exact). Are you saying this is only possible through trail and error? Thanks for the answer

P.S. i know my questions are silly but why does it get downvoted?

2017-07-13 02:19:25 -0600 received badge  Editor (source)
2017-07-13 02:18:05 -0600 asked a question image ROIs in python

What are the numbers in the the bracket? Are they rows and columns of the pixel matrix.Also how come the person know the exact position to copy the image of a ball inside of an image as for that you would have to be very accurate down to the pixel.

This is in the opencv-python tutorial below is the link. "Here I am selecting the ball and copying it to another region in the image:

ball = img[280:340, 330:390]

img[273:333, 100:160] = ball "

Here is the link of the tutorial:http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_core/py_basic_ops/py_basic_ops.html#basic-ops

Go to Image ROI

Thanks :)

2017-07-13 01:45:48 -0600 commented answer In opencv-python tutorials core operations basic operations on images accessing pixel value throws an error

Th directory shouldn't matter. I'm using raspberry pi 3 btw. Also what does has no attribute '__getitem__' mean? Thanks

2017-07-13 01:28:36 -0600 asked a question In opencv-python tutorials core operations basic operations on images accessing pixel value throws an error

Here is the code(with error as i am working directly on the shell as instructed by the website) same as on the website:

>>> import cv2
>>> import numpy as np
>>> img = cv2.imread('result.jpg')
>>> px = img[100,100]

Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    px = img[100,100]
TypeError: 'NoneType' object has no attribute '__getitem__'

Thanks :)