First, you should say: I didn't notice what it was.
Second, you noticed (were aware) that a vegetable was in your sandwich, but you didn't recognise what it was.
Recognise suggests that you tried to identify the vegetable but were unable to, whereas didn't notice suggests that you didn't care and that the type of vegetable was unimportant to your story.
If you tried really hard to find out what sort of vegetable it was, you could use the word identify: ... I couldn't identify it.
Uncle M (not a teacher)
Interested in Language