You’re on the right track. The problem with this code is that it is checking for a custom field instead of a featured image.

try this:

<?php
if (has_post_thumbnail()) { //if a thumbnail has been set
$imgID = get_post_thumbnail_id($post->ID); //get the id of the featured image
$featuredImage = wp_get_attachment_image_src($imgID, 'full' );//get the url of the featured image (returns an array)
$imgURL = $featuredImage[0]; //get the url of the image out of the array
?>
<style type="text/css">
.header-image {
border:none;
color:black;
background-image: url(<?php echo $imgURL ?>);
}
</style>
<?php
}//end if
?>

your theme (or at least the link) does not have an element with the css class .header-image

to add this ‘featured background image’ to the post title, apply the coding possibly on .single .post-title (this restricts it to single posts) and also add some formatting for the background position and repeat;