Design of robust blind detector with application to watermarking