Loading...
Searching...
No Matches
ExtRackOp.h
1
22/*
23 * RackOp.h
24 *
25 * Created on: Mar 7, 2011
26 * Author: mpeura
27 */
28
29#ifndef ExtRackOP_H_
30#define ExtRackOP_H_
31
32//#include "RackOp.h"
33#include <iostream>
34#include "product/PolarProductOp.h"
35
36namespace rack {
37
38
40
43class ExtRackOp : public PolarProductOp {
44public:
45
47 /*
48 ExtRackOp(double p1 = 1.0, long int p2 = 1000) :
49 PolarProductOp("ExtRackOp","Kuvaus..."){
50 //setParameters(parameters);
51 link("p1", this->p1, p1);
52 link("p2", this->p2, p2);
53 };
54 double p1;
55 long int p2;
56
57 */
58 ExtRackOp(int horz = 8, int vert = 16) :
59 PolarProductOp("ExtRackOp","Kuvaus..."){
60 //setParameters(parameters);
61 link("horz", this->horz, horz);
62 link("vert", this->vert, vert);
63 };
64
65 int horz;
66 int vert;
67
68
69protected:
70
71
72 void filterImage(const drain::Options &attributes, const Image &src, Image &dst){
73 //PolarToCartesianOp aPTC;
74 const int width = src.getWidth();
75 const int height = src.getHeight();
76
77 //const int horz = getParameter("horz",16);
78 //const int vert = getParameter("vert",8);
79
80
81 dst.setGeometry(width,height);
82 std::cout<<"horz"<<horz<<"vert"<<vert<<"\n";
83// std::cout<<"width"<<width<<"height"<<height<<"\n";
84
85// dst.at(100,100) == 255;
86
87 rand();
88
89 for (int j=0; j<height; j++){
90 for (int i=0; i<width; i++){
91// rr = rand()%255; #random noise
92// if(rr==100){
93// dst.at(i,j)=rr;
94// }
95/*
96 if(src.at(i,j)!=0 && src.at(i-1,j)==0 && src.at(i+1,j)==0\
97 && src.at(i,j-1)==0 && src.at(i,j+1)==0){
98 dst.at(i,j)=255;
99 std::cout<<1;
100 }
101 else{
102 dst.at(i,j)=src.at(i,j);
103 }
104*/
105/*
106 if(((i-0)*(i-0) + (j-0)*(j-0) )< 200 ){
107 dst.at(i,j)=255;
108 }
109
110 else{
111 dst.at(i,j) = 0;
112 }
113*/
114// if(rr==100){
115// dst.at(i,j)=rr;
116// }
117// dst.at(i,j) = src.at(i,j) ^ ((i&horz)==0)*16 ^ ((j&vert)==0)*32;
118 dst.put(i,j,0);
119 }
120 }
121 int j = height/2;
122 int i = width/2;
123
124 std::cout<<i<<" "<<j<<"\n";
125 for(int k = 0; k<1000;k++){
126 if( dst.get<int>(i,j) == 0){
127 dst.put(i,j,rand()% 100 + 50);
128 }
129// else{
130// dst.at(i,j) += 5;
131// }
132 i += rand()% 3-1;
133 j += rand()% 3-1;
134 }
135
136
137 }
138
139
140
141};
142
143
144} // namespace rack
145
146
147#endif /* RACKOP_H_ */
void put(size_t i, T x)
Sets the intensity in location i to x. See \address.
Definition ImageFrame.h:192
T get(size_t i) const
Gets the intensity at location i. See address().
Definition ImageFrame.h:254
Class for multi-channel digital images. Supports dynamic typing with base types (char,...
Definition Image.h:184
virtual void setGeometry(size_t width, size_t height, size_t imageChannels=1, size_t alphaChannels=0)
Resizes the image, keeps the current type.
Definition Image.h:95
Base class for radar data processors.
Definition ExtRackOp.h:43
ExtRackOp(int horz=8, int vert=16)
Kuvaus doxygeniin.
Definition ExtRackOp.h:58
Base class for flat (2D) products computed in the polar coordinate system. Volume is used as input.
Definition PolarProductOp.h:59
Definition DataSelector.cpp:44