Thanks for the replies guys, by now I have tried using a bright led and a photosensitive resistor and theres definitely some difference between white and black bricks but the problem is that it won't get those values when theyre close together due to the light being so spread. So right now I'm tempted to go with the RFID idea from JopieK.
Jopie do you have any documentation on how you implemented it or what parts you used, they would be very helpful in my process I believe.
Arjen thanks fro you reply on the tweakers forum aswell, you certainly have some nice stuff implemented in your track, already found out why my range was so bad, going to fix that asap but it's a matter of using different IR leds. Personally I work with PF trains so identification is crucial because I need to know which train I need to send a signal to, after I get identification right I think I can get some really cool things going.