View unanswered posts | View active topics It is currently Sun Nov 23, 2014 4:55 pm






Reply to topic  [ 12 posts ] 
Can the NXTCam read individual pixals? 
Author Message
Rookie

Joined: Tue Jan 22, 2008 3:22 am
Posts: 8
Location: Australia
Post Can the NXTCam read individual pixals?
Hi,

I was wondering if Robot C can read indivual pixals off the mindsensor NXTCam. I haven't actually got a camera but I need to know whether you can read the indivual pixals before I buy one as they are expensive.

If anyone has any sample code that shows how to read the pixals - that would be great too :D .

Thanks,
Shan Piete


Tue Jan 22, 2008 5:14 am
Profile
Rookie

Joined: Tue Jan 22, 2008 3:22 am
Posts: 8
Location: Australia
Post 
Hi all,

To answer my own question, no you cannot read indivual pixals off the camera. Instead a lot of the processing of the infomation is actually done on the camera.

The image is processed into "blobs" of colours you have set to the camera (the camera can track up to 8 blobs and colours). You can retieve the infomation from regestries on the camera. The infomation stored in the regestries includes the colour of the blob and it's co-ordinates.

The sample programs that come with the camera for robot C don't seem to work for me (I orginally pluged it into the wrong port - oops - but that's now definately NOT the problem). The robot can read off the camera but it gets very large hex numbers returned and nothing is displayed on the screen (the program is supposed to display the blobs that the camera sees on the screen). Can anyone help me with the problem or post some sample code for the camera that does work (doesn't matter what the codes does, as long as it reads info from the camera).

Thanks,
Shan Piete
p.s if anything i've said is wrong, pls don't hesitate to correct me :)


Tue Mar 04, 2008 2:38 am
Profile
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post 
hast du es auf die folgende Weise ausprobiert ?
(sorry, mein englisch ist zu schlecht, daher schreibe ich auf deutsch):
1.) Installations-Anleitung:
http://www.mindsensors.com/index.php?mo ... PAGE_id=83

2.) man muss vorher gesondert den USB-Treiber installieren:
http://www.mindsensors.com/index.php?mo ... ment_id=44

3.) Konfigurations- und Steuerprogramm nxtCamView runterladen
http://sourceforge.net/project/showfile ... _id=203058

4.) Demos, um damit per USB die Kamera zu initialisieren:
http://nxtcamview.sourceforge.net/DemoScreenCam.htm

5.) RobotC-Treiber und Beispiel-Programme aus ZIP-File von Gordon Wyeth austesten:
http://www.mindsensors.com/index.php?mo ... ment_id=50
http://www.itee.uq.edu.au/~wyeth/NXT/#N ... indsensors

Anmerkung: Ich hatte auch große Probleme mit der Farb-Erkennung (Demos von Gordon Wyeth), aber bei mir war definitiv die Kamera defekt. Ich warte zur Zeit auf Ersatz!

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Tue Mar 04, 2008 4:18 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Jan 31, 2007 3:39 am
Posts: 299
Location: San Diego, California. USA
Post 
Hi Shan,

Your second post is correct, you cannot read the individual pixels because the NXTcam does allot of the processing for you and gives you blob number and location

As for the RobotC code, it should work, iv been using it allot B-). Have you installed the NXTcamView software so you can configure your camera. The NXTcamView lets you set the colors the camera will look for, I believe the default color values are nothing. The software is a must have to configure your camera.

Ford Perfect has all the important links for the camera software, the NXTcamView is the third link down.

let me know if this helps B-)

Scott

_________________
Mmmm Legos B-)

My Robot Projects:
http://www.freewebs.com/robotprojects/


Wed Mar 05, 2008 12:02 am
Profile WWW
Rookie

Joined: Tue Jan 22, 2008 3:22 am
Posts: 8
Location: Australia
Post 
Hi,

thanks guys for the help but i'm still having problems in regards to getting infomation off the camera.

I have had a look and tried most of the sample code for the camera but it doesn't work for me (I used the calibrating program). I think that the problem is in the NXTCamlib code that is used as a included file in all the programs.

