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 # 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.

Python, Programming

  • Category:- Python
  • Reference No.:- M92016719

Have any Question?


Related Questions in Python

Question a software company sells a package that retails

Question : 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 usi ...

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 ...

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 ...

Sieve of eratosthenes in pythonthe goal is to find all the

Sieve of Eratosthenes (in Python) The goal is to find all the prime numbers less than or equal to some natural number maxn. We have a list that tells us if any of the numbers 0..maxn are "marked". It can be an array of b ...

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 ...

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 ...

Project reconnaissance and attack on ics

Project: Reconnaissance and Attack on ICS NetworksEnvironment Setup The second mini project will be based on Industrial Network Protocols, specifically the Modbus protocol. Please follow the instructions carefully to set ...

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.

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 ...

  • 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