Help with Mathematica: Transforming Image Pixels to Natural Numbers

  • Context: Mathematica 
  • Thread starter Thread starter Andreanne
  • Start date Start date
  • Tags Tags
    Mathematica
Click For Summary

Discussion Overview

The discussion revolves around transforming image pixels into natural numbers using Mathematica, as outlined in a referenced scientific article. Participants explore programming challenges, particularly in relation to understanding and implementing code from the article, which includes Delphi programming aspects.

Discussion Character

  • Technical explanation
  • Homework-related
  • Debate/contested

Main Points Raised

  • One participant seeks assistance in transforming image pixels to natural numbers in Mathematica, having started with the command Flatten to create a set of pixels.
  • Another participant questions the original poster's programming experience in Delphi and Mathematica, suggesting that a lack of familiarity with either language could hinder progress.
  • A participant recommends finding an introduction to Delphi to better understand the code in the referenced paper, emphasizing the importance of grasping the encryption method described.
  • There is a suggestion to isolate a small part of the Delphi code that performs encryption, with the idea that starting with a simple task could facilitate learning and implementation.
  • One participant encourages contacting the author of the paper for clarification on a simple test case to verify the implementation, highlighting the importance of politeness in such communication.
  • There is a call for the original poster to post further updates on their progress and challenges after attempting to simplify the task.

Areas of Agreement / Disagreement

Participants express differing levels of experience with programming languages and the specific challenges of translating code from Delphi to Mathematica. There is no consensus on the best approach to proceed, as various strategies are suggested without agreement on a single method.

Contextual Notes

Participants note the complexity of the original Delphi code and the potential difficulty in isolating the encryption functionality. There is an acknowledgment of the need for foundational knowledge in both programming languages to effectively tackle the problem.

Who May Find This Useful

This discussion may be useful for individuals interested in image processing, programming in Mathematica, or those looking to understand encryption methods in the context of programming language translation.

Andreanne
Messages
2
Reaction score
0
Hi, I am trying to do a transformation on an image with the program Mathematica in the same way stated in the following scientific article :
http://arxiv.org/PS_cache/arxiv/pdf/0710/0710.0021v1.pdf
I would like to associate each pixel of the picture with a pair of natural numbers. I used the command Flatten and created a set of all the pixels of the image, then I don't know what else to do...
 
Last edited:
Physics news on Phys.org
Do you have any experience programming in Delphi so you can understand some of his 5 page program in the article?

Do you have any experience programming in Mathematica so you can implement simple things?

If you are lacking one or both of those skills then you might want to look for simple programming tutorials in the language you lack.

I don't see an obvious block of code which seems to be this-is-where-a-byte-is-encrypted. There is lots of fooling around with buttons and input and output, but I can't identify a tiny part of that which does the encryption that you could try to port to Mathematica. Perhaps someone else can see where that is.
 
I have no experience programming in Delphi, in Mathematica I can only program simple things.

Thank you for your help.
 
I suggest you find a nice introduction to Delphi, preferably a well written book. Learn enough about that to enable you to understand most of the statements in his five pages of Delphi code in his paper. You perhaps don't need to learn enough to be able to write programs in Delphi, just enough so you can understand programs someone else has written and gotten to run.

At the same time I suggest you try to understand enough about his non-code parts of the paper to roughly understand his encryption method.

While doing that perhaps you can sort through his code and see if you can identify and isolate a small part of the code that encrypts a single number or perhaps a single row of numbers.

If you can see how to separate all the stuff he has for buttons and input and output and I assume windows and other things like that then perhaps there may be only a page, or possibly even less, of code that actually encrypts a number. I'm always a fan of starting with the smallest possible task when doing something new. Can you correctly encrypt a single number? That would be an excellent start. I don't recall if he has a concrete example of encrypting a single number or a small row. If he has that then what you want to do is to be able to get exactly the same result he does. If he doesn't have that then (DO NOT tell him I sent you) try to contact the author and explain that you are just getting started and trying to understand and implement his code in a new language and you would really REALLY like to have an extremely simple first test case to verify your work. Perhaps if he is nice he will send you a paragraph of explanation and an unencrypted and encrypted list of numbers. That will be gold for you to use. Be REALLY polite when you contact this person and see if he will be nice to you.

Once you think you have simplified things down to just encrypting one number or one row and you can translate his Delphi into simple pseudocode the post another message with what you have done and what you don't understand and where you are stuck. Someone might be nice enough to provide you with hints then.
 
Last edited:

Similar threads

  • · Replies 0 ·
Replies
0
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
8K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 19 ·
Replies
19
Views
4K
  • · Replies 4 ·
Replies
4
Views
7K
  • · Replies 3 ·
Replies
3
Views
4K