[Tutor] How to save each pixel from image to jagged array in exact coordinate

2014-08-06 Thread Whees Northbee
Hello, I try do background subtraction using python, and I have problem to save each pixel to jagged array... *My jagged array is:* m_samples=[] height, width, depth=cap.shape c_black=np.zeros( (height,width), dtype=np.uint8) for i in range(0,NUM_SAMPLES,1): m_samples.appe

[Tutor] Error in get pixel value in coordinate (x, y) using getPixel(x, y)

2014-08-07 Thread Whees Northbee
Please help me... I'm using python 2.7.6, numpy 1.8.1, opencv 2.4.9.. I want to get pixel value in one number like 255 not each value like these R(190), G(23), B(45) from coordinate (x,y)... I try these code m_samples[k][i][j]=getPixel(img,row,col) But get error: NameError: name 'getPixel' is not

Re: [Tutor] Error in get pixel value in coordinate (x, y) using getPixel(x, y)

2014-08-18 Thread Whees Northbee
I'm so sorry for late reply, my laptop broken, the code actually I already put in thread before so I'll copy to here.. I don't know how to get pixel, I just searched and many link using 'getPixel' to get value of pixel.. I know color frame using 3 channel B G R to get pixel, but I just want to get

[Tutor] How to count vehicle? I'm trying but my code don't increasing..

2014-09-01 Thread Whees Northbee
Hello, I'm trying to counting vehicle, but I can't increasing it, I use python 2.7.6 and opencv 2.4.9 Here the code: import cv2 bgsMOG = cv2.BackgroundSubtractorMOG2(500,30,True) cap = cv2.VideoCapture("d:\MOV_5680.avi") counter=0 if cap: while True: ret, frame = cap.read(

[Tutor] How to count vehicle? I'm trying but my code don't increasing..

2014-09-01 Thread Whees Northbee
Hello, I'm trying to counting vehicle, but I can't increasing it, I use python 2.7.6 and opencv 2.4.9 Here the code: import cv2 bgsMOG = cv2.BackgroundSubtractorMOG2(500,30,True) cap = cv2.VideoCapture("d:\MOV_5680.avi") counter=0 if cap: while True: ret, frame = cap.read(

Re: [Tutor] How to count vehicle? I'm trying but my code don't increasing..

2014-09-01 Thread Whees Northbee
>What is the value of y here? (x,y,w,h)=cv2.boundingRect(contour), where x,y is the left up position from contour, and w,h is width and height of contour.. >* if w > 10 and h > 15:* *this code I used, because there's a lot small blob from video shaking, or the movement of trees..

Re: [Tutor] How to count vehicle? I'm trying but my code don't increasing..

2014-09-01 Thread Whees Northbee
There's no vehicle in my code, my video just contain vehicles so I think I don't need to use haar classifier, so I'm just do background subtraction to get foreground which is vehicle movement because there's no other movement except vehicle and maybe little movement from trees... I just use opencv

Re: [Tutor] How to count vehicle? I'm trying but my code don't increasing..

2014-09-02 Thread Whees Northbee
If all of these confusing, I'll simplify the problem, I need to know if a point (x,y) exactly at a line where line is (ax1,ay) to (ax2,ay).. Can someone tell me how?? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

Re: [Tutor] How to count vehicle? I'm trying but my code don't increasing..

2014-09-05 Thread Whees Northbee
th python because I'm work with computer vision I'm not I'm newbie to both.. I'm sorry.. On Wed, Sep 3, 2014 at 6:04 AM, Danny Yoo wrote: > > > > On Tue, Sep 2, 2014 at 7:01 AM, Whees Northbee > wrote: > >> If all of these confusing, I'll simplify th

[Tutor] How to edit value of second column row i-th array in numpy?

2015-01-15 Thread Whees Northbee
If I have array a=[[60,70,1],[43,54,2],[87,67,3],[90,89,4],[12,4,5]] where [x,y,id] and I want to find if x=87 and y=67, and find which row is it,and I need to edit the id column with new value.. I can search in first column using: if (x in a[:,0]): print('yes') how I can know index row so I