Images of different gray levels

Source: Internet
Author: User

Conclusion 1: for images with more details, the gray level is relatively independent of sensory quality when the image size (N) remains unchanged;

Explanation: If the image details are large and the gray level is reduced, the visual perception is not much different.

Code compilation is relatively casual and performance optimization is not performed. Only observe the effect:

# Define K 1 // grayscale level # define STEP (256/(1 <K) int main () {// char name [50]; iplImage * image = cvLoadImage ("e: \ OpenCV_Image \ airplane.jpg", 0); // IplImage * result = cvCreateImage (cvGetSize (image), 8, 1 ); cvNamedWindow ("source image"); cvNamedWindow (""); cvShowImage ("source image", image); for (int I = 0; I <image-> width; I ++) for (int j = 0; j <image-> height; j ++) {int value = cvGetReal2D (image, I, j); int step = STEP; while (value> step) {step + = STEP;} value = step; cvSetReal2D (image, I, j, value);} cvShowImage ("transform", image ); // sprintf (name, "% s % d % s", "e :\\ OpenCV_Image \ airplane _", K ,". jpg "); // cvSaveImage (name, image); cvWaitKey (); cvReleaseImage (& image); return 0 ;}




The three images are original images, K = 1, 2, 3, 4, 5, 6, and 7, 8 from left to right (level 1 is a binarization image, level 8 is the gray scale of the original image)

Question: How can I evaluate the details of an image at the same resolution...

Images of different gray levels

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.