From what i can see from the debugger, the arrays that are used in the program arn't being created properly, so there is only 1 slot in the array instead of the 8 ones that the programs is expecting. I think it is the way the arrays are created (they use a type def). Is anyone else found this to be a problem and is it a problem with robot C or is it invalid code not picked up by the complier? (I am planning to create seperate arrays in the program where needed to see if it fixes the problem instead of using the type def arrays but i haven't had time yet :) )

Also, if anyone has had experience with the NXTcam it would be really good if they could post their working code (this is the first time i have used a camera when programming :D).

thanks,
Shan Piete


Mon Mar 17, 2008 5:42 am
Profile
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post 
I meanwhile got similar problems with those blobs, but moreover the color recognition was awfully bad (all over red-in-red pictures).
because the color recognition was awfully bad (all over red-in-red pictures).
The 2nd cam I got in exchange couldn't be recognized by NxtCamView via USB at all. Both meanwhile have been returned to mindsensors for refund.

But moreover the image processing speed was very slow- too slow for object detecting while driving around.

I'd wish there were some blob patterns already to be downloaded to the cam - sth. like the old Vision Command patterns (1 centered circle, or 5 circles arranged in a line, ore 8 in a block, which all easily can be programmed to light-, color-, or movement recognition; the NxtCamView was too complicated to me) .

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Last edited by Ford Prefect on Tue Mar 18, 2008 1:46 pm, edited 1 time in total.



Mon Mar 17, 2008 6:37 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Jan 31, 2007 3:39 am
Posts: 299
Location: San Diego, California. USA
Post 
The camera is red saturated because the camera can detect the visible and the infrared spectrum. To eliminate the infrared spectrum, you will have to use a IR filter that only lets Visible light through. This makes the color detection of the camera much better, and it is no longer all red saturated.

Hope this helps B-)

_________________
Mmmm Legos B-)

My Robot Projects:
http://www.freewebs.com/robotprojects/


Mon Mar 17, 2008 3:56 pm
Profile WWW
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post 
no, the images were over and over red in red.

Image

I'm sure the cam was faulty, although Mindsensors claimed it had been bad focussing (?)

BTW, the substitute was faulty too, but this one could even not been detected by NxtCamView ar the virtual Com port.

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Last edited by Ford Prefect on Sun Mar 30, 2008 10:19 am, edited 1 time in total.



Mon Mar 17, 2008 4:46 pm
Profile
Rookie

Joined: Tue Jan 22, 2008 3:22 am
Posts: 8
Location: Australia
Post 
Hi,

Well the camera is now working and it was the problem with the arrays as i had thought. I just replaced the type def arrays with individual int arrays and the sample programs seem to work fine.

My camera does have the redness that starwarslegokid and Ford Prefect were talking about and i was wondering where i could buy or how i could make a cheap IR filter.

Thanks,
Shan Piete


Fri Mar 28, 2008 10:15 pm
Profile
Rookie

Joined: Tue Jan 22, 2008 3:22 am
Posts: 8
Location: Australia
Post 
Hi,

Another question - has anyone been able to use the camera in line following mode - i tried using it today and it doesn't seem to be working. I have set the camera to line following mode though NXTCamView and set camera to linefollowing mode in the code thought the regestries too but this just stops the program from working.

Would greatly apprecialy any help or a guess

thanks,
Shan


Fri Mar 28, 2008 11:15 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Jan 31, 2007 3:39 am
Posts: 299
Location: San Diego, California. USA
Post 
I haven't done it, but there are some videos of users making line following robots with the camera, and they work very well. The video shows that they changed the mode using NXG block, maybe this will work?

Scott B-)

Line following videos
http://nxtasy.org/2008/03/19/nxtcam-videos/

_________________
Mmmm Legos B-)

My Robot Projects:
http://www.freewebs.com/robotprojects/


Sat Mar 29, 2008 12:49 am
Profile WWW
Rookie

Joined: Tue Jan 22, 2008 3:22 am
Posts: 8
Location: Australia
Post 
Hi,

Thanks for the help. I still can't get the linefollwer mode working but i've worked out a way so i don't need it. It is still problem that needs solving so if anyone knows how to change the mode it would be good to post it so others having similar problems are helped. :D

Thanks,
Shan


Tue Apr 22, 2008 11:35 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 12 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.