try with +distort and -layers merge
convert backgroundimage \( trial.jpg -matte -virtual-pixel transparent
+distort Perspective "0,0 335,945 0,1127 292,1499 1539,1127 1208,1229 1539,0 1208,399" \)
-compose over -layers merge background_trial.png
this assumes you want to overlay the perspective on a background image and your control points are picked appropriately from the corresponding locations in both images.
see although a complex example
http://www.imagemagick.org/Usage/distorts/#box3d
Here is example code that was used recently to create the image at
http://www.imagemagick.org/script/index.php (though the image was flipped horizontally afterwards in this case)
picture="mona_lisa.png"
# get picture corners clockwise from top left
width=`convert $picture -ping -format "%[fx:w-1]" info:`
height=`convert $picture -ping -format "%[fx:h-1]" info:`
p1=0,0
p2=$width,0
p3=$width,$height
p4=0,$height
# measured desired corresponding wizard drawing points
w1=298,488
w2=431,472
w3=497,590
w4=370,616
# combine control points
points="$p1 $w1 $p2 $w2 $p3 $w3 $p4 $w4"
echo $points
# process picture in perspective and overlay on wizard
convert wizard_template.png \
\( $picture -channel rgba -alpha set -virtual-pixel transparent \
+distort perspective "$points" \) \
-compose over -layers merge wizard_mona_lisa.png
If this is not what you need, then please post links to your images and explain the result you want.