I can do 2d collision detection of boxes and circles ,but I have a question . How can I do collision detection in this situation (1,2).I am using libGDX game engine for creating games.

Fixture (1) in your world should most likely be a ChainShape. ChainShapes are determined by an array of Vector2 objects, the more you have, the smoother the ChainShape tends to be.
Without very tedious scripting, making a fixture from an image is done by putting vectors at relatively close points to make a shape that looks similar to the image.
Further information on how to create a ChainShape can be found here.
Texturethat fits thePolygon. Posibly theTextureis a simple square and it is stretched regarding the hight of the current area. So both, the polygons and the view depend on this variable height, which could be generated randomly. - Robert P