Refractive index is one of the most important physical parameters of the materials. Owe to its great influence on the working characteristics of an optical systems, high accuracy measurement is required. Many methods have been proposed such as the v-prism method, the minimum deviation angle method, and the interferometric method. However, for the restriction of the principle, the shape of the sample is required to be a parallel plate or a prism with a specific shape. The sample with only spherical or aspheric surfaces cannot be tested. In this paper, an improved Brewster method is proposed to measure the refractive index of optical materials with arbitrary shapes. Brewster law can be expressed as that the reflectivity of the P-polarized light approaches zero when it is incident in the Brewster angle, which is the inverse trigonometric value of the refractive index. In the original method, a parallel laser beam with P polarization is incident on the sample, and reflected by it to a photodiode to get the intensity. The minimum intensity position corresponding to Brewster angle can be found by changing the incident angle. The reflecting surface of the sample need to be planar to provide smooth reflective area with a size greater than the beam diameter. In the improved method, a laser probe focusing on the sample and an array detector are used instead of the parallel beam and the photodiode. The minimum intensity position can be found with image processing technology. Since the laser beam is focused on the sample, only a tiny area with a size of 10 microns for reflection is needed. Thus, whatever the shape of the sample is, the method can be used. In order to demonstrate the feasibility, samples with different shapes such as a prism, a parallel plate and a lens was tested, and the accuracy of the results could all reach the order of magnitude of 10-3.