Compact, adaptive and discriminative spatial pyramid for improved scene and object classification