Monday, July 30, 2018

Have you ever wondered whether we need to upgrade the format of our images from ,jpg to say something newer ? Images typically store RGB values per pixel. The file itself may have a small metadata attached that gives some information about the image.  That's all we have to go with. Image processing algorithms try to use the data directly and work with it. This is very different from most metadata based query processing systems. Since the processing is based directly on the data, there is very little information to go with except the RGB value.
Instead if there can be an additional dimension to each pixel such that we not only store the color value but also depth information in the image and an irrefutable authority of the pixel, then we have a lot more to go by. Images taken first hand from devices might have this value. Images that are touched and saved again may have a different value. Recently, there have been newer algorithms that can detect whether there are tamperings to images. However, these can be significantly improved if there is additional data per pixel. Images like files may come with some metadata such as timestamps and versions but they could do a lot more such as publisher information, CRC check, timestamp, unique universal identifier and device to image mapping on the file. These then provide much more information to the image processing algorithms.
Storage has never been a concern for images. Although JPG formats are savvy about storage, devices and cameras have been pushing for higher and higher resolution. The only thing that has not improved on a per pixel basis is the RGB coding associated with the pixel. Instead if this could be a vector with other dimensions, an image may speak more eloquently than ever before. While we may not be able to change erstwhile file formats, we can certainly generate newer file formats. This means we continue to work with existing image formats without any disruption while leveraging the benefits from newer file format. I also want to separate the encoding from the data captured. The file format is essentially a manifestation of the data captured. In this regard, the JBIG and JBIG2 are file formats that encode the bi-level images in newer ways but. The providing of additional data is independent of the encoding. If we capture more information on the pixels, we can certainly improve not just the encoding, the processing but also the information that we can revisit later.
The class of operations on images usually work with pixel blocks. In the case of binary images, these are 3 x 3 blocks. Since we are looking to record information additionally per pixel, we can also progressively connect information between pixel groups at the time of storage. Processing offloaded to image capturing devices will result in massive information capture at little or no cost to capturing time. Thus the entire image processing field of study could benefit with more information from the images.
#codingexercise
Check if a number has the same count of set and unset bits.
boolean hasEqualSetAndUnsetBits(int n)
{
    int set = 0;
    int unset = 0;
    while (n)
    {
        if (n & 0x1) {
             set++;
        } else {
             unset++;
        }
        n = n >> 1;
    }
    return (set == unset);
}
If we were to start with fixed length binary representations then we only need to count one of them.

No comments:

Post a Comment