Help with Mathematica: Transforming Image Pixels to Natural Numbers

  • Mathematica
  • Thread starter Andreanne
  • Start date
  • Tags
    Mathematica
In summary, the conversation suggests that the person is trying to implement an encryption method described in a scientific article using the programming language Mathematica. They are seeking advice and guidance on how to understand and translate the code written in Delphi in the article. The expert suggests starting with simple tasks, such as encrypting a single number, and recommends finding a good introduction to Delphi to better understand the code. The expert also suggests reaching out to the author for a simple test case to verify implementation. They offer to help with any further questions or difficulties.
  • #1
Andreanne
2
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
  • #2
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.
 
  • #3
I have no experience programming in Delphi, in Mathematica I can only program simple things.

Thank you for your help.
 
  • #4
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:
  • #5


I would suggest using the "ImageData" function in Mathematica to extract the pixel values of the image. This will give you a matrix of numbers representing the color values of each pixel. From there, you can use the "Flatten" command to convert the matrix into a list of numbers. To associate each pixel with a pair of natural numbers, you can use the "MapIndexed" function to apply a function to each element in the list, where the function takes the position of the element in the list (which can be converted to a pair of natural numbers) as an argument. This will give you a list of pairs of natural numbers corresponding to each pixel in the image. I hope this helps in your transformation process.
 

What is Mathematica and how does it relate to image transformation?

Mathematica is a software program commonly used in scientific research and data analysis. It has built-in functions and algorithms for processing and analyzing images, including transforming pixel values to natural numbers.

Why would someone need to transform image pixels to natural numbers?

In certain applications, it is necessary to perform mathematical operations on images. Since pixel values are represented as numbers in an image, transforming them to natural numbers allows for easier manipulation and analysis.

What is the process for transforming image pixels to natural numbers in Mathematica?

First, the image must be imported into Mathematica using the "Import" function. Then, the pixel values can be accessed using the "ImageData" function. Finally, the pixel values can be transformed using built-in functions such as "Round" or "Floor".

Can image pixels be transformed to any type of natural numbers?

Yes, image pixels can be transformed to any type of natural numbers, including integers and decimals. The type of transformation will depend on the specific needs of the analysis being performed.

Are there any limitations or considerations when transforming image pixels to natural numbers?

One limitation to consider is that transforming pixels to natural numbers may result in some loss of information or precision, depending on the specific transformation used. It is important to carefully consider the needs of the analysis and choose an appropriate transformation method.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Programming and Computer Science
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
7K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
19
Views
4K
Replies
1
Views
920
Back
Top