We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Newbie problem. (Read 1560 times)
Newbie problem.
May 2nd, 2006, 12:37am
 
Hi I'm Kelvin Lee from Malaysia. I'm studying Chris Mendoza's ghostly mirror processing artwork. I'm having difficulties getting it to work. I've contacted him and he has helped me to sort out the bugs. but he doesn't have a camera so he can't check out the camera part. I'm using a dv cam = panasonic NV-GS70 for the input and running it with processing 0114. Quicktime 7 and WinVdig_105. running all that on a windows xp and my cpu is an AMD 64bit processor with 1gb of ram. My problem now is there is nothing that comes out except a white background. Here is the scripts in notepad format. I've also tried running the camera with the mirror example included with processing 0114 and it works. Just that for Chris's work it didn't show any output.

here's the link to the script that was used.

http://www.klekdesign.com/script2.txt

looking forward to your replies. Thanks.
Re: Newbie problem.
Reply #1 - May 2nd, 2006, 12:58am
 
It looks like you've kinda misunderstood how the video library works by the looks of it.

In the Old Processing (which is what it looks like you've adapted the code from - Ah, the old days...) you needed to wait for a new frame and reserved a boolean for this (newFrame on your code).

Nowadays this is done by the captureEvent() method and the capture.read() methods as opposed to the videoEvent() method in Old Processing. Get rid of the captureEvent method at the end of your code and also replace the videoEvent() (which ain't ever gonna happen because that event has been renamed captureEvent() - hence the white screen) with:
Code:

void captureEvent(Capture video){
video.read();
newFrame = true;
}

Try
Code:

import processing.opengl.*

at the start of your code and adding: ,OPENGL to the size() method parameters for some graphics card speed as those particles look like a lot of work for my computer so OPENGL mode might take some pressure off.

If my suggestion's unclear just post back and I'll upload my altered version of your code for you.
Re: Newbie problem.
Reply #2 - May 2nd, 2006, 1:56am
 
hi thanks for the prompt reply st33d i've made the changes but duno where i've gone wrong. I think its easier if you could post up your version. thanks alot.
Re: Newbie problem.
Reply #3 - May 2nd, 2006, 2:09am
 
http://www.klekdesign.com/script3.txt

anyway i've included a copy of the script again. haha. so opengl reduces the workload on the CPU? cool.
Re: Newbie problem.
Reply #4 - May 2nd, 2006, 10:24am
 
Are you still having trouble with this?

Looking at the .txt file and obvious error is the duplication of the captureEvent() method.
Re: Newbie problem.
Reply #5 - May 2nd, 2006, 10:25am
 
after a sleep I've finally got the code working but why does the whole video seem compressed at the bottom? I've included a print screen. And Also it will only fill up the screen when moved.

http://www.klekdesign.com/script4.txt
the script

http://www.klekdesign.com/images/printscreen3.jpg
the mirror example with processing 0114 as you can see the video output is fine.

http://www.klekdesign.com/images/printscreen1.jpg
the result when initiated.

and

http://www.klekdesign.com/images/printscreen2.jpg
repetitions which I have no ideae where they came from.

thanks in advanced to anyone who could help me. cheers.
Re: Newbie problem.
Reply #6 - May 3rd, 2006, 8:52pm
 
hello? anyone know what did i do wrong? pls let me know. pls view the links above.
Re: Newbie problem.
Reply #7 - May 3rd, 2006, 9:29pm
 
hello what? it's been ten hours since your post. does somebody owe you their free time to help with your project?

is there something in the water that the board has gotten this rude?
Re: Newbie problem.
Reply #8 - May 4th, 2006, 4:11am
 
erm no. but I just want to know where I have gone wrong. thats all. hmm i wasn't trying to be rude. erm nevermind and sorry if you think i was being rude. and thanks to those that has been helping.

also its not a project. I'm just learning. :|
Re: Newbie problem.
Reply #9 - May 7th, 2006, 1:14am
 
If I had a penny for every unanswered post or stupid question I've posted on this forum I'd have enough for McDonalds Happy Meal (maybe two).

But the amount of intelligently answered posts I've received has amounted to two firsts in terms of grades that count so far and I'm hoping I can finish with a degree of the same. Patience is well rewarded.

On the other hand, I've been 11 meters in the bloody air with a fear of heights trying to do a big art installation. If I don't check the board - chances are I'm drinking myself through the floor from stress.

Patronization follows

videoEvent() is not a Processing method it was removed on the change from Alpha to Beta. Get that bloody thing out of your code like I told you to.

And...

The code works fine on my machine. I'm uploading a version I've made from yours - with an image of the camera capture in the background to illustrate what is going on.

If you look at what analyzeChangeVideo() is doing you'll see that it runs through all the pixels, looks for a change and then creates a lot of little motes where there is a change.

The downside is that you only have 10,000 particles. Those have to look after 307200 pixels! (640 * 480) Once they get used up, the code starts grabbing preused particles. Hence the motes end up at the bottom of the screen.

I tried making it skip lots of pixels at a time but it makes it look a bit crap.

My version.

My advice if you like this thing and want to continue with it that you try to break it down into something simple. Or perhaps just put the code in another window and copy it by hand into processing whilst changing the name of each variable into something you understand. That way you know for sure what you're writing. It may be slow but if you're learning as opposed to trying to get a project together for a deadline, it's a good thing to do.
Re: Newbie problem.
Reply #10 - May 7th, 2006, 4:52am
 
In reply to Ben's comment about the "Hello", I think that's because some people here are more used to large programming communities where some members practically live on the boards and answer posts within 3 minutes, 24.1 hours a day. (for example, OneSadCookie at iDevGames.com). Processing however, is more of a hobby language at the moment (although I see no reason why small scale projects can't be done it it, in fact I recommend it as a starting point for anyone interested in coding). This means that people might check the boards once a day, or twice a week, or whenever they remember about processing. And of course Processing for me is an exciting new language/IDE/whathaveyou and if I have free time to devout to Processing, I would much rather code something than browse the forums.

In short: patience is a virtue around here. I have found that I sometimes have fixed my problem before I get a reply, and you know what? That's a good thing; it means that I get to solve the problem myself and thus increase my ability to code, because that's what coding is in a sense, creating and solving problems. Programming is more of a "problem" than a math "problem".

(sorry about the big rant Tongue)
Page Index Toggle Pages: 1