1. A tyre shape inspection method for inspecting defect in a sidewall surface of a tyre under inspection, by using an image of a sidewall surface of a sample tyre having the sidewall surface in which uneven marks are formed, the method comprising: a teaching operation step; and an inspection operation step, wherein the teaching operation step comprises: a mask image generating step of detecting boundary lines which are contours of the uneven marks, in a sample original image which is a two-dimensional image of the sidewall surface of the sample tyre, and generating a mask image showing positions of the boundary lines; and a height offset image generating step of generating a height offset image which shows a height of the uneven marks, the height offset image being obtained by, in use of a plurality of discrete height threshold values, classifying a height of regions in the sample original image which remain after excluding regions corresponding to the positions of the boundary lines shown in the mask image, and the inspection operation step comprises: a difference processing step of excluding the uneven marks from an inspection image which is a two-dimensional image of the sidewall surface of the tyre under inspection to generate an unevenness-excluded image, by subtracting the height offset image from the inspection image; and a shape defect inspecting step of inspecting the shape defect in the sidewall surface of the tyre under inspection, on the basis of the unevenness-excluded image, wherein, in the height offset image generating step, the following steps are performed using the sample original image, the mask image and the plurality of discrete height threshold values set in respect of the uneven marks: (I) extracting, from the mask image, line data corresponding to one line data in the sample original image along a tyre circumference direction of the sample original image; (II) respectively setting regions demarcated by the boundary lines shown by the line data extracted from the mask image, on the one line data in the sample original image, as one label region; (III) setting a label region which is longest in the circumference direction, of the plurality of label regions, as a height offset value calculation start region, or setting a region having the largest surface area, of the regions demarcated by the boundary lines shown by the mask image, as a height offset value calculation start region; (IV) determining a height difference between label regions in a region pair comprising mutually adjacent label regions, in the plurality of label regions which are aligned sequentially from the calculation start region, the height difference being determined successively for each region pair starting from a region pair including the calculation start region; and (V) setting a height threshold value closest to the height difference of each region pair, of the plurality of discrete height threshold values, as a height offset value for the label region which is posterior in the alignment sequence of the pair of label regions which constitute each region pair, the height offset image being generated by repeating the steps (I) to (V) in respect of all of line data in the sample original image.