| Nowadays,industrial cameras and home cameras have been widely applied and developed.The clearness and resolution of the collected videos and images is becoming higher and higher,which brings greater challenges to the storage and transmission of videos and images.Traditionally,the Bayer image is firstly transformed to the RGB format in the camera side.And then the RGB image is compressed and processed(including brightness correction,geometric correction,lossy compression,digital anti shake,etc.).However,due to the increasing demand for ultra-high definition images,the amount of Bayer image data is huge,which poses a severe challenge to the limited memory space of the image processing chip inside the camera.Therefore,a lossless compression algorithm of Bayer image is designed,which enables the image processor inside the camera to decode and process image at the same time,thus greatly reducing the memory consumption of the camera.In addition,because there are particles in the sky such as fog and dust.When people use cameras to collect images and videos,they will directly lead to blurred images and poor quality.Based on this,Kaiming He proposed an image dehazing algorithm based on the dark channel prior.But the performance of this method is not well enough when there is a large sky area in the image.Based on this,we propose an image dehazing algorithm based on sky region segmentation and dark channel prior for foggy image which owns a large area of sky.The compression of Bayer format image is divided into the encoder and the decoder.In the encoder,an Bayer image is first divided into suitable image block based on image resolution;then the image blocks are predicted based the best prediction mode.Then the differences between the original value and the predicted value of a block is encoded by Huffman encoder,while the best prediction modes of the block are encoded by Golomb encoder so as to generate the bitstream.The decoder works as an inverse procedure of the encoder.Experimental results demonstrate that this kind of algorithm of Bayer images can not only improve the compression efficiency,but also reduce the processing time.For images that contain large area of the sky,we firstly identifies the sky area and non-sky area;then determine the transmittance of the sky area and non-sky area,and make a fine on the transmittance guide by the improved filter algorithm,to some extent reduce the image edge to appear after dehazing.The experimental results show this algorithm can significantly improve the fog removal effect.Specially the sky area's dehazing effect is more natural,and the edge of the scene is clearer. |