0

I'm trying to use the rudimentary Math Input Panel API with C# to load an image. However, it seems that the panel can only load ISF images (referencing this question). Does anybody know of a programmatic way to convert a PNG or any other image file to an ISF file? I'm guessing the ISF file would need to be black and white, but what else is there to do?

Community
  • 1
  • 1
mjkaufer
  • 4,047
  • 5
  • 27
  • 55
  • I have edited your title. Please see, "[Should questions include “tags” in their titles?](http://meta.stackexchange.com/questions/19190/)", where the consensus is "no, they should not". – John Saunders Apr 07 '14 at 03:08

1 Answers1

1

ISF is a vector format. Math Input Panel API also require strict stroke order for better symbol recognition. PNG is a raster image format, that don't contain any stroke-data(no vectors, no stroke-order). It's very easy to convert ISF to PNG, but reverse conversion is hard, and there no built-ins to do this.

To convert PNG to ICF must somehow convert pixels to vectors(write own little vectorizer using center-line tracing algorithm for example), and correctly order strokes in vector result(from upper-left to upper-right used used in most languages, except RTL like arabic).

rufanov
  • 3,266
  • 1
  • 23
  • 41
  • Could one simply create a bunch of mini-vectors, representing pixels instead? For instance, if I have five pixels in a group, simply make 5 vectors to act as a psuedo-stroke? And if I were to have a bunch of vectors in the first place, how would I convert these vectors to an ISF? – mjkaufer Apr 07 '14 at 14:23
  • As separate "vector dots"? No. This must not work, because most of input recognition applications(such as Math Input Panel) based on checking statistics about symbols(collected in real life handwriting sessions) about "what is angle of each stroke? how strokes close to each other? how they ordered?" - by using just "mini-vectors" you can't provide this information to MS MIP – rufanov Apr 07 '14 at 23:55