Comparison of two bmp files

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Comparison of two bmp files

Abhishek Tiwari
Hello Everyone,

I have to write C/C++ program for this task
----------------------------
Compare two bmp files, Pixels that are NOT the same - make them GREEN. Write diff to a new bmp file : diff.bmp
----------------------------

Could you please help

Best Regards
Abhishek
Reply | Threaded
Open this post in threaded view
|

Re: Comparison of two bmp files

Bob Davies
Reply | Threaded
Open this post in threaded view
|

Re: Comparison of two bmp files

kaolin
In reply to this post by Abhishek Tiwari
If it's literally a per-pixel difference, cv has a "diff" function.

https://stackoverflow.com/questions/27035672/cv-extract-differences-between-two-images 
is doing a more complex thing than it sounds like you need (it always
helps to send sample images), but it has discussion over image channels
and the simple way of looping through a cv::mat, and such.

-kaolin

On 11/8/18 3:55 AM, Abhishek Tiwari [hidden email] [OpenCV] wrote:

>
> Hello Everyone,
>
> I have to write C/C++ program for this task
> ----------------------------
> Compare two bmp files, Pixels that are NOT the same - make them GREEN.
> Write diff to a new bmp file : diff.bmp
> ----------------------------
>
> Could you please help
>
> Best Regards
> Abhishek
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Comparison of two bmp files

Abhishek Tiwari
In reply to this post by Abhishek Tiwari
Thank you so much for the help & Information, Kaolin & Bob Davies.
I really appreciate :-)
Best Regards
Abhishek


--------------------------------------------
On Thu, 11/8/18, Kaolin Fire [hidden email] [OpenCV] <[hidden email]> wrote:

 Subject: Re: [OpenCV] Comparison of two bmp files
 To: [hidden email]
 Date: Thursday, November 8, 2018, 4:35 PM
 
 
  
 
 
 
   
 
 
     
       
       
       
   
   
     If
 it's literally a per-pixel
       difference, cv has a "diff" function.
 
       
 
 https://stackoverflow.com/questions/27035672/cv-extract-differences-between-two-images
       is doing a more complex thing than it sounds like you
 need (it
       always helps to send sample images), but it has
 discussion over
       image channels and the simple way of looping through a
 cv::mat,
       and such.
 
       
 
       -kaolin
 
       
 
       On 11/8/18 3:55 AM, Abhishek Tiwari [hidden email]
       [OpenCV] wrote:
 
     
     
       
        
       
           
             Hello Everyone,
 
               
 
               I have to write C/C++ program for this task
 
 
               ----------------------------
 
               Compare two bmp files, Pixels that are NOT the
 same - make
               them GREEN. Write diff to a new bmp file :
 diff.bmp
 
               ----------------------------
 
               
 
               Could you please help
 
               
 
               Best Regards
 
               Abhishek
 
             
           
           
       
       
       
       
     
     
 
     
   
 
 
 
     
     
 
     
     
 
 
 
 #yiv9217395573 #yiv9217395573 --
   #yiv9217395573ygrp-mkp {
 border:1px solid #d8d8d8;font-family:Arial;margin:10px
 0;padding:0 10px;}
 
 #yiv9217395573 #yiv9217395573ygrp-mkp hr {
 border:1px solid #d8d8d8;}
 
 #yiv9217395573 #yiv9217395573ygrp-mkp #yiv9217395573hd {
 color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px
 0;}
 
 #yiv9217395573 #yiv9217395573ygrp-mkp #yiv9217395573ads {
 margin-bottom:10px;}
 
 #yiv9217395573 #yiv9217395573ygrp-mkp .yiv9217395573ad {
 padding:0 0;}
 
 #yiv9217395573 #yiv9217395573ygrp-mkp .yiv9217395573ad p {
 margin:0;}
 
 #yiv9217395573 #yiv9217395573ygrp-mkp .yiv9217395573ad a {
 color:#0000ff;text-decoration:none;}
 #yiv9217395573 #yiv9217395573ygrp-sponsor
 #yiv9217395573ygrp-lc {
 font-family:Arial;}
 
 #yiv9217395573 #yiv9217395573ygrp-sponsor
 #yiv9217395573ygrp-lc #yiv9217395573hd {
 margin:10px
 0px;font-weight:700;font-size:78%;line-height:122%;}
 
 #yiv9217395573 #yiv9217395573ygrp-sponsor
 #yiv9217395573ygrp-lc .yiv9217395573ad {
 margin-bottom:10px;padding:0 0;}
 
 #yiv9217395573 #yiv9217395573actions {
 font-family:Verdana;font-size:11px;padding:10px 0;}
 
 #yiv9217395573 #yiv9217395573activity {
 background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}
 
 #yiv9217395573 #yiv9217395573activity span {
 font-weight:700;}
 
 #yiv9217395573 #yiv9217395573activity span:first-child {
 text-transform:uppercase;}
 
 #yiv9217395573 #yiv9217395573activity span a {
 color:#5085b6;text-decoration:none;}
 
 #yiv9217395573 #yiv9217395573activity span span {
 color:#ff7900;}
 
 #yiv9217395573 #yiv9217395573activity span
 .yiv9217395573underline {
 text-decoration:underline;}
 
 #yiv9217395573 .yiv9217395573attach {
 clear:both;display:table;font-family:Arial;font-size:12px;padding:10px
 0;width:400px;}
 
 #yiv9217395573 .yiv9217395573attach div a {
 text-decoration:none;}
 
 #yiv9217395573 .yiv9217395573attach img {
 border:none;padding-right:5px;}
 
 #yiv9217395573 .yiv9217395573attach label {
 display:block;margin-bottom:5px;}
 
 #yiv9217395573 .yiv9217395573attach label a {
 text-decoration:none;}
 
 #yiv9217395573 blockquote {
 margin:0 0 0 4px;}
 
 #yiv9217395573 .yiv9217395573bold {
 font-family:Arial;font-size:13px;font-weight:700;}
 
 #yiv9217395573 .yiv9217395573bold a {
 text-decoration:none;}
 
 #yiv9217395573 dd.yiv9217395573last p a {
 font-family:Verdana;font-weight:700;}
 
 #yiv9217395573 dd.yiv9217395573last p span {
 margin-right:10px;font-family:Verdana;font-weight:700;}
 
 #yiv9217395573 dd.yiv9217395573last p
 span.yiv9217395573yshortcuts {
 margin-right:0;}
 
 #yiv9217395573 div.yiv9217395573attach-table div div a {
 text-decoration:none;}
 
 #yiv9217395573 div.yiv9217395573attach-table {
 width:400px;}
 
 #yiv9217395573 div.yiv9217395573file-title a, #yiv9217395573
 div.yiv9217395573file-title a:active, #yiv9217395573
 div.yiv9217395573file-title a:hover, #yiv9217395573
 div.yiv9217395573file-title a:visited {
 text-decoration:none;}
 
 #yiv9217395573 div.yiv9217395573photo-title a,
 #yiv9217395573 div.yiv9217395573photo-title a:active,
 #yiv9217395573 div.yiv9217395573photo-title a:hover,
 #yiv9217395573 div.yiv9217395573photo-title a:visited {
 text-decoration:none;}
 
 #yiv9217395573 div#yiv9217395573ygrp-mlmsg
 #yiv9217395573ygrp-msg p a span.yiv9217395573yshortcuts {
 font-family:Verdana;font-size:10px;font-weight:normal;}
 
 #yiv9217395573 .yiv9217395573green {
 color:#628c2a;}
 
 #yiv9217395573 .yiv9217395573MsoNormal {
 margin:0 0 0 0;}
 
 #yiv9217395573 o {
 font-size:0;}
 
 #yiv9217395573 #yiv9217395573photos div {
 float:left;width:72px;}
 
 #yiv9217395573 #yiv9217395573photos div div {
 border:1px solid
 #666666;min-height:62px;overflow:hidden;width:62px;}
 
 #yiv9217395573 #yiv9217395573photos div label {
 color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}
 
 #yiv9217395573 #yiv9217395573reco-category {
 font-size:77%;}
 
 #yiv9217395573 #yiv9217395573reco-desc {
 font-size:77%;}
 
 #yiv9217395573 .yiv9217395573replbq {
 margin:4px;}
 
 #yiv9217395573 #yiv9217395573ygrp-actbar div a:first-child {
 margin-right:2px;padding-right:5px;}
 
 #yiv9217395573 #yiv9217395573ygrp-mlmsg {
 font-size:13px;font-family:Arial, helvetica, clean,
 sans-serif;}
 
 #yiv9217395573 #yiv9217395573ygrp-mlmsg table {
 font-size:inherit;font:100%;}
 
 #yiv9217395573 #yiv9217395573ygrp-mlmsg select,
 #yiv9217395573 input, #yiv9217395573 textarea {
 font:99% Arial, Helvetica, clean, sans-serif;}
 
 #yiv9217395573 #yiv9217395573ygrp-mlmsg pre, #yiv9217395573
 code {
 font:115% monospace;}
 
 #yiv9217395573 #yiv9217395573ygrp-mlmsg * {
 line-height:1.22em;}
 
 #yiv9217395573 #yiv9217395573ygrp-mlmsg #yiv9217395573logo {
 padding-bottom:10px;}
 
 
 #yiv9217395573 #yiv9217395573ygrp-msg p a {
 font-family:Verdana;}
 
 #yiv9217395573 #yiv9217395573ygrp-msg
 p#yiv9217395573attach-count span {
 color:#1E66AE;font-weight:700;}
 
 #yiv9217395573 #yiv9217395573ygrp-reco
 #yiv9217395573reco-head {
 color:#ff7900;font-weight:700;}
 
 #yiv9217395573 #yiv9217395573ygrp-reco {
 margin-bottom:20px;padding:0px;}
 
 #yiv9217395573 #yiv9217395573ygrp-sponsor #yiv9217395573ov
 li a {
 font-size:130%;text-decoration:none;}
 
 #yiv9217395573 #yiv9217395573ygrp-sponsor #yiv9217395573ov
 li {
 font-size:77%;list-style-type:square;padding:6px 0;}
 
 #yiv9217395573 #yiv9217395573ygrp-sponsor #yiv9217395573ov
 ul {
 margin:0;padding:0 0 0 8px;}
 
 #yiv9217395573 #yiv9217395573ygrp-text {
 font-family:Georgia;}
 
 #yiv9217395573 #yiv9217395573ygrp-text p {
 margin:0 0 1em 0;}
 
 #yiv9217395573 #yiv9217395573ygrp-text tt {
 font-size:120%;}
 
 #yiv9217395573 #yiv9217395573ygrp-vital ul li:last-child {
 border-right:none !important;
 }
 #yiv9217395573