Create a luminance (grey) histogram for a picture

Assignment Help Python Programming
Reference no: EM131262792

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 # vaues). 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: EM131262792

Questions Cloud

Determine the actual speed and size of the pump : A pump is required to move water at 2900 gal/min against a head of 200 ft. The approximate rotational speed is 1400 rpm. Using the appropriate dimensionless performance curve in the text, determine the actual speed and size of the pump to operate ..
Full range leadership development behaviors : Respond to the question in 300 words. How can you use Full Range leadership development behaviors to engage customers in design, product testing, enhancement ideas, using the company's internet website?
Analyze differences between endotherms and exotherms : Differences between endotherms and exotherms. Definition and examples of epithelial tissue. Definition and examples of connective tissue.
Summarizes certifications and continuing education : Write a 700- to 1,050-word paper that summarizes certifications and continuing education that would be appropriate for a professional role in a hospital or other applicable health care setting.
Create a luminance (grey) histogram for a picture : 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
Building the motivation of trainees before : Describe a number of ideas for building the motivation of trainees before and during a program. What suggestions would you offer for ensuring that trainees are motivated to transfer their skills after they leave the training and are back at their ..
Roles of top management and middle managers : Describe the respective roles of top management and middle managers in the development of each of the following planning documents:the strategic plan - annual report - major project proposal - due diligence review.
Identify major historical developments in world cultures : Clearly state in your own words the "surprise ending" in the reading you selected. Clearly identify the point in the reading when you realized that there were elements in the reading that surprised you. Not all of the surprises come at the end.
Most susceptible to content adjacency : What kinds of websites are most susceptible to content adjacency? Are news sites? Why or why not? What sorts of technical features might act as breeding grounds for content adjacency problems?

Reviews

Write a Review

Python Programming Questions & Answers

  Write a program to that displays a table

Write a program to that displays a table of the Celsius temperatures 0 through 20 and their Fahrenheit and Kelvin equivalents

  Implement your algorithm in python

Write a Python program that, for every transaction, takes input on the customer ID and the total sale amount in the transaction.

  Write a program that generates two integers

Write a program that generates two integers under 100, show them on screen, and prompts the user to enter the sum of these two integers. The program then reports true if the answer is correct, false otherwise.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Write a python program to demonstrate a theme for your robot

Write a Python program to demonstrate a theme for your robot. Your team must think of something fc your robot to do using the sensors and/or motors.

  The initial number for generating the sequences

Then, after the functions, read in the initial number for generating the sequences. Here, check that it is a positive integer. If it is not, give an error message and exit the program.

  Make a python program that uses the getcwd

Make a Python program that uses the getcwd() function to provide a string of the current working directory. Save the string in the variable current folder and display the value.

  Program to do the enciphering

Write a program to do the enciphering. It should prompt the user for a message, and print out both the entered message and its corresponding ciphertext.

  Fill in the python code

Fill in the Python code to play Tic Tac Toe. I won't award points unless it runs succesfully. # Tic-Tac-Toe Game def drawBoard(board): # Draws the board using the list of numbers print(" ") print(" ",board[0]," | ",board[1]," | ", board[2]) print("--..

  Write a program using python to implement a password cracker

Write a program using Python to implement a password cracker for Linux. You should utilize a dictionary (small - English) to crack the password.

  Project- add time and object interaction to the simulation

Project: Add Time and Object Interaction to the Simulation. Bring the simulation to life with simulated time and object interaction. Illustrates the alternative flow of control for errors provided by try/catch in place of returned error codes

  The block of statements below the line of stars

The block of statements below the line of stars is where I need help correcting. The true line that needs to be corrected is p = add((getX(k),getY(r))), it needs to give points of the path using the block of information. I have somthing which I kn..

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