PROBLEM TO BE SOLVED: To enable an image to be compression-encoded with a compression parameter capable of minimizing the influence of image quality deterioration on image analysis. SOLUTION: An input image is received, an image analysis is performed on the input image, a compression parameter is set according to a predetermined rule, compressed data is generated by compressing the input image according to the set compression parameter, and the compressed data is generated. Of the compression parameters that generate the decoded data obtained by decoding, perform the image analysis on the decoded data, and match the result of the image analysis on the input image with the result of the image analysis on the decoded data. Output the compression parameter with the highest [Selection diagram]【課題】画質の劣化による画像解析への影響を最小限に抑えることができる圧縮パラメータで画像を圧縮符号化することを可能にする。【解決手段】入力画像を受け付け、前記入力画像に対する画像解析を行い、圧縮パラメータを所定のルールに従って設定し、設定された前記圧縮パラメータに従って前記入力画像を圧縮した圧縮データを生成し、前記圧縮データを復号した復号データを生成し、前記復号データに対する前記画像解析を行い、前記入力画像に対する前記画像解析の結果と前記復号データに対する前記画像解析の結果とが一致する前記圧縮パラメータのうち、圧縮率が最も高い前記圧縮パラメータを出力する。【選択図】 図1