Robert Shillman -- Chairman
Thanks, John. Hello, everyone. Thank you for joining us. And I hope it's still culturally acceptable to say happy Valentine's Day but if that offended anyone, I will immediately take responsibility for that and issue a dramatic apology.
Tonight, we reported record fourth quarter and full-year results from continuing operations for revenue, for net income, and for earnings per share. And as we expected and reported to you on our last call, our growth rate did slow at the end of 2018 because of slower spending by customers, particularly in China, and you'll hear more about that detail later in the call.
I'll now turn the call over to my partner, Rob Willett, who will provide much more detail into our 2018 results. Rob, the microphone is yours.
Robert Willett -- President and Chief Executive Officer
Thank you, Dr. Bob, and good evening, everyone. For 2018, we reported our ninth consecutive year of record revenue. This achievement follows a spectacular 2017 that included substantial investments by our customers in machine vision for OLED display and smartphone manufacturing.
We faced tough comparisons to 2017 when a few large customers scaled back their purchases in 2018. As a result, annual revenue grew by only 5% over 2017. However, if you exclude those customers, the increase was 18%, reflecting substantial contributions from the rest of our business.
Cognex performed well in a number of end markets, notably logistics and automotive. Our logistics business grew by more than 50% over 2017. With annual revenue surpassing $100 million, it has become a meaningful part of our business. The growth outlook for logistics remains strong. Cognex is now widely recognized as the technology leader for machine vision in this market and we are rapidly gaining market share.
In automotive, annual revenue grew by high single digits year-on-year, just short of our 10% long-term growth expectation for that market. Following two consecutive years of faster growth, the industry began to slow in the second half of 2018. Despite recent softness in this market, we see the potential for growth in the medium and long-term, as recent trends in the automotive industry drive significant changes in technology and automation.
In 2018, Cognex invested a record $116 million, or 14% of revenue, in engineering, marking our ninth consecutive year or RD&E growth. We believe that investing in engineering will keep Cognex on the leading edge of vision technology. In that regard, we launched several high-performing products during 2018.
VisionPro ViDi integrates the power of deep learning technology we acquired in 2017 into the Cognex VisionPro platform. It's now easier for sophisticated customers to use our deep learning techniques with our industry-leading vision tools.
Deep learning is one of the most exciting advances in our market in the past 20 years and Cognex is viewed as the leader in applying this new technology to industrial machine vision. Our deep learning-based image analysis software opens a new range of applications for Cognex where our traditional rule-based vision doesn't apply.
Our DataMan 470 Barcode Reader was the most successful product launch in Cognex history, in terms of sales generated within the first six months. This high-performance reader has been rapidly adopted in the logistics industry, as well as in general manufacturing.
The MX-1502ER broadens our vision-enabled mobile terminal family to include extended range reading. The MX-1502ER can read codes in quick succession from as near as six inches to as far as 30 feet, a capability that improves our position in the high-potential mobile terminal market.
In Q4, we introduced the 9000 Series of our industry-leading In-Sight smart camera, enabling ultra-high-resolution machine vision in an easy-to-use product.
In 2018, we added more than 350 cognoids worldwide. Most of these new employees were hired in sales and in engineering. Also of note, we successfully implemented our new SAP enterprise resource planning system, which provides a platform to scale our operations and understand our business with greater clarity as we approach $1 billion in annual revenue.
Turning now to key financial metrics, gross margin was within our expected range for 2018 but our success in the logistics market has required engineering to support to help customers get up and running. This support has been slightly dilutive to our overall gross margin and it is expected to continue to be in the first half of 2019. We consider this as a worthwhile near-term cost of winning share and introducing our leading-edge products to customers in the large, fast-growing logistics market. Our strategy for developing this market is similar to the one we used successfully in the factory automation market nearly 20 years ago. The downward pressure on our overall gross margin should ease as we move through the back half of this year.
Moving on to operating margin, our focus on the long-term led to investments during a slower growth year in 2018 that reduced Cognex's overall operating margin below the exceptional levels we saw in 2017. We believe that our long-term growth will be the result of our continued technology leadership and a larger salesforce.
Cognex Corporation (CGNX) Q4 2018 Earnings Conference Call Transcript -- The Motley Fool