Technological innovation has been one of the biggest catalysts for stock market growth over the last century, and that's unlikely to change anytime soon. For investors who back the right companies and allow growth trends and competitive wins to stack up over the long term, incredible returns are possible.

With that in mind, read on to see why two Motley Fool contributors think that buying these two stocks right now while they're still down significantly from previous highs looks like a good move.

Nvidia stock is a buy after taking a breather

Keith Noonan: Nvidia (NVDA -3.36%) is the company responsible for the advanced graphics processing units (GPUs) that are at the heart of the artificial intelligence (AI) revolution. It's also the market's most influential and intensely monitored battleground stock.

Even after a 14% pullback from an all-time high reached in June, the company's stock is still up roughly 136% in 2024. Spurred by incredible demand from large data center customers, including Microsoft and Meta Platforms, Nvidia's sales and earnings growth has been nothing short of incredible. But some investors also wonder how long the company can sustain its stellar sales momentum and margins.

With a market capitalization of roughly $2.86 trillion as of this writing, Nvidia's valuation has soared more than 2,480% over the last five years, and it stands as the world's third-most valuable company. There should be little doubt that it's a high-risk stock, but I also think that it's still one worth owning for long-term investors.

In the second quarter, Nvidia posted a gross margin of 75.1% -- down from the record margin of 78.4% it posted in Q1. The company also guided for a gross margin of roughly 74.5% in the current quarter. The company is still posting fantastic margins, but it's not unreasonable to think that the business's gross margin may have hit a peak for now. On the other hand, Nvidia's outlook remains very promising.

After growing sales 122% year over year in Q2, Nvidia expects Q3 sales to jump 79% compared to 2023's Q3. It also has a major performance catalyst on track to begin contributing in Q4 and then be an even bigger performance driver in the next fiscal year.

Nvidia will launch its next-generation Blackwell chips in this year's final quarter, and the hardware is poised to deliver major AI performance improvements and huge revenue for Nvidia. CEO Jensen Huang has said he expects the Blackwell processors to be the company's most successful products ever.

While Nvidia could price its Blackwell processors at levels that significantly boost gross margins, it doesn't necessarily have to go that route. The company is crushing the competition in the market for advanced GPUs and accelerators for AI, and a relatively small sacrifice on the margin front could help it secure advantages that shore up its long-term positioning in today's most important tech trend.

For long-term investors looking for ways to play AI trends, Nvidia stock remains a worthwhile portfolio addition.

The dip in Cognex's share price is an ideal buying opportunity

Lee Samaha: There's no way to sugarcoat the situation; machine vision company Cognex's (CGNX -0.99%) end markets are struggling in 2024. Still, much of that struggle is already reflected in the share price (down 60% from its all-time high). But long-term investors aren't buying stocks for a few quarters' earnings but rather for their long-run earnings potential.

Cognex and its machine vision solutions continue to have substantial growth opportunities. Using automated machine vision in manufacturing or logistics (such as e-commerce fulfillment) helps improve quality, consistency, efficiency, costs, and safety. It also creates digital information used in data analytics to improve processes.

Management sees its end markets growing at 13% annually for the next several years, with Cognex slightly outgrowing its markets by 15% annually.

Over the near term, Cognex is dealing with a lowering of growth expectations in two of its three key end markets: automotive and consumer electronics. Raised interest rates over the past few years dampened expectations for automotive sales this year, including electric vehicles (EVs), and Cognex's technology is utilized in EV battery production. Relatively high interest rates also challenged consumer discretionary spending (for example, on smartphones, where Cognex's machine vision helps layer screens).

The result is a dampening of growth prospects in 2024. Given that the company tends to report larger orders in the spring and summer (as its customers gear up for rising production in the fourth quarter), it's unlikely that Cognex will have overly positive newsflow on orders before the spring of 2025.

Still, these trends won't last forever, and a lower interest rate environment in 2025 could spur a release of pent-up investment spending in automotive and consumer electronics. Meanwhile, Cognex's logistics end market is already in recovery mode. That suggests that the weakness in the share price offers an ideal buying opportunity for a company with an excellent track record of growth.