Certainly not rosemary (which is a member of the lavender family). But it certainly looks like a lavender. Rosemary has almost needle like leaves and doesn't smell like aniseed (I speak as a darn good cook not a darn good gardner).
If the leaves smell like aniseed then it is certainly a herb but is not the classic dill type with feathery type leaves, or even basil with broad leaves. So let's settle for a lavender. Which one, I leave to better gardners. (But not better cooks). Don't forget that lavender was originally grown as a herb. Bit strong for modern taste.