Page 3 of 3

Re: Nice project but I need help to get it done

Posted: Fri May 09, 2014 12:35 pm
by BMS Doug
Ooops,

I've just re-read the tutorial I linked that gave us the cv file, the delay time is in milliseconds, not seconds.
try changing cv2.waitKey(30) to cv2.waitKey(30000).

Re: Nice project but I need help to get it done

Posted: Fri May 09, 2014 1:47 pm
by richard_robust
Hi Dough,

This is the script that I use now:

import numpy as np
import cv2
import sys

from cv2.cv import *
from cv2 import *

# Load an color image unchanged
# The image should be in the working directory or a full path of the image should be given.

sys.path.append('/usr/local/lib/python2.7/site-packages')
img = cv2.imread('/pictures/richard.jpg',-1) <=== I think the problem situated here

cv2.imshow
cv2.waitKey(30000)
cv2.destroyAllWindows()

this is what I have now , i call it with "python imageview.py"
It does something but it doesnt let the pic show also it doesnt give a Error.
keep trying until it works but more info from you guys would be excelent.

BR,

Richard

Re: Nice project but I need help to get it done

Posted: Fri May 09, 2014 2:41 pm
by richard_robust
Hi Dough and all the other Pi lovers,

The day is almost finisched and finaly it works. :lol:

code:
import numpy as np
import cv2

img = cv2.imread('richard.jpg',-1)

cv2.imshow('richard.jpg ,img)
cv2.waitKey(5000)
cv2.destroyAllWindows()


had to kick the rest cause of no image at all and no errors.
a few lines of code makes this thing finally happen.

this is the code I use to make it work, although I will have to work a little on it to finish it but that wouldn't be a big problem.

The next BIGGEST thing I have to do is to : the event-handling when something happens run this program with the right picture of course but that is for next week.

That was a good tip Dough Simplecv does the job fine (maybe have to shut down some process on the pi to get is faster done but that are problems for the next days after the weekend)

Thanks for your help Dough much appreciated.
Good bye and have a nice weekend all,

Richard

Re: Nice project but I need help to get it done

Posted: Sun May 11, 2014 8:38 am
by BMS Doug
The python program I gave earlier was an overview of how to approach it, I don't think the while block was correctly defined.

Build slowly towards your goal

You have had success with activating an LED from your relay already?
If so you just swap the image display code for the LED activation code.

After you have the image displaying when activated by the relay you can wrap that code in a while block that is controlled by the other PC which has to be on.

Re: Nice project but I need help to get it done

Posted: Thu May 15, 2014 8:51 am
by BMS Doug
Any luck with this Richard?

Aha, I see you are seeking help in the programming forums, good idea.

Re: Nice project but I need help to get it done

Posted: Tue May 27, 2014 3:52 pm
by richard_robust
BMS Doug wrote:Any luck with this Richard?

Aha, I see you are seeking help in the programming forums, good idea.
Hi Doug,

Good news , I got a little more time to fix this project :lol: , but never the less the sooner it is finished the better I sleep.

Ok I got the python program finished , and it works.

I was playing with the breadboard but it is almost impossible to find that push button over here (got it ordered by Farrell but they didn't deliver it. so that is the only thing I don't have , for the rest I got everything) (I tried to take a push button from an old laptop ... but it failed to do so the iron wasn't hot enough I think. Anyway after burning my fingers enough for a couple of years)Maybe next week I order an new Pi for a friend , and will order the push-buttons again by our friends of Farrell.

What I know is that we need to program the pi's GPIO to make it function. I know now that we can put in the program (windows side) an ip adress of a device that can handle inputs. So we can do it via network. The pins we have to make later to make that buss sound (got it work via breadboard so we know now witch pins we need to connect to make the buss sound (thanks to my friend David).
Like you see Dough I'm still bussy with it and when will not stop until this is finished, at home I'm reaaaaly enjoying my Rasperry Pi as a media station (raspbmc) after this project I will go for the solar thing. I think the more I'm bussy with it the faster I will learn this great device (just have to buy that book that was earlier mention in this post)

BR,

Richard

Re: Nice project but I need help to get it done

Posted: Tue May 27, 2014 8:39 pm
by BMS Doug
Hi Richard,

Sorry to hear that you had problems with getting a switch.
As an interim measure you can use just about anything to act as a switch, perhaps an old light switch or even just tap two wires together.

I ordered a bag of 50 switches from China via amazon, they took awhile to arrive but cost very little. I've got all sorts of other components on order too, all bulk purchased. It'll take ages to use them all up but I expect I'll use everything eventually (except I'll order more when I'm running low).

Re: Nice project but I need help to get it done

Posted: Wed May 28, 2014 10:00 am
by richard_robust
BMS Doug wrote:Hi Richard,

Sorry to hear that you had problems with getting a switch.
As an interim measure you can use just about anything to act as a switch, perhaps an old light switch or even just tap two wires together.

I ordered a bag of 50 switches from China via amazon, they took awhile to arrive but cost very little. I've got all sorts of other components on order too, all bulk purchased. It'll take ages to use them all up but I expect I'll use everything eventually (except I'll order more when I'm running low).
Hi Dough,

Hmmm must can you give me an article number or so then I can also order me some , cause will need it now and maybe later also so it will be a good investment. Tapping 2 wires together hmmm, I was thinking to do that but I was afraid that I burn me Pi :?
Any way now I got the picture working , now I must find a way to let the pi act to the info that comes from the main pc. Or I put a cron on the folder for checking every sec => but take a lot of resources. Or I make a program (try to ) that only acts when there is a signal (signal can be http or ftp? ? not sure about that (the signal but what would be the most easy way that doesn't use to much resources )) because it have to be quick response. => the 2 signals (buzzer and picture). There is a signal that comes out of the program (in the program I can put a ip-adress as where the signal has to go) and ( i can choose between ftp or http (maybe more but have to check it out)

So probably we gone get it work after all ... :D

BR

Richard

Re: Nice project but I need help to get it done

Posted: Sat May 31, 2014 5:25 am
by BMS Doug
Rechecking my order it seems I was mistaken, it was 100 pushbuttons for £1.01, extravagant huh.

Re: Nice project but I need help to get it done

Posted: Wed Jun 04, 2014 8:45 am
by richard_robust
Ok the story contentious,

I gone try to push the picture from the windows pc to the pi via http, just have to configure Apache to let the picture show for 5 second's with or without sound and then turn to black background(with no borders) until there is a new picture to show. I think this may work after all.


BR,

Richard

Re: Nice project but I need help to get it done

Posted: Fri Jun 20, 2014 2:13 pm
by BMS Doug
Hi Richard,

Any progress?