LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-06-2008, 02:16 AM   #1
pjpunnoose
LQ Newbie
 
Registered: May 2008
Posts: 19

Rep: Reputation: 0
image decoding


how do i recognise a character that is embedded on a .jpeg or an mpeg file
hoping that somebody will give me a correct answer
punnoose
 
Old 05-06-2008, 02:21 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Quote:
hoping that somebody will give me a correct answer
"correct"?? Is this homework?

Quote:
how do i recognise a character that is embedded on a .jpeg or an mpeg file
Depends on how the character was embedded.
 
Old 05-06-2008, 02:32 AM   #3
pjpunnoose
LQ Newbie
 
Registered: May 2008
Posts: 19

Original Poster
Rep: Reputation: 0
this is a work given to me by my company. i haveto decode a character given at a particular location on the screen how do i decode that
with regards
punnoose
 
Old 05-06-2008, 02:55 AM   #4
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Depends on how the character was encoded.

Sounds like a test. You employers want to know if you have the knowledge to figure this out? In which case, you need to understand character encoding and image formats.

For eg. a way to add a character to a bitmap would be to replace a particular pixel value with the character's ascii value. In the picture, it would appear as a single wrong pixel, lost in a high-res image.

You could extract it by zooming in on the image (without anti-aliasing) until individual pixels are visible, then using a color picker tool.

A more common way is to xor the string, suitably padded, to the binary of the image. You extract the plaintext with xor and the unadulterated image.

It is also possible to create a bitmap of the character at a suitable resolution - then odd it to the bitmap image, then compress the image. Nasty as jpeg compression is lossy.

My point here is that there are lots of ways of getting text into another file (image file in this case). If you have not been told how, then you will have to use your native wit, and your knowledge of the resources available to the people who made the image, to figure it out.
 
Old 05-06-2008, 04:18 AM   #5
brianmcgee
Member
 
Registered: Jun 2007
Location: Munich, Germany
Distribution: RHEL, CentOS, Fedora, SLES (...)
Posts: 399

Rep: Reputation: 39
http://en.wikipedia.org/wiki/Optical...er_recognition
 
Old 05-06-2008, 07:00 AM   #6
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Quote:
Originally Posted by brianmcgee View Post
Exactly - are we talking about a character drawn in the image at a particular x-y location - in that sence "embedded" or one of the other myriad methods available?

More information is needed.
 
Old 05-06-2008, 11:12 PM   #7
pjpunnoose
LQ Newbie
 
Registered: May 2008
Posts: 19

Original Poster
Rep: Reputation: 0
how do i encode this using coding in c++ please help me
with
pjpunnoose
 
Old 05-07-2008, 02:43 AM   #8
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Please answer the questions in the previous responses.

If I use my previous example of adding a string to a bitmap - you will notice that the string is just a row of numbers, and so is the bitmap. In the bitmap, the numbers represent color values while in the string the numbers represent characters.

The exact meaning of the numbers depends on how the characters/colors are encoded. Maybe the colors are HSV, maybe the characters are utf8? Whatever.

Normally an image will have some metadata at the start - this will depend on the actual encoding of the image. Typically, the metadata will say how wide hde image is and what the color encoding is. If the metadata of the image occupies the first N bytes, and the string has S bytes, then you can substitute the bytes of the string for the bytes of thu image starting at byte N+1 and ending at N+S.

So, you need to study character and image encoding methods. You need to find the C++ instructions for manipulating binary files. Then you will have your solution.

Another alternative would be to write out your string as a bitmap - in a painting program, for eg. Then you can just xor the two bitmaps together.

Z = Img xor Str

In which case, you just need to know how to do an xor operation in C++

Good luck.

Last edited by Simon Bridge; 05-07-2008 at 02:45 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
decoding /dev/mem image using C EkantoApon Programming 2 02-10-2006 08:54 AM
decoding X cursors Krasu Programming 0 02-09-2005 03:08 PM
.wav decoding sibtay Programming 2 09-30-2004 05:44 PM
decoding TazLinux Linux - General 4 11-29-2003 12:47 PM


All times are GMT -5. The time now is 07:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration