English 中文(简体)
如何与画面合作, 在不同点从寒冷变成热?
原标题:How to work with picture to change from cold to hot on different points?
  • 时间:2012-05-25 13:14:21
  •  标签:
  • c#
  • usb
  • image

Background:
I have a microcontroller with 13 sensors for pressure reading in a foot on these 13 different points. The value read from each sensor goes from 0 to 1023 and is stored, then I send a string that contains these values over USB to a C# program running on the pc side.

Question:
On the pc side program using C#, how can I put a foot picture and make it change on these specific 13 points from cold to hot according with the value that came from the USB? That way showing the pressure in specific parts of the foot. Where more pressure more hot, where less pressure more cold. Don t need to show numerical values for hot or cold.

USB通讯没问题,只需要照片处理

问题回答

你所要做的事情通常称为"http://en.wikipedia.org/wiki/Heat_map" rel=“nofollow” heatmap ,这样,如果你进一步研究这个术语,你可能会发现一些补充信息。

我看到你们的任务有三个基本步骤:

  1. Map the real-world sensor locations to pixel locations on a foot image (so you know which pixels to colour)
  2. Once you have read all the sensors, build the heat map by mapping the sensor value to a colour (I m assuming you want something like black at 0, bright red at 1023) and then do something like a linear interpolation between the sensor locations relative to each pixel.
  3. Blend the heat map value into the picture of a foot using alpha blending. You could also create a "heat map" bitmap image and just draw it on top of the foot image with a transparency set.

您可以使用 "http://msdn.microsoft.com/en-us/library/aa287582%28v=vs. 71%.29.aspx" rel = "nofollow" > this code 等方法写给位图。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签