An in-vehicle device, comprising: - an image acquisition unit configured to acquire an image photographed by a camera including a lens; - a storage unit; - a dirt detection unit configured to detect dirt on the lens on the basis of the image acquired by the image acquisition unit and to store dirt region information indicating a region where the dirt exists in the image into the storage unit, wherein the dirt detection unit includes a first dirt detection unit to detect a water drop and a second dirt detection unit configured to detect mud, wherein the first dirt detection unit is configured to store the detected water drop as first dirt region information into the storage unit, and the second dirt detection unit is configured to store the detected mud as second dirt region information into the storage unit; - a dirt removal information generation unit configured to monitor the dirt region information stored in the storage unit and to generate dirt removal information indicating a region where the dirt on the lens is removed; and - a rewriting unit configured to rewrite the dirt region information on the basis of the dirt removal information, a first monitoring unit configured to generate first dirt removal information on the basis of the first dirt region information, a second monitoring unit configured to generate second dirt removal information on the basis of the second dirt region information, wherein the in-vehicle device is charaterized in that a table storage unit is configured to store an elimination relation table in which a first condition for rewriting the first dirt region information and a second condition for rewriting the second dirt region information are stored, wherein the rewriting unit is configured to rewrite the second dirt region information on the basis of the second condition described in the elimination relation table and the first dirt removal information, and to rewrite the first dirt region information on the basis of the first condition described in the elimination relation table and the second dirt removal information. - an image acquisition unit configured to acquire an image photographed by a camera including a lens; - a storage unit; - a dirt detection unit configured to detect dirt on the lens on the basis of the image acquired by the image acquisition unit and to store dirt region information indicating a region where the dirt exists in the image into the storage unit, wherein the dirt detection unit includes a first dirt detection unit to detect a water drop and a second dirt detection unit configured to detect mud, wherein the first dirt detection unit is configured to store the detected water drop as first dirt region information into the storage unit, and the second dirt detection unit is configured to store the detected mud as second dirt region information into the storage unit; - a dirt removal information generation unit configured to monitor the dirt region information stored in the storage unit and to generate dirt removal information indicating a region where the dirt on the lens is removed; and - a rewriting unit configured to rewrite the dirt region information on the basis of the dirt removal information,