The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 2 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
How to implement this problem in Assembly language?
// - This function takes in a square sized grayscale image and applies thresholding on each pixel.
// i.e. it should change pixel values according to this formula:
// 0xFF if x >= threshold
// 0x00 if x < threshold
// - The width and height of the image are equal to dim.
// - You are not allowed to define additional variables. //
void imageThresholding(unsigned char* image, int dim, unsigned char threshold)
{ __asm {
Â
Â
I‘fll'l 'Ij IITIflflE' IIII'EEI'IDICIEI'IHZ Image thresholding is a simple1 yet effective, way of partitioning an image into a foreground and
background. This image analysis technique is a type of image segmentation that isolates objects by converting grayscale images into binary images. An example of such conversion is shown below: l 3‘1 Lena.png Lena_binary.png Your task is to write the body of the threshold function that takes in an array of pixels of a grayscale image along with its dimensions and applies binary image thresholding on it. The input for this part is
a square sized grayscale image. For grayscale images. one byte is used to represent each pixel‘s intensity where the possible values range from mm to DxFF. In other words1 the image is stored in a 2D' anay where each element is a byte. Refer to the Mom on memory layout to learn how a 2D
array is stored in memory. Your function should replace the yalue of each pixel in the grayscale image with the maximum possible value {flxFE i.e. brightest yaluefr if the intensity [yalue} of that pixel is greater than or equal
to some constant T, or otherwise with the minimum yalue {DJ-tilt}, i.e. darkest yalue}. We use T=flxflfl
-----------