The year 2012 has been full of surprises, from Apple soaring to new highs daily to a virtually uninterrupted market rally that is worrying many investors. Since the start of the year, the S&P 500 is up an astounding 12%.

At times like these, prudent investors take a moment to reflect, because favored stocks have a funny habit of going out of favor, sometimes for extended periods. And those underappreciated stocks that didn't keep up with the market's rally? They come to offer solid values and a good opportunity to profit.

Continue reading and I'll give you three unappreciated stocks that I'm buying as fast as I can in 2012. Two pay sizable dividends and the third is a hidden cash generator that cranks out its own fair-size dividend. These are great picks to do well over the next two or three years. In fact, I'll be adding more as soon as the Fool's Rules permit.

1. Regis Corp. (NYSE: RGS)
The performance of Regis' stock over the past five years is uglier than a $3 haircut, but that's why we have a great opportunity. Regis owns various hair salons, including Regis, Super Cuts, and Master Cuts. The company suffered from bloated middle management, and its executives never met a deal they didn't like, completely wasting shareholder capital for years on bungled investments.

That has changed. In October, activist investor Starboard Capital won a proxy fight to turn around Regis, putting three of its members on the board of directors. That was just the opening. Earlier this year, the CEO-elect resigned, as did the COO, and you can bet that new management will be aligned with Starboard. Plus, Regis has cut its management ranks and is working to sell off its non-core assets, such as its international operations, its hair restoration business, and a chain of beauty schools.

That's great, because those businesses obscure the real cash generator at the heart of Regis -- its North American operations. That unit requires little capital investment and produces a ton of cash, something on the order of 25% free cash flow margins, according to Regis. The cost-cutting should show the true earnings potential of the company, and the asset sales should leave it with a pile of cash, perhaps half its market cap (just $1 billion now). The market hasn't caught on to this yet, so I'm buying now.

2. Retail Opportunity Investment Corp. (Nasdaq: ROIC)
Retail Opportunity Investment Corp., or ROIC for short, operates as a value investor's dream, buying distressed commercial real estate at bargain-basement prices. CEO Stuart Tanz steers this ship, snatching up deals on the East and West coasts. He focuses on properties in more affluent areas with a high-traffic tenant as an anchor, for example, a grocery store or drugstore. He then boosts the property's value by reinvesting in it and improving occupancy and ultimately selling to, ahem, less price-sensitive buyers.

Tanz has done this dance before. As CEO of Pan Pacific Properties until 2006, he earned early investors nearly 800% in just 10 years after selling the company to Kimco Realty. That's probably the endgame at ROIC, too.

But in the meantime, dividend investors should rejoice. This small REIT -- just a $600 million market cap -- already provides a sizable dividend, at 4%, and it's committed to paying 70%-80% of funds from operations out to investors. Its size also means it can grow relatively quickly.

3. Brookfield Infrastructure Partners (NYSE: BIP)
Brookfield Infrastructure has what I like in a stock: a cheap valuation with a mission that most people find more boring than chopping wood (one of the things that Brookfield actually does). It trades at just eight times earnings and offers a 5% yield. While it's bigger than ROIC and Regis, its $4 billion market cap still falls below the radar of many big investors.

Brookfield offers a great play on diverse infrastructure assets across the world. It owns stakes in timberland, railroads, ports, power transmission assets, and coal terminals -- all the necessities to keep a modern global economy running. And that's the appeal. Brookfield invests in high-quality assets that have high barriers to entry. These assets offer annuity-like income streams with the chance for capital appreciation, too.

The company is on the hunt for value-priced assets. Last year it snapped up two Chilean toll roads. In 2010 it acquired Australia's Prime Infrastructure, which many investors saw as a very smart buy. That's the type of value-creating purchase that will allow the company to achieve its total return goal of 12% to 15% annually and meet its payout growth target of 3% to 7% per year. That means more money in your pocket along with the safety of Brookfield's hard assets.

Foolish bottom line
These are the type of underappreciated stocks that I like to load up my portfolio with, and I'll be doing just that as soon as I can. They're small caps or mid caps that the market just hasn't caught on to yet. If you'd like more ideas like these, the Motley Fool Hidden Gems team has identified two small caps that are too small to fail. If you'd like free access to these two companies that "the government won't let go broke," just click here.