User:Yuds16/sandbox

Perceptual Hashing
Perceptual Hashing, also known as image hashing, is an algorithm that allows computer machines to generate a digital fingerprint of various forms of multimedia using hash functions. With a database of such items, it could be used in digital forensics in order to detect cases of copyright infringement or plagiarism. An example would be if an image has been applied a different watermark on it or it was resized or applied noise on, this algorithm should be able to detect that the image is of the same source. Along with this use, storing media in this format is also better in terms of computer resources. The fingerprint generated by this algorithm is effective in detecting if 2 different media contents are similar enough by using differential methods. The effectiveness of the algorithm would depend on the type of hashing method that would be used to process the image, along with other processes. Different approaches to perceptual hashing algorithm that is both more effective and efficient is still being researched upon.

Description
Going deeper into perceptual hashing, since a majority of this topic pertains to images, it relates closely to computer vision, then following it hashing. Computer vision is about how a computer processes and views an image, since it is not the same as us humans do. It involves algorithms to process the image and then read the image pixel by pixel in order for the computer to detect patterns. Hashing is about generating a code that is unique to a specific input. Hashing involves performing specific operations onto the input, and the hashing function and process may differ depending on use. An example of the use of hashing is a hash table, which is a data structure to store data. Unlike cryptographic hash function which its main purpose is for security purposes hence it cannot be inverted back to its original input, perceptual hashing focuses on content identification which involves breaking down the media content into parts to be processed and then generate an output out of it that is distinct.

Perceptual hashing, being a combination of these 2 fields, makes use of image processing to make it readable by the computer and then pass it through a hash function to output a hash code. Generating a media fingerprint being one of the main purposes and application of this algorithm, it is important for the algorithm to yield results that are both at an acceptable level of robustness and discrimination. Robustness and discrimination are terms that are often used in computer science to signify properties of either an algorithm or dataset. Robustness signify that the program is not susceptible to errors, and in the case of perceptual hashing, it refers to the algorithm being able to yield the same resulting output for an image even if noise, rotation, resizing, and other factoring methods have been applied to it. Discrimination on the other hand, is used to signify that the algorithm or program would be able to generate an output that is different and completely unrelated to one another if 2 inputs are of different content. An algorithm that would be considered effective would be algorithms that can detect similarity in images even when some edits have been applied on the image. Modifying on the approach to perceptual hashing on the computer vision field where the image is being processed to be read by the computer machine, or the hash function where the output is produced, are the only changes that could affect the output. However, the method of differentiating 2 images also affects whether the output of individual images could be compared affectively or not. In conclusion, it is a combination of these 3 factors that would determine the effectiveness of different approaches to perceptual hashing.

Image Processing
Similar to any computer vision, the first process is to convert the image to grayscale for easier processing. By using a grayscale image, the intensity of the shade of the colors would be the only factor rather than having to process the RGB color model which would increase the time complexity. This grayscale image then could be read in a range of 0 to 255, depending on its intensity. These intensity values are stored in a table like entry, corresponding to the image pixel coordinates. Grids are also often used in different computer vision methods in order to group different areas of the picture together. Feature extraction algorithm is then run on the image to scale the image so that the important part of the image would be the one that gets processed. This increases performance of the algorithm since the dimension of the image is smaller and this also ensures that 2 image with the same content could be compared effectively.