Create a luminance histogram

Assignment Help Python Programming
Reference no: EM131261941

In this activity, you will create a \"luminance (grey) histogram\" for a picture # chosen by the user. A luminance histogram is created by counting how many # pixels are there for each level of luminance and then by drawing a chart (typically # a bar chart) showing \"how popular\" each luminance value was in the image. # Please check Google Images for examples. # There are many ways to approach this. Here\'s the suggested approach (feel free to # follow your own as long as yours is functionally the same or better): #

1. Create a list of 256 integers as follows: # histogramData=[0]*256 #

2. Go through each pixel of the image and at each pixel: #

2.1: Calculate the luminance \"lum\" of that pixel (i.e. the average of RGB # values). This value would be an integer between 0-255. #

2.2: Increment the value in the list at position \"lum\" by 1. #

3. The previous step will generate the data necessary for the histogram. You # must now create an empty image for the histogram. It should be 256 pixels # wide as there are only 256 unique levels. The height of the histogram should # be tall enough to fit the largest value in the histogramData list. You can # manually estimate what the height at first but later you can think about # making the height dynamic to different pictures\' histograms. #

4. Go through the histogram list and for each item, draw a line (i.e. a bar # in the bar chart) whose height corresponds to the value of the item # in the list. # The lines should start from the bottom of the image. The x coordinates of # each line will correspond to the list element\'s position. E.g. list item at # position zero will have its line drawn at x zero in the histogram.

Reference no: EM131261941

Questions Cloud

Select a half dozen or so countries : Select a half-dozen or so countries with which you are unfamiliar, and research basic geographic information about them.
Reflect on the traditional forms of architecture : Reflect on the traditional forms of architecture and assess how they contribute to what you observe, feel, think and do in these spaces.
Moore electronic sells automated lighting for airport runway : Write a brief paragraph on what this statute contains that relates to Moore's dilemma. Some American executives think this law causes American corporations to suffer a competitive disadvantage. Do you agree? Why or why not?
How can marketers use sensory marketing to their advantage : Please do some research on sensory marketing and explain what it is. Based on what you have learned so far in class, how can marketers use sensory marketing to their advantage? Please provide two examples of companies that have used sensory market..
Create a luminance histogram : In this activity, you will create a \"luminance (grey) histogram\" for a picture # chosen by the user. A luminance histogram is created by counting how many # pixels are there for each level of luminance and then by drawing a chart (typically # a ..
Describe the way the sample was offered to the public : Describe the way the sample was offered to the public. Explain whether you purchased the product due to the coupon or sample and why. Finally state your evaluation of the product's promotion through sampling and coupons.
How should your company enter the global marketplace : Assume your company is or will be marketing globally. How should your company enter the global marketplace? How will international issues affect your firm?
Explain background information on how that problem developed : Describe background information on how that problem developed or came into existence. Show why this is a societal problem, and provide perspectives from multiple disciplines.
Discuss the nfls current strategy for global market entry : Discuss the NFL's current strategy for global market entry. How has this strategy changed and why did the NFL make these changes?

Reviews

Write a Review

Python Programming Questions & Answers

  Design and implement an english test

CSP1150 - Programming Principles - You are required to design and implement an "English Test" program in which the user is presented with a word and then asked to answer a simple question about the word. After 5 words, the program shows the user's..

  Write a python program that computes the mean, median, mode

How to write a python program that computes the mean, median, and mode?

  Calculate the average monthly private employment

Since the transition from one term to another occurs partway through January, the last year listed for any president is the same as the first year of the next president. Calculate the average monthly private employment for each political party.

  1 checking for a circle on a line by itself your program

1. checking for a circle. on a line by itself your program must either print is a circle yes or is a circle no

  Write a function rmduplic(l), where l is any list

Write a function rmDuplic(L), where L is any list. The function should return a list M that contains the same items as L, except that repetitions (duplicates) have been removed: only the first occurrence of each entry is kept (i.e., order is prese..

  Create a cheat commands in the game

Create a cheat commands in the game so player can pick up any item he wants from any location in the map - Display all possible actions you can carry out in game.

  Write a program that accepts as input a sentence

Write a program that accepts as input a sentence in which all of the words are run together but the first character of each word is uppercase. Convert the sentence to a string in which the words are separated by space and only the first word start..

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Function by sum of sines

code the program using an editor (DO NOT COMMAND LINE THE PROGRAM) and show the results

  Student record due smartsite thursday 1211 1155 pm file

due smartsite thursday 1211 1155 p.m. file names grading.py ltbrgtall prompts for input and all output must match my

  Write a function that takes as input an image object

Write a function that takes as input an image object, crops it to make it a square, and returns the resulting object. You must write a function to accomplish this.

  Design part of the code for the haunted house game

Create a cheat commands in the game so player can teleport to any location in the map - You are tasked with improving and designing part of the code for the Haunted House game.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd