To answer this question we need to remember what a perfect flower and an imperfect flower is, a perfect flower is one that has both reproductive organs feminine and masculine regardless of the other structures (tepals, sepals, etc), meanwhile, an imperfect flower lacks one of the reproductive organs either be feminine or masculine, regardless of the other structures.
In the diagram the flower depicted even wen lacks sepals and petals is perfect as it posses gynoecium (feminine) and androecium (masculine)