Kaniadakis entropy is a kind of generalized entropy based on the $$ \kappa $$ probability distribution, which has a good ability to deal with the distribution of long tail. The image thresholding algorithm based on Kaniadakis entropy can effectively segment images with long-tailed distribution histograms, such as nondestructive testing image. However, Kaniadakis entropy is a generalized information entropy with parameter. How to choose appropriate parameter $$ \kappa $$ is a problem to be solved. In this paper, we proposed an adaptive parameter selection Kaniadakis entropy thresholding algorithm. Based on a clustering effectiveness evaluation index, we transform the parameter selection problem into an optimization problem, then use particle swarm optimization search algorithm to optimize it and finally obtain the segmentation threshold under the optimal parameter. The presented algorithm can adaptively select parameters according to different images and obtain the optimal segmentation images. In order to show the effectiveness of the proposed method, the segmentation results are compared with several existing entropy-based thresholding algorithms. Experimental results both qualitatively and quantitatively demonstrate that the proposed method is effective.