Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Python Expert

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

Python, Programming

  • Category:- Python
  • Reference No.:- M92017565
  • Price:- $150

Guranteed 48 Hours Delivery, In Price:- $150

Have any Question?


Related Questions in Python

Quesiton write a python script that counts occurrences of

Quesiton: Write a python script that counts occurrences of words in a file. • The script expects two command-line arguments: the name of an input file and a threshold (an integer). Here is an example of how to run the sc ...

Simple python traffic lightswrite a program that simulates

Simple Python (Traffic lights) Write a program that simulates a traffic light. The program lets the user select one of three lights: red, yellow, or green. When a radio button is selected, the light is turned on, and onl ...

The second task in this assignment is to create a python

The second task in this assignment is to create a Python program called pancakes.py that will determine the final order of a stack of pancakes after a series of flips.(PYTHON 3) Problem Task In this problem, your input w ...

Question write a python program with a graphical user

Question: Write a python program with a graphical user interface that will allow a user to create a custom pizza which they wish to order. At minimum, the user should be able to choose the size of the pizza, the type of ...

Question research pythons dictionary data type dictdiscuss

Question : Research Python's dictionary data type (dict). Discuss its interface and usage. Include examples. Discuss practical applications of dictionaries.

Learning outcomes lo3 - research develop and document a

Learning Outcomes LO3 - Research, develop, and document a basic security policy, and analyse, record, and resolve all security incidents LO4 - Identify and assess the threats to, and vulnerabilities of networks Assessmen ...

A software company sells a package that retails for 99

A software company sells a package that retails for $99. Quantity discounts are given according to the following table: Quantity Discount 10 - 19 20% 20 - 49 30% 50 - 99 40% 100 or more 50% Write a program using python t ...

Questionwhat is a python development frameworkgive 3

Question What is a python development framework? Give 3 examples python development framework used today. and explain which development framework is used in which industry.

In this programming assignment you will write a client

In this programming assignment, you will write a client pingprogram in Python. Your client will send a simple ping message to a server, receive a correspondingpong message back from the server, and determine the delay be ...

Architecture and system integrationcase study queensland

Architecture and System Integration Case Study: Queensland Health - eHealth Investment Strategy After evaluating various platforms, Queensland Health finally decided to adopt a Service Oriented Architecture (SOA) for its ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As