Researchers have applied case-based reasoning to legal informatics in recent decades, yet real-world applications of case-based systems have been hampered by the need to manually create the case instances. To alleviate this problem, we propose algorithms for automatically generating and refining case instances from real-world judgment documents for criminal summary judgments. Our algorithms attempt to extract important legal information from the documents of past lawsuits to build case instances, and then refine these case instances by merging similar cases and removing relatively irrelevant information from the cases. Experimental results, obtained from applying the resulting cases to classifying real-world lawsuits, indicate that our algorithms are viable for assisting the task of building case databases for case-based legal reasoning systems